Mercurial > hg > digilib-old
changeset 1152:13be1a009bbc
individual annotation styles
author | hertzhaft |
---|---|
date | Tue, 27 Nov 2012 01:10:06 +0100 |
parents | 139ad480333b |
children | dcf55ac4ed4e |
files | webapp/src/main/webapp/jquery/jquery.digilib.annotator.js |
diffstat | 1 files changed, 12 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/webapp/src/main/webapp/jquery/jquery.digilib.annotator.js Mon Nov 26 23:49:41 2012 +0100 +++ b/webapp/src/main/webapp/jquery/jquery.digilib.annotator.js Tue Nov 27 01:10:06 2012 +0100 @@ -50,7 +50,7 @@ digilib.fn.highlightButtons(data, 'annotations', show); renderAnnotations(data); }, - + /** * set user account for annotations */ @@ -191,7 +191,7 @@ // create and edit new annotation var annotation = annotator.createAnnotation(); annotator.showEditor(annotation, mpos.getAsCss()); - return false; + return false; }); }; @@ -251,11 +251,12 @@ // show annotation number idx = annot.idx ? annot.idx : '?'; } + var shape = null; var area = null; var type = null; if (annotation.shapes != null) { // annotation shape - var shape = annotation.shapes[0]; + shape = annotation.shapes[0]; type = shape.type; if (type === "point") { area = geom.position(shape.geometry); @@ -267,7 +268,8 @@ } } else if (annotation.areas != null) { // legacy annotation areas - area = geom.rectangle(annotation.areas[0]); + shape = annotation.areas[0] + area = geom.rectangle(shape); if (area.isRectangle()) { type = 'rectangle'; } else { @@ -295,10 +297,14 @@ } // save annotation in data for Annotator $annotation.data('annotation', annotation); - // add css class from annotation + // add css class from annotations collection if (annotation.cssclass != null) { $annotation.addClass(annotation.cssclass); } + // add individual css class for this annotation + if (shape.cssclass != null) { + $annotation.addClass(shape.cssclass); + } // save reference to div annot.$div = $annotation; $elem.append($annotation); @@ -380,7 +386,7 @@ var getAnnotationToken = function (data) { return data.dlOpts.annotationToken; }; - + /** * returns the annotation user. */