r62142 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62141‎ | r62142 | r62143 >
Date:22:20, 8 February 2010
Author:adam
Status:ok
Tags:
Comment:
Follow up to r62139. Adding a comment and moving from a while, to a for loop
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' => 109 ),
 76+ array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 110 ),
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' => 227 ),
 86+ array( 'src' => 'js/plugins.combined.js', 'version' => 228 ),
8787 ),
8888 'minified' => array(
89 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 227 ),
 89+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 228 ),
9090 ),
9191 ),
9292 );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js
@@ -301,14 +301,18 @@
302302 return false;
303303 }
304304 break;
 305+ // Intercept all tab events to provide consisten behavior across browsers
 306+ // Webkit browsers insert tab characters by default into the iframe rather than changing input focus
305307 case 9:
306308 var $tabindexList = $j( '[tabindex]:visible' ).sort( function( a, b ) {
307309 return a.tabIndex > b.tabIndex ? 1 : -1;
308310 } );
309 - while( ! $tabindexList.eq( 0 ).is( '#' + context.$iframe.attr( 'id' ) ) ) {
310 - $tabindexList = $tabindexList.slice( 1 );
 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;
 315+ }
311316 }
312 - $tabindexList.get( 1 ).focus();
313317 return false;
314318 break;
315319 }
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -6734,14 +6734,18 @@
67356735 return false;
67366736 }
67376737 break;
 6738+ // Intercept all tab events to provide consisten behavior across browsers
 6739+ // Webkit browsers insert tab characters by default into the iframe rather than changing input focus
67386740 case 9:
67396741 var $tabindexList = $j( '[tabindex]:visible' ).sort( function( a, b ) {
67406742 return a.tabIndex > b.tabIndex ? 1 : -1;
67416743 } );
6742 - while( ! $tabindexList.eq( 0 ).is( '#' + context.$iframe.attr( 'id' ) ) ) {
6743 - $tabindexList = $tabindexList.slice( 1 );
 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;
 6748+ }
67446749 }
6745 - $tabindexList.get( 1 ).focus();
67466750 return false;
67476751 break;
67486752 }
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -447,8 +447,8 @@
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;});while(!$tabindexList.eq(0).is('#'+context.$iframe.attr('id'))){$tabindexList=$tabindexList.slice(1);}
452 -$tabindexList.get(1).focus();return false;break;}
 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;}
453453 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';}
454454 switch(event.which){case 8:break;}
455455 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

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r62139Tabindex fix for safari and chromeadam21:56, 8 February 2010

Status & tagging log