From 8aa5a3e5f1ce0b660fe52906672d9417373d6d4f Mon Sep 17 00:00:00 2001 From: harshalitalele Date: Thu, 12 Apr 2018 21:53:28 +0530 Subject: [PATCH] removed irrelevant commits --- readme.md | 7 ---- user-specific-annotation-plugin.js | 67 ------------------------------ 2 files changed, 74 deletions(-) delete mode 100644 user-specific-annotation-plugin.js diff --git a/readme.md b/readme.md index 433dc3e..191c9e1 100644 --- a/readme.md +++ b/readme.md @@ -1,10 +1,3 @@ -To Do: -1. removeHandler https://github.com/annotorious/annotorious/issues/193 -2. displacement of annotation in chrome -3. circular annotation - https://github.com/annotorious/annotorious/issues/55 -4. Drawing a polygon using annotorious - update this in gitter openseadragon -6. Adding custom annotations on OpenSeadragon module - # Annotorious - Image Annotation for the Web **CURRENTLY UNSUPPORTED** diff --git a/user-specific-annotation-plugin.js b/user-specific-annotation-plugin.js deleted file mode 100644 index e657eb5..0000000 --- a/user-specific-annotation-plugin.js +++ /dev/null @@ -1,67 +0,0 @@ -annotorious.plugin.userSpecificAnnotations = function() { } - -annotorious.plugin.userSpecificAnnotations.prototype.onInitAnnotator = function(annotator) { - var oldAddAnnotation = annotorious.mediatypes.openseadragon.Viewer.prototype.addAnnotation; - - function toCamelCase(str) { - return String(str).replace(/\-([a-z])/g, function(all, match) { - return match.toUpperCase(); - }); - }; - - function addCustomAnnotation(annotation) { - var geometry = annotation.shapes[0].geometry; - var outer = goog.dom.createDom('div', 'annotorious-ol-boxmarker-outer'); - var inner = goog.dom.createDom('div', 'annotorious-ol-boxmarker-inner'); - goog.style.setSize(inner, '100%', '100%'); - goog.dom.appendChild(outer, inner); - - for(var key in annotation.properties) { - outer.style[toCamelCase(key)] = annotation.properties[key]; - } - - var rect = new OpenSeadragon.Rect(geometry.x, geometry.y, geometry.width, geometry.height); - - var overlay = {annotation: annotation, outer: outer, inner: inner}; - - var self = this; - goog.events.listen(inner, goog.events.EventType.MOUSEOVER, function(event) { - if (!self._currentlyHighlightedOverlay) - self._updateHighlight(overlay); - - self._lastHoveredOverlay = overlay; - }); - - goog.events.listen(inner, goog.events.EventType.MOUSEOUT, function(event) { - delete self._lastHoveredOverlay; - self._popup.startHideTimer(); - }); - - this._overlays.push(overlay); - - goog.array.sort(this._overlays, function(a, b) { - var shapeA = a.annotation.shapes[0]; - var shapeB = b.annotation.shapes[0]; - return annotorious.shape.getSize(shapeB) - annotorious.shape.getSize(shapeA); - }); - - var zIndex = 1; - goog.array.forEach(this._overlays, function(overlay) { - goog.style.setStyle(overlay.outer, 'z-index', zIndex); - zIndex++; - }); - - this._osdViewer.addOverlay(outer, rect); - } - - - annotorious.mediatypes.openseadragon.Viewer.prototype.addAnnotation = function(annotation, opt_replace) { - if(annotation.properties) { - addCustomAnnotation.apply(this, [annotation]); - } else { - oldAddAnnotation.apply(this, [annotation, opt_replace]); - } - } -} - -anno.addPlugin('userSpecificAnnotations', {}); \ No newline at end of file