Merge branch 'collections' into bugs

fixed Conflicts:
	test/demo/collections/main.js
This commit is contained in:
Ian Gilman 2014-12-19 11:58:41 -08:00
commit c0163f7d6b
3 changed files with 27 additions and 12 deletions

View File

@ -107,9 +107,11 @@ $.extend( $.DziTileSource.prototype, $.TileSource.prototype, /** @lends OpenSead
var ns;
if ( data.Image ) {
ns = data.Image.xmlns;
} else if ( data.documentElement && "Image" == data.documentElement.localName ) {
} 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 ||
"http://schemas.microsoft.com/deepzoom/2009" == 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.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.getElementsByTagName("Rect" )[ 0 ];
if (rectNode === undefined) {
rectNode = dispRectNode.getElementsByTagNameNS(ns, "Rect" )[ 0 ];
}
displayRects.push({
Rect: {

View File

@ -177,7 +177,7 @@ $.extend( $.World.prototype, $.EventSource.prototype, /** @lends OpenSeadragon.W
removeItem: function( item ) {
$.console.assert(item, "[World.removeItem] item is required");
var index = this._items.indexOf( item );
var index = $.indexOf(this._items, item );
if ( index === -1 ) {
return;
}

View File

@ -9,20 +9,21 @@
var testInitialOpen = true;
var testOverlays = false;
var testMargins = false;
var testNavigator = true;
var testNavigator = false;
var margins;
var config = {
// debugMode: true,
zoomPerScroll: 1.02,
showNavigator: testNavigator,
useCanvas: true,
// sequenceMode: true,
// showReferenceStrip: true,
// referenceStripScroll: 'vertical',
navPrevNextWrap: false,
preserveViewport: false,
// collectionMode: true,
// collectionRows: 3,
collectionMode: true,
collectionRows: 1,
// collectionLayout: 'vertical',
// collectionTileSize: 10,
// collectionTileMargin: 10,
@ -97,8 +98,11 @@
this.viewer = OpenSeadragon(config);
if (testInitialOpen) {
this.viewer.addHandler( "open", function() {
});
function openHandler() {
self.viewer.removeHandler('open', openHandler);
}
this.viewer.addHandler( "open", openHandler);
}
if (testMargins) {