mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-02-18 07:43:13 +03:00
Merge branch 'master' of github.com:openseadragon/openseadragon into issue37-navigator
This commit is contained in:
commit
3e24be12e0
@ -68,9 +68,8 @@ When contributing, please attempt to match the code style already in the codebas
|
|||||||
|
|
||||||
When fixing bugs and adding features, when appropriate please also:
|
When fixing bugs and adding features, when appropriate please also:
|
||||||
|
|
||||||
* Update changelog.txt
|
|
||||||
* Add/update related unit tests
|
|
||||||
* Update related doc comments
|
* Update related doc comments
|
||||||
|
* Add/update related unit tests
|
||||||
|
|
||||||
If you're new to the project, check out our [good first bug](https://github.com/openseadragon/openseadragon/issues?labels=good+first+bug&page=1&state=open) issues for some places to dip your toe in the water.
|
If you're new to the project, check out our [good first bug](https://github.com/openseadragon/openseadragon/issues?labels=good+first+bug&page=1&state=open) issues for some places to dip your toe in the water.
|
||||||
|
|
||||||
|
@ -9,6 +9,10 @@ OPENSEADRAGON CHANGELOG
|
|||||||
* Keyboard handling is now done in the viewer rather than navigator (#46)
|
* Keyboard handling is now done in the viewer rather than navigator (#46)
|
||||||
* Additional navigator fixes (#46)
|
* Additional navigator fixes (#46)
|
||||||
* Fixed an error in EventHandler.removeHandler() (#48)
|
* Fixed an error in EventHandler.removeHandler() (#48)
|
||||||
|
* Better requestAnimationFrame detection on older Firefox (#103)
|
||||||
|
* More efficient navigator loading (#115)
|
||||||
|
* Sometimes tiles wouldn't resolve if you used the blendTime option; fixed. (#95)
|
||||||
|
* You can now choose to have previous and next buttons wrap using the config.navPrevNextWrap. (#114)
|
||||||
|
|
||||||
0.9.127:
|
0.9.127:
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ $.ButtonState = {
|
|||||||
* @param {String} options.srcRest URL of image to use in 'rest' state
|
* @param {String} options.srcRest URL of image to use in 'rest' state
|
||||||
* @param {String} options.srcGroup URL of image to use in 'up' state
|
* @param {String} options.srcGroup URL of image to use in 'up' state
|
||||||
* @param {String} options.srcHover URL of image to use in 'hover' state
|
* @param {String} options.srcHover URL of image to use in 'hover' state
|
||||||
* @param {String} options.srcDown URL of image to use in 'domn' state
|
* @param {String} options.srcDown URL of image to use in 'down' state
|
||||||
* @param {Element} [options.element] Element to use as a container for the
|
* @param {Element} [options.element] Element to use as a container for the
|
||||||
* button.
|
* button.
|
||||||
* @property {String} tooltip Provides context help for the button we the
|
* @property {String} tooltip Provides context help for the button we the
|
||||||
@ -65,7 +65,7 @@ $.ButtonState = {
|
|||||||
* @property {String} srcRest URL of image to use in 'rest' state
|
* @property {String} srcRest URL of image to use in 'rest' state
|
||||||
* @property {String} srcGroup URL of image to use in 'up' state
|
* @property {String} srcGroup URL of image to use in 'up' state
|
||||||
* @property {String} srcHover URL of image to use in 'hover' state
|
* @property {String} srcHover URL of image to use in 'hover' state
|
||||||
* @property {String} srcDown URL of image to use in 'domn' state
|
* @property {String} srcDown URL of image to use in 'down' state
|
||||||
* @property {Object} config Configurable settings for this button. DEPRECATED.
|
* @property {Object} config Configurable settings for this button. DEPRECATED.
|
||||||
* @property {Element} [element] Element to use as a container for the
|
* @property {Element} [element] Element to use as a container for the
|
||||||
* button.
|
* button.
|
||||||
|
@ -709,8 +709,7 @@ function updateTile( drawer, drawLevel, haveDrawn, x, y, level, levelOpacity, le
|
|||||||
);
|
);
|
||||||
|
|
||||||
if ( tile.loaded ) {
|
if ( tile.loaded ) {
|
||||||
|
var needsUpdate = blendTile(
|
||||||
drawer.updateAgain = blendTile(
|
|
||||||
drawer,
|
drawer,
|
||||||
tile,
|
tile,
|
||||||
x, y,
|
x, y,
|
||||||
@ -718,6 +717,10 @@ function updateTile( drawer, drawLevel, haveDrawn, x, y, level, levelOpacity, le
|
|||||||
levelOpacity,
|
levelOpacity,
|
||||||
currentTime
|
currentTime
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ( needsUpdate ) {
|
||||||
|
drawer.updateAgain = true;
|
||||||
|
}
|
||||||
} else if ( tile.loading ) {
|
} else if ( tile.loading ) {
|
||||||
// the tile is already in the download queue
|
// the tile is already in the download queue
|
||||||
// thanks josh1093 for finally translating this typo
|
// thanks josh1093 for finally translating this typo
|
||||||
|
@ -258,6 +258,11 @@
|
|||||||
* these paths, prefer setting the option.prefixUrl rather than overriding
|
* these paths, prefer setting the option.prefixUrl rather than overriding
|
||||||
* every image path directly through this setting.
|
* every image path directly through this setting.
|
||||||
*
|
*
|
||||||
|
* @param {Boolean} [options.navPrevNextWrap=false]
|
||||||
|
* If the 'previous' button will wrap to the last image when viewing the first
|
||||||
|
* image and if the 'next' button will wrap to the first image when viewing
|
||||||
|
* the last image.
|
||||||
|
*
|
||||||
* @returns {OpenSeadragon.Viewer}
|
* @returns {OpenSeadragon.Viewer}
|
||||||
*/
|
*/
|
||||||
window.OpenSeadragon = window.OpenSeadragon || function( options ){
|
window.OpenSeadragon = window.OpenSeadragon || function( options ){
|
||||||
@ -595,6 +600,7 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){
|
|||||||
DOWN: 'next_pressed.png'
|
DOWN: 'next_pressed.png'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
navPrevNextWrap: false,
|
||||||
|
|
||||||
//DEVELOPER SETTINGS
|
//DEVELOPER SETTINGS
|
||||||
debugMode: false,
|
debugMode: false,
|
||||||
|
@ -346,6 +346,10 @@ $.Viewer = function( options ) {
|
|||||||
beginControlsAutoHide( _this );
|
beginControlsAutoHide( _this );
|
||||||
} ); // initial fade out
|
} ); // initial fade out
|
||||||
|
|
||||||
|
if(this.navPrevNextWrap){
|
||||||
|
this.previousButton.enable();
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$.extend( $.Viewer.prototype, $.EventHandler.prototype, $.ControlDock.prototype, {
|
$.extend( $.Viewer.prototype, $.EventHandler.prototype, $.ControlDock.prototype, {
|
||||||
@ -523,8 +527,11 @@ $.extend( $.Viewer.prototype, $.EventHandler.prototype, $.ControlDock.prototype,
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Shows or hides the controls (e.g. the default navigation buttons).
|
||||||
|
*
|
||||||
* @function
|
* @function
|
||||||
* @name OpenSeadragon.Viewer.prototype.setDashboardEnabled
|
* @name OpenSeadragon.Viewer.prototype.setControlsEnabled
|
||||||
|
* @param {Boolean} true to show, false to hide.
|
||||||
* @return {OpenSeadragon.Viewer} Chainable.
|
* @return {OpenSeadragon.Viewer} Chainable.
|
||||||
*/
|
*/
|
||||||
setControlsEnabled: function( enabled ) {
|
setControlsEnabled: function( enabled ) {
|
||||||
@ -1019,7 +1026,9 @@ $.extend( $.Viewer.prototype, $.EventHandler.prototype, $.ControlDock.prototype,
|
|||||||
if( this.nextButton ){
|
if( this.nextButton ){
|
||||||
if( ( this.tileSources.length - 1 ) === page ){
|
if( ( this.tileSources.length - 1 ) === page ){
|
||||||
//Disable next button
|
//Disable next button
|
||||||
this.nextButton.disable();
|
if(!this.navPrevNextWrap){
|
||||||
|
this.nextButton.disable();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.nextButton.enable();
|
this.nextButton.enable();
|
||||||
}
|
}
|
||||||
@ -1029,7 +1038,9 @@ $.extend( $.Viewer.prototype, $.EventHandler.prototype, $.ControlDock.prototype,
|
|||||||
//Enable previous button
|
//Enable previous button
|
||||||
this.previousButton.enable();
|
this.previousButton.enable();
|
||||||
} else {
|
} else {
|
||||||
this.previousButton.disable();
|
if(!this.navPrevNextWrap){
|
||||||
|
this.previousButton.disable();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1145,7 +1156,10 @@ function openTileSource( viewer, source ) {
|
|||||||
sizeRatio: _this.navigatorSizeRatio,
|
sizeRatio: _this.navigatorSizeRatio,
|
||||||
height: _this.navigatorHeight,
|
height: _this.navigatorHeight,
|
||||||
width: _this.navigatorWidth,
|
width: _this.navigatorWidth,
|
||||||
tileSources: _this.tileSources,
|
// By passing the fully parsed source here, the navigator doesn't
|
||||||
|
// have to load it again. Additionally, we don't have to call
|
||||||
|
// navigator.open, as it's implicitly called in the ctor.
|
||||||
|
tileSources: source,
|
||||||
tileHost: _this.tileHost,
|
tileHost: _this.tileHost,
|
||||||
prefixUrl: _this.prefixUrl,
|
prefixUrl: _this.prefixUrl,
|
||||||
overlays: _this.overlays,
|
overlays: _this.overlays,
|
||||||
@ -1210,10 +1224,6 @@ function openTileSource( viewer, source ) {
|
|||||||
}
|
}
|
||||||
VIEWERS[ _this.hash ] = _this;
|
VIEWERS[ _this.hash ] = _this;
|
||||||
|
|
||||||
if( _this.navigator ){
|
|
||||||
_this.navigator.open( source );
|
|
||||||
}
|
|
||||||
|
|
||||||
_this.raiseEvent( 'open', { source: source, viewer: _this } );
|
_this.raiseEvent( 'open', { source: source, viewer: _this } );
|
||||||
|
|
||||||
return _this;
|
return _this;
|
||||||
@ -1623,12 +1633,18 @@ function onFullPage() {
|
|||||||
|
|
||||||
function onPrevious(){
|
function onPrevious(){
|
||||||
var previous = THIS[ this.hash ].sequence - 1;
|
var previous = THIS[ this.hash ].sequence - 1;
|
||||||
|
if(this.navPrevNextWrap && previous < 0){
|
||||||
|
previous += this.tileSources.length;
|
||||||
|
}
|
||||||
this.goToPage( previous );
|
this.goToPage( previous );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function onNext(){
|
function onNext(){
|
||||||
var next = THIS[ this.hash ].sequence + 1;
|
var next = THIS[ this.hash ].sequence + 1;
|
||||||
|
if(this.navPrevNextWrap && next >= this.tileSources.length){
|
||||||
|
next = 0;
|
||||||
|
}
|
||||||
this.goToPage( next );
|
this.goToPage( next );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user