r57151 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57150‎ | r57151 | r57152 >
Date:20:21, 30 September 2009
Author:catrope
Status:deferred
Tags:
Comment:
EditToolbar: (bug 20896) Make the text boxes in the link dialog wider (size=50). Also move the dialog after left by half the gained width after resizing.
Modified paths:
  • /trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.php (modified) (history)
  • /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
@@ -66,17 +66,17 @@
6767 array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 14 ),
6868 array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 7 ),
6969 array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 11 ),
70 - array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 3 ),
 70+ array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 4 ),
7171 array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 13 ),
7272 // FIXME: jQuery UI doesn't belong here, should move to no_js2
7373 // once we figure out how to do jQuery UI properly in JS2
7474 array( 'src' => 'js/js2/jquery-ui-1.7.2.js', 'version' => '1.7.2y' ),
7575 ),
7676 'combined' => array(
77 - array( 'src' => 'js/plugins.combined.js', 'version' => 33 ),
 77+ array( 'src' => 'js/plugins.combined.js', 'version' => 34 ),
7878 ),
7979 'minified' => array(
80 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 33 ),
 80+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 34 ),
8181 ),
8282 ),
8383 );
Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js
@@ -760,19 +760,19 @@
761761 <div id="edittoolbar-link-dialog-tab-int"><fieldset><table><tr>\
762762 <td><label for="edittoolbar-link-int-target" rel="edittoolbar-tool-link-int-target"></label></td>\
763763 <td>\
764 - <input type="text" id="edittoolbar-link-int-target" />\
 764+ <input type="text" id="edittoolbar-link-int-target" size="50" />\
765765 <div id="edittoolbar-link-int-target-status" style="display: inline;"></div>\
766766 </td>\
767767 </tr><tr>\
768768 <td><label for="edittoolbar-link-int-text" rel="edittoolbar-tool-link-int-text"></label></td>\
769 - <td><input type="text" id="edittoolbar-link-int-text" /></td>\
 769+ <td><input type="text" id="edittoolbar-link-int-text" size="50" /></td>\
770770 </table></fieldset></div>\
771771 <div id="edittoolbar-link-dialog-tab-ext"><fieldset><table><tr>\
772772 <td><label for="edittoolbar-link-ext-target" rel="edittoolbar-tool-link-ext-target"></label></td>\
773 - <td><input type="text" id="edittoolbar-link-ext-target" /></td>\
 773+ <td><input type="text" id="edittoolbar-link-ext-target" size="50" /></td>\
774774 </tr><tr>\
775775 <td><label for="edittoolbar-link-ext-text" rel="edittoolbar-tool-link-ext-text"></label></td>\
776 - <td><input type="text" id="edittoolbar-link-ext-text" /></td>\
 776+ <td><input type="text" id="edittoolbar-link-ext-text" size="50" /></td>\
777777 </table></fieldset></div>\
778778 </div>',
779779 init: function() {
Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.php
@@ -19,7 +19,7 @@
2020 /* Configuration */
2121
2222 // Bump the version number every time you change any of the .css/.js files
23 -$wgEditToolbarStyleVersion = 46;
 23+$wgEditToolbarStyleVersion = 47;
2424
2525 // Set this to true to simply override the stock toolbar for everyone
2626 $wgEditToolbarGlobalEnable = false;
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.dialogs.js
@@ -100,6 +100,7 @@
101101 */
102102 resize: function() {
103103 var wrapper = $(this).closest( '.ui-dialog' );
 104+ var oldWidth = wrapper.width();
104105 // Make sure elements don't wrapped so we get an accurate idea
105106 // of whether they really fit. Also temporarily show hidden
106107 // elements.
@@ -122,6 +123,9 @@
123124 $(this).width( $(this).get(0).scrollWidth );
124125 wrapper.width( wrapper.get(0).scrollWidth );
125126 $(this).dialog( { 'width': wrapper.width() } );
 127+ wrapper.css( 'left',
 128+ parseInt( wrapper.css( 'left' ) ) -
 129+ ( wrapper.width() - oldWidth ) / 2 );
126130 }
127131
128132 $(this).css( 'white-space', oldWS );
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -1407,6 +1407,7 @@
14081408 */
14091409 resize: function() {
14101410 var wrapper = $(this).closest( '.ui-dialog' );
 1411+ var oldWidth = wrapper.width();
14111412 // Make sure elements don't wrapped so we get an accurate idea
14121413 // of whether they really fit. Also temporarily show hidden
14131414 // elements.
@@ -1429,6 +1430,9 @@
14301431 $(this).width( $(this).get(0).scrollWidth );
14311432 wrapper.width( wrapper.get(0).scrollWidth );
14321433 $(this).dialog( { 'width': wrapper.width() } );
 1434+ wrapper.css( 'left',
 1435+ parseInt( wrapper.css( 'left' ) ) -
 1436+ ( wrapper.width() - oldWidth ) / 2 );
14331437 }
14341438
14351439 $(this).css( 'white-space', oldWS );
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -89,7 +89,8 @@
9090 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];}
9191 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');configuration.newButtons={};for(msg in configuration.buttons)
9292 configuration.newButtons[gM(msg)]=configuration.buttons[msg];configuration.buttons=configuration.newButtons;$('<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)
93 -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()});}
 93+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 oldWidth=wrapper.width();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()});wrapper.css('left',parseInt(wrapper.css('left'))-
 94+(wrapper.width()-oldWidth)/2);}
9495 $(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;}
9596 $sections.append($.wikiEditor.modules.toolbar.fn.buildSection(context,section,data[type][section]));$tabs.append($.wikiEditor.modules.toolbar.fn.buildTab(context,section,data[type][section]));}
9697 break;case'groups':if(!('section'in data)){continue;}

Status & tagging log