Merge branch 'master' of github.com:thatcher/openseadragon

This commit is contained in:
thatcher 2013-01-31 12:30:36 -05:00
commit bd135904b6
22 changed files with 291 additions and 226 deletions

View File

@ -1,3 +1,5 @@
/*globals OpenSeadragon */
/** /**
* @version OpenSeadragon 0.9.92 * @version OpenSeadragon 0.9.92
* *
@ -239,7 +241,7 @@
* *
* @returns {OpenSeadragon.Viewer} * @returns {OpenSeadragon.Viewer}
*/ */
OpenSeadragon = window.OpenSeadragon || function( options ){ window.OpenSeadragon = window.OpenSeadragon || function( options ){
return new OpenSeadragon.Viewer( options ); return new OpenSeadragon.Viewer( options );
@ -1869,6 +1871,7 @@ OpenSeadragon = window.OpenSeadragon || function( options ){
}( OpenSeadragon )); }( OpenSeadragon ));
/*globals OpenSeadragon */
(function($){ (function($){
@ -1956,7 +1959,7 @@ $.EventHandler.prototype = {
if ( handler ) { if ( handler ) {
if ( !eventArgs ) { if ( !eventArgs ) {
eventArgs = new Object(); eventArgs = {};
} }
handler( this, eventArgs ); handler( this, eventArgs );
@ -1965,6 +1968,7 @@ $.EventHandler.prototype = {
}; };
}( OpenSeadragon )); }( OpenSeadragon ));
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){
@ -2287,7 +2291,7 @@ $.EventHandler.prototype = {
delegate.tracking = true; delegate.tracking = true;
ACTIVE[ tracker.hash ] = tracker; ACTIVE[ tracker.hash ] = tracker;
} }
}; }
/** /**
* Stops tracking mouse events on this element. * Stops tracking mouse events on this element.
@ -2322,7 +2326,7 @@ $.EventHandler.prototype = {
delegate.tracking = false; delegate.tracking = false;
delete ACTIVE[ tracker.hash ]; delete ACTIVE[ tracker.hash ];
} }
}; }
/** /**
* @private * @private
@ -2330,7 +2334,7 @@ $.EventHandler.prototype = {
*/ */
function hasMouse( tracker ) { function hasMouse( tracker ) {
return THIS[ tracker.hash ].insideElement; return THIS[ tracker.hash ].insideElement;
}; }
/** /**
* Begin capturing mouse events on this element. * Begin capturing mouse events on this element.
@ -2376,7 +2380,7 @@ $.EventHandler.prototype = {
} }
delegate.capturing = true; delegate.capturing = true;
} }
}; }
/** /**
@ -2423,7 +2427,7 @@ $.EventHandler.prototype = {
} }
delegate.capturing = false; delegate.capturing = false;
} }
}; }
/** /**
@ -2437,7 +2441,7 @@ $.EventHandler.prototype = {
handler( ACTIVE[ otherHash ], event ); handler( ACTIVE[ otherHash ], event );
} }
} }
}; }
/** /**
@ -2456,7 +2460,7 @@ $.EventHandler.prototype = {
$.cancelEvent( event ); $.cancelEvent( event );
} }
} }
}; }
/** /**
@ -2475,7 +2479,7 @@ $.EventHandler.prototype = {
$.cancelEvent( event ); $.cancelEvent( event );
} }
} }
}; }
/** /**
@ -2495,7 +2499,7 @@ $.EventHandler.prototype = {
$.cancelEvent( event ); $.cancelEvent( event );
} }
} }
}; }
/** /**
@ -2542,7 +2546,7 @@ $.EventHandler.prototype = {
$.cancelEvent( event ); $.cancelEvent( event );
} }
} }
}; }
/** /**
@ -2589,7 +2593,7 @@ $.EventHandler.prototype = {
$.cancelEvent( event ); $.cancelEvent( event );
} }
} }
}; }
/** /**
@ -2635,7 +2639,7 @@ $.EventHandler.prototype = {
// add us to the list // add us to the list
CAPTURING.push( tracker ); CAPTURING.push( tracker );
} }
}; }
/** /**
* @private * @private
@ -2665,7 +2669,7 @@ $.EventHandler.prototype = {
} }
event.preventDefault(); event.preventDefault();
}; }
/** /**
@ -2702,7 +2706,7 @@ $.EventHandler.prototype = {
if ( insideElementPress && insideElementRelease ) { if ( insideElementPress && insideElementRelease ) {
handleMouseClick( tracker, event ); handleMouseClick( tracker, event );
} }
}; }
/** /**
@ -2724,7 +2728,7 @@ $.EventHandler.prototype = {
//$.console.debug("pinch end"); //$.console.debug("pinch end");
} }
event.preventDefault(); event.preventDefault();
}; }
/** /**
@ -2761,7 +2765,7 @@ $.EventHandler.prototype = {
); );
$.stopEvent( event ); $.stopEvent( event );
}; }
/** /**
@ -2778,7 +2782,7 @@ $.EventHandler.prototype = {
onMouseUp( tracker, event ); onMouseUp( tracker, event );
} }
releaseMouse( tracker ); releaseMouse( tracker );
}; }
/** /**
@ -2789,7 +2793,7 @@ $.EventHandler.prototype = {
if ( tracker.clickHandler ) { if ( tracker.clickHandler ) {
$.cancelEvent( event ); $.cancelEvent( event );
} }
}; }
/** /**
@ -2828,7 +2832,7 @@ $.EventHandler.prototype = {
$.cancelEvent( event ); $.cancelEvent( event );
} }
} }
}; }
/** /**
@ -2861,7 +2865,7 @@ $.EventHandler.prototype = {
$.cancelEvent( event ); $.cancelEvent( event );
} }
} }
}; }
/** /**
@ -2888,7 +2892,7 @@ $.EventHandler.prototype = {
$.cancelEvent( event ); $.cancelEvent( event );
} }
} }
}; }
/** /**
@ -2932,7 +2936,7 @@ $.EventHandler.prototype = {
} }
} }
event.preventDefault(); event.preventDefault();
}; }
/** /**
* Only triggered once by the deepest element that initially received * Only triggered once by the deepest element that initially received
@ -2950,7 +2954,7 @@ $.EventHandler.prototype = {
} }
$.stopEvent( event ); $.stopEvent( event );
}; }
/** /**
* @private * @private
@ -2958,7 +2962,7 @@ $.EventHandler.prototype = {
*/ */
function getMouseAbsolute( event ) { function getMouseAbsolute( event ) {
return $.getMousePosition( event ); return $.getMousePosition( event );
}; }
/** /**
* @private * @private
@ -2969,7 +2973,7 @@ $.EventHandler.prototype = {
offset = $.getElementPosition( element ); offset = $.getElementPosition( element );
return mouse.minus( offset ); return mouse.minus( offset );
}; }
/** /**
* @private * @private
@ -2986,7 +2990,7 @@ $.EventHandler.prototype = {
} }
} }
return elementA == elementB; return elementA == elementB;
}; }
/** /**
* @private * @private
@ -2994,7 +2998,7 @@ $.EventHandler.prototype = {
*/ */
function onGlobalMouseDown() { function onGlobalMouseDown() {
IS_BUTTON_DOWN = true; IS_BUTTON_DOWN = true;
}; }
/** /**
* @private * @private
@ -3002,7 +3006,7 @@ $.EventHandler.prototype = {
*/ */
function onGlobalMouseUp() { function onGlobalMouseUp() {
IS_BUTTON_DOWN = false; IS_BUTTON_DOWN = false;
}; }
(function () { (function () {
@ -3016,6 +3020,7 @@ $.EventHandler.prototype = {
})(); })();
}( OpenSeadragon )); }( OpenSeadragon ));
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){
@ -3121,6 +3126,8 @@ $.Control.prototype = {
}; };
}( OpenSeadragon )); }( OpenSeadragon ));
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){
//id hash for private properties; //id hash for private properties;
@ -3178,8 +3185,8 @@ $.Control.prototype = {
* @function * @function
*/ */
addControl: function ( element, anchor ) { addControl: function ( element, anchor ) {
var element = $.getElement( element ), element = $.getElement( element );
div = null; var div = null;
if ( getControlIndex( this, element ) >= 0 ) { if ( getControlIndex( this, element ) >= 0 ) {
return; // they're trying to add a duplicate control return; // they're trying to add a duplicate control
@ -3210,8 +3217,8 @@ $.Control.prototype = {
element.style.paddingLeft = "0px"; element.style.paddingLeft = "0px";
element.style.paddingTop = "0px"; element.style.paddingTop = "0px";
break; break;
case $.ControlAnchor.NONE:
default: default:
case $.ControlAnchor.NONE:
div = this.container; div = this.container;
element.style.margin = "0px"; element.style.margin = "0px";
element.style.padding = "0px"; element.style.padding = "0px";
@ -3230,8 +3237,8 @@ $.Control.prototype = {
* @return {OpenSeadragon.ControlDock} Chainable. * @return {OpenSeadragon.ControlDock} Chainable.
*/ */
removeControl: function ( element ) { removeControl: function ( element ) {
var element = $.getElement( element ), element = $.getElement( element );
i = getControlIndex( this, element ); var i = getControlIndex( this, element );
if ( i >= 0 ) { if ( i >= 0 ) {
this.controls[ i ].destroy(); this.controls[ i ].destroy();
@ -3302,9 +3309,11 @@ $.Control.prototype = {
} }
return -1; return -1;
}; }
}( OpenSeadragon ));(function( $ ){ }( OpenSeadragon ));/*globals OpenSeadragon */
(function( $ ){
// dictionary from hash to private properties // dictionary from hash to private properties
var THIS = {}, var THIS = {},
@ -3883,7 +3892,7 @@ $.extend( $.Viewer.prototype, $.EventHandler.prototype, $.ControlDock.prototype,
abortControlsAutoHide( this ); abortControlsAutoHide( this );
} else { } else {
beginControlsAutoHide( this ); beginControlsAutoHide( this );
}; }
}, },
@ -4366,7 +4375,7 @@ function scheduleUpdate( viewer, updateFunc, prevUpdateTime ){
return window.setTimeout( function(){ return window.setTimeout( function(){
updateFunc( viewer ); updateFunc( viewer );
}, deltaTime ); }, deltaTime );
}; }
//provides a sequence in the fade animation //provides a sequence in the fade animation
@ -4374,7 +4383,7 @@ function scheduleControlsFade( viewer ) {
window.setTimeout( function(){ window.setTimeout( function(){
updateControlsFade( viewer ); updateControlsFade( viewer );
}, 20); }, 20);
}; }
//initiates an animation to hide the controls //initiates an animation to hide the controls
@ -4390,7 +4399,7 @@ function beginControlsAutoHide( viewer ) {
window.setTimeout( function(){ window.setTimeout( function(){
scheduleControlsFade( viewer ); scheduleControlsFade( viewer );
}, viewer.controlsFadeDelay ); }, viewer.controlsFadeDelay );
}; }
//determines if fade animation is done or continues the animation //determines if fade animation is done or continues the animation
@ -4416,7 +4425,7 @@ function updateControlsFade( viewer ) {
scheduleControlsFade( viewer ); scheduleControlsFade( viewer );
} }
} }
}; }
//stop the fade animation on the controls and show them //stop the fade animation on the controls and show them
@ -4426,7 +4435,7 @@ function abortControlsAutoHide( viewer ) {
for ( i = viewer.controls.length - 1; i >= 0; i-- ) { for ( i = viewer.controls.length - 1; i >= 0; i-- ) {
viewer.controls[ i ].setOpacity( 1.0 ); viewer.controls[ i ].setOpacity( 1.0 );
} }
}; }
@ -4435,12 +4444,12 @@ function abortControlsAutoHide( viewer ) {
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
function onFocus(){ function onFocus(){
abortControlsAutoHide( this ); abortControlsAutoHide( this );
}; }
function onBlur(){ function onBlur(){
beginControlsAutoHide( this ); beginControlsAutoHide( this );
}; }
function onCanvasClick( tracker, position, quick, shift ) { function onCanvasClick( tracker, position, quick, shift ) {
var zoomPreClick, var zoomPreClick,
@ -4454,7 +4463,7 @@ function onCanvasClick( tracker, position, quick, shift ) {
); );
this.viewport.applyConstraints(); this.viewport.applyConstraints();
} }
}; }
function onCanvasDrag( tracker, position, delta, shift ) { function onCanvasDrag( tracker, position, delta, shift ) {
if ( this.viewport ) { if ( this.viewport ) {
@ -4470,13 +4479,13 @@ function onCanvasDrag( tracker, position, delta, shift ) {
) )
); );
} }
}; }
function onCanvasRelease( tracker, position, insideElementPress, insideElementRelease ) { function onCanvasRelease( tracker, position, insideElementPress, insideElementRelease ) {
if ( insideElementPress && this.viewport ) { if ( insideElementPress && this.viewport ) {
this.viewport.applyConstraints(); this.viewport.applyConstraints();
} }
}; }
function onCanvasScroll( tracker, position, scroll, shift ) { function onCanvasScroll( tracker, position, scroll, shift ) {
var factor; var factor;
@ -4490,7 +4499,7 @@ function onCanvasScroll( tracker, position, scroll, shift ) {
} }
//cancels event //cancels event
return false; return false;
}; }
function onContainerExit( tracker, position, buttonDownElement, buttonDownAny ) { function onContainerExit( tracker, position, buttonDownElement, buttonDownAny ) {
if ( !buttonDownElement ) { if ( !buttonDownElement ) {
@ -4499,7 +4508,7 @@ function onContainerExit( tracker, position, buttonDownElement, buttonDownAny )
beginControlsAutoHide( this ); beginControlsAutoHide( this );
} }
} }
}; }
function onContainerRelease( tracker, position, insideElementPress, insideElementRelease ) { function onContainerRelease( tracker, position, insideElementPress, insideElementRelease ) {
if ( !insideElementRelease ) { if ( !insideElementRelease ) {
@ -4508,12 +4517,12 @@ function onContainerRelease( tracker, position, insideElementPress, insideElemen
beginControlsAutoHide( this ); beginControlsAutoHide( this );
} }
} }
}; }
function onContainerEnter( tracker, position, buttonDownElement, buttonDownAny ) { function onContainerEnter( tracker, position, buttonDownElement, buttonDownAny ) {
THIS[ this.hash ].mouseInside = true; THIS[ this.hash ].mouseInside = true;
abortControlsAutoHide( this ); abortControlsAutoHide( this );
}; }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@ -4531,7 +4540,7 @@ function updateMulti( viewer ) {
beginTime = +new Date(); beginTime = +new Date();
updateOnce( viewer ); updateOnce( viewer );
scheduleUpdate( viewer, arguments.callee, beginTime ); scheduleUpdate( viewer, arguments.callee, beginTime );
}; }
function updateOnce( viewer ) { function updateOnce( viewer ) {
@ -4588,7 +4597,7 @@ function updateOnce( viewer ) {
THIS[ viewer.hash ].animating = animated; THIS[ viewer.hash ].animating = animated;
//viewer.profiler.endUpdate(); //viewer.profiler.endUpdate();
}; }
@ -4597,7 +4606,7 @@ function updateOnce( viewer ) {
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
function resolveUrl( prefix, url ) { function resolveUrl( prefix, url ) {
return prefix ? prefix + url : url; return prefix ? prefix + url : url;
}; }
@ -4606,7 +4615,7 @@ function beginZoomingIn() {
THIS[ this.hash ].zoomFactor = this.zoomPerSecond; THIS[ this.hash ].zoomFactor = this.zoomPerSecond;
THIS[ this.hash ].zooming = true; THIS[ this.hash ].zooming = true;
scheduleZoom( this ); scheduleZoom( this );
}; }
function beginZoomingOut() { function beginZoomingOut() {
@ -4614,17 +4623,17 @@ function beginZoomingOut() {
THIS[ this.hash ].zoomFactor = 1.0 / this.zoomPerSecond; THIS[ this.hash ].zoomFactor = 1.0 / this.zoomPerSecond;
THIS[ this.hash ].zooming = true; THIS[ this.hash ].zooming = true;
scheduleZoom( this ); scheduleZoom( this );
}; }
function endZooming() { function endZooming() {
THIS[ this.hash ].zooming = false; THIS[ this.hash ].zooming = false;
}; }
function scheduleZoom( viewer ) { function scheduleZoom( viewer ) {
window.setTimeout( $.delegate( viewer, doZoom ), 10 ); window.setTimeout( $.delegate( viewer, doZoom ), 10 );
}; }
function doZoom() { function doZoom() {
@ -4642,7 +4651,7 @@ function doZoom() {
THIS[ this.hash ].lastZoomTime = currentTime; THIS[ this.hash ].lastZoomTime = currentTime;
scheduleZoom( this ); scheduleZoom( this );
} }
}; }
function doSingleZoomIn() { function doSingleZoomIn() {
@ -4653,7 +4662,7 @@ function doSingleZoomIn() {
); );
this.viewport.applyConstraints(); this.viewport.applyConstraints();
} }
}; }
function doSingleZoomOut() { function doSingleZoomOut() {
@ -4664,20 +4673,20 @@ function doSingleZoomOut() {
); );
this.viewport.applyConstraints(); this.viewport.applyConstraints();
} }
}; }
function lightUp() { function lightUp() {
this.buttons.emulateEnter(); this.buttons.emulateEnter();
this.buttons.emulateExit(); this.buttons.emulateExit();
}; }
function onHome() { function onHome() {
if ( this.viewport ) { if ( this.viewport ) {
this.viewport.goHome(); this.viewport.goHome();
} }
}; }
function onFullPage() { function onFullPage() {
@ -4690,22 +4699,24 @@ function onFullPage() {
if ( this.viewport ) { if ( this.viewport ) {
this.viewport.applyConstraints(); this.viewport.applyConstraints();
} }
}; }
function onPrevious(){ function onPrevious(){
var previous = THIS[ this.hash ].sequence - 1; var previous = THIS[ this.hash ].sequence - 1;
this.goToPage( previous ); this.goToPage( previous );
}; }
function onNext(){ function onNext(){
var next = THIS[ this.hash ].sequence + 1; var next = THIS[ this.hash ].sequence + 1;
this.goToPage( next ); this.goToPage( next );
}; }
}( OpenSeadragon )); }( OpenSeadragon ));
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){
/** /**
@ -4772,10 +4783,17 @@ $.Navigator = function( options ){
style.fontSize = '0px'; style.fontSize = '0px';
style.overflow = 'hidden'; style.overflow = 'hidden';
style.border = '2px solid #900'; style.border = '2px solid #900';
//TODO: IE doesnt like this property being set //TODO: IE doesnt like this property being set
//try{ style.outline = '2px auto #909'; }catch(e){/*ignore*/} //try{ style.outline = '2px auto #909'; }catch(e){/*ignore*/}
style.background = 'transparent'; style.background = 'transparent';
style.float = 'left'; //Webkit
// We use square bracket notation on the statement below, because float is a keyword.
// This is important for the Google Closure compliler, if nothing else.
/*jshint sub:true */
style['float'] = 'left'; //Webkit
style.cssFloat = 'left'; //Firefox style.cssFloat = 'left'; //Firefox
style.styleFloat = 'left'; //IE style.styleFloat = 'left'; //IE
style.zIndex = 999999999; style.zIndex = 999999999;
@ -4836,16 +4854,18 @@ $.Navigator = function( options ){
case 119://w case 119://w
case 87://W case 87://W
case 38://up arrow case 38://up arrow
shiftKey ? if (shiftKey)
_this.viewer.viewport.zoomBy(1.1): _this.viewer.viewport.zoomBy(1.1);
else
_this.viewer.viewport.panBy(new $.Point(0, -0.05)); _this.viewer.viewport.panBy(new $.Point(0, -0.05));
_this.viewer.viewport.applyConstraints(); _this.viewer.viewport.applyConstraints();
return false; return false;
case 115://s case 115://s
case 83://S case 83://S
case 40://down arrow case 40://down arrow
shiftKey ? if (shiftKey)
_this.viewer.viewport.zoomBy(0.9): _this.viewer.viewport.zoomBy(0.9);
else
_this.viewer.viewport.panBy(new $.Point(0, 0.05)); _this.viewer.viewport.panBy(new $.Point(0, 0.05));
_this.viewer.viewport.applyConstraints(); _this.viewer.viewport.applyConstraints();
return false; return false;
@ -4939,7 +4959,7 @@ $.extend( $.Navigator.prototype, $.EventHandler.prototype, $.Viewer.prototype, {
*/ */
function onCanvasClick( tracker, position, quick, shift ) { function onCanvasClick( tracker, position, quick, shift ) {
this.displayRegion.focus(); this.displayRegion.focus();
}; }
/** /**
@ -4961,7 +4981,7 @@ function onCanvasDrag( tracker, position, delta, shift ) {
) )
); );
} }
}; }
/** /**
@ -4973,7 +4993,7 @@ function onCanvasRelease( tracker, position, insideElementPress, insideElementRe
if ( insideElementPress && this.viewer.viewport ) { if ( insideElementPress && this.viewer.viewport ) {
this.viewer.viewport.applyConstraints(); this.viewer.viewport.applyConstraints();
} }
}; }
/** /**
@ -4994,7 +5014,7 @@ function onCanvasScroll( tracker, position, scroll, shift ) {
} }
//cancels event //cancels event
return false; return false;
}; }
}( OpenSeadragon )); }( OpenSeadragon ));
@ -5089,6 +5109,7 @@ $.extend( $, {
}); });
}( OpenSeadragon )); }( OpenSeadragon ));
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){
@ -5231,6 +5252,7 @@ $.Point.prototype = {
}; };
}( OpenSeadragon )); }( OpenSeadragon ));
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){
@ -5609,7 +5631,7 @@ function processResponse( xhr ){
data = responseText; data = responseText;
} }
return data; return data;
}; }
/** /**
@ -5968,6 +5990,7 @@ function configureFromObject( tileSource, configuration ){
}; };
}( OpenSeadragon )); }( OpenSeadragon ));
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){
@ -6162,7 +6185,7 @@ function filterFiles( files ){
return a.height - b.height; return a.height - b.height;
}); });
}; }
/** /**
* @private * @private
@ -6196,8 +6219,8 @@ function configureFromXML( tileSource, xmlDoc ){
conf.levels .push({ conf.levels .push({
url: level.getAttribute( "url" ), url: level.getAttribute( "url" ),
width: parseInt( level.getAttribute( "width" ) ), width: parseInt( level.getAttribute( "width" ), 10 ),
height: parseInt( level.getAttribute( "height" ) ) height: parseInt( level.getAttribute( "height" ), 10 )
}); });
} }
@ -6215,7 +6238,7 @@ function configureFromXML( tileSource, xmlDoc ){
} }
throw new Error( 'Unknown element ' + rootName ); throw new Error( 'Unknown element ' + rootName );
}; }
/** /**
* @private * @private
@ -6226,9 +6249,10 @@ function configureFromObject( tileSource, configuration ){
return configuration.levels; return configuration.levels;
}; }
}( OpenSeadragon )); }( OpenSeadragon ));
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){
@ -6340,7 +6364,7 @@ $.extend( $.TileSourceCollection.prototype, $.TileSource.prototype, {
}( OpenSeadragon )); }( OpenSeadragon ));
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){
@ -6589,7 +6613,7 @@ function scheduleFade( button ) {
window.setTimeout(function(){ window.setTimeout(function(){
updateFade( button ); updateFade( button );
}, 20 ); }, 20 );
}; }
function updateFade( button ) { function updateFade( button ) {
var currentTime, var currentTime,
@ -6611,7 +6635,7 @@ function updateFade( button ) {
scheduleFade( button ); scheduleFade( button );
} }
} }
}; }
function beginFading( button ) { function beginFading( button ) {
button.shouldFade = true; button.shouldFade = true;
@ -6619,14 +6643,14 @@ function beginFading( button ) {
window.setTimeout( function(){ window.setTimeout( function(){
scheduleFade( button ); scheduleFade( button );
}, button.fadeDelay ); }, button.fadeDelay );
}; }
function stopFading( button ) { function stopFading( button ) {
button.shouldFade = false; button.shouldFade = false;
if( button.imgGroup ){ if( button.imgGroup ){
$.setElementOpacity( button.imgGroup, 1.0, true ); $.setElementOpacity( button.imgGroup, 1.0, true );
} }
}; }
function inTo( button, newState ) { function inTo( button, newState ) {
@ -6655,7 +6679,7 @@ function inTo( button, newState ) {
} }
button.currentState = $.ButtonState.DOWN; button.currentState = $.ButtonState.DOWN;
} }
}; }
function outTo( button, newState ) { function outTo( button, newState ) {
@ -6685,11 +6709,12 @@ function outTo( button, newState ) {
beginFading( button ); beginFading( button );
button.currentState = $.ButtonState.REST; button.currentState = $.ButtonState.REST;
} }
}; }
}( OpenSeadragon )); }( OpenSeadragon ));
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){
/** /**
@ -6800,6 +6825,7 @@ $.ButtonGroup.prototype = {
}( OpenSeadragon )); }( OpenSeadragon ));
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){
@ -7437,7 +7463,8 @@ function onKeyPress( tracker, keyCode, shiftKey ){
}( OpenSeadragon )); }( OpenSeadragon ));/*globals OpenSeadragon */
(function( $ ){ (function( $ ){
/** /**
@ -7460,11 +7487,12 @@ $.DisplayRect = function( x, y, width, height, minLevel, maxLevel ) {
this.minLevel = minLevel; this.minLevel = minLevel;
this.maxLevel = maxLevel; this.maxLevel = maxLevel;
} };
$.extend( $.DisplayRect.prototype, $.Rect.prototype ); $.extend( $.DisplayRect.prototype, $.Rect.prototype );
}( OpenSeadragon )); }( OpenSeadragon ));
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){
@ -7572,7 +7600,7 @@ $.Spring.prototype = {
( this.target.time - this.start.time ) ( this.target.time - this.start.time )
); );
} }
} };
/** /**
* @private * @private
@ -7580,9 +7608,10 @@ $.Spring.prototype = {
function transform( stiffness, x ) { function transform( stiffness, x ) {
return ( 1.0 - Math.exp( stiffness * -x ) ) / return ( 1.0 - Math.exp( stiffness * -x ) ) /
( 1.0 - Math.exp( -stiffness ) ); ( 1.0 - Math.exp( -stiffness ) );
}; }
}( OpenSeadragon )); }( OpenSeadragon ));
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){
@ -7781,6 +7810,7 @@ $.Tile.prototype = {
}; };
}( OpenSeadragon )); }( OpenSeadragon ));
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){
@ -7865,8 +7895,8 @@ $.Tile.prototype = {
case $.OverlayPlacement.LEFT: case $.OverlayPlacement.LEFT:
position.y -= size.y / 2; position.y -= size.y / 2;
break; break;
case $.OverlayPlacement.CENTER:
default: default:
case $.OverlayPlacement.CENTER:
position.x -= size.x / 2; position.x -= size.x / 2;
position.y -= size.y / 2; position.y -= size.y / 2;
break; break;
@ -7953,6 +7983,7 @@ $.Tile.prototype = {
}; };
}( OpenSeadragon )); }( OpenSeadragon ));
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){
@ -8440,7 +8471,7 @@ function updateViewport( drawer ) {
// because we haven't finished drawing, so // because we haven't finished drawing, so
drawer.updateAgain = true; drawer.updateAgain = true;
} }
}; }
function updateLevel( drawer, haveDrawn, level, levelOpacity, levelVisibility, viewportTL, viewportBR, currentTime, best ){ function updateLevel( drawer, haveDrawn, level, levelOpacity, levelVisibility, viewportTL, viewportBR, currentTime, best ){
@ -8486,7 +8517,7 @@ function updateLevel( drawer, haveDrawn, level, levelOpacity, levelVisibility, v
} }
} }
return best; return best;
}; }
function updateTile( drawer, drawLevel, haveDrawn, x, y, level, levelOpacity, levelVisibility, viewportCenter, numberOfTiles, currentTime, best){ function updateTile( drawer, drawLevel, haveDrawn, x, y, level, levelOpacity, levelVisibility, viewportCenter, numberOfTiles, currentTime, best){
@ -8546,7 +8577,7 @@ function updateTile( drawer, drawLevel, haveDrawn, x, y, level, levelOpacity, le
} }
return best; return best;
}; }
function getTile( x, y, level, tileSource, tilesMatrix, time, numTiles, normHeight ) { function getTile( x, y, level, tileSource, tilesMatrix, time, numTiles, normHeight ) {
var xMod, var xMod,
@ -8587,7 +8618,7 @@ function getTile( x, y, level, tileSource, tilesMatrix, time, numTiles, normHeig
tile.lastTouchTime = time; tile.lastTouchTime = time;
return tile; return tile;
}; }
function loadTile( drawer, tile, time ) { function loadTile( drawer, tile, time ) {
@ -8602,7 +8633,7 @@ function loadTile( drawer, tile, time ) {
} }
); );
} }
}; }
function onTileLoad( drawer, tile, time, image ) { function onTileLoad( drawer, tile, time, image ) {
var insertionIndex, var insertionIndex,
@ -8672,7 +8703,7 @@ function onTileLoad( drawer, tile, time, image ) {
drawer.tilesLoaded[ insertionIndex ] = tile; drawer.tilesLoaded[ insertionIndex ] = tile;
drawer.updateAgain = true; drawer.updateAgain = true;
}; }
function positionTile( tile, overlap, viewport, viewportCenter, levelVisibility ){ function positionTile( tile, overlap, viewport, viewportCenter, levelVisibility ){
@ -8693,7 +8724,7 @@ function positionTile( tile, overlap, viewport, viewportCenter, levelVisibility
tile.size = sizeC; tile.size = sizeC;
tile.distance = tileDistance; tile.distance = tileDistance;
tile.visibility = levelVisibility; tile.visibility = levelVisibility;
}; }
function blendTile( drawer, tile, x, y, level, levelOpacity, currentTime ){ function blendTile( drawer, tile, x, y, level, levelOpacity, currentTime ){
@ -8723,13 +8754,13 @@ function blendTile( drawer, tile, x, y, level, levelOpacity, currentTime ){
} }
return false; return false;
}; }
function clearTiles( drawer ) { function clearTiles( drawer ) {
drawer.tilesMatrix = {}; drawer.tilesMatrix = {};
drawer.tilesLoaded = []; drawer.tilesLoaded = [];
}; }
/** /**
* @private * @private
@ -8772,7 +8803,7 @@ function providesCoverage( coverage, level, x, y ) {
coverage[ level ][ x ][ y ] === undefined || coverage[ level ][ x ][ y ] === undefined ||
coverage[ level ][ x ][ y ] === true coverage[ level ][ x ][ y ] === true
); );
}; }
/** /**
* @private * @private
@ -8792,7 +8823,7 @@ function isCovered( coverage, level, x, y ) {
providesCoverage( coverage, level + 1, 2 * x + 1, 2 * y + 1 ) providesCoverage( coverage, level + 1, 2 * x + 1, 2 * y + 1 )
); );
} }
}; }
/** /**
* @private * @private
@ -8813,7 +8844,7 @@ function setCoverage( coverage, level, x, y, covers ) {
} }
coverage[ level ][ x ][ y ] = covers; coverage[ level ][ x ][ y ] = covers;
}; }
/** /**
* @private * @private
@ -8824,7 +8855,7 @@ function setCoverage( coverage, level, x, y, covers ) {
*/ */
function resetCoverage( coverage, level ) { function resetCoverage( coverage, level ) {
coverage[ level ] = {}; coverage[ level ] = {};
}; }
/** /**
* @private * @private
@ -8841,7 +8872,7 @@ function getOverlayIndex( overlays, element ) {
} }
return -1; return -1;
}; }
/** /**
* @private * @private
@ -8863,7 +8894,7 @@ function compareTiles( previousBest, tile ) {
} }
return previousBest; return previousBest;
}; }
function finishLoadingImage( image, callback, successful, jobid ){ function finishLoadingImage( image, callback, successful, jobid ){
@ -8878,7 +8909,7 @@ function finishLoadingImage( image, callback, successful, jobid ){
callback( image.src, successful ? image : null); callback( image.src, successful ? image : null);
}, 1 ); }, 1 );
}; }
function drawOverlays( viewport, overlays, container ){ function drawOverlays( viewport, overlays, container ){
@ -8887,7 +8918,7 @@ function drawOverlays( viewport, overlays, container ){
for ( i = 0; i < length; i++ ) { for ( i = 0; i < length; i++ ) {
drawOverlay( viewport, overlays[ i ], container ); drawOverlay( viewport, overlays[ i ], container );
} }
}; }
function drawOverlay( viewport, overlay, container ){ function drawOverlay( viewport, overlay, container ){
@ -8900,7 +8931,7 @@ function drawOverlay( viewport, overlay, container ){
true true
); );
overlay.drawHTML( container ); overlay.drawHTML( container );
}; }
function drawTiles( drawer, lastDrawn ){ function drawTiles( drawer, lastDrawn ){
var i, var i,
@ -8993,7 +9024,7 @@ function drawTiles( drawer, lastDrawn ){
tile.beingDrawn = true; tile.beingDrawn = true;
} }
} }
}; }
function drawDebugInfo( drawer, tile, count, i ){ function drawDebugInfo( drawer, tile, count, i ){
@ -9052,10 +9083,11 @@ function drawDebugInfo( drawer, tile, count, i ){
tile.position.y + 70 tile.position.y + 70
); );
} }
}; }
}( OpenSeadragon )); }( OpenSeadragon ));
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){

View File

@ -1,4 +1,4 @@
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){
@ -247,7 +247,7 @@ function scheduleFade( button ) {
window.setTimeout(function(){ window.setTimeout(function(){
updateFade( button ); updateFade( button );
}, 20 ); }, 20 );
}; }
function updateFade( button ) { function updateFade( button ) {
var currentTime, var currentTime,
@ -269,7 +269,7 @@ function updateFade( button ) {
scheduleFade( button ); scheduleFade( button );
} }
} }
}; }
function beginFading( button ) { function beginFading( button ) {
button.shouldFade = true; button.shouldFade = true;
@ -277,14 +277,14 @@ function beginFading( button ) {
window.setTimeout( function(){ window.setTimeout( function(){
scheduleFade( button ); scheduleFade( button );
}, button.fadeDelay ); }, button.fadeDelay );
}; }
function stopFading( button ) { function stopFading( button ) {
button.shouldFade = false; button.shouldFade = false;
if( button.imgGroup ){ if( button.imgGroup ){
$.setElementOpacity( button.imgGroup, 1.0, true ); $.setElementOpacity( button.imgGroup, 1.0, true );
} }
}; }
function inTo( button, newState ) { function inTo( button, newState ) {
@ -313,7 +313,7 @@ function inTo( button, newState ) {
} }
button.currentState = $.ButtonState.DOWN; button.currentState = $.ButtonState.DOWN;
} }
}; }
function outTo( button, newState ) { function outTo( button, newState ) {
@ -343,7 +343,7 @@ function outTo( button, newState ) {
beginFading( button ); beginFading( button );
button.currentState = $.ButtonState.REST; button.currentState = $.ButtonState.REST;
} }
}; }

View File

@ -1,3 +1,4 @@
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){
/** /**

View File

@ -1,3 +1,4 @@
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){

View File

@ -1,3 +1,5 @@
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){
//id hash for private properties; //id hash for private properties;
@ -55,8 +57,8 @@
* @function * @function
*/ */
addControl: function ( element, anchor ) { addControl: function ( element, anchor ) {
var element = $.getElement( element ), element = $.getElement( element );
div = null; var div = null;
if ( getControlIndex( this, element ) >= 0 ) { if ( getControlIndex( this, element ) >= 0 ) {
return; // they're trying to add a duplicate control return; // they're trying to add a duplicate control
@ -87,8 +89,8 @@
element.style.paddingLeft = "0px"; element.style.paddingLeft = "0px";
element.style.paddingTop = "0px"; element.style.paddingTop = "0px";
break; break;
case $.ControlAnchor.NONE:
default: default:
case $.ControlAnchor.NONE:
div = this.container; div = this.container;
element.style.margin = "0px"; element.style.margin = "0px";
element.style.padding = "0px"; element.style.padding = "0px";
@ -107,8 +109,8 @@
* @return {OpenSeadragon.ControlDock} Chainable. * @return {OpenSeadragon.ControlDock} Chainable.
*/ */
removeControl: function ( element ) { removeControl: function ( element ) {
var element = $.getElement( element ), element = $.getElement( element );
i = getControlIndex( this, element ); var i = getControlIndex( this, element );
if ( i >= 0 ) { if ( i >= 0 ) {
this.controls[ i ].destroy(); this.controls[ i ].destroy();
@ -179,6 +181,6 @@
} }
return -1; return -1;
}; }
}( OpenSeadragon )); }( OpenSeadragon ));

View File

@ -1,3 +1,4 @@
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){
@ -21,7 +22,7 @@ $.DisplayRect = function( x, y, width, height, minLevel, maxLevel ) {
this.minLevel = minLevel; this.minLevel = minLevel;
this.maxLevel = maxLevel; this.maxLevel = maxLevel;
} };
$.extend( $.DisplayRect.prototype, $.Rect.prototype ); $.extend( $.DisplayRect.prototype, $.Rect.prototype );

View File

@ -1,3 +1,4 @@
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){
@ -485,7 +486,7 @@ function updateViewport( drawer ) {
// because we haven't finished drawing, so // because we haven't finished drawing, so
drawer.updateAgain = true; drawer.updateAgain = true;
} }
}; }
function updateLevel( drawer, haveDrawn, level, levelOpacity, levelVisibility, viewportTL, viewportBR, currentTime, best ){ function updateLevel( drawer, haveDrawn, level, levelOpacity, levelVisibility, viewportTL, viewportBR, currentTime, best ){
@ -531,7 +532,7 @@ function updateLevel( drawer, haveDrawn, level, levelOpacity, levelVisibility, v
} }
} }
return best; return best;
}; }
function updateTile( drawer, drawLevel, haveDrawn, x, y, level, levelOpacity, levelVisibility, viewportCenter, numberOfTiles, currentTime, best){ function updateTile( drawer, drawLevel, haveDrawn, x, y, level, levelOpacity, levelVisibility, viewportCenter, numberOfTiles, currentTime, best){
@ -591,7 +592,7 @@ function updateTile( drawer, drawLevel, haveDrawn, x, y, level, levelOpacity, le
} }
return best; return best;
}; }
function getTile( x, y, level, tileSource, tilesMatrix, time, numTiles, normHeight ) { function getTile( x, y, level, tileSource, tilesMatrix, time, numTiles, normHeight ) {
var xMod, var xMod,
@ -632,7 +633,7 @@ function getTile( x, y, level, tileSource, tilesMatrix, time, numTiles, normHeig
tile.lastTouchTime = time; tile.lastTouchTime = time;
return tile; return tile;
}; }
function loadTile( drawer, tile, time ) { function loadTile( drawer, tile, time ) {
@ -647,7 +648,7 @@ function loadTile( drawer, tile, time ) {
} }
); );
} }
}; }
function onTileLoad( drawer, tile, time, image ) { function onTileLoad( drawer, tile, time, image ) {
var insertionIndex, var insertionIndex,
@ -717,7 +718,7 @@ function onTileLoad( drawer, tile, time, image ) {
drawer.tilesLoaded[ insertionIndex ] = tile; drawer.tilesLoaded[ insertionIndex ] = tile;
drawer.updateAgain = true; drawer.updateAgain = true;
}; }
function positionTile( tile, overlap, viewport, viewportCenter, levelVisibility ){ function positionTile( tile, overlap, viewport, viewportCenter, levelVisibility ){
@ -738,7 +739,7 @@ function positionTile( tile, overlap, viewport, viewportCenter, levelVisibility
tile.size = sizeC; tile.size = sizeC;
tile.distance = tileDistance; tile.distance = tileDistance;
tile.visibility = levelVisibility; tile.visibility = levelVisibility;
}; }
function blendTile( drawer, tile, x, y, level, levelOpacity, currentTime ){ function blendTile( drawer, tile, x, y, level, levelOpacity, currentTime ){
@ -768,13 +769,13 @@ function blendTile( drawer, tile, x, y, level, levelOpacity, currentTime ){
} }
return false; return false;
}; }
function clearTiles( drawer ) { function clearTiles( drawer ) {
drawer.tilesMatrix = {}; drawer.tilesMatrix = {};
drawer.tilesLoaded = []; drawer.tilesLoaded = [];
}; }
/** /**
* @private * @private
@ -817,7 +818,7 @@ function providesCoverage( coverage, level, x, y ) {
coverage[ level ][ x ][ y ] === undefined || coverage[ level ][ x ][ y ] === undefined ||
coverage[ level ][ x ][ y ] === true coverage[ level ][ x ][ y ] === true
); );
}; }
/** /**
* @private * @private
@ -837,7 +838,7 @@ function isCovered( coverage, level, x, y ) {
providesCoverage( coverage, level + 1, 2 * x + 1, 2 * y + 1 ) providesCoverage( coverage, level + 1, 2 * x + 1, 2 * y + 1 )
); );
} }
}; }
/** /**
* @private * @private
@ -858,7 +859,7 @@ function setCoverage( coverage, level, x, y, covers ) {
} }
coverage[ level ][ x ][ y ] = covers; coverage[ level ][ x ][ y ] = covers;
}; }
/** /**
* @private * @private
@ -869,7 +870,7 @@ function setCoverage( coverage, level, x, y, covers ) {
*/ */
function resetCoverage( coverage, level ) { function resetCoverage( coverage, level ) {
coverage[ level ] = {}; coverage[ level ] = {};
}; }
/** /**
* @private * @private
@ -886,7 +887,7 @@ function getOverlayIndex( overlays, element ) {
} }
return -1; return -1;
}; }
/** /**
* @private * @private
@ -908,7 +909,7 @@ function compareTiles( previousBest, tile ) {
} }
return previousBest; return previousBest;
}; }
function finishLoadingImage( image, callback, successful, jobid ){ function finishLoadingImage( image, callback, successful, jobid ){
@ -923,7 +924,7 @@ function finishLoadingImage( image, callback, successful, jobid ){
callback( image.src, successful ? image : null); callback( image.src, successful ? image : null);
}, 1 ); }, 1 );
}; }
function drawOverlays( viewport, overlays, container ){ function drawOverlays( viewport, overlays, container ){
@ -932,7 +933,7 @@ function drawOverlays( viewport, overlays, container ){
for ( i = 0; i < length; i++ ) { for ( i = 0; i < length; i++ ) {
drawOverlay( viewport, overlays[ i ], container ); drawOverlay( viewport, overlays[ i ], container );
} }
}; }
function drawOverlay( viewport, overlay, container ){ function drawOverlay( viewport, overlay, container ){
@ -945,7 +946,7 @@ function drawOverlay( viewport, overlay, container ){
true true
); );
overlay.drawHTML( container ); overlay.drawHTML( container );
}; }
function drawTiles( drawer, lastDrawn ){ function drawTiles( drawer, lastDrawn ){
var i, var i,
@ -1038,7 +1039,7 @@ function drawTiles( drawer, lastDrawn ){
tile.beingDrawn = true; tile.beingDrawn = true;
} }
} }
}; }
function drawDebugInfo( drawer, tile, count, i ){ function drawDebugInfo( drawer, tile, count, i ){
@ -1097,7 +1098,7 @@ function drawDebugInfo( drawer, tile, count, i ){
tile.position.y + 70 tile.position.y + 70
); );
} }
}; }
}( OpenSeadragon )); }( OpenSeadragon ));

View File

@ -1,3 +1,4 @@
/*globals OpenSeadragon */
(function($){ (function($){
@ -85,7 +86,7 @@ $.EventHandler.prototype = {
if ( handler ) { if ( handler ) {
if ( !eventArgs ) { if ( !eventArgs ) {
eventArgs = new Object(); eventArgs = {};
} }
handler( this, eventArgs ); handler( this, eventArgs );

View File

@ -1,3 +1,4 @@
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){
@ -192,7 +193,7 @@ function filterFiles( files ){
return a.height - b.height; return a.height - b.height;
}); });
}; }
/** /**
* @private * @private
@ -226,8 +227,8 @@ function configureFromXML( tileSource, xmlDoc ){
conf.levels .push({ conf.levels .push({
url: level.getAttribute( "url" ), url: level.getAttribute( "url" ),
width: parseInt( level.getAttribute( "width" ) ), width: parseInt( level.getAttribute( "width" ), 10 ),
height: parseInt( level.getAttribute( "height" ) ) height: parseInt( level.getAttribute( "height" ), 10 )
}); });
} }
@ -245,7 +246,7 @@ function configureFromXML( tileSource, xmlDoc ){
} }
throw new Error( 'Unknown element ' + rootName ); throw new Error( 'Unknown element ' + rootName );
}; }
/** /**
* @private * @private
@ -256,6 +257,6 @@ function configureFromObject( tileSource, configuration ){
return configuration.levels; return configuration.levels;
}; }
}( OpenSeadragon )); }( OpenSeadragon ));

View File

@ -1,3 +1,4 @@
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){
@ -320,7 +321,7 @@
delegate.tracking = true; delegate.tracking = true;
ACTIVE[ tracker.hash ] = tracker; ACTIVE[ tracker.hash ] = tracker;
} }
}; }
/** /**
* Stops tracking mouse events on this element. * Stops tracking mouse events on this element.
@ -355,7 +356,7 @@
delegate.tracking = false; delegate.tracking = false;
delete ACTIVE[ tracker.hash ]; delete ACTIVE[ tracker.hash ];
} }
}; }
/** /**
* @private * @private
@ -363,7 +364,7 @@
*/ */
function hasMouse( tracker ) { function hasMouse( tracker ) {
return THIS[ tracker.hash ].insideElement; return THIS[ tracker.hash ].insideElement;
}; }
/** /**
* Begin capturing mouse events on this element. * Begin capturing mouse events on this element.
@ -409,7 +410,7 @@
} }
delegate.capturing = true; delegate.capturing = true;
} }
}; }
/** /**
@ -456,7 +457,7 @@
} }
delegate.capturing = false; delegate.capturing = false;
} }
}; }
/** /**
@ -470,7 +471,7 @@
handler( ACTIVE[ otherHash ], event ); handler( ACTIVE[ otherHash ], event );
} }
} }
}; }
/** /**
@ -489,7 +490,7 @@
$.cancelEvent( event ); $.cancelEvent( event );
} }
} }
}; }
/** /**
@ -508,7 +509,7 @@
$.cancelEvent( event ); $.cancelEvent( event );
} }
} }
}; }
/** /**
@ -528,7 +529,7 @@
$.cancelEvent( event ); $.cancelEvent( event );
} }
} }
}; }
/** /**
@ -575,7 +576,7 @@
$.cancelEvent( event ); $.cancelEvent( event );
} }
} }
}; }
/** /**
@ -622,7 +623,7 @@
$.cancelEvent( event ); $.cancelEvent( event );
} }
} }
}; }
/** /**
@ -668,7 +669,7 @@
// add us to the list // add us to the list
CAPTURING.push( tracker ); CAPTURING.push( tracker );
} }
}; }
/** /**
* @private * @private
@ -698,7 +699,7 @@
} }
event.preventDefault(); event.preventDefault();
}; }
/** /**
@ -735,7 +736,7 @@
if ( insideElementPress && insideElementRelease ) { if ( insideElementPress && insideElementRelease ) {
handleMouseClick( tracker, event ); handleMouseClick( tracker, event );
} }
}; }
/** /**
@ -757,7 +758,7 @@
//$.console.debug("pinch end"); //$.console.debug("pinch end");
} }
event.preventDefault(); event.preventDefault();
}; }
/** /**
@ -794,7 +795,7 @@
); );
$.stopEvent( event ); $.stopEvent( event );
}; }
/** /**
@ -811,7 +812,7 @@
onMouseUp( tracker, event ); onMouseUp( tracker, event );
} }
releaseMouse( tracker ); releaseMouse( tracker );
}; }
/** /**
@ -822,7 +823,7 @@
if ( tracker.clickHandler ) { if ( tracker.clickHandler ) {
$.cancelEvent( event ); $.cancelEvent( event );
} }
}; }
/** /**
@ -861,7 +862,7 @@
$.cancelEvent( event ); $.cancelEvent( event );
} }
} }
}; }
/** /**
@ -894,7 +895,7 @@
$.cancelEvent( event ); $.cancelEvent( event );
} }
} }
}; }
/** /**
@ -921,7 +922,7 @@
$.cancelEvent( event ); $.cancelEvent( event );
} }
} }
}; }
/** /**
@ -965,7 +966,7 @@
} }
} }
event.preventDefault(); event.preventDefault();
}; }
/** /**
* Only triggered once by the deepest element that initially received * Only triggered once by the deepest element that initially received
@ -983,7 +984,7 @@
} }
$.stopEvent( event ); $.stopEvent( event );
}; }
/** /**
* @private * @private
@ -991,7 +992,7 @@
*/ */
function getMouseAbsolute( event ) { function getMouseAbsolute( event ) {
return $.getMousePosition( event ); return $.getMousePosition( event );
}; }
/** /**
* @private * @private
@ -1002,7 +1003,7 @@
offset = $.getElementPosition( element ); offset = $.getElementPosition( element );
return mouse.minus( offset ); return mouse.minus( offset );
}; }
/** /**
* @private * @private
@ -1019,7 +1020,7 @@
} }
} }
return elementA == elementB; return elementA == elementB;
}; }
/** /**
* @private * @private
@ -1027,7 +1028,7 @@
*/ */
function onGlobalMouseDown() { function onGlobalMouseDown() {
IS_BUTTON_DOWN = true; IS_BUTTON_DOWN = true;
}; }
/** /**
* @private * @private
@ -1035,7 +1036,7 @@
*/ */
function onGlobalMouseUp() { function onGlobalMouseUp() {
IS_BUTTON_DOWN = false; IS_BUTTON_DOWN = false;
}; }
(function () { (function () {

View File

@ -1,3 +1,5 @@
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){
/** /**
@ -64,10 +66,17 @@ $.Navigator = function( options ){
style.fontSize = '0px'; style.fontSize = '0px';
style.overflow = 'hidden'; style.overflow = 'hidden';
style.border = '2px solid #900'; style.border = '2px solid #900';
//TODO: IE doesnt like this property being set //TODO: IE doesnt like this property being set
//try{ style.outline = '2px auto #909'; }catch(e){/*ignore*/} //try{ style.outline = '2px auto #909'; }catch(e){/*ignore*/}
style.background = 'transparent'; style.background = 'transparent';
style.float = 'left'; //Webkit
// We use square bracket notation on the statement below, because float is a keyword.
// This is important for the Google Closure compliler, if nothing else.
/*jshint sub:true */
style['float'] = 'left'; //Webkit
style.cssFloat = 'left'; //Firefox style.cssFloat = 'left'; //Firefox
style.styleFloat = 'left'; //IE style.styleFloat = 'left'; //IE
style.zIndex = 999999999; style.zIndex = 999999999;
@ -128,16 +137,18 @@ $.Navigator = function( options ){
case 119://w case 119://w
case 87://W case 87://W
case 38://up arrow case 38://up arrow
shiftKey ? if (shiftKey)
_this.viewer.viewport.zoomBy(1.1): _this.viewer.viewport.zoomBy(1.1);
else
_this.viewer.viewport.panBy(new $.Point(0, -0.05)); _this.viewer.viewport.panBy(new $.Point(0, -0.05));
_this.viewer.viewport.applyConstraints(); _this.viewer.viewport.applyConstraints();
return false; return false;
case 115://s case 115://s
case 83://S case 83://S
case 40://down arrow case 40://down arrow
shiftKey ? if (shiftKey)
_this.viewer.viewport.zoomBy(0.9): _this.viewer.viewport.zoomBy(0.9);
else
_this.viewer.viewport.panBy(new $.Point(0, 0.05)); _this.viewer.viewport.panBy(new $.Point(0, 0.05));
_this.viewer.viewport.applyConstraints(); _this.viewer.viewport.applyConstraints();
return false; return false;
@ -231,7 +242,7 @@ $.extend( $.Navigator.prototype, $.EventHandler.prototype, $.Viewer.prototype, {
*/ */
function onCanvasClick( tracker, position, quick, shift ) { function onCanvasClick( tracker, position, quick, shift ) {
this.displayRegion.focus(); this.displayRegion.focus();
}; }
/** /**
@ -253,7 +264,7 @@ function onCanvasDrag( tracker, position, delta, shift ) {
) )
); );
} }
}; }
/** /**
@ -265,7 +276,7 @@ function onCanvasRelease( tracker, position, insideElementPress, insideElementRe
if ( insideElementPress && this.viewer.viewport ) { if ( insideElementPress && this.viewer.viewport ) {
this.viewer.viewport.applyConstraints(); this.viewer.viewport.applyConstraints();
} }
}; }
/** /**
@ -286,7 +297,7 @@ function onCanvasScroll( tracker, position, scroll, shift ) {
} }
//cancels event //cancels event
return false; return false;
}; }
}( OpenSeadragon )); }( OpenSeadragon ));

View File

@ -1,3 +1,5 @@
/*globals OpenSeadragon */
/** /**
* @version OpenSeadragon @VERSION@ * @version OpenSeadragon @VERSION@
* *
@ -239,7 +241,7 @@
* *
* @returns {OpenSeadragon.Viewer} * @returns {OpenSeadragon.Viewer}
*/ */
OpenSeadragon = window.OpenSeadragon || function( options ){ window.OpenSeadragon = window.OpenSeadragon || function( options ){
return new OpenSeadragon.Viewer( options ); return new OpenSeadragon.Viewer( options );

View File

@ -1,3 +1,4 @@
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){
@ -82,8 +83,8 @@
case $.OverlayPlacement.LEFT: case $.OverlayPlacement.LEFT:
position.y -= size.y / 2; position.y -= size.y / 2;
break; break;
case $.OverlayPlacement.CENTER:
default: default:
case $.OverlayPlacement.CENTER:
position.x -= size.x / 2; position.x -= size.x / 2;
position.y -= size.y / 2; position.y -= size.y / 2;
break; break;

View File

@ -1,3 +1,4 @@
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){

View File

@ -1,3 +1,4 @@
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){

View File

@ -1,3 +1,4 @@
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){

View File

@ -1,3 +1,4 @@
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){
@ -105,7 +106,7 @@ $.Spring.prototype = {
( this.target.time - this.start.time ) ( this.target.time - this.start.time )
); );
} }
} };
/** /**
* @private * @private
@ -113,6 +114,6 @@ $.Spring.prototype = {
function transform( stiffness, x ) { function transform( stiffness, x ) {
return ( 1.0 - Math.exp( stiffness * -x ) ) / return ( 1.0 - Math.exp( stiffness * -x ) ) /
( 1.0 - Math.exp( -stiffness ) ); ( 1.0 - Math.exp( -stiffness ) );
}; }
}( OpenSeadragon )); }( OpenSeadragon ));

View File

@ -1,3 +1,4 @@
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){

View File

@ -1,3 +1,4 @@
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){
@ -376,7 +377,7 @@ function processResponse( xhr ){
data = responseText; data = responseText;
} }
return data; return data;
}; }
/** /**

View File

@ -1,3 +1,4 @@
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){

View File

@ -1,3 +1,5 @@
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){
// dictionary from hash to private properties // dictionary from hash to private properties
@ -577,7 +579,7 @@ $.extend( $.Viewer.prototype, $.EventHandler.prototype, $.ControlDock.prototype,
abortControlsAutoHide( this ); abortControlsAutoHide( this );
} else { } else {
beginControlsAutoHide( this ); beginControlsAutoHide( this );
}; }
}, },
@ -1060,7 +1062,7 @@ function scheduleUpdate( viewer, updateFunc, prevUpdateTime ){
return window.setTimeout( function(){ return window.setTimeout( function(){
updateFunc( viewer ); updateFunc( viewer );
}, deltaTime ); }, deltaTime );
}; }
//provides a sequence in the fade animation //provides a sequence in the fade animation
@ -1068,7 +1070,7 @@ function scheduleControlsFade( viewer ) {
window.setTimeout( function(){ window.setTimeout( function(){
updateControlsFade( viewer ); updateControlsFade( viewer );
}, 20); }, 20);
}; }
//initiates an animation to hide the controls //initiates an animation to hide the controls
@ -1084,7 +1086,7 @@ function beginControlsAutoHide( viewer ) {
window.setTimeout( function(){ window.setTimeout( function(){
scheduleControlsFade( viewer ); scheduleControlsFade( viewer );
}, viewer.controlsFadeDelay ); }, viewer.controlsFadeDelay );
}; }
//determines if fade animation is done or continues the animation //determines if fade animation is done or continues the animation
@ -1110,7 +1112,7 @@ function updateControlsFade( viewer ) {
scheduleControlsFade( viewer ); scheduleControlsFade( viewer );
} }
} }
}; }
//stop the fade animation on the controls and show them //stop the fade animation on the controls and show them
@ -1120,7 +1122,7 @@ function abortControlsAutoHide( viewer ) {
for ( i = viewer.controls.length - 1; i >= 0; i-- ) { for ( i = viewer.controls.length - 1; i >= 0; i-- ) {
viewer.controls[ i ].setOpacity( 1.0 ); viewer.controls[ i ].setOpacity( 1.0 );
} }
}; }
@ -1129,12 +1131,12 @@ function abortControlsAutoHide( viewer ) {
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
function onFocus(){ function onFocus(){
abortControlsAutoHide( this ); abortControlsAutoHide( this );
}; }
function onBlur(){ function onBlur(){
beginControlsAutoHide( this ); beginControlsAutoHide( this );
}; }
function onCanvasClick( tracker, position, quick, shift ) { function onCanvasClick( tracker, position, quick, shift ) {
var zoomPreClick, var zoomPreClick,
@ -1148,7 +1150,7 @@ function onCanvasClick( tracker, position, quick, shift ) {
); );
this.viewport.applyConstraints(); this.viewport.applyConstraints();
} }
}; }
function onCanvasDrag( tracker, position, delta, shift ) { function onCanvasDrag( tracker, position, delta, shift ) {
if ( this.viewport ) { if ( this.viewport ) {
@ -1164,13 +1166,13 @@ function onCanvasDrag( tracker, position, delta, shift ) {
) )
); );
} }
}; }
function onCanvasRelease( tracker, position, insideElementPress, insideElementRelease ) { function onCanvasRelease( tracker, position, insideElementPress, insideElementRelease ) {
if ( insideElementPress && this.viewport ) { if ( insideElementPress && this.viewport ) {
this.viewport.applyConstraints(); this.viewport.applyConstraints();
} }
}; }
function onCanvasScroll( tracker, position, scroll, shift ) { function onCanvasScroll( tracker, position, scroll, shift ) {
var factor; var factor;
@ -1184,7 +1186,7 @@ function onCanvasScroll( tracker, position, scroll, shift ) {
} }
//cancels event //cancels event
return false; return false;
}; }
function onContainerExit( tracker, position, buttonDownElement, buttonDownAny ) { function onContainerExit( tracker, position, buttonDownElement, buttonDownAny ) {
if ( !buttonDownElement ) { if ( !buttonDownElement ) {
@ -1193,7 +1195,7 @@ function onContainerExit( tracker, position, buttonDownElement, buttonDownAny )
beginControlsAutoHide( this ); beginControlsAutoHide( this );
} }
} }
}; }
function onContainerRelease( tracker, position, insideElementPress, insideElementRelease ) { function onContainerRelease( tracker, position, insideElementPress, insideElementRelease ) {
if ( !insideElementRelease ) { if ( !insideElementRelease ) {
@ -1202,12 +1204,12 @@ function onContainerRelease( tracker, position, insideElementPress, insideElemen
beginControlsAutoHide( this ); beginControlsAutoHide( this );
} }
} }
}; }
function onContainerEnter( tracker, position, buttonDownElement, buttonDownAny ) { function onContainerEnter( tracker, position, buttonDownElement, buttonDownAny ) {
THIS[ this.hash ].mouseInside = true; THIS[ this.hash ].mouseInside = true;
abortControlsAutoHide( this ); abortControlsAutoHide( this );
}; }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@ -1225,7 +1227,7 @@ function updateMulti( viewer ) {
beginTime = +new Date(); beginTime = +new Date();
updateOnce( viewer ); updateOnce( viewer );
scheduleUpdate( viewer, arguments.callee, beginTime ); scheduleUpdate( viewer, arguments.callee, beginTime );
}; }
function updateOnce( viewer ) { function updateOnce( viewer ) {
@ -1282,7 +1284,7 @@ function updateOnce( viewer ) {
THIS[ viewer.hash ].animating = animated; THIS[ viewer.hash ].animating = animated;
//viewer.profiler.endUpdate(); //viewer.profiler.endUpdate();
}; }
@ -1291,7 +1293,7 @@ function updateOnce( viewer ) {
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
function resolveUrl( prefix, url ) { function resolveUrl( prefix, url ) {
return prefix ? prefix + url : url; return prefix ? prefix + url : url;
}; }
@ -1300,7 +1302,7 @@ function beginZoomingIn() {
THIS[ this.hash ].zoomFactor = this.zoomPerSecond; THIS[ this.hash ].zoomFactor = this.zoomPerSecond;
THIS[ this.hash ].zooming = true; THIS[ this.hash ].zooming = true;
scheduleZoom( this ); scheduleZoom( this );
}; }
function beginZoomingOut() { function beginZoomingOut() {
@ -1308,17 +1310,17 @@ function beginZoomingOut() {
THIS[ this.hash ].zoomFactor = 1.0 / this.zoomPerSecond; THIS[ this.hash ].zoomFactor = 1.0 / this.zoomPerSecond;
THIS[ this.hash ].zooming = true; THIS[ this.hash ].zooming = true;
scheduleZoom( this ); scheduleZoom( this );
}; }
function endZooming() { function endZooming() {
THIS[ this.hash ].zooming = false; THIS[ this.hash ].zooming = false;
}; }
function scheduleZoom( viewer ) { function scheduleZoom( viewer ) {
window.setTimeout( $.delegate( viewer, doZoom ), 10 ); window.setTimeout( $.delegate( viewer, doZoom ), 10 );
}; }
function doZoom() { function doZoom() {
@ -1336,7 +1338,7 @@ function doZoom() {
THIS[ this.hash ].lastZoomTime = currentTime; THIS[ this.hash ].lastZoomTime = currentTime;
scheduleZoom( this ); scheduleZoom( this );
} }
}; }
function doSingleZoomIn() { function doSingleZoomIn() {
@ -1347,7 +1349,7 @@ function doSingleZoomIn() {
); );
this.viewport.applyConstraints(); this.viewport.applyConstraints();
} }
}; }
function doSingleZoomOut() { function doSingleZoomOut() {
@ -1358,20 +1360,20 @@ function doSingleZoomOut() {
); );
this.viewport.applyConstraints(); this.viewport.applyConstraints();
} }
}; }
function lightUp() { function lightUp() {
this.buttons.emulateEnter(); this.buttons.emulateEnter();
this.buttons.emulateExit(); this.buttons.emulateExit();
}; }
function onHome() { function onHome() {
if ( this.viewport ) { if ( this.viewport ) {
this.viewport.goHome(); this.viewport.goHome();
} }
}; }
function onFullPage() { function onFullPage() {
@ -1384,19 +1386,19 @@ function onFullPage() {
if ( this.viewport ) { if ( this.viewport ) {
this.viewport.applyConstraints(); this.viewport.applyConstraints();
} }
}; }
function onPrevious(){ function onPrevious(){
var previous = THIS[ this.hash ].sequence - 1; var previous = THIS[ this.hash ].sequence - 1;
this.goToPage( previous ); this.goToPage( previous );
}; }
function onNext(){ function onNext(){
var next = THIS[ this.hash ].sequence + 1; var next = THIS[ this.hash ].sequence + 1;
this.goToPage( next ); this.goToPage( next );
}; }
}( OpenSeadragon )); }( OpenSeadragon ));

View File

@ -1,3 +1,4 @@
/*globals OpenSeadragon */
(function( $ ){ (function( $ ){