r56332 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56331‎ | r56332 | r56333 >
Date:20:10, 14 September 2009
Author:catrope
Status:ok
Tags:
Comment:
EditToolbar: (bug 20567) Pressing TAB in a text field in a dialog moves cursor to summary box. There seems to be no way around this other than manually adding tabindexes to each of those fields
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.autoEllipse.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.dialogs.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -65,15 +65,15 @@
6666 array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 9 ),
6767 array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 4 ),
6868 array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 11 ),
69 - array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 1 ),
 69+ array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 2 ),
7070 array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 5 ),
7171 array( 'src' => 'js/js2/jquery-ui-1.7.2.js', 'version' => '1.7.2x' ),
7272 ),
7373 'combined' => array(
74 - array( 'src' => 'js/plugins.combined.js', 'version' => 19 ),
 74+ array( 'src' => 'js/plugins.combined.js', 'version' => 20 ),
7575 ),
7676 'minified' => array(
77 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 19 ),
 77+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 20 ),
7878 ),
7979 ),
8080 );
Property changes on: trunk/extensions/UsabilityInitiative/js/plugins/jquery.autoEllipse.js
___________________________________________________________________
Name: svn:eol-style
8181 + native
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.dialogs.js
@@ -73,6 +73,22 @@
7474 $(this).closest( '.ui-dialog-content' ).each(
7575 $.wikiEditor.modules.dialogs.fn.resize );
7676 });
 77+
 78+ // Add tabindexes to dialog form elements
 79+ // Find the highest tabindex in use
 80+ var maxTI = 0;
 81+ $j( '[tabindex]' ).each( function() {
 82+ var ti = parseInt( $j(this).attr( 'tabindex' ) );
 83+ if ( ti > maxTI )
 84+ maxTI = ti;
 85+ });
 86+
 87+ var tabIndex = maxTI + 1;
 88+ $j( '.ui-dialog input, .ui-dialog button' )
 89+ .not( '[tabindex]' )
 90+ .each( function() {
 91+ $j(this).attr( 'tabindex', tabIndex++ );
 92+ });
7793 }
7894 }
7995 },
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -1228,6 +1228,22 @@
12291229 $(this).closest( '.ui-dialog-content' ).each(
12301230 $.wikiEditor.modules.dialogs.fn.resize );
12311231 });
 1232+
 1233+ // Add tabindexes to dialog form elements
 1234+ // Find the highest tabindex in use
 1235+ var maxTI = 0;
 1236+ $j( '[tabindex]' ).each( function() {
 1237+ var ti = parseInt( $j(this).attr( 'tabindex' ) );
 1238+ if ( ti > maxTI )
 1239+ maxTI = ti;
 1240+ });
 1241+
 1242+ var tabIndex = maxTI + 1;
 1243+ $j( '.ui-dialog input, .ui-dialog button' )
 1244+ .not( '[tabindex]' )
 1245+ .each( function() {
 1246+ $j(this).attr( 'tabindex', tabIndex++ );
 1247+ });
12321248 }
12331249 }
12341250 },
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -77,7 +77,8 @@
7878 if(arguments.length>0&&typeof arguments[0]=='object'){context.api.addModule(context,arguments[0]);}
7979 context.$textarea.scrollToCaretPosition(0);return $(this).data('wikiEditor-context',context);};})(jQuery);RegExp.escape=function(s){return s.replace(/([.*+?^${}()|\/\\[\]])/g,'\\$1');};(function($){$.wikiEditor.modules.dialogs={api:{addDialog:function(context,data){$.wikiEditor.modules.dialogs.fn.create(context,{'modules':data})},openDialog:function(context,data){if(data.dialog in $.wikiEditor.modules.dialogs.modules){$('#'+$.wikiEditor.modules.dialogs.modules[data.dialog].id).dialog('open');}},closeDialog:function(context,data){if(data.dialog in $.wikiEditor.modules.dialogs.modules){$('#'+$.wikiEditor.modules.dialogs.modules[data.dialog].id).dialog('close');}}},fn:{create:function(context,config){for(module in config){$.wikiEditor.modules.dialogs.modules[module]=config[module];}
8080 for(module in $.wikiEditor.modules.dialogs.modules){var module=$.wikiEditor.modules.dialogs.modules[module];if($('#'+module.id).size()==0){var configuration=module.dialog;configuration.bgiframe=true;configuration.autoOpen=false;configuration.modal=true;configuration.title=$.wikiEditor.autoMsg(module,'title');for(msg in configuration.buttons){configuration.buttons[gM(msg)]=configuration.buttons[msg];delete configuration.buttons[msg];}
81 -$('<div /> ').attr('id',module.id).html(module.html).data('context',context).appendTo($('body')).each(module.init).dialog(configuration).bind('dialogopen',$.wikiEditor.modules.dialogs.fn.resize).find('.ui-tabs').bind('tabsshow',function(){$(this).closest('.ui-dialog-content').each($.wikiEditor.modules.dialogs.fn.resize);});}}},resize:function(){var wrapper=$(this).closest('.ui-dialog');var oldHidden=$(this).find('*').not(':visible');oldHidden.each(function(){$(this).data('oldstyle',$(this).attr('style'));});oldHidden.show();var oldWS=$(this).css('white-space');$(this).css('white-space','nowrap');if(wrapper.width()<=$(this).get(0).scrollWidth){$(this).width($(this).get(0).scrollWidth);wrapper.width(wrapper.get(0).scrollWidth);$(this).dialog({'width':wrapper.width()});}
 81+$('<div /> ').attr('id',module.id).html(module.html).data('context',context).appendTo($('body')).each(module.init).dialog(configuration).bind('dialogopen',$.wikiEditor.modules.dialogs.fn.resize).find('.ui-tabs').bind('tabsshow',function(){$(this).closest('.ui-dialog-content').each($.wikiEditor.modules.dialogs.fn.resize);});var maxTI=0;$j('[tabindex]').each(function(){var ti=parseInt($j(this).attr('tabindex'));if(ti>maxTI)
 82+maxTI=ti;});var tabIndex=maxTI+1;$j('.ui-dialog input, .ui-dialog button').not('[tabindex]').each(function(){$j(this).attr('tabindex',tabIndex++);});}}},resize:function(){var wrapper=$(this).closest('.ui-dialog');var oldHidden=$(this).find('*').not(':visible');oldHidden.each(function(){$(this).data('oldstyle',$(this).attr('style'));});oldHidden.show();var oldWS=$(this).css('white-space');$(this).css('white-space','nowrap');if(wrapper.width()<=$(this).get(0).scrollWidth){$(this).width($(this).get(0).scrollWidth);wrapper.width(wrapper.get(0).scrollWidth);$(this).dialog({'width':wrapper.width()});}
8283 $(this).css('white-space',oldWS);oldHidden.each(function(){$(this).attr('style',$(this).data('oldstyle'));});}},'modules':{}};})(jQuery);(function($){$.wikiEditor.modules.toolbar={api:{addToToolbar:function(context,data){for(type in data){switch(type){case'sections':var $sections=context.modules.$toolbar.find('div.sections');var $tabs=context.modules.$toolbar.find('div.tabs');for(section in data[type]){if(section=='main'){context.modules.$toolbar.prepend($.wikiEditor.modules.toolbar.fn.buildSection(context,section,data[type][section]));continue;}
8384 $sections.append($.wikiEditor.modules.toolbar.fn.buildSection(context,section,data[type][section]));$tabs.append($.wikiEditor.modules.toolbar.fn.buildTab(context,section,data[type][section]));}
8485 break;case'groups':if(!('section'in data)){continue;}

Status & tagging log