Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -71,14 +71,14 @@ |
72 | 72 | array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 16 ), |
73 | 73 | array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 12 ), |
74 | 74 | array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 17 ), |
75 | | - array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 6 ), |
| 75 | + array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 7 ), |
76 | 76 | array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 22 ), |
77 | 77 | ), |
78 | 78 | 'combined' => array( |
79 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 52 ), |
| 79 | + array( 'src' => 'js/plugins.combined.js', 'version' => 53 ), |
80 | 80 | ), |
81 | 81 | 'minified' => array( |
82 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 52 ), |
| 82 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 53 ), |
83 | 83 | ), |
84 | 84 | ), |
85 | 85 | ); |
Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js |
— | — | @@ -1019,10 +1019,15 @@ |
1020 | 1020 | var whitespace = $j( '#edittoolbar-link-dialog' ).data( 'whitespace' ); |
1021 | 1021 | var target = $j( '#edittoolbar-link-int-target' ).val(); |
1022 | 1022 | var text = $j( '#edittoolbar-link-int-text' ).val(); |
1023 | | - if ( text == '' ) { |
| 1023 | + if ( target == '' ) { |
1024 | 1024 | alert( gM( 'edittoolbar-tool-link-empty' ) ); |
1025 | 1025 | return; |
1026 | 1026 | } |
| 1027 | + if ( $j.trim( text ) == '' ) { |
| 1028 | + // [[Foo| ]] creates an invisible link |
| 1029 | + // Instead, generate [[Foo|]] |
| 1030 | + text = ''; |
| 1031 | + } |
1027 | 1032 | if ( $j( '#edittoolbar-link-type-int' ).is( ':checked' ) ) { |
1028 | 1033 | // FIXME: Exactly how fragile is this? |
1029 | 1034 | if ( $j( '#edittoolbar-link-int-target-status-invalid' ).is( ':visible' ) ) { |
Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.min.js |
— | — | @@ -47,7 +47,8 @@ |
48 | 48 | request.abort();}});},dialog:{width:500,buttons:{'edittoolbar-tool-link-insert':function(){function escapeInternalText(s){return s.replace(/(]{2,})/g,'<nowiki>$1</nowiki>');} |
49 | 49 | function escapeExternalTarget(s){return s.replace(/ /g,'%20').replace(/]/g,'%5D');} |
50 | 50 | function escapeExternalText(s){return s.replace(/(]+)/g,'<nowiki>$1</nowiki>');} |
51 | | -var insertText='';var whitespace=$j('#edittoolbar-link-dialog').data('whitespace');var target=$j('#edittoolbar-link-int-target').val();var text=$j('#edittoolbar-link-int-text').val();if(text==''){alert(gM('edittoolbar-tool-link-empty'));return;} |
| 51 | +var insertText='';var whitespace=$j('#edittoolbar-link-dialog').data('whitespace');var target=$j('#edittoolbar-link-int-target').val();var text=$j('#edittoolbar-link-int-text').val();if(target==''){alert(gM('edittoolbar-tool-link-empty'));return;} |
| 52 | +if($j.trim(text)==''){text='';} |
52 | 53 | if($j('#edittoolbar-link-type-int').is(':checked')){if($j('#edittoolbar-link-int-target-status-invalid').is(':visible')){alert(gM('edittoolbar-tool-link-int-invalid'));return;} |
53 | 54 | if(target==text) |
54 | 55 | insertText='[['+target+']]';else |
— | — | @@ -125,12 +126,12 @@ |
126 | 127 | <div id="edittoolbar-replace-emptysearch" rel="edittoolbar-tool-replace-emptysearch"></div>\ |
127 | 128 | <div id="edittoolbar-replace-invalidregex"></div>\ |
128 | 129 | </div>\ |
129 | | - <fieldset><table><tr>\ |
| 130 | + <fieldset><table style="width: 100%;"><tr>\ |
130 | 131 | <td><label for="edittoolbar-replace-search" rel="edittoolbar-tool-replace-search"></label></td>\ |
131 | | - <td><input type="text" id="edittoolbar-replace-search" /></td>\ |
| 132 | + <td><input type="text" id="edittoolbar-replace-search" style="width: 100%;" /></td>\ |
132 | 133 | </tr><tr>\ |
133 | 134 | <td><label for="edittoolbar-replace-replace" rel="edittoolbar-tool-replace-replace"></label></td>\ |
134 | | - <td><input type="text" id="edittoolbar-replace-replace" /></td>\ |
| 135 | + <td><input type="text" id="edittoolbar-replace-replace" style="width: 100%;" /></td>\ |
135 | 136 | </tr></table><table><tr>\ |
136 | 137 | <td><input type="checkbox" id="edittoolbar-replace-case" /></td>\ |
137 | 138 | <td><label for="edittoolbar-replace-case" rel="edittoolbar-tool-replace-case"></label></td>\ |
Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.php |
— | — | @@ -19,7 +19,7 @@ |
20 | 20 | /* Configuration */ |
21 | 21 | |
22 | 22 | // Bump the version number every time you change any of the .css/.js files |
23 | | -$wgEditToolbarStyleVersion = 64; |
| 23 | +$wgEditToolbarStyleVersion = 65; |
24 | 24 | |
25 | 25 | // Set this to true to simply override the stock toolbar for everyone |
26 | 26 | $wgEditToolbarGlobalEnable = false; |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.dialogs.js |
— | — | @@ -123,8 +123,16 @@ |
124 | 124 | $(this).css( 'white-space', 'nowrap' ); |
125 | 125 | |
126 | 126 | if ( wrapper.width() <= $(this).get(0).scrollWidth ) { |
127 | | - $(this).width( $(this).get(0).scrollWidth ); |
128 | | - wrapper.width( wrapper.get(0).scrollWidth ); |
| 127 | + var thisWidth = $(this).data( 'thisWidth' ) ? $(this).data( 'thisWidth' ) : 0; |
| 128 | + thisWidth = Math.max( $(this).get(0).scrollWidth, thisWidth ); |
| 129 | + $(this).width( thisWidth ); |
| 130 | + $(this).data( 'thisWidth', thisWidth ); |
| 131 | + |
| 132 | + var wrapperWidth = $(this).data( 'wrapperWidth' ) ? $(this).data( 'wrapperWidth' ) : 0; |
| 133 | + wrapperWidth = Math.max( wrapper.get(0).scrollWidth, wrapperWidth ); |
| 134 | + wrapper.width( wrapperWidth ); |
| 135 | + $(this).data( 'wrapperWidth', wrapperWidth ); |
| 136 | + |
129 | 137 | $(this).dialog( { 'width': wrapper.width() } ); |
130 | 138 | wrapper.css( 'left', |
131 | 139 | parseInt( wrapper.css( 'left' ) ) - |
— | — | @@ -135,6 +143,7 @@ |
136 | 144 | oldHidden.each( function() { |
137 | 145 | $(this).attr( 'style', $(this).data( 'oldstyle' ) ); |
138 | 146 | }); |
| 147 | + |
139 | 148 | } |
140 | 149 | }, |
141 | 150 | modules: {}, |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -1601,8 +1601,16 @@ |
1602 | 1602 | $(this).css( 'white-space', 'nowrap' ); |
1603 | 1603 | |
1604 | 1604 | if ( wrapper.width() <= $(this).get(0).scrollWidth ) { |
1605 | | - $(this).width( $(this).get(0).scrollWidth ); |
1606 | | - wrapper.width( wrapper.get(0).scrollWidth ); |
| 1605 | + var thisWidth = $(this).data( 'thisWidth' ) ? $(this).data( 'thisWidth' ) : 0; |
| 1606 | + thisWidth = Math.max( $(this).get(0).scrollWidth, thisWidth ); |
| 1607 | + $(this).width( thisWidth ); |
| 1608 | + $(this).data( 'thisWidth', thisWidth ); |
| 1609 | + |
| 1610 | + var wrapperWidth = $(this).data( 'wrapperWidth' ) ? $(this).data( 'wrapperWidth' ) : 0; |
| 1611 | + wrapperWidth = Math.max( wrapper.get(0).scrollWidth, wrapperWidth ); |
| 1612 | + wrapper.width( wrapperWidth ); |
| 1613 | + $(this).data( 'wrapperWidth', wrapperWidth ); |
| 1614 | + |
1607 | 1615 | $(this).dialog( { 'width': wrapper.width() } ); |
1608 | 1616 | wrapper.css( 'left', |
1609 | 1617 | parseInt( wrapper.css( 'left' ) ) - |
— | — | @@ -1613,6 +1621,7 @@ |
1614 | 1622 | oldHidden.each( function() { |
1615 | 1623 | $(this).attr( 'style', $(this).data( 'oldstyle' ) ); |
1616 | 1624 | }); |
| 1625 | + |
1617 | 1626 | } |
1618 | 1627 | }, |
1619 | 1628 | modules: {}, |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -91,7 +91,7 @@ |
92 | 92 | 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];} |
93 | 93 | mvJsLoader.doLoad(['$j.ui','$j.ui.dialog','$j.ui.draggable','$j.ui.resizable'],function(){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) |
94 | 94 | 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) |
95 | | -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'))- |
| 95 | +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){var thisWidth=$(this).data('thisWidth')?$(this).data('thisWidth'):0;thisWidth=Math.max($(this).get(0).scrollWidth,thisWidth);$(this).width(thisWidth);$(this).data('thisWidth',thisWidth);var wrapperWidth=$(this).data('wrapperWidth')?$(this).data('wrapperWidth'):0;wrapperWidth=Math.max(wrapper.get(0).scrollWidth,wrapperWidth);wrapper.width(wrapperWidth);$(this).data('wrapperWidth',wrapperWidth);$(this).dialog({'width':wrapper.width()});wrapper.css('left',parseInt(wrapper.css('left'))- |
96 | 96 | (wrapper.width()-oldWidth)/2);} |
97 | 97 | $(this).css('white-space',oldWS);oldHidden.each(function(){$(this).attr('style',$(this).data('oldstyle'));});}},modules:{},quickDialog:function(body,settings){$('<div />').text(body).appendTo($('body')).dialog($.extend({bgiframe:true,modal:true},settings)).dialog('open');}};})(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;} |
98 | 98 | $sections.append($.wikiEditor.modules.toolbar.fn.buildSection(context,section,data[type][section]));$tabs.append($.wikiEditor.modules.toolbar.fn.buildTab(context,section,data[type][section]));$section=$sections.find('.section:visible');if($section.size()){$sections.animate({'height':$section.outerHeight()},'fast');}} |