r62145 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62144‎ | r62145 | r62146 >
Date:23:18, 8 February 2010
Author:adam
Status:ok
Tags:
Comment:
Altering our tab override to use the default behavior when modifier keys are pressed
Modified paths:
  • /trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins.combined.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -72,7 +72,7 @@
7373 array( 'src' => 'js/plugins/jquery.namespaceSelect.js', 'version' => 1 ),
7474 array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 7 ),
7575 array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 27 ),
76 - array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 111 ),
 76+ array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 112 ),
7777 array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 29 ),
7878 array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 47 ),
7979 array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 12 ),
@@ -82,10 +82,10 @@
8383 array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 2 ),
8484 ),
8585 'combined' => array(
86 - array( 'src' => 'js/plugins.combined.js', 'version' => 229 ),
 86+ array( 'src' => 'js/plugins.combined.js', 'version' => 230 ),
8787 ),
8888 'minified' => array(
89 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 229 ),
 89+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 230 ),
9090 ),
9191 ),
9292 );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js
@@ -304,16 +304,21 @@
305305 // Intercept all tab events to provide consisten behavior across browsers
306306 // Webkit browsers insert tab characters by default into the iframe rather than changing input focus
307307 case 9:
308 - var $tabindexList = $j( '[tabindex]:visible' ).sort( function( a, b ) {
309 - return a.tabIndex > b.tabIndex ? 1 : -1;
310 - } );
311 - for( var i=0; i < $tabindexList.length; i++ ) {
312 - if( $tabindexList.eq( i ).is( '#' + context.$iframe.attr( 'id' ) ) ) {
313 - $tabindexList.get( i + 1 ).focus();
314 - break;
 308+ // if any modifier keys are pressed, allow the browser to do it's thing
 309+ if ( event.ctrlKey || event.altKey || event.shiftKey ) {
 310+ return true;
 311+ } else {
 312+ var $tabindexList = $j( '[tabindex]:visible' ).sort( function( a, b ) {
 313+ return a.tabIndex > b.tabIndex ? 1 : -1;
 314+ } );
 315+ for( var i=0; i < $tabindexList.length; i++ ) {
 316+ if( $tabindexList.eq( i ).attr('id') == context.$iframe.attr( 'id' ) ) {
 317+ $tabindexList.get( i + 1 ).focus();
 318+ break;
 319+ }
315320 }
 321+ return false;
316322 }
317 - return false;
318323 break;
319324 }
320325 return true;
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -6737,16 +6737,21 @@
67386738 // Intercept all tab events to provide consisten behavior across browsers
67396739 // Webkit browsers insert tab characters by default into the iframe rather than changing input focus
67406740 case 9:
6741 - var $tabindexList = $j( '[tabindex]:visible' ).sort( function( a, b ) {
6742 - return a.tabIndex > b.tabIndex ? 1 : -1;
6743 - } );
6744 - for( var i=0; i < $tabindexList.length; i++ ) {
6745 - if( $tabindexList.eq( i ).is( '#' + context.$iframe.attr( 'id' ) ) ) {
6746 - $tabindexList.get( i + 1 ).focus();
6747 - break;
 6741+ // if any modifier keys are pressed, allow the browser to do it's thing
 6742+ if ( event.ctrlKey || event.altKey || event.shiftKey ) {
 6743+ return true;
 6744+ } else {
 6745+ var $tabindexList = $j( '[tabindex]:visible' ).sort( function( a, b ) {
 6746+ return a.tabIndex > b.tabIndex ? 1 : -1;
 6747+ } );
 6748+ for( var i=0; i < $tabindexList.length; i++ ) {
 6749+ if( $tabindexList.eq( i ).attr('id') == context.$iframe.attr( 'id' ) ) {
 6750+ $tabindexList.get( i + 1 ).focus();
 6751+ break;
 6752+ }
67486753 }
 6754+ return false;
67496755 }
6750 - return false;
67516756 break;
67526757 }
67536758 return true;
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -447,8 +447,9 @@
448448 if('fn'in $.wikiEditor.modules[module]&&'create'in $.wikiEditor.modules[module].fn){context.modules[module]={};$.wikiEditor.modules[module].fn.create(context,modules[module]);}}}}};context.evt={'keydown':function(event){switch(event.which){case 90:if((event.ctrlKey||event.metaKey)&&context.history.length){if(event.shiftKey){context.historyPosition++;}else{context.historyPosition--;}
449449 if(context.history.length+context.historyPosition>=0&&context.historyPosition<0){context.$content.html(context.history[context.history.length+context.historyPosition].html);}else{context.historyPosition=Math.max(-context.history.length,Math.min(context.historyPosition,-1));}
450450 return false;}
451 -break;case 9:var $tabindexList=$j('[tabindex]:visible').sort(function(a,b){return a.tabIndex>b.tabIndex?1:-1;});for(var i=0;i<$tabindexList.length;i++){if($tabindexList.eq(i).is('#'+context.$iframe.attr('id'))){$tabindexList.get(i+1).focus();break;}}
452 -return false;break;}
 451+break;case 9:if(event.ctrlKey||event.altKey||event.shiftKey){return true;}else{var $tabindexList=$j('[tabindex]:visible').sort(function(a,b){return a.tabIndex>b.tabIndex?1:-1;});for(var i=0;i<$tabindexList.length;i++){if($tabindexList.eq(i).attr('id')==context.$iframe.attr('id')){$tabindexList.get(i+1).focus();break;}}
 452+return false;}
 453+break;}
453454 return true;},'change':function(event){event.data.scope='division';var newHTML=context.$content.html();if(context.oldHTML!=newHTML){context.fn.purgeOffsets();context.oldHTML=newHTML;event.data.scope='realchange';}
454455 switch(event.which){case 8:break;}
455456 return true;},'delayedChange':function(event){event.data.scope='division';var newHTML=context.$content.html();if(context.oldDelayedHTML!=newHTML){context.fn.purgeOffsets();context.oldDelayedHTML=newHTML;event.data.scope='realchange';if(newHTML!==context.history[context.history.length+context.historyPosition].html){context.historyPosition=-1;}

Follow-up revisions

RevisionCommit summaryAuthorDate
r62184wmf-deployment: Merge r62139, r62142 and r62145 from trunk (UsabilityInitiati...catrope16:50, 9 February 2010

Status & tagging log