r58310 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58309‎ | r58310 | r58311 >
Date:12:41, 29 October 2009
Author:catrope
Status:ok
Tags:
Comment:
EditToolbar: (bug 21343) Treat regexes as multiline in search&replace, so ^ and $ match the start and end of lines instead of the entire textbox contents. I hear this breaks older browsers, but if those browsers are so old they're not supported by wikiEditor anyway, we can get away with it
Modified paths:
  • /trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.min.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.php (modified) (history)

Diff [purge]

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 = 65;
 23+$wgEditToolbarStyleVersion = 66;
2424
2525 // Set this to true to simply override the stock toolbar for everyone
2626 $wgEditToolbarGlobalEnable = false;
Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js
@@ -1370,7 +1370,7 @@
13711371 return;
13721372 }
13731373 var replaceStr = $j( '#edittoolbar-replace-replace' ).val();
1374 - var flags = '';
 1374+ var flags = 'm';
13751375 var matchCase = $j( '#edittoolbar-replace-case' ).is( ':checked' );
13761376 var isRegex = $j( '#edittoolbar-replace-regex' ).is( ':checked' );
13771377 if ( !matchCase ) {
Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.min.js
@@ -139,7 +139,7 @@
140140 <td><input type="checkbox" id="edittoolbar-replace-regex" /></td>\
141141 <td><label for="edittoolbar-replace-regex" rel="edittoolbar-tool-replace-regex"></label></td>\
142142 </tr></table></fieldset>',init:function(){$j(this).find('[rel]').each(function(){$j(this).text(gM($j(this).attr('rel')));});$j(this).data('replaceCallback',function(mode){$j('#edittoolbar-replace-nomatch, #edittoolbar-replace-success, #edittoolbar-replace-emptysearch, #edittoolbar-replace-invalidregex').hide();var searchStr=$j('#edittoolbar-replace-search').val();if(searchStr==''){$j('#edittoolbar-replace-emptysearch').show();return;}
143 -var replaceStr=$j('#edittoolbar-replace-replace').val();var flags='';var matchCase=$j('#edittoolbar-replace-case').is(':checked');var isRegex=$j('#edittoolbar-replace-regex').is(':checked');if(!matchCase){flags+='i';}
 143+var replaceStr=$j('#edittoolbar-replace-replace').val();var flags='m';var matchCase=$j('#edittoolbar-replace-case').is(':checked');var isRegex=$j('#edittoolbar-replace-regex').is(':checked');if(!matchCase){flags+='i';}
144144 if(mode=='replaceAll'){flags+='g';}
145145 if(!isRegex){searchStr=RegExp.escape(searchStr);}
146146 try{var regex=new RegExp(searchStr,flags);}catch(e){$j('#edittoolbar-replace-invalidregex').text(gM('edittoolbar-tool-replace-invalidregex',e.message)).show();return;}

Follow-up revisions

RevisionCommit summaryAuthorDate
r59204wmf-deployment: Merging usability changes from trunk...catrope18:53, 18 November 2009

Status & tagging log