r68238 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68237‎ | r68238 | r68239 >
Date:20:47, 18 June 2010
Author:catrope
Status:deferred
Tags:
Comment:
UsabilityInitiative: Remove the rule saying that anything matcing [^.]\.[a-z]{2,](\/|$) is a URL: stuff like "File:Example.jpg" matches this too
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,16 +16,16 @@
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' => 95 ),
 20+ array( 'src' => 'Modules/Toolbar/Toolbar.js', 'version' => 96 ),
2121 array( 'src' => 'Modules/TemplateEditor/TemplateEditor.js', 'version' => 6 ),
2222 array( 'src' => 'Modules/Templates/Templates.js', 'version' => 1 ),
2323 array( 'src' => 'Modules/AddMediaWizard/AddMediaWizard.js', 'version' => 6 ),
2424 ),
2525 'combined' => array(
26 - array( 'src' => 'WikiEditor.combined.js', 'version' => 102 ),
 26+ array( 'src' => 'WikiEditor.combined.js', 'version' => 103 ),
2727 ),
2828 'minified' => array(
29 - array( 'src' => 'WikiEditor.combined.min.js', 'version' => 102 ),
 29+ array( 'src' => 'WikiEditor.combined.min.js', 'version' => 103 ),
3030 ),
3131 );
3232 static $messages = array(
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.js
@@ -1046,15 +1046,13 @@
10471047 // The following things are considered to be external links:
10481048 // * Starts a URL protocol
10491049 // * Starts with www.
1050 - // * Ends with a . followed by two or more letters
1051 - // * Contains a . followed by two or more letters followed by /
1052 - // All of these are potentially valid titles, and the latter three
 1050+ // All of these are potentially valid titles, and the latter two
10531051 // categories match about 6300 titles in enwiki's ns0. Out of 6.9M
10541052 // titles, that's 0.09%
10551053 if ( typeof arguments.callee.regex == 'undefined' ) {
10561054 // Cache the regex
10571055 arguments.callee.regex =
1058 - new RegExp( "(^(" + wgUrlProtocols + "))|(^www\\.)|([^.]\\.[a-z]{2,}($|\\/))", 'i');
 1056+ new RegExp( "^(" + wgUrlProtocols + "|www\\.)", 'i');
10591057 }
10601058 return s.match( arguments.callee.regex );
10611059 }
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.min.js
@@ -26,7 +26,7 @@
2727 <label for="wikieditor-toolbar-link-type-ext" rel="wikieditor-toolbar-tool-link-ext"></label>\
2828 </div>\
2929 </div>\
30 - </fieldset>',init:function(){function isExternalLink(s){if(typeof arguments.callee.regex=='undefined'){arguments.callee.regex=new RegExp("(^("+wgUrlProtocols+"))|(^www\\.)|([^.]\\.[a-z]{2,}($|\\/))",'i');}
 30+ </fieldset>',init:function(){function isExternalLink(s){if(typeof arguments.callee.regex=='undefined'){arguments.callee.regex=new RegExp("^("+wgUrlProtocols+"|www\\.)",'i');}
3131 return s.match(arguments.callee.regex);}
3232 function updateWidget(status){$j('#wikieditor-toolbar-link-int-target-status').children().hide();$j('#wikieditor-toolbar-link-int-target').parent().removeClass('status-invalid status-external status-notexists status-exists status-loading');if(status){$j('#wikieditor-toolbar-link-int-target-status-'+status).show();$j('#wikieditor-toolbar-link-int-target').parent().addClass('status-'+status);}
3333 if(status=='invalid'){$j('.ui-dialog:visible .ui-dialog-buttonpane button:first').attr('disabled',true).addClass('disabled');}else{$j('.ui-dialog:visible .ui-dialog-buttonpane button:first').removeAttr('disabled').removeClass('disabled');}}
Index: trunk/extensions/UsabilityInitiative/WikiEditor/Modules/Toolbar/Toolbar.js
@@ -997,15 +997,13 @@
998998 // The following things are considered to be external links:
999999 // * Starts a URL protocol
10001000 // * Starts with www.
1001 - // * Ends with a . followed by two or more letters
1002 - // * Contains a . followed by two or more letters followed by /
1003 - // All of these are potentially valid titles, and the latter three
 1001+ // All of these are potentially valid titles, and the latter two
10041002 // categories match about 6300 titles in enwiki's ns0. Out of 6.9M
10051003 // titles, that's 0.09%
10061004 if ( typeof arguments.callee.regex == 'undefined' ) {
10071005 // Cache the regex
10081006 arguments.callee.regex =
1009 - new RegExp( "(^(" + wgUrlProtocols + "))|(^www\\.)|([^.]\\.[a-z]{2,}($|\\/))", 'i');
 1007+ new RegExp( "^(" + wgUrlProtocols + "|www\\.)", 'i');
10101008 }
10111009 return s.match( arguments.callee.regex );
10121010 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r682391.16wmf4: MFT r68238catrope20:50, 18 June 2010

Status & tagging log