http://www.mediawiki.org/wiki/Special:Code/MediaWiki/62145

Revision: 62145
Author:   adam
Date:     2010-02-08 23:18:09 +0000 (Mon, 08 Feb 2010)

Log Message:
-----------
Altering our tab override to use the default behavior when modifier keys are 
pressed

Modified Paths:
--------------
    trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
    trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js
    trunk/extensions/UsabilityInitiative/js/plugins.combined.js
    trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js

Modified: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
===================================================================
--- trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php  
2010-02-08 22:55:53 UTC (rev 62144)
+++ trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php  
2010-02-08 23:18:09 UTC (rev 62145)
@@ -72,7 +72,7 @@
                                array( 'src' => 
'js/plugins/jquery.namespaceSelect.js', 'version' => 1 ),
                                array( 'src' => 
'js/plugins/jquery.suggestions.js', 'version' => 7 ),
                                array( 'src' => 
'js/plugins/jquery.textSelection.js', 'version' => 27 ),
-                               array( 'src' => 
'js/plugins/jquery.wikiEditor.js', 'version' => 111 ),
+                               array( 'src' => 
'js/plugins/jquery.wikiEditor.js', 'version' => 112 ),
                                array( 'src' => 
'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 29 ),
                                array( 'src' => 
'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 47 ),
                                array( 'src' => 
'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 12 ),
@@ -82,10 +82,10 @@
                                array( 'src' => 
'js/plugins/jquery.wikiEditor.publish.js', 'version' => 2 ),
                        ),
                        'combined' => array(
-                               array( 'src' => 'js/plugins.combined.js', 
'version' => 229 ),
+                               array( 'src' => 'js/plugins.combined.js', 
'version' => 230 ),
                        ),
                        'minified' => array(
-                               array( 'src' => 'js/plugins.combined.min.js', 
'version' => 229 ),
+                               array( 'src' => 'js/plugins.combined.min.js', 
'version' => 230 ),
                        ),
                ),
        );

Modified: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js
===================================================================
--- trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js        
2010-02-08 22:55:53 UTC (rev 62144)
+++ trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js        
2010-02-08 23:18:09 UTC (rev 62145)
@@ -304,16 +304,21 @@
                                        // Intercept all tab events to provide 
consisten behavior across browsers
                                        // Webkit browsers insert tab 
characters by default into the iframe rather than changing input focus
                                        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;
+                                               // if any modifier keys are 
pressed, allow the browser to do it's thing
+                                               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;
+                                                               }
                                                        }
+                                                       return false;
                                                }
-                                               return false;
                                        break;
                        }
                        return true;

Modified: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
===================================================================
--- trunk/extensions/UsabilityInitiative/js/plugins.combined.js 2010-02-08 
22:55:53 UTC (rev 62144)
+++ trunk/extensions/UsabilityInitiative/js/plugins.combined.js 2010-02-08 
23:18:09 UTC (rev 62145)
@@ -6737,16 +6737,21 @@
                                        // Intercept all tab events to provide 
consisten behavior across browsers
                                        // Webkit browsers insert tab 
characters by default into the iframe rather than changing input focus
                                        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;
+                                               // if any modifier keys are 
pressed, allow the browser to do it's thing
+                                               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;
+                                                               }
                                                        }
+                                                       return false;
                                                }
-                                               return false;
                                        break;
                        }
                        return true;

Modified: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
===================================================================
--- trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js     
2010-02-08 22:55:53 UTC (rev 62144)
+++ trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js     
2010-02-08 23:18:09 UTC (rev 62145)
@@ -447,8 +447,9 @@
 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--;}
 
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));}
 return false;}
-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;}}
-return false;break;}
+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;}}
+return false;}
+break;}
 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';}
 switch(event.which){case 8:break;}
 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;}



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to