# HG changeset patch # User robcast # Date 1352396577 -3600 # Node ID efe4b0f18cf83642c1d3657114be592b079d161b # Parent 8bd10cd041694eabbc58fa858846e02c42e55d76 annotator plugin does regions now. diff -r 8bd10cd04169 -r efe4b0f18cf8 webapp/src/main/webapp/jquery/img/fullscreen/32/annotation-region.png Binary file webapp/src/main/webapp/jquery/img/fullscreen/32/annotation-region.png has changed diff -r 8bd10cd04169 -r efe4b0f18cf8 webapp/src/main/webapp/jquery/img/fullscreen3.svg --- a/webapp/src/main/webapp/jquery/img/fullscreen3.svg Wed Nov 07 18:09:57 2012 +0100 +++ b/webapp/src/main/webapp/jquery/img/fullscreen3.svg Thu Nov 08 18:42:57 2012 +0100 @@ -120,13 +120,13 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="14.74" - inkscape:cx="3.4974471" + inkscape:cx="-7.5948188" inkscape:cy="15.995577" - inkscape:current-layer="g4602" + inkscape:current-layer="g3411" showgrid="true" inkscape:grid-bbox="true" inkscape:document-units="px" - inkscape:window-width="1837" + inkscape:window-width="1842" inkscape:window-height="1156" inkscape:window-x="1920" inkscape:window-y="22" @@ -664,6 +664,25 @@ sodipodi:nodetypes="ccccc" /> + '+idx+''); + //addRegionAttributes(data, $regionDiv, attr); + } else { + var pos = area.getPosition(); + if (!data.zoomArea.containsPosition(pos)) return; + var screenRect = data.imgTrafo.transform(pos); + console.debug("renderannotations: pos=", pos); // create annotation var html = '
'+idx+'
'; - var $annotation = $(html); - // save annotation in data for Annotator - $annotation.data('annotation', annotation); - // save reference to div - annot.$div = $annotation; - $elem.append($annotation); - // hook up Annotator events - $annotation.on("mouseover", annotator.onHighlightMouseover); - $annotation.on("mouseout", annotator.startViewerHideTimer); - mpos.adjustDiv($annotation); - } + $annotation = $(html); + } + // save annotation in data for Annotator + $annotation.data('annotation', annotation); + // save reference to div + annot.$div = $annotation; + $elem.append($annotation); + // hook up Annotator events + $annotation.on("mouseover", annotator.onHighlightMouseover); + $annotation.on("mouseout", annotator.startViewerHideTimer); + screenRect.adjustDiv($annotation); }; /** diff -r 8bd10cd04169 -r efe4b0f18cf8 webapp/src/main/webapp/jquery/jquery.digilib.css --- a/webapp/src/main/webapp/jquery/jquery.digilib.css Wed Nov 07 18:09:57 2012 +0100 +++ b/webapp/src/main/webapp/jquery/jquery.digilib.css Thu Nov 08 18:42:57 2012 +0100 @@ -178,17 +178,12 @@ } /* annotations */ -div.dl-digilib div.dl-annotationbody { - background-color: yellow; - border-radius: 5px; -} -div.dl-digilib div.dl-annotationbody div.dl-text { - padding: 10px; -} -div.dl-digilib div.dl-annotationbody div.dl-creator { - color: gray; - padding: 5px; - border-top: 1px solid silver; +div.dl-digilib div.dl-annotationregion { + background-color: rgba(255, 255, 10, 0.3); + border-radius: 5px; + border: 1px solid black; + padding: 2px 4px; + font-weight: bold; } div.dl-digilib #dl-cm { diff -r 8bd10cd04169 -r efe4b0f18cf8 webapp/src/main/webapp/jquery/jquery.digilib.geometry.js --- a/webapp/src/main/webapp/jquery/jquery.digilib.geometry.js Wed Nov 07 18:09:57 2012 +0100 +++ b/webapp/src/main/webapp/jquery/jquery.digilib.geometry.js Thu Nov 08 18:42:57 2012 +0100 @@ -66,8 +66,8 @@ if (x.x != null) { // position object that = { - x : x.x, - y : x.y + x : parseFloat(x.x), + y : parseFloat(x.y) }; } if (x.pageX != null) { @@ -156,10 +156,10 @@ } else if (y == null) { // assume x is rectangle that = { - x : x.x || 0, - y : x.y || 0, - width : x.width || 0, - height : x.height || 0 + x : parseFloat(x.x) || 0, + y : parseFloat(x.y) || 0, + width : parseFloat(x.width) || 0, + height : parseFloat(x.height) || 0 }; } else { // assume x and y are Position @@ -346,6 +346,10 @@ that.getAsSvg = function() { return [this.x, this.y, this.width, this.height].join(" "); }; + // returns if this rectangle is a rectangle + that.isRectangle = function () { + return this.width > 0 && this.height > 0; + }; // returns size and position of this rectangle formatted for ??? (w x h@x,y) that.toString = function() { return this.width + "x" + this.height + "@" + this.x + "," + this.y;