r61031 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61030‎ | r61031 | r61032 >
Date:22:25, 13 January 2010
Author:tparscal
Status:ok
Tags:
Comment:
Found a bug in the TOC plugin that was causing problems.
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
@@ -88,16 +88,16 @@
8989 array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 12 ),
9090 array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 40 ),
9191 array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 10 ),
92 - array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 60 ),
 92+ array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 61 ),
9393 array( 'src' => 'js/plugins/jquery.wikiEditor.preview.js', 'version' => 9 ),
9494 array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 14 ),
9595 array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 1 ),
9696 ),
9797 'combined' => array(
98 - array( 'src' => 'js/plugins.combined.js', 'version' => 140 ),
 98+ array( 'src' => 'js/plugins.combined.js', 'version' => 141 ),
9999 ),
100100 'minified' => array(
101 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 140 ),
 101+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 141 ),
102102 ),
103103 ),
104104 );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toc.js
@@ -29,7 +29,7 @@
3030 // Add the TOC to the document
3131 $.wikiEditor.modules.toc.fn.build( context );
3232 context.$content.parent()
33 - .blur( function( event ) {
 33+ .blur( function() {
3434 var context = event.data.context;
3535 $.wikiEditor.modules.toc.fn.unhighlight( context );
3636 });
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -8366,7 +8366,7 @@
83678367 // Add the TOC to the document
83688368 $.wikiEditor.modules.toc.fn.build( context );
83698369 context.$content.parent()
8370 - .blur( function( event ) {
 8370+ .blur( function() {
83718371 var context = event.data.context;
83728372 $.wikiEditor.modules.toc.fn.unhighlight( context );
83738373 });
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -554,7 +554,7 @@
555555 nameEndIndex=nameEnd.index+oldDivider+2;ranges.push(new Range(ranges[ranges.length-1].end,nameBeginIndex));nameIndex=ranges.push(new Range(nameBeginIndex,nameEndIndex))-1;currentValue=currentField.substring(currentField.indexOf('=')+1);oldDivider+=currentField.indexOf('=')+1;valueBegin=currentValue.match(/\S+/);if(valueBegin==null){continue;}
556556 valueBeginIndex=valueBegin.index+oldDivider+1;valueEnd=currentValue.match(/[^\s]\s*$/);if(valueEnd==null){continue;}
557557 valueEndIndex=valueEnd.index+oldDivider+2;equalsIndex=ranges.push(new Range(ranges[ranges.length-1].end,valueBeginIndex))-1;valueIndex=ranges.push(new Range(valueBeginIndex,valueEndIndex))-1;params.push(new Param(wikitext.substring(nameBeginIndex,nameEndIndex),wikitext.substring(valueBeginIndex,valueEndIndex),currentParamNumber,nameIndex,equalsIndex,valueIndex));paramsByName[wikitext.substring(nameBeginIndex,nameEndIndex)]=currentParamNumber;}}
558 -ranges.push(new Range(valueEndIndex,wikitext.length));this.ranges=ranges;this.wikitext=wikitext;this.params=params;this.paramsByName=paramsByName;this.templateNameIndex=templateNameIndex;}}};})(jQuery);(function($){$.wikiEditor.modules.toc={cfg:{defaultWidth:'166px',minimumWidth:'70px',rtl:false},api:{},evt:{change:function(context,event){$.wikiEditor.modules.toc.fn.update(context);},ready:function(context,event){$.wikiEditor.modules.toc.fn.build(context);context.$content.parent().blur(function(event){var context=event.data.context;$.wikiEditor.modules.toc.fn.unhighlight(context);});},resize:function(context,event){context.modules.toc.$toc.height(context.$ui.find('.wikiEditor-ui-left').height()-
 558+ranges.push(new Range(valueEndIndex,wikitext.length));this.ranges=ranges;this.wikitext=wikitext;this.params=params;this.paramsByName=paramsByName;this.templateNameIndex=templateNameIndex;}}};})(jQuery);(function($){$.wikiEditor.modules.toc={cfg:{defaultWidth:'166px',minimumWidth:'70px',rtl:false},api:{},evt:{change:function(context,event){$.wikiEditor.modules.toc.fn.update(context);},ready:function(context,event){$.wikiEditor.modules.toc.fn.build(context);context.$content.parent().blur(function(){var context=event.data.context;$.wikiEditor.modules.toc.fn.unhighlight(context);});},resize:function(context,event){context.modules.toc.$toc.height(context.$ui.find('.wikiEditor-ui-left').height()-
559559 context.$ui.find('.tab-toc').outerHeight());},mark:function(context,event){var markers=context.modules.highlight.markers;var tokenArray=context.modules.highlight.tokenArray;var outline=context.data.outline=[];var h=0;for(var i=0;i<tokenArray.length;i++){if(tokenArray[i].label!='TOC_HEADER'){continue;}
560560 h++;markers.push({index:h,start:tokenArray[i].tokenStart,end:tokenArray[i].offset,afterWrap:function(node){var marker=$(node).data('marker');$(node).addClass('wikiEditor-toc-header').addClass('wikiEditor-toc-section-'+marker.index).data('section',marker.index);},getWrapper:function(ca1,ca2){return $(ca1.parentNode).is('div.wikiEditor-toc-header')&&ca1.previousSibling==null&&ca1.nextSibling==null?ca1.parentNode:null;}});outline.push({'text':tokenArray[i].match[2],'level':tokenArray[i].match[1].length,'index':h});}
561561 $.wikiEditor.modules.toc.fn.build(context);$.wikiEditor.modules.toc.fn.update(context);}},exp:[{'regex':/^(={1,6})(.+?)\1\s*$/m,'label':'TOC_HEADER','markAfter':true}],fn:{create:function(context,config){if('$toc'in context.modules.toc){return;}

Status & tagging log