Merge branch 'master' of https://github.com/openseadragon/openseadragon into openseadragon-master
# Conflicts: # src/tiledimage.js
@ -1,5 +1,5 @@
|
|||||||
Copyright (C) 2009 CodePlex Foundation
|
Copyright (C) 2009 CodePlex Foundation
|
||||||
Copyright (C) 2010-2013 OpenSeadragon contributors
|
Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions are met:
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
@ -1,26 +1,31 @@
|
|||||||
OPENSEADRAGON CHANGELOG
|
OPENSEADRAGON CHANGELOG
|
||||||
=======================
|
=======================
|
||||||
|
|
||||||
3.0.1: (in progress)
|
3.2.0: (in progress)
|
||||||
|
|
||||||
|
* Improved the constraints that keep the image in the viewer, specifically when zoomed out a lot (#2160 @joedf)
|
||||||
|
* You can now provide an element for the navigator (as an alternative to an ID) (#1303 @cameronbaney, #2166 #2175 @joedf)
|
||||||
|
|
||||||
|
3.1.0:
|
||||||
|
|
||||||
* Added subPixelRoundingForTransparency Viewer option to address seams that can appear in semi-transparent images (#2075 @TanukiSharp)
|
* Added subPixelRoundingForTransparency Viewer option to address seams that can appear in semi-transparent images (#2075 @TanukiSharp)
|
||||||
* Added Viewer.isAnimating() (#2075 @TanukiSharp)
|
* Added Viewer.isAnimating() (#2075 @TanukiSharp)
|
||||||
* Added isFullScreen method to Viewer (#2067 @JachiOnuoha)
|
* Added isFullScreen method to Viewer (#2067 @JachiOnuoha)
|
||||||
|
* Added option to include POST data when loading files via Ajax (#2072 @Aiosa)
|
||||||
|
* Exposed TiledImage's private functions for better maintainability (#2134 @Aiosa)
|
||||||
|
* Tile cache keys are now generated by the tile source, so it's easier to override them as needed (#2138 @Aiosa)
|
||||||
|
* Pinch to zoom now zooms around the center of the pinch, rather than the center of the viewer (#2158 @cavenel)
|
||||||
|
* Added fallback and deprecation warning for Viewer.buttons (which got changed to buttonGroup in 3.0.0) (#2153 @devbyjonah)
|
||||||
* Fixed an issue where turning off panVertical or panHorizontal would not affect the panning keyboard combos (#2069 @JachiOnuoha)
|
* Fixed an issue where turning off panVertical or panHorizontal would not affect the panning keyboard combos (#2069 @JachiOnuoha)
|
||||||
* Cleaned up console.logs so that errors and warnings use console.error and console.warn as appropriate (#2073 @Abhishek-90)
|
* Cleaned up console.logs so that errors and warnings use console.error and console.warn as appropriate (#2073 @Abhishek-90)
|
||||||
* Improved documentation (#2067 @JachiOnuoha, #2112 @shyamkumaryadav, #2152 @joedf, #2155 @samwilson)
|
* Improved documentation (#2067 @JachiOnuoha, #2112 @shyamkumaryadav, #2152 @joedf, #2155 @samwilson)
|
||||||
* Added option to include POST data when loading files via Ajax (#2072 @Aiosa)
|
|
||||||
* Fixed: Setting useCanvas to false would break the viewer (#2116 @rvv-bouvet)
|
* Fixed: Setting useCanvas to false would break the viewer (#2116 @rvv-bouvet)
|
||||||
* Allow silencing multi-image warnings on viewport coordinate conversion functions (#2120 @claycoleman)
|
* Allow silencing multi-image warnings on viewport coordinate conversion functions (#2120 @claycoleman)
|
||||||
* Fixed: Swiping fast multiple times made contact points in MouseTracker out of sync for touch events (#2121 @ronnymikalsen)
|
* Fixed: Swiping fast multiple times made contact points in MouseTracker out of sync for touch events (#2121 @ronnymikalsen)
|
||||||
* Made MouseTracker more robust in certain scenarios (#2134, #2147 @Aiosa)
|
* Made MouseTracker more robust in certain scenarios (#2134, #2147 @Aiosa)
|
||||||
* Exposed TiledImage's private functions for better maintainability (#2134 @Aiosa)
|
|
||||||
* Fixed an issue where full page mode wouldn't grow properly if you resized the window (#2100 @TanukiSharp)
|
* Fixed an issue where full page mode wouldn't grow properly if you resized the window (#2100 @TanukiSharp)
|
||||||
* Tile cache keys are now generated by the tile source, so it's easier to override them as needed (#2138 @Aiosa)
|
|
||||||
* Now if you pass an error handler into makeAjaxRequest, it doesn't report errors into the console (#2142 @Aiosa)
|
* Now if you pass an error handler into makeAjaxRequest, it doesn't report errors into the console (#2142 @Aiosa)
|
||||||
* Fixed error caused by attaching MouseTracker to the page's document element (#2145 @tdiprima)
|
* Fixed error caused by attaching MouseTracker to the page's document element (#2145 @tdiprima)
|
||||||
* Added fallback and deprecation warning for Viewer.buttons (which got changed to buttonGroup in 3.0.0) (#2153 @devbyjonah)
|
|
||||||
* Pinch to zoom now zooms around the center of the pinch, rather than the center of the viewer (#2158 @cavenel)
|
|
||||||
* Fixed an issue that would sometimes cause problems with freeing up ImageTileSource memory (#2162 @pearcetm)
|
* Fixed an issue that would sometimes cause problems with freeing up ImageTileSource memory (#2162 @pearcetm)
|
||||||
|
|
||||||
3.0.0:
|
3.0.0:
|
||||||
|
7124
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "openseadragon",
|
"name": "openseadragon",
|
||||||
"version": "3.0.0",
|
"version": "3.1.0",
|
||||||
"description": "Provides a smooth, zoomable user interface for HTML/Javascript.",
|
"description": "Provides a smooth, zoomable user interface for HTML/Javascript.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"image",
|
"image",
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - Button
|
* OpenSeadragon - Button
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - ButtonGroup
|
* OpenSeadragon - ButtonGroup
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - Control
|
* OpenSeadragon - Control
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - ControlDock
|
* OpenSeadragon - ControlDock
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - DisplayRect
|
* OpenSeadragon - DisplayRect
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - Drawer
|
* OpenSeadragon - Drawer
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - DziTileSource
|
* OpenSeadragon - DziTileSource
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - EventSource
|
* OpenSeadragon - EventSource
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - full-screen support functions
|
* OpenSeadragon - full-screen support functions
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - IIIFTileSource
|
* OpenSeadragon - IIIFTileSource
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
@ -51,8 +51,11 @@ $.IIIFTileSource = function( options ){
|
|||||||
|
|
||||||
$.extend( true, this, options );
|
$.extend( true, this, options );
|
||||||
|
|
||||||
if ( !( this.height && this.width && this['@id'] ) ) {
|
/* Normalizes v3-style 'id' keys to an "_id" internal property */
|
||||||
throw new Error( 'IIIF required parameters not provided.' );
|
this._id = this["@id"] || this["id"] || this['identifier'] || null;
|
||||||
|
|
||||||
|
if ( !( this.height && this.width && this._id) ) {
|
||||||
|
throw new Error( 'IIIF required parameters (width, height, or id) not provided.' );
|
||||||
}
|
}
|
||||||
|
|
||||||
options.tileSizePerScaleFactor = {};
|
options.tileSizePerScaleFactor = {};
|
||||||
@ -147,7 +150,7 @@ $.extend( $.IIIFTileSource.prototype, $.TileSource.prototype, /** @lends OpenSea
|
|||||||
* this tile source.
|
* this tile source.
|
||||||
* @function
|
* @function
|
||||||
* @param {Object|Array} data
|
* @param {Object|Array} data
|
||||||
* @param {String} optional - url
|
* @param {String} [url] - url
|
||||||
*/
|
*/
|
||||||
|
|
||||||
supports: function( data, url ) {
|
supports: function( data, url ) {
|
||||||
@ -180,23 +183,29 @@ $.extend( $.IIIFTileSource.prototype, $.TileSource.prototype, /** @lends OpenSea
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* A static function used to prepare an incoming IIIF Image API info.json
|
||||||
|
* response for processing by the tile handler. Normalizes data for all
|
||||||
|
* versions of IIIF (1.0, 1.1, 2.x, 3.x) and returns a data object that
|
||||||
|
* may be passed to the IIIFTileSource.
|
||||||
*
|
*
|
||||||
* @function
|
* @function
|
||||||
|
* @static
|
||||||
* @param {Object} data - the raw configuration
|
* @param {Object} data - the raw configuration
|
||||||
* @param {String} url - the url configuration was retrieved from
|
* @param {String} url - the url configuration was retrieved from
|
||||||
* @param {String} postData - HTTP POST data in k=v&k2=v2... form or null
|
* @param {String} postData - HTTP POST data in k=v&k2=v2... form or null
|
||||||
* @example <caption>IIIF 1.1 Info Looks like this</caption>
|
* @return {Object} A normalized IIIF data object
|
||||||
|
* @example <caption>IIIF 2.x Info Looks like this</caption>
|
||||||
* {
|
* {
|
||||||
* "@context" : "http://library.stanford.edu/iiif/image-api/1.1/context.json",
|
* "@context": "http://iiif.io/api/image/2/context.json",
|
||||||
* "@id": "http://iiif.example.com/prefix/1E34750D-38DB-4825-A38A-B60A345E591C",
|
* "@id": "http://iiif.example.com/prefix/1E34750D-38DB-4825-A38A-B60A345E591C",
|
||||||
* "width" : 6000,
|
* "protocol": "http://iiif.io/api/image",
|
||||||
* "height" : 4000,
|
* "height": 1024,
|
||||||
* "scale_factors" : [ 1, 2, 4 ],
|
* "width": 775,
|
||||||
* "tile_width" : 1024,
|
* "tiles" : [{"width":256, "scaleFactors":[1,2,4,8]}],
|
||||||
* "tile_height" : 1024,
|
* "profile": ["http://iiif.io/api/image/2/level1.json", {
|
||||||
* "formats" : [ "jpg", "png" ],
|
* "qualities": [ "native", "bitonal", "grey", "color" ],
|
||||||
* "qualities" : [ "native", "grey" ],
|
* "formats": [ "jpg", "png", "gif" ]
|
||||||
* "profile" : "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0"
|
* }]
|
||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
configure: function( data, url, postData ){
|
configure: function( data, url, postData ){
|
||||||
@ -204,13 +213,13 @@ $.extend( $.IIIFTileSource.prototype, $.TileSource.prototype, /** @lends OpenSea
|
|||||||
if ( !$.isPlainObject(data) ) {
|
if ( !$.isPlainObject(data) ) {
|
||||||
var options = configureFromXml10( data );
|
var options = configureFromXml10( data );
|
||||||
options['@context'] = "http://iiif.io/api/image/1.0/context.json";
|
options['@context'] = "http://iiif.io/api/image/1.0/context.json";
|
||||||
options['@id'] = url.replace('/info.xml', '');
|
options["@id"] = url.replace('/info.xml', '');
|
||||||
options.version = 1;
|
options.version = 1;
|
||||||
return options;
|
return options;
|
||||||
} else {
|
} else {
|
||||||
if ( !data['@context'] ) {
|
if ( !data['@context'] ) {
|
||||||
data['@context'] = 'http://iiif.io/api/image/1.0/context.json';
|
data['@context'] = 'http://iiif.io/api/image/1.0/context.json';
|
||||||
data['@id'] = url.replace('/info.json', '');
|
data["@id"] = url.replace('/info.json', '');
|
||||||
data.version = 1;
|
data.version = 1;
|
||||||
} else {
|
} else {
|
||||||
var context = data['@context'];
|
var context = data['@context'];
|
||||||
@ -239,9 +248,7 @@ $.extend( $.IIIFTileSource.prototype, $.TileSource.prototype, /** @lends OpenSea
|
|||||||
$.console.error('Data has a @context property which contains no known IIIF context URI.');
|
$.console.error('Data has a @context property which contains no known IIIF context URI.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( !data['@id'] && data['id'] ) {
|
|
||||||
data['@id'] = data['id'];
|
|
||||||
}
|
|
||||||
if (data.preferredFormats) {
|
if (data.preferredFormats) {
|
||||||
for (var f = 0; f < data.preferredFormats.length; f++ ) {
|
for (var f = 0; f < data.preferredFormats.length; f++ ) {
|
||||||
if ( OpenSeadragon.imageFormatSupported(data.preferredFormats[f]) ) {
|
if ( OpenSeadragon.imageFormatSupported(data.preferredFormats[f]) ) {
|
||||||
@ -431,7 +438,7 @@ $.extend( $.IIIFTileSource.prototype, $.TileSource.prototype, /** @lends OpenSea
|
|||||||
iiifSize = iiifSizeW + ",";
|
iiifSize = iiifSizeW + ",";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
uri = [ this['@id'], iiifRegion, iiifSize, IIIF_ROTATION, iiifQuality ].join( '/' );
|
uri = [ this._id, iiifRegion, iiifSize, IIIF_ROTATION, iiifQuality ].join( '/' );
|
||||||
|
|
||||||
return uri;
|
return uri;
|
||||||
},
|
},
|
||||||
@ -482,7 +489,7 @@ $.extend( $.IIIFTileSource.prototype, $.TileSource.prototype, /** @lends OpenSea
|
|||||||
var levels = [];
|
var levels = [];
|
||||||
for(var i = 0; i < options.sizes.length; i++) {
|
for(var i = 0; i < options.sizes.length; i++) {
|
||||||
levels.push({
|
levels.push({
|
||||||
url: options['@id'] + '/full/' + options.sizes[i].width + ',' +
|
url: options._id + '/full/' + options.sizes[i].width + ',' +
|
||||||
(options.version === 3 ? options.sizes[i].height : '') +
|
(options.version === 3 ? options.sizes[i].height : '') +
|
||||||
'/0/default.' + options.tileFormat,
|
'/0/default.' + options.tileFormat,
|
||||||
width: options.sizes[i].width,
|
width: options.sizes[i].width,
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - ImageLoader
|
* OpenSeadragon - ImageLoader
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - ImageTileSource
|
* OpenSeadragon - ImageTileSource
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - LegacyTileSource
|
* OpenSeadragon - LegacyTileSource
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - MouseTracker
|
* OpenSeadragon - MouseTracker
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - Navigator
|
* OpenSeadragon - Navigator
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
@ -45,7 +45,9 @@
|
|||||||
* @memberof OpenSeadragon
|
* @memberof OpenSeadragon
|
||||||
* @extends OpenSeadragon.Viewer
|
* @extends OpenSeadragon.Viewer
|
||||||
* @extends OpenSeadragon.EventSource
|
* @extends OpenSeadragon.EventSource
|
||||||
* @param {Object} options
|
* @param {Object} options - Navigator options
|
||||||
|
* @param {Element} [options.element] - An element to use for the navigator.
|
||||||
|
* @param {String} [options.id] - Id of the element to use for the navigator. However, this is ignored if {@link options.element} is provided.
|
||||||
*/
|
*/
|
||||||
$.Navigator = function( options ){
|
$.Navigator = function( options ){
|
||||||
|
|
||||||
@ -55,8 +57,31 @@ $.Navigator = function( options ){
|
|||||||
navigatorSize;
|
navigatorSize;
|
||||||
|
|
||||||
//We may need to create a new element and id if they did not
|
//We may need to create a new element and id if they did not
|
||||||
//provide the id for the existing element
|
//provide the id for the existing element or the element itself
|
||||||
if( !options.id ){
|
if( options.element || options.id ){
|
||||||
|
if ( options.element ) {
|
||||||
|
if ( options.id ){
|
||||||
|
$.console.warn("Given option.id for Navigator was ignored since option.element was provided and is being used instead.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Don't overwrite the element's id if it has one already
|
||||||
|
if ( options.element.id ) {
|
||||||
|
options.id = options.element.id;
|
||||||
|
} else {
|
||||||
|
options.id = 'navigator-' + $.now();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.element = options.element;
|
||||||
|
} else {
|
||||||
|
this.element = document.getElementById( options.id );
|
||||||
|
}
|
||||||
|
|
||||||
|
options.controlOptions = {
|
||||||
|
anchor: $.ControlAnchor.NONE,
|
||||||
|
attachToViewer: false,
|
||||||
|
autoFade: false
|
||||||
|
};
|
||||||
|
} else {
|
||||||
options.id = 'navigator-' + $.now();
|
options.id = 'navigator-' + $.now();
|
||||||
this.element = $.makeNeutralElement( "div" );
|
this.element = $.makeNeutralElement( "div" );
|
||||||
options.controlOptions = {
|
options.controlOptions = {
|
||||||
@ -82,14 +107,6 @@ $.Navigator = function( options ){
|
|||||||
options.controlOptions.width = options.width;
|
options.controlOptions.width = options.width;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
|
||||||
this.element = document.getElementById( options.id );
|
|
||||||
options.controlOptions = {
|
|
||||||
anchor: $.ControlAnchor.NONE,
|
|
||||||
attachToViewer: false,
|
|
||||||
autoFade: false
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
this.element.id = options.id;
|
this.element.id = options.id;
|
||||||
this.element.className += ' navigator';
|
this.element.className += ' navigator';
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon
|
* OpenSeadragon
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
@ -60,7 +60,7 @@
|
|||||||
/*
|
/*
|
||||||
* Portions of this source file taken from mattsnider.com:
|
* Portions of this source file taken from mattsnider.com:
|
||||||
*
|
*
|
||||||
* Copyright (c) 2006-2013 Matt Snider
|
* Copyright (c) 2006-2022 Matt Snider
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
* copy of this software and associated documentation files (the "Software"),
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
@ -410,6 +410,11 @@
|
|||||||
* @property {Boolean} [showNavigator=false]
|
* @property {Boolean} [showNavigator=false]
|
||||||
* Set to true to make the navigator minimap appear.
|
* Set to true to make the navigator minimap appear.
|
||||||
*
|
*
|
||||||
|
* @property {Element} [navigatorElement=null]
|
||||||
|
* The element to hold the navigator minimap.
|
||||||
|
* If an element is specified, the Id option (see navigatorId) is ignored.
|
||||||
|
* If no element nor ID is specified, a div element will be generated accordingly.
|
||||||
|
*
|
||||||
* @property {String} [navigatorId=navigator-GENERATED DATE]
|
* @property {String} [navigatorId=navigator-GENERATED DATE]
|
||||||
* The ID of a div to hold the navigator minimap.
|
* The ID of a div to hold the navigator minimap.
|
||||||
* If an ID is specified, the navigatorPosition, navigatorSizeRatio, navigatorMaintainSizeRatio, navigator[Top|Left|Height|Width] and navigatorAutoFade options will be ignored.
|
* If an ID is specified, the navigatorPosition, navigatorSizeRatio, navigatorMaintainSizeRatio, navigator[Top|Left|Height|Width] and navigatorAutoFade options will be ignored.
|
||||||
@ -1265,6 +1270,7 @@ function OpenSeadragon( options ){
|
|||||||
|
|
||||||
//VIEWPORT NAVIGATOR SETTINGS
|
//VIEWPORT NAVIGATOR SETTINGS
|
||||||
showNavigator: false,
|
showNavigator: false,
|
||||||
|
navigatorElement: null,
|
||||||
navigatorId: null,
|
navigatorId: null,
|
||||||
navigatorPosition: null,
|
navigatorPosition: null,
|
||||||
navigatorSizeRatio: 0.2,
|
navigatorSizeRatio: 0.2,
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - OsmTileSource
|
* OpenSeadragon - OsmTileSource
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - Overlay
|
* OpenSeadragon - Overlay
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - Point
|
* OpenSeadragon - Point
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - Profiler
|
* OpenSeadragon - Profiler
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - Rect
|
* OpenSeadragon - Rect
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - ReferenceStrip
|
* OpenSeadragon - ReferenceStrip
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - Spring
|
* OpenSeadragon - Spring
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - getString/setString
|
* OpenSeadragon - getString/setString
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - Tile
|
* OpenSeadragon - Tile
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - TileCache
|
* OpenSeadragon - TileCache
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - TiledImage
|
* OpenSeadragon - TiledImage
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
@ -1236,8 +1236,8 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
|
||||||
* Updates all tiles at a given resolution level.
|
* Updates all tiles at a given resolution level.
|
||||||
|
* @private
|
||||||
* @param {Boolean} haveDrawn
|
* @param {Boolean} haveDrawn
|
||||||
* @param {Boolean} drawLevel
|
* @param {Boolean} drawLevel
|
||||||
* @param {Number} level
|
* @param {Number} level
|
||||||
@ -1651,8 +1651,8 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag
|
|||||||
* @inner
|
* @inner
|
||||||
* @param {OpenSeadragon.Tile} tile
|
* @param {OpenSeadragon.Tile} tile
|
||||||
* @param {*} data image data, the data sent to ImageJob.prototype.finish(), by default an Image object
|
* @param {*} data image data, the data sent to ImageJob.prototype.finish(), by default an Image object
|
||||||
* @param {Number || undefined} cutoff
|
* @param {Number|undefined} cutoff
|
||||||
* @param {XMLHttpRequest || undefined} tileRequest
|
* @param {XMLHttpRequest|undefined} tileRequest
|
||||||
*/
|
*/
|
||||||
_setTileLoaded: function(tile, data, cutoff, tileRequest) {
|
_setTileLoaded: function(tile, data, cutoff, tileRequest) {
|
||||||
var increment = 0,
|
var increment = 0,
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - TileSource
|
* OpenSeadragon - TileSource
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
@ -649,7 +649,7 @@ $.TileSource.prototype = {
|
|||||||
* @param {Number} level
|
* @param {Number} level
|
||||||
* @param {Number} x
|
* @param {Number} x
|
||||||
* @param {Number} y
|
* @param {Number} y
|
||||||
* @return {* || null} post data to send with tile configuration request
|
* @return {*|null} post data to send with tile configuration request
|
||||||
*/
|
*/
|
||||||
getTilePostData: function( level, x, y ) {
|
getTilePostData: function( level, x, y ) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - TileSourceCollection
|
* OpenSeadragon - TileSourceCollection
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - TmsTileSource
|
* OpenSeadragon - TmsTileSource
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - Viewer
|
* OpenSeadragon - Viewer
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
@ -431,6 +431,7 @@ $.Viewer = function( options ) {
|
|||||||
//Instantiate a navigator if configured
|
//Instantiate a navigator if configured
|
||||||
if ( this.showNavigator){
|
if ( this.showNavigator){
|
||||||
this.navigator = new $.Navigator({
|
this.navigator = new $.Navigator({
|
||||||
|
element: this.navigatorElement,
|
||||||
id: this.navigatorId,
|
id: this.navigatorId,
|
||||||
position: this.navigatorPosition,
|
position: this.navigatorPosition,
|
||||||
sizeRatio: this.navigatorSizeRatio,
|
sizeRatio: this.navigatorSizeRatio,
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - Viewport
|
* OpenSeadragon - Viewport
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
@ -500,12 +500,24 @@ $.Viewport.prototype = {
|
|||||||
if (this.wrapHorizontal) {
|
if (this.wrapHorizontal) {
|
||||||
//do nothing
|
//do nothing
|
||||||
} else {
|
} else {
|
||||||
var horizontalThreshold = this.visibilityRatio * newBounds.width;
|
|
||||||
var boundsRight = newBounds.x + newBounds.width;
|
var boundsRight = newBounds.x + newBounds.width;
|
||||||
var contentRight = this._contentBoundsNoRotate.x + this._contentBoundsNoRotate.width;
|
var contentRight = this._contentBoundsNoRotate.x + this._contentBoundsNoRotate.width;
|
||||||
var leftDx = this._contentBoundsNoRotate.x - boundsRight + horizontalThreshold;
|
|
||||||
var rightDx = contentRight - newBounds.x - horizontalThreshold;
|
|
||||||
|
|
||||||
|
var horizontalThreshold, leftDx, rightDx;
|
||||||
|
if (newBounds.width > this._contentBoundsNoRotate.width) {
|
||||||
|
horizontalThreshold = this.visibilityRatio * this._contentBoundsNoRotate.width;
|
||||||
|
leftDx = this._contentBoundsNoRotate.x - newBounds.x + horizontalThreshold;
|
||||||
|
rightDx = contentRight - boundsRight - horizontalThreshold;
|
||||||
|
|
||||||
|
if (rightDx > 0) {
|
||||||
|
newBounds.x += rightDx;
|
||||||
|
} else if (leftDx < 0) {
|
||||||
|
newBounds.x += leftDx;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
horizontalThreshold = this.visibilityRatio * newBounds.width;
|
||||||
|
leftDx = this._contentBoundsNoRotate.x - boundsRight + horizontalThreshold;
|
||||||
|
rightDx = contentRight - newBounds.x - horizontalThreshold;
|
||||||
if (horizontalThreshold > this._contentBoundsNoRotate.width) {
|
if (horizontalThreshold > this._contentBoundsNoRotate.width) {
|
||||||
newBounds.x += (leftDx + rightDx) / 2;
|
newBounds.x += (leftDx + rightDx) / 2;
|
||||||
} else if (rightDx < 0) {
|
} else if (rightDx < 0) {
|
||||||
@ -514,16 +526,29 @@ $.Viewport.prototype = {
|
|||||||
newBounds.x += leftDx;
|
newBounds.x += leftDx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (this.wrapVertical) {
|
if (this.wrapVertical) {
|
||||||
//do nothing
|
//do nothing
|
||||||
} else {
|
} else {
|
||||||
var verticalThreshold = this.visibilityRatio * newBounds.height;
|
|
||||||
var boundsBottom = newBounds.y + newBounds.height;
|
var boundsBottom = newBounds.y + newBounds.height;
|
||||||
var contentBottom = this._contentBoundsNoRotate.y + this._contentBoundsNoRotate.height;
|
var contentBottom = this._contentBoundsNoRotate.y + this._contentBoundsNoRotate.height;
|
||||||
var topDy = this._contentBoundsNoRotate.y - boundsBottom + verticalThreshold;
|
|
||||||
var bottomDy = contentBottom - newBounds.y - verticalThreshold;
|
|
||||||
|
|
||||||
|
var verticalThreshold, topDy, bottomDy;
|
||||||
|
if (newBounds.height > this._contentBoundsNoRotate.height) {
|
||||||
|
verticalThreshold = this.visibilityRatio * this._contentBoundsNoRotate.height;
|
||||||
|
topDy = this._contentBoundsNoRotate.y - newBounds.y + verticalThreshold;
|
||||||
|
bottomDy = contentBottom - boundsBottom - verticalThreshold;
|
||||||
|
|
||||||
|
if (bottomDy > 0) {
|
||||||
|
newBounds.y += bottomDy;
|
||||||
|
} else if (topDy < 0) {
|
||||||
|
newBounds.y += topDy;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
verticalThreshold = this.visibilityRatio * newBounds.height;
|
||||||
|
topDy = this._contentBoundsNoRotate.y - boundsBottom + verticalThreshold;
|
||||||
|
bottomDy = contentBottom - newBounds.y - verticalThreshold;
|
||||||
if (verticalThreshold > this._contentBoundsNoRotate.height) {
|
if (verticalThreshold > this._contentBoundsNoRotate.height) {
|
||||||
newBounds.y += (topDy + bottomDy) / 2;
|
newBounds.y += (topDy + bottomDy) / 2;
|
||||||
} else if (bottomDy < 0) {
|
} else if (bottomDy < 0) {
|
||||||
@ -532,6 +557,7 @@ $.Viewport.prototype = {
|
|||||||
newBounds.y += topDy;
|
newBounds.y += topDy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return newBounds;
|
return newBounds;
|
||||||
},
|
},
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
* OpenSeadragon - World
|
* OpenSeadragon - World
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 CodePlex Foundation
|
* Copyright (C) 2009 CodePlex Foundation
|
||||||
* Copyright (C) 2010-2013 OpenSeadragon contributors
|
* Copyright (C) 2010-2022 OpenSeadragon contributors
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
|
BIN
test/data/iiif_3_0_sizes/full/1600,1164/0/default.jpg
Normal file
After Width: | Height: | Size: 208 KiB |
BIN
test/data/iiif_3_0_sizes/full/3200,2328/0/default.jpg
Normal file
After Width: | Height: | Size: 678 KiB |
BIN
test/data/iiif_3_0_sizes/full/400,291/0/default.jpg
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
test/data/iiif_3_0_sizes/full/6976,5074/0/default.jpg
Normal file
After Width: | Height: | Size: 1.8 MiB |
BIN
test/data/iiif_3_0_sizes/full/800,582/0/default.jpg
Normal file
After Width: | Height: | Size: 67 KiB |
15
test/data/iiif_3_0_sizes/info.json
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"@context": "http://iiif.io/api/image/3/context.json",
|
||||||
|
"id": "http://localhost:8000/test/data/iiif_3_0_sizes",
|
||||||
|
"protocol": "http://iiif.io/api/image",
|
||||||
|
"width": 6976,
|
||||||
|
"height": 5074,
|
||||||
|
"profile": "level0",
|
||||||
|
"sizes" : [
|
||||||
|
{"width" : 400, "height" : 291},
|
||||||
|
{"width" : 800, "height" : 582},
|
||||||
|
{"width" : 1600, "height" : 1164},
|
||||||
|
{"width" : 3200, "height": 2328},
|
||||||
|
{"width" : 6976, "height": 5074}
|
||||||
|
]
|
||||||
|
}
|
BIN
test/data/iiif_3_0_tiled/0,0,256,256/256,256/0/default.jpg
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
test/data/iiif_3_0_tiled/0,0,512,512/256,256/0/default.jpg
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
test/data/iiif_3_0_tiled/0,0,775,1024/194,256/0/default.jpg
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
test/data/iiif_3_0_tiled/0,256,256,256/256,256/0/default.jpg
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
test/data/iiif_3_0_tiled/0,512,256,256/256,256/0/default.jpg
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
test/data/iiif_3_0_tiled/0,512,512,512/256,256/0/default.jpg
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
test/data/iiif_3_0_tiled/0,768,256,256/256,256/0/default.jpg
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
test/data/iiif_3_0_tiled/256,0,256,256/256,256/0/default.jpg
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
test/data/iiif_3_0_tiled/256,256,256,256/256,256/0/default.jpg
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
test/data/iiif_3_0_tiled/256,512,256,256/256,256/0/default.jpg
Normal file
After Width: | Height: | Size: 35 KiB |
BIN
test/data/iiif_3_0_tiled/256,768,256,256/256,256/0/default.jpg
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
test/data/iiif_3_0_tiled/512,0,256,256/256,256/0/default.jpg
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
test/data/iiif_3_0_tiled/512,0,263,512/132,256/0/default.jpg
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
test/data/iiif_3_0_tiled/512,256,256,256/256,256/0/default.jpg
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
test/data/iiif_3_0_tiled/512,512,256,256/256,256/0/default.jpg
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
test/data/iiif_3_0_tiled/512,512,263,512/132,256/0/default.jpg
Normal file
After Width: | Height: | Size: 9.9 KiB |
BIN
test/data/iiif_3_0_tiled/512,768,256,256/256,256/0/default.jpg
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
test/data/iiif_3_0_tiled/768,0,7,256/7,256/0/default.jpg
Normal file
After Width: | Height: | Size: 717 B |
BIN
test/data/iiif_3_0_tiled/768,256,7,256/7,256/0/default.jpg
Normal file
After Width: | Height: | Size: 716 B |
BIN
test/data/iiif_3_0_tiled/768,512,7,256/7,256/0/default.jpg
Normal file
After Width: | Height: | Size: 717 B |
BIN
test/data/iiif_3_0_tiled/768,768,7,256/7,256/0/default.jpg
Normal file
After Width: | Height: | Size: 712 B |
BIN
test/data/iiif_3_0_tiled/full/1,/0/default.jpg
Normal file
After Width: | Height: | Size: 633 B |
BIN
test/data/iiif_3_0_tiled/full/13,/0/default.jpg
Normal file
After Width: | Height: | Size: 810 B |
BIN
test/data/iiif_3_0_tiled/full/2,/0/default.jpg
Normal file
After Width: | Height: | Size: 663 B |
BIN
test/data/iiif_3_0_tiled/full/25,/0/default.jpg
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
test/data/iiif_3_0_tiled/full/4,/0/default.jpg
Normal file
After Width: | Height: | Size: 675 B |
BIN
test/data/iiif_3_0_tiled/full/49,/0/default.jpg
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
test/data/iiif_3_0_tiled/full/7,/0/default.jpg
Normal file
After Width: | Height: | Size: 683 B |
BIN
test/data/iiif_3_0_tiled/full/97,/0/default.jpg
Normal file
After Width: | Height: | Size: 7.1 KiB |
11
test/data/iiif_3_0_tiled/info.json
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"@context": "http://iiif.io/api/image/3/context.json",
|
||||||
|
"id": "http://localhost:8000/test/data/iiif_3_0_tiled",
|
||||||
|
"protocol": "http://iiif.io/api/image",
|
||||||
|
"height": 1024,
|
||||||
|
"width": 775,
|
||||||
|
"tiles" : [{"width":256, "scaleFactors":[1,2,4,8]}],
|
||||||
|
"profile": "level2",
|
||||||
|
"extraQualities": ["bitonal", "grey", "color"],
|
||||||
|
"extraFormats": ["jpg", "png", "gif" ]
|
||||||
|
}
|
BIN
test/data/iiif_3_0_tiled_sf1/0,0,256,256/256,256/0/default.jpg
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
test/data/iiif_3_0_tiled_sf1/0,256,256,256/256,256/0/default.jpg
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
test/data/iiif_3_0_tiled_sf1/0,512,256,256/256,256/0/default.jpg
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
test/data/iiif_3_0_tiled_sf1/0,768,256,256/256,256/0/default.jpg
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
test/data/iiif_3_0_tiled_sf1/256,0,256,256/256,256/0/default.jpg
Normal file
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 15 KiB |
BIN
test/data/iiif_3_0_tiled_sf1/512,0,256,256/256,256/0/default.jpg
Normal file
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 11 KiB |
BIN
test/data/iiif_3_0_tiled_sf1/768,0,7,256/7,256/0/default.jpg
Normal file
After Width: | Height: | Size: 717 B |
BIN
test/data/iiif_3_0_tiled_sf1/768,256,7,256/7,256/0/default.jpg
Normal file
After Width: | Height: | Size: 716 B |
BIN
test/data/iiif_3_0_tiled_sf1/768,512,7,256/7,256/0/default.jpg
Normal file
After Width: | Height: | Size: 717 B |
BIN
test/data/iiif_3_0_tiled_sf1/768,768,7,256/7,256/0/default.jpg
Normal file
After Width: | Height: | Size: 712 B |
11
test/data/iiif_3_0_tiled_sf1/info.json
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"@context": "http://iiif.io/api/image/3/context.json",
|
||||||
|
"id": "http://localhost:8000/test/data/iiif_3_0_tiled_sf1",
|
||||||
|
"protocol": "http://iiif.io/api/image",
|
||||||
|
"height": 1024,
|
||||||
|
"width": 775,
|
||||||
|
"tiles" : [{"width": 256, "scaleFactors": [1]}],
|
||||||
|
"profile": "level2",
|
||||||
|
"extraQualities": ["bitonal", "grey", "color"],
|
||||||
|
"extraFormats": ["jpg", "png", "gif" ]
|
||||||
|
}
|
@ -151,6 +151,20 @@
|
|||||||
'}', assert);
|
'}', assert);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
QUnit.test('IIIF 3.0 JSON', function(assert) {
|
||||||
|
testOpenUrl('iiif_3_0_tiled/info.json', assert);
|
||||||
|
});
|
||||||
|
|
||||||
|
// ----------
|
||||||
|
QUnit.test('IIIF 3.0 JSON scaleFactors [1]', function(assert) {
|
||||||
|
testOpenUrl('iiif_3_0_tiled_sf1/info.json', assert);
|
||||||
|
});
|
||||||
|
|
||||||
|
// ----------
|
||||||
|
QUnit.test('IIIF 3.0 JSON, sizes array only', function(assert) {
|
||||||
|
testOpenUrl('iiif_3_0_sizes/info.json', assert);
|
||||||
|
});
|
||||||
|
|
||||||
// ----------
|
// ----------
|
||||||
QUnit.test('ImageTileSource', function(assert) {
|
QUnit.test('ImageTileSource', function(assert) {
|
||||||
testOpen({
|
testOpen({
|
||||||
|
@ -143,7 +143,9 @@
|
|||||||
"profile": "level1"
|
"profile": "level1"
|
||||||
};
|
};
|
||||||
|
|
||||||
QUnit.test('IIIFTileSource.configure determins correct version', function(assert) {
|
QUnit.module('IIIF');
|
||||||
|
|
||||||
|
QUnit.test('IIIFTileSource.configure determines correct version', function(assert) {
|
||||||
var options1_0xml = configure(infoXml10level0);
|
var options1_0xml = configure(infoXml10level0);
|
||||||
assert.ok(options1_0xml.version);
|
assert.ok(options1_0xml.version);
|
||||||
assert.equal(options1_0xml.version, 1, 'Version is 1 for version 1.0 info.xml');
|
assert.equal(options1_0xml.version, 1, 'Version is 1 for version 1.0 info.xml');
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
<script src="/test/modules/basic.js"></script>
|
<script src="/test/modules/basic.js"></script>
|
||||||
<script src="/test/modules/strings.js"></script>
|
<script src="/test/modules/strings.js"></script>
|
||||||
<script src="/test/modules/formats.js"></script>
|
<script src="/test/modules/formats.js"></script>
|
||||||
|
<script src="/test/modules/iiif.js"></script>
|
||||||
<script src="/test/modules/utils.js"></script>
|
<script src="/test/modules/utils.js"></script>
|
||||||
<script src="/test/modules/events.js"></script>
|
<script src="/test/modules/events.js"></script>
|
||||||
<script src="/test/modules/units.js"></script>
|
<script src="/test/modules/units.js"></script>
|
||||||
@ -46,7 +47,6 @@
|
|||||||
<script src="/test/modules/ajax-tiles.js"></script>
|
<script src="/test/modules/ajax-tiles.js"></script>
|
||||||
<script src="/test/modules/ajax-post-data.js"></script>
|
<script src="/test/modules/ajax-post-data.js"></script>
|
||||||
<script src="/test/modules/imageloader.js"></script>
|
<script src="/test/modules/imageloader.js"></script>
|
||||||
<script src="/test/modules/iiif.js"></script>
|
|
||||||
<!--The navigator tests are the slowest (for now; hopefully they can be sped up)
|
<!--The navigator tests are the slowest (for now; hopefully they can be sped up)
|
||||||
so we put them last. -->
|
so we put them last. -->
|
||||||
<script src="/test/modules/navigator.js"></script>
|
<script src="/test/modules/navigator.js"></script>
|
||||||
|