# HG changeset patch # User casties # Date 1351849917 -3600 # Node ID 1525c820ee274649d9ce0485d7609005a7ac7c56 # Parent 7affda55c10e988dda08cf51fe1f4a0f2b351677 annotator annotations even show up now. diff -r 7affda55c10e -r 1525c820ee27 webapp/src/main/webapp/jquery/jquery.digilib.annotator.js --- a/webapp/src/main/webapp/jquery/jquery.digilib.annotator.js Thu Nov 01 18:38:11 2012 +0100 +++ b/webapp/src/main/webapp/jquery/jquery.digilib.annotator.js Fri Nov 02 10:51:57 2012 +0100 @@ -177,7 +177,7 @@ /** * place annotations on the image */ - var renderAnnotations = function(data) { + var renderAnnotations = function (data) { console.debug("renderAnnotations: annotator=", annotator); if (annotator == null || data.$img == null || data.imgTrafo == null) return; @@ -191,19 +191,20 @@ if (!data.settings.isAnnotationsVisible) return; for (var i = 0; i < annotations.length; i++) { var annotation = annotations[i]; - renderAnnotation(data, annotation); + renderAnnotation(data, annotation, i+1); } }; /** * place annotation on the image */ - var renderAnnotation = function(data, annotation) { + var renderAnnotation = function (data, annotation, idx) { console.debug("renderAnnotation: annotation=", annotation); if (annotation == null || data.$img == null || data.imgTrafo == null) return; var cssPrefix = data.settings.cssPrefix; var $elem = data.$elem; + if (idx == null) idx = '?'; // try to show annotation user state $elem.find('div#'+cssPrefix+'button-annotationuser').attr('title', 'annotation user: '+data.settings.annotationUser); if (!data.settings.isAnnotationsVisible) return; @@ -212,11 +213,14 @@ var mpos = data.imgTrafo.transform(pos); console.debug("renderannotations: pos=", mpos); // create annotation - var html = '
?
'; - // set text as tooltip + var html = '
'+idx+'
'; var $annotation = $(html); - $annotation.attr('title', "Annotation: " + annotation.text); + $annotation.data('annotation', annotation); + // set text as tooltip + //$annotation.attr('title', "Annotation: " + annotation.text); $elem.append($annotation); + $annotation.on("mouseover", annotator.onHighlightMouseover); + $annotation.on("mouseout", annotator.startViewerHideTimer); mpos.adjustDiv($annotation); } };