From d694c7ea6ca81c24a74a6bbd88dbddfc71501c70 Mon Sep 17 00:00:00 2001 From: Ian Gilman Date: Mon, 5 Jan 2015 13:17:05 -0800 Subject: [PATCH 1/8] Version bump --- changelog.txt | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/changelog.txt b/changelog.txt index 5485d015..4e71760e 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,7 +1,7 @@ OPENSEADRAGON CHANGELOG ======================= -1.2.0: (in progress) +1.2.0: * New combined IIIF TileSource for 1.0 through 2.0 (#441) * BREAKING CHANGE: Removed IIIF1_1TileSource (now that IIIFTileSource supports all versions) diff --git a/package.json b/package.json index 486d8743..6aa039fe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "OpenSeadragon", - "version": "1.1.1", + "version": "1.2.0", "description": "Provides a smooth, zoomable user interface for HTML/Javascript.", "devDependencies": { "grunt": "^0.4.5", From 8ff70dd54fee5b4ebe212311f599a7fecfd14514 Mon Sep 17 00:00:00 2001 From: Ian Gilman Date: Mon, 5 Jan 2015 13:21:19 -0800 Subject: [PATCH 2/8] Started 1.2.1 --- changelog.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changelog.txt b/changelog.txt index 4e71760e..779df7b5 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,8 @@ OPENSEADRAGON CHANGELOG ======================= +1.2.1: (in progress) + 1.2.0: * New combined IIIF TileSource for 1.0 through 2.0 (#441) From 9e07c96d29407f38108e9ee424bfc9eb37d5bec0 Mon Sep 17 00:00:00 2001 From: Younes El Alami Date: Fri, 9 Jan 2015 02:21:16 +0000 Subject: [PATCH 3/8] Added preserveOverlays option to Viewer --- src/openseadragon.js | 7 +++++++ src/viewer.js | 15 ++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/openseadragon.js b/src/openseadragon.js index f8b744de..e1a37e2f 100644 --- a/src/openseadragon.js +++ b/src/openseadragon.js @@ -519,6 +519,12 @@ * position. If preserveViewport is set to true, then the viewport position * is preserved when navigating between images in the sequence. * + * @property {Boolean} [preserveOverlays=false] + * If the viewer has been configured with a sequence of tile sources, then + * normally navigating to through each image resets the overlays. + * If preserveOverlays is set to true, then the overlays + * are preserved when navigating between images in the sequence. + * * @property {Boolean} [showReferenceStrip=false] * If the viewer has been configured with a sequence of tile sources, then * display a scrolling strip of image thumbnails for navigating through the images. @@ -945,6 +951,7 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){ showSequenceControl: true, //SEQUENCE sequenceControlAnchor: null, //SEQUENCE preserveViewport: false, //SEQUENCE + preserveOverlays: false, //SEQUENCE navPrevNextWrap: false, //SEQUENCE showNavigationControl: true, //ZOOM/HOME/FULL/ROTATION navigationControlAnchor: null, //ZOOM/HOME/FULL/ROTATION diff --git a/src/viewer.js b/src/viewer.js index 39ed6294..32a18722 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -539,9 +539,13 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, this.navigator.close(); } - this.clearOverlays(); + if( ! this.preserveOverlays) + { + this.clearOverlays(); + this.overlaysContainer.innerHTML = ""; + } + this.drawersContainer.innerHTML = ""; - this.overlaysContainer.innerHTML = ""; if ( this.drawer ) { this.drawer.destroy(); @@ -1968,7 +1972,12 @@ function openTileSource( viewer, source ) { _this.viewport.resetContentSize( _this.source.dimensions ); } - _this.source.overlays = _this.source.overlays || []; + if( _this.preserveOverlays ){ + _this.source.overlays = _this.currentOverlays; + } + else{ + _this.source.overlays = _this.source.overlays || []; + } _this.drawer = new $.Drawer({ viewer: _this, From 1d16b01a2863ef1268f093b09c082b4f8ab91687 Mon Sep 17 00:00:00 2001 From: Younes El Alami Date: Sat, 10 Jan 2015 12:11:45 +0000 Subject: [PATCH 4/8] Changed _this.source.overlays to _this.overlays, https://github.com/openseadragon/openseadragon/pull/561/files#r22730318 --- src/viewer.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/viewer.js b/src/viewer.js index 32a18722..a359a9d9 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -1973,12 +1973,11 @@ function openTileSource( viewer, source ) { } if( _this.preserveOverlays ){ - _this.source.overlays = _this.currentOverlays; - } - else{ - _this.source.overlays = _this.source.overlays || []; + _this.overlays = _this.currentOverlays; } + _this.source.overlays = _this.source.overlays || []; + _this.drawer = new $.Drawer({ viewer: _this, source: _this.source, From 7b6f7d6a5b35ec2ff9dc0b5ed116e2c21c35e8c1 Mon Sep 17 00:00:00 2001 From: Ian Gilman Date: Mon, 12 Jan 2015 13:40:33 -0800 Subject: [PATCH 5/8] Changelog for #561 --- changelog.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/changelog.txt b/changelog.txt index 779df7b5..f9a8cda9 100644 --- a/changelog.txt +++ b/changelog.txt @@ -3,6 +3,8 @@ OPENSEADRAGON CHANGELOG 1.2.1: (in progress) +* Added preserveOverlays option (#561) + 1.2.0: * New combined IIIF TileSource for 1.0 through 2.0 (#441) From 753bf64e8a4d9cb6ce0dfd16d89b0be278cdafbe Mon Sep 17 00:00:00 2001 From: Ian Gilman Date: Mon, 12 Jan 2015 14:18:39 -0800 Subject: [PATCH 6/8] * Fixed: DZI tilesource was broken --- src/dzitilesource.js | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/dzitilesource.js b/src/dzitilesource.js index eb283fab..99dd92d1 100644 --- a/src/dzitilesource.js +++ b/src/dzitilesource.js @@ -107,8 +107,10 @@ $.extend( $.DziTileSource.prototype, $.TileSource.prototype, /** @lends OpenSead var ns; if ( data.Image ) { ns = data.Image.xmlns; - } else if ( data.documentElement && "Image" == data.documentElement.localName ) { - ns = data.documentElement.namespaceURI; + } else if ( data.documentElement) { + if ("Image" == data.documentElement.localName || "Image" == data.documentElement.tagName) { + ns = data.documentElement.namespaceURI; + } } return ( "http://schemas.microsoft.com/deepzoom/2008" == ns || @@ -221,7 +223,7 @@ function configureFromXML( tileSource, xmlDoc ){ } var root = xmlDoc.documentElement, - rootName = root.localName, + rootName = root.localName || root.tagName, ns = xmlDoc.documentElement.namespaceURI, configuration = null, displayRects = [], @@ -234,7 +236,10 @@ function configureFromXML( tileSource, xmlDoc ){ if ( rootName == "Image" ) { try { - sizeNode = root.getElementsByTagNameNS(ns, "Size" )[ 0 ]; + sizeNode = root.getElementsByTagName("Size" )[ 0 ]; + if (sizeNode === undefined) { + sizeNode = root.getElementsByTagNameNS(ns, "Size" )[ 0 ]; + } configuration = { Image: { @@ -257,11 +262,17 @@ function configureFromXML( tileSource, xmlDoc ){ ); } - dispRectNodes = root.getElementsByTagNameNS(ns, "DisplayRect" ); + dispRectNodes = root.getElementsByTagName("DisplayRect" ); + if (dispRectNodes === undefined) { + dispRectNodes = root.getElementsByTagNameNS(ns, "DisplayRect" )[ 0 ]; + } for ( i = 0; i < dispRectNodes.length; i++ ) { dispRectNode = dispRectNodes[ i ]; - rectNode = dispRectNode.getElementsByTagNameNS(ns, "Rect" )[ 0 ]; + rectNode = dispRectNode.getElementsByTagName("Rect" )[ 0 ]; + if (rectNode === undefined) { + rectNode = dispRectNode.getElementsByTagNameNS(ns, "Rect" )[ 0 ]; + } displayRects.push({ Rect: { From 00edbe565a40cb192bda753d1d7807571cf0c82a Mon Sep 17 00:00:00 2001 From: Ian Gilman Date: Mon, 12 Jan 2015 14:21:57 -0800 Subject: [PATCH 7/8] Changelog for #563 --- changelog.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.txt b/changelog.txt index f9a8cda9..903e3062 100644 --- a/changelog.txt +++ b/changelog.txt @@ -4,6 +4,7 @@ OPENSEADRAGON CHANGELOG 1.2.1: (in progress) * Added preserveOverlays option (#561) +* Fixed: DZI tilesource was broken (#563) 1.2.0: From 83b7d7597ac7c74422d23f16c94ad2dc287db15c Mon Sep 17 00:00:00 2001 From: Ian Gilman Date: Mon, 12 Jan 2015 14:22:10 -0800 Subject: [PATCH 8/8] Added a note about preserveOverlays --- src/openseadragon.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/openseadragon.js b/src/openseadragon.js index e1a37e2f..27d3262c 100644 --- a/src/openseadragon.js +++ b/src/openseadragon.js @@ -515,15 +515,17 @@ * * @property {Boolean} [preserveViewport=false] * If the viewer has been configured with a sequence of tile sources, then - * normally navigating to through each image resets the viewport to 'home' + * normally navigating through each image resets the viewport to 'home' * position. If preserveViewport is set to true, then the viewport position * is preserved when navigating between images in the sequence. * * @property {Boolean} [preserveOverlays=false] * If the viewer has been configured with a sequence of tile sources, then - * normally navigating to through each image resets the overlays. + * normally navigating through each image resets the overlays. * If preserveOverlays is set to true, then the overlays * are preserved when navigating between images in the sequence. + * Note: setting preserveOverlays overrides any overlays specified in the + * "overlays" property. * * @property {Boolean} [showReferenceStrip=false] * If the viewer has been configured with a sequence of tile sources, then