r60103 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60102‎ | r60103 | r60104 >
Date:23:29, 15 December 2009
Author:adam
Status:ok
Tags:
Comment:
A better regex for the code committed in r60098. Again.
Modified paths:
  • /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.toc.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -75,16 +75,16 @@
7676 array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 3 ),
7777 array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 40 ),
7878 array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 10 ),
79 - array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 53 ),
 79+ array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 54 ),
8080 array( 'src' => 'js/plugins/jquery.wikiEditor.preview.js', 'version' => 8 ),
8181 array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 3 ),
8282 array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 1 ),
8383 ),
8484 'combined' => array(
85 - array( 'src' => 'js/plugins.combined.js', 'version' => 113 ),
 85+ array( 'src' => 'js/plugins.combined.js', 'version' => 114 ),
8686 ),
8787 'minified' => array(
88 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 113 ),
 88+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 114 ),
8989 ),
9090 ),
9191 );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toc.js
@@ -414,7 +414,7 @@
415415 outline[h] = { 'text': match[2], 'wrapper': div, 'level': match[1].length, 'index': h + 1 };
416416 h++;
417417 }
418 - context.$content.html( context.$content.html().replace( /[\r?\n]/g, "<br>" ) );
 418+ context.$content.html( context.$content.html().replace( /\r?\n/g, "<br>" ) );
419419 context.$content.each( traverseTextNodes );
420420
421421 // Normalize heading levels for list creation
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -3447,7 +3447,7 @@
34483448 outline[h] = { 'text': match[2], 'wrapper': div, 'level': match[1].length, 'index': h + 1 };
34493449 h++;
34503450 }
3451 - context.$content.html( context.$content.html().replace( /[\r?\n]/g, "<br>" ) );
 3451+ context.$content.html( context.$content.html().replace( /\r?\n/g, "<br>" ) );
34523452 context.$content.each( traverseTextNodes );
34533453
34543454 // Normalize heading levels for list creation
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -224,7 +224,7 @@
225225 div=$(this).parent();else if($(this).parent().is('div'))
226226 div=$(this).parent().addClass('wikiEditor-toc-header');else{div=$('<div />').text(text).css('display','inline').addClass('wikiEditor-toc-header');$(this).replaceWith(div);}
227227 outline[h]={'text':match[2],'wrapper':div,'level':match[1].length,'index':h+1};h++;}
228 -context.$content.html(context.$content.html().replace(/[\r?\n]/g,"<br>"));context.$content.each(traverseTextNodes);var lastLevel=0;var nLevel=0;for(var i=0;i<outline.length;i++){if(outline[i].level>lastLevel){nLevel++;}
 228+context.$content.html(context.$content.html().replace(/\r?\n/g,"<br>"));context.$content.each(traverseTextNodes);var lastLevel=0;var nLevel=0;for(var i=0;i<outline.length;i++){if(outline[i].level>lastLevel){nLevel++;}
229229 else if(outline[i].level<lastLevel){nLevel-=Math.max(1,lastLevel-outline[i].level);}
230230 if(nLevel<=0){nLevel=1;}
231231 outline[i].nLevel=nLevel;lastLevel=outline[i].level;}

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r60098Fixing the NTOC buidling in Safari, and probably other webkit browsers. Fixin...adam23:09, 15 December 2009

Status & tagging log