IE specific patch for navigator (styleFloat), also keyboard accessibility patches for firefox

This commit is contained in:
thatcher 2012-03-20 15:30:29 -04:00
parent 2e821a7dc6
commit 825023aaf6
5 changed files with 52 additions and 30 deletions

View File

@ -6,7 +6,7 @@
PROJECT: openseadragon PROJECT: openseadragon
BUILD_MAJOR: 0 BUILD_MAJOR: 0
BUILD_MINOR: 9 BUILD_MINOR: 9
BUILD_ID: 34 BUILD_ID: 36
BUILD: ${PROJECT}.${BUILD_MAJOR}.${BUILD_MINOR}.${BUILD_ID} BUILD: ${PROJECT}.${BUILD_MAJOR}.${BUILD_MINOR}.${BUILD_ID}
VERSION: ${BUILD_MAJOR}.${BUILD_MINOR}.${BUILD_ID} VERSION: ${BUILD_MAJOR}.${BUILD_MINOR}.${BUILD_ID}

View File

@ -1,5 +1,5 @@
/** /**
* @version OpenSeadragon 0.9.34 * @version OpenSeadragon 0.9.36
* *
* @fileOverview * @fileOverview
* <h2> * <h2>
@ -2206,13 +2206,16 @@ $.EventHandler.prototype = {
*/ */
function onKeyPress( tracker, event ){ function onKeyPress( tracker, event ){
//console.log( "keypress %s", event.keyCode ); //console.log( "keypress %s", event.keyCode );
var propagate;
if ( tracker.keyHandler ) { if ( tracker.keyHandler ) {
try { try {
tracker.keyHandler( propagate = tracker.keyHandler(
tracker, tracker,
event.keyCode event.keyCode
); );
$.cancelEvent( event ); if( !propagate ){
$.cancelEvent( event );
}
} catch ( e ) { } catch ( e ) {
$.console.error( $.console.error(
"%s while executing key handler: %s", "%s while executing key handler: %s",
@ -4208,7 +4211,7 @@ $.Navigator = function( options ){
style.background = 'transparent'; style.background = 'transparent';
style.float = 'left'; //Webkit style.float = 'left'; //Webkit
style.cssFloat = 'left'; //Firefox style.cssFloat = 'left'; //Firefox
style.floatStyle = 'left'; //IE style.styleFloat = 'left'; //IE
style.zIndex = 999999999; style.zIndex = 999999999;
}( this.displayRegion.style )); }( this.displayRegion.style ));
@ -4235,29 +4238,33 @@ $.Navigator = function( options ){
//console.log( keyCode ); //console.log( keyCode );
switch( keyCode ){ switch( keyCode ){
case 119://w case 119://w
case 38://up arrow
_this.viewer.viewport.panBy(new $.Point(0, -0.05)); _this.viewer.viewport.panBy(new $.Point(0, -0.05));
break; return false;
case 115://s case 115://s
case 40://down arrow
_this.viewer.viewport.panBy(new $.Point(0, 0.05)); _this.viewer.viewport.panBy(new $.Point(0, 0.05));
break; return false;
case 97://a case 97://a
case 37://left arrow
_this.viewer.viewport.panBy(new $.Point(-0.05, 0)); _this.viewer.viewport.panBy(new $.Point(-0.05, 0));
break; return false;
case 100://d case 100://d
case 39://right arrow
_this.viewer.viewport.panBy(new $.Point(0.05, 0)); _this.viewer.viewport.panBy(new $.Point(0.05, 0));
break; return false;
case 61://=|+ case 61://=|+
_this.viewer.viewport.zoomBy(1.1); _this.viewer.viewport.zoomBy(1.1);
break; return false;
case 45://-|_ case 45://-|_
_this.viewer.viewport.zoomBy(0.9); _this.viewer.viewport.zoomBy(0.9);
break; return false;
case 48://0|) case 48://0|)
_this.viewer.viewport.goHome(); _this.viewer.viewport.goHome();
break; return false;
default: default:
//console.log( 'navigator keycode %s', keyCode ); //console.log( 'navigator keycode %s', keyCode );
return; return true;
} }
} }
}).setTracking( true ); // default state }).setTracking( true ); // default state
@ -5124,9 +5131,13 @@ $.Button = function( options ) {
}, },
keyHandler: function( tracker, key ){ keyHandler: function( tracker, key ){
//console.log( "%s : handling key!", _this.tooltip); //console.log( "%s : handling key %s!", _this.tooltip, key);
_this.raiseEvent( "onClick", _this ); if( 13 === key ){
_this.raiseEvent( "onRelease", _this ); _this.raiseEvent( "onClick", _this );
_this.raiseEvent( "onRelease", _this );
return false;
}
return true;
} }
}).setTracking( true ); }).setTracking( true );

View File

@ -189,9 +189,13 @@ $.Button = function( options ) {
}, },
keyHandler: function( tracker, key ){ keyHandler: function( tracker, key ){
//console.log( "%s : handling key!", _this.tooltip); //console.log( "%s : handling key %s!", _this.tooltip, key);
_this.raiseEvent( "onClick", _this ); if( 13 === key ){
_this.raiseEvent( "onRelease", _this ); _this.raiseEvent( "onClick", _this );
_this.raiseEvent( "onRelease", _this );
return false;
}
return true;
} }
}).setTracking( true ); }).setTracking( true );

View File

@ -529,13 +529,16 @@
*/ */
function onKeyPress( tracker, event ){ function onKeyPress( tracker, event ){
//console.log( "keypress %s", event.keyCode ); //console.log( "keypress %s", event.keyCode );
var propagate;
if ( tracker.keyHandler ) { if ( tracker.keyHandler ) {
try { try {
tracker.keyHandler( propagate = tracker.keyHandler(
tracker, tracker,
event.keyCode event.keyCode
); );
$.cancelEvent( event ); if( !propagate ){
$.cancelEvent( event );
}
} catch ( e ) { } catch ( e ) {
$.console.error( $.console.error(
"%s while executing key handler: %s", "%s while executing key handler: %s",

View File

@ -60,7 +60,7 @@ $.Navigator = function( options ){
style.background = 'transparent'; style.background = 'transparent';
style.float = 'left'; //Webkit style.float = 'left'; //Webkit
style.cssFloat = 'left'; //Firefox style.cssFloat = 'left'; //Firefox
style.floatStyle = 'left'; //IE style.styleFloat = 'left'; //IE
style.zIndex = 999999999; style.zIndex = 999999999;
}( this.displayRegion.style )); }( this.displayRegion.style ));
@ -87,29 +87,33 @@ $.Navigator = function( options ){
//console.log( keyCode ); //console.log( keyCode );
switch( keyCode ){ switch( keyCode ){
case 119://w case 119://w
case 38://up arrow
_this.viewer.viewport.panBy(new $.Point(0, -0.05)); _this.viewer.viewport.panBy(new $.Point(0, -0.05));
break; return false;
case 115://s case 115://s
case 40://down arrow
_this.viewer.viewport.panBy(new $.Point(0, 0.05)); _this.viewer.viewport.panBy(new $.Point(0, 0.05));
break; return false;
case 97://a case 97://a
case 37://left arrow
_this.viewer.viewport.panBy(new $.Point(-0.05, 0)); _this.viewer.viewport.panBy(new $.Point(-0.05, 0));
break; return false;
case 100://d case 100://d
case 39://right arrow
_this.viewer.viewport.panBy(new $.Point(0.05, 0)); _this.viewer.viewport.panBy(new $.Point(0.05, 0));
break; return false;
case 61://=|+ case 61://=|+
_this.viewer.viewport.zoomBy(1.1); _this.viewer.viewport.zoomBy(1.1);
break; return false;
case 45://-|_ case 45://-|_
_this.viewer.viewport.zoomBy(0.9); _this.viewer.viewport.zoomBy(0.9);
break; return false;
case 48://0|) case 48://0|)
_this.viewer.viewport.goHome(); _this.viewer.viewport.goHome();
break; return false;
default: default:
//console.log( 'navigator keycode %s', keyCode ); //console.log( 'navigator keycode %s', keyCode );
return; return true;
} }
} }
}).setTracking( true ); // default state }).setTracking( true ); // default state