r67542 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67541‎ | r67542 | r67543 >
Date:14:52, 7 June 2010
Author:catrope
Status:deferred
Tags:
Comment:
UsabilityInitiative: (bug 22901) Work around jQuery UI bug that causes the close [x] in the top right corner of a dialog to retain focus after being clicked
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.dialogs.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -78,7 +78,7 @@
7979 array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 191 ),
8080 array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 53 ),
8181 array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 65 ),
82 - array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 24 ),
 82+ array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 25 ),
8383 array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 98 ),
8484 array( 'src' => 'js/plugins/jquery.wikiEditor.preview.js', 'version' => 11 ),
8585 array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 77 ),
@@ -89,10 +89,10 @@
9090 array( 'src' => 'js/thirdparty/contentCollector.js', 'version' => 1 ),
9191 ),
9292 'combined' => array(
93 - array( 'src' => 'js/plugins.combined.js', 'version' => 416 ),
 93+ array( 'src' => 'js/plugins.combined.js', 'version' => 417 ),
9494 ),
9595 'minified' => array(
96 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 416 ),
 96+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 417 ),
9797 ),
9898 ),
9999 );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.dialogs.js
@@ -51,6 +51,12 @@
5252 $.wikiEditor.modules.dialogs.fn.reallyCreate( context, mod );
5353 $dialog = $( '#' + mod.id );
5454 }
 55+
 56+ // Workaround for bug in jQuery UI: close button in top right retains focus
 57+ $dialog.closest( '.ui-dialog' )
 58+ .find( '.ui-dialog-titlebar-close' )
 59+ .removeClass( 'ui-state-focus' );
 60+
5561 $dialog.dialog( 'open' );
5662 }
5763 },
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -8732,6 +8732,12 @@
87338733 $.wikiEditor.modules.dialogs.fn.reallyCreate( context, mod );
87348734 $dialog = $( '#' + mod.id );
87358735 }
 8736+
 8737+ // Workaround for bug in jQuery UI: close button in top right retains focus
 8738+ $dialog.closest( '.ui-dialog' )
 8739+ .find( '.ui-dialog-titlebar-close' )
 8740+ .removeClass( 'ui-state-focus' );
 8741+
87368742 $dialog.dialog( 'open' );
87378743 }
87388744 },
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -602,7 +602,7 @@
603603 for(module in modules){if(module in $.wikiEditor.modules&&$.wikiEditor.isSupported($.wikiEditor.modules[module])&&$.wikiEditor.isRequired($.wikiEditor.modules[module],'iframe')){context.fn.setupIframe();break;}}}
604604 if(args.length>0){var call=args.shift();if(call in context.api){context.api[call](context,typeof args[0]=='undefined'?{}:args[0]);}}
605605 return $(this).data('wikiEditor-context',context);};})(jQuery);RegExp.escape=function(s){return s.replace(/([.*+?^${}()|\/\\[\]])/g,'\\$1');};(function($){$.wikiEditor.modules.dialogs={'browsers':{'ltr':{'msie':[['>=',7]],'firefox':[['>=',2],['!=','2.0'],['!=','2.0.0.1'],['!=','2.0.0.2'],['!=','2.0.0.3'],['!=','2.0.0.4']],'opera':[['>=',9.6]],'safari':[['>=',3]],'chrome':[['>=',3]]},'rtl':{'msie':[['>=',7]],'firefox':[['>=',2],['!=','2.0'],['!=','2.0.0.1'],['!=','2.0.0.2'],['!=','2.0.0.3'],['!=','2.0.0.4']],'opera':[['>=',9.6]],'safari':[['>=',3]],'chrome':[['>=',3]]}},api:{addDialog:function(context,data){$.wikiEditor.modules.dialogs.fn.create(context,data)},openDialog:function(context,module){if(module in $.wikiEditor.modules.dialogs.modules){var mod=$.wikiEditor.modules.dialogs.modules[module];var $dialog=$('#'+mod.id);if($dialog.length==0){$.wikiEditor.modules.dialogs.fn.reallyCreate(context,mod);$dialog=$('#'+mod.id);}
606 -$dialog.dialog('open');}},closeDialog:function(context,module){if(module in $.wikiEditor.modules.dialogs.modules){$('#'+$.wikiEditor.modules.dialogs.modules[module].id).dialog('close');}}},fn:{create:function(context,config){for(mod in config){var module=config[mod];var filtered=false;if(typeof module.filters!='undefined'){for(var i=0;i<module.filters.length;i++){if($(module.filters[i]).length==0){filtered=true;break;}}}
 606+$dialog.closest('.ui-dialog').find('.ui-dialog-titlebar-close').removeClass('ui-state-focus');$dialog.dialog('open');}},closeDialog:function(context,module){if(module in $.wikiEditor.modules.dialogs.modules){$('#'+$.wikiEditor.modules.dialogs.modules[module].id).dialog('close');}}},fn:{create:function(context,config){for(mod in config){var module=config[mod];var filtered=false;if(typeof module.filters!='undefined'){for(var i=0;i<module.filters.length;i++){if($(module.filters[i]).length==0){filtered=true;break;}}}
607607 if(!filtered&&$.wikiEditor.isSupported(module)&&$('#'+module.id).size()==0){$.wikiEditor.modules.dialogs.modules[mod]=module;if(typeof context.$iframe=='undefined'&&$.wikiEditor.isRequired(module,'iframe')){context.fn.setupIframe();}
608608 context.$textarea.trigger('wikiEditor-dialogs-setup-'+mod);}}},reallyCreate:function(context,module){mw.usability.load(['$j.ui','$j.ui.dialog','$j.ui.draggable','$j.ui.resizable'],function(){var configuration=module.dialog;configuration.bgiframe=true;configuration.autoOpen=false;configuration.modal=true;configuration.title=$.wikiEditor.autoMsg(module,'title');configuration.newButtons={};for(msg in configuration.buttons)
609609 configuration.newButtons[mw.usability.getMsg(msg)]=configuration.buttons[msg];configuration.buttons=configuration.newButtons;var dialogDiv=$('<div />').attr('id',module.id).html(module.html).data('context',context).appendTo($('body')).each(module.init).dialog(configuration);$.wikiEditor.modules.dialogs.fn.setTabindexes(dialogDiv.closest('.ui-dialog').find('button').not('[tabindex]'));if(!('resizeme'in module)||module.resizeme){dialogDiv.bind('dialogopen',$.wikiEditor.modules.dialogs.fn.resize).find('.ui-tabs').bind('tabsshow',function(){$(this).closest('.ui-dialog-content').each($.wikiEditor.modules.dialogs.fn.resize);});}

Status & tagging log