r62033 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62032‎ | r62033 | r62034 >
Date:16:48, 5 February 2010
Author:adam
Status:deferred
Tags:
Comment:
Insert Link Dialog: Better handling of the link status indicator on repeat openings of the dialog. Addresses bug 20867
Modified paths:
  • /trunk/extensions/UsabilityInitiative/WikiEditor/Modules/Toolbar/Toolbar.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.min.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php
@@ -16,14 +16,14 @@
1717 array( 'src' => 'Modules/Preview/Preview.js', 'version' => 6 ),
1818 array( 'src' => 'Modules/Publish/Publish.js', 'version' => 6 ),
1919 array( 'src' => 'Modules/Toc/Toc.js', 'version' => 7 ),
20 - array( 'src' => 'Modules/Toolbar/Toolbar.js', 'version' => 47 ),
 20+ array( 'src' => 'Modules/Toolbar/Toolbar.js', 'version' => 48 ),
2121 array( 'src' => 'Modules/TemplateEditor/TemplateEditor.js', 'version' => 4 ),
2222 ),
2323 'combined' => array(
24 - array( 'src' => 'WikiEditor.combined.js', 'version' => 49 ),
 24+ array( 'src' => 'WikiEditor.combined.js', 'version' => 50 ),
2525 ),
2626 'minified' => array(
27 - array( 'src' => 'WikiEditor.combined.min.js', 'version' => 49 ),
 27+ array( 'src' => 'WikiEditor.combined.min.js', 'version' => 50 ),
2828 ),
2929 );
3030 static $messages = array(
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.js
@@ -1303,8 +1303,8 @@
13041304 // Pre-fill the text fields based on the current selection
13051305 var selection = $j(this).data( 'context' ).$textarea.textSelection( 'getSelection' );
13061306 $j( '#wikieditor-toolbar-link-int-target' ).focus();
1307 - // Hide any status indicators that may be visible
1308 - $j( '#wikieditor-toolbar-link-int-target-status > div:visible').hide();
 1307+ // Trigger the change event, so the link status indicator is up to date
 1308+ $j( '#wikieditor-toolbar-link-int-target' ).change();
13091309 $j( '#wikieditor-toolbar-link-dialog' ).data( 'whitespace', [ '', '' ] );
13101310 if ( selection != '' ) {
13111311 var target, text, type;
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.min.js
@@ -67,7 +67,7 @@
6868 insertText=escTarget;else if(text=='')
6969 insertText='['+escTarget+']';else
7070 insertText='['+escTarget+' '+escText+']';}
71 -if(whitespace)insertText=whitespace[0]+insertText+whitespace[1];$j.wikiEditor.modules.toolbar.fn.doAction($j(this).data('context'),{type:'replace',options:{pre:insertText}},$j(this));$j('#wikieditor-toolbar-link-int-target, #wikieditor-toolbar-link-int-text').val('');$j('#wikieditor-toolbar-link-type-int, #wikieditor-toolbar-link-type-ext').attr('checked','');$j(this).dialog('close');},'wikieditor-toolbar-tool-link-cancel':function(){$j(this).dialog('close');}},open:function(){$j(this).data('articlePathRegex',new RegExp('^'+RegExp.escape(wgServer+wgArticlePath).replace(/\\\$1/g,'(.*)')+'$'));var selection=$j(this).data('context').$textarea.textSelection('getSelection');$j('#wikieditor-toolbar-link-int-target').focus();$j('#wikieditor-toolbar-link-int-target-status > div:visible').hide();$j('#wikieditor-toolbar-link-dialog').data('whitespace',['','']);if(selection!=''){var target,text,type;var matches;if((matches=selection.match(/^(\s*)\[\[([^\]\|]+)(\|([^\]\|]*))?\]\](\s*)$/))){target=matches[2];text=(matches[4]?matches[4]:matches[2]);type='int';$j('#wikieditor-toolbar-link-dialog').data('whitespace',[matches[1],matches[5]]);}else if((matches=selection.match(/^(\s*)\[([^\] ]+)( ([^\]]+))?\](\s*)$/))){target=matches[2];text=(matches[4]?matches[4]:'');type='ext';$j('#wikieditor-toolbar-link-dialog').data('whitespace',[matches[1],matches[5]]);}else{target=text=selection;}
 71+if(whitespace)insertText=whitespace[0]+insertText+whitespace[1];$j.wikiEditor.modules.toolbar.fn.doAction($j(this).data('context'),{type:'replace',options:{pre:insertText}},$j(this));$j('#wikieditor-toolbar-link-int-target, #wikieditor-toolbar-link-int-text').val('');$j('#wikieditor-toolbar-link-type-int, #wikieditor-toolbar-link-type-ext').attr('checked','');$j(this).dialog('close');},'wikieditor-toolbar-tool-link-cancel':function(){$j(this).dialog('close');}},open:function(){$j(this).data('articlePathRegex',new RegExp('^'+RegExp.escape(wgServer+wgArticlePath).replace(/\\\$1/g,'(.*)')+'$'));var selection=$j(this).data('context').$textarea.textSelection('getSelection');$j('#wikieditor-toolbar-link-int-target').focus();$j('#wikieditor-toolbar-link-int-target').change();$j('#wikieditor-toolbar-link-dialog').data('whitespace',['','']);if(selection!=''){var target,text,type;var matches;if((matches=selection.match(/^(\s*)\[\[([^\]\|]+)(\|([^\]\|]*))?\]\](\s*)$/))){target=matches[2];text=(matches[4]?matches[4]:matches[2]);type='int';$j('#wikieditor-toolbar-link-dialog').data('whitespace',[matches[1],matches[5]]);}else if((matches=selection.match(/^(\s*)\[([^\] ]+)( ([^\]]+))?\](\s*)$/))){target=matches[2];text=(matches[4]?matches[4]:'');type='ext';$j('#wikieditor-toolbar-link-dialog').data('whitespace',[matches[1],matches[5]]);}else{target=text=selection;}
7272 if(typeof text!='undefined')
7373 $j('#wikieditor-toolbar-link-int-text').val(text).change();if(typeof target!='undefined')
7474 $j('#wikieditor-toolbar-link-int-target').val(target).change();if(typeof type!='undefined')
Index: trunk/extensions/UsabilityInitiative/WikiEditor/Modules/Toolbar/Toolbar.js
@@ -1254,8 +1254,8 @@
12551255 // Pre-fill the text fields based on the current selection
12561256 var selection = $j(this).data( 'context' ).$textarea.textSelection( 'getSelection' );
12571257 $j( '#wikieditor-toolbar-link-int-target' ).focus();
1258 - // Hide any status indicators that may be visible
1259 - $j( '#wikieditor-toolbar-link-int-target-status > div:visible').hide();
 1258+ // Trigger the change event, so the link status indicator is up to date
 1259+ $j( '#wikieditor-toolbar-link-int-target' ).change();
12601260 $j( '#wikieditor-toolbar-link-dialog' ).data( 'whitespace', [ '', '' ] );
12611261 if ( selection != '' ) {
12621262 var target, text, type;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r61894Fixing two bugs with the insert link dialog. One was bug 20867, the other a d...adam22:58, 2 February 2010
r61932Fixing a bug identified in a comment on bug 20867, where incorrect link statu...adam15:20, 3 February 2010

Status & tagging log