r55172 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55171‎ | r55172 | r55173 >
Date:10:36, 17 August 2009
Author:catrope
Status:deferred
Tags:
Comment:
NavigableTOC: Don't add section 0 link for section edits
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
@@ -59,13 +59,13 @@
6060 array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 9 ),
6161 array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 4 ),
6262 array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 10 ),
63 - array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 4 ),
 63+ array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 5 ),
6464 ),
6565 'combined' => array(
66 - array( 'src' => 'js/plugins.combined.js', 'version' => 14 ),
 66+ array( 'src' => 'js/plugins.combined.js', 'version' => 15 ),
6767 ),
6868 'minified' => array(
69 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 14 ),
 69+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 15 ),
7070 ),
7171 ),
7272 );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toc.js
@@ -214,11 +214,16 @@
215215 outline[i].nLevel = nLevel;
216216 lastLevel = nLevel;
217217 }
218 - // Recursively build the structure and adds special item for section 0
 218+ // Recursively build the structure and add special item for
 219+ // section 0, if needed
219220 var structure = buildStructure( outline );
220 - structure.unshift(
221 - { 'text': wgPageName.replace(/_/g, ' '), 'level': 1, 'index': 0, 'position': 0 }
222 - );
 221+ if ( $( 'input[name=wpSection]' ).val() == '' )
 222+ structure.unshift( {
 223+ 'text': wgPageName.replace(/_/g, ' '),
 224+ 'level': 1,
 225+ 'index': 0,
 226+ 'position': 0
 227+ });
223228 context.modules.$toc.html( buildList( structure ) );
224229 // Cache the outline for later use
225230 context.data.outline = outline;
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -894,11 +894,16 @@
895895 outline[i].nLevel = nLevel;
896896 lastLevel = nLevel;
897897 }
898 - // Recursively build the structure and adds special item for section 0
 898+ // Recursively build the structure and add special item for
 899+ // section 0, if needed
899900 var structure = buildStructure( outline );
900 - structure.unshift(
901 - { 'text': wgPageName.replace(/_/g, ' '), 'level': 1, 'index': 0, 'position': 0 }
902 - );
 901+ if ( $( 'input[name=wpSection]' ).val() == '' )
 902+ structure.unshift( {
 903+ 'text': wgPageName.replace(/_/g, ' '),
 904+ 'level': 1,
 905+ 'index': 0,
 906+ 'position': 0
 907+ });
903908 context.modules.$toc.html( buildList( structure ) );
904909 // Cache the outline for later use
905910 context.data.outline = outline;
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -69,7 +69,8 @@
7070 var lastLevel=0;var nLevel=0;for(var i=0;i<outline.length;i++){if(outline[i].level>lastLevel){nLevel++;}
7171 else if(outline[i].level<lastLevel){nLevel-=Math.max(1,lastLevel-outline[i].level);}
7272 outline[i].nLevel=nLevel;lastLevel=nLevel;}
73 -var structure=buildStructure(outline);structure.unshift({'text':wgPageName.replace(/_/g,' '),'level':1,'index':0,'position':0});context.modules.$toc.html(buildList(structure));context.data.outline=outline;}}};})(jQuery);(function($){$.wikiEditor.modules.toolbar={imgPath:wgScriptPath+'/extensions/UsabilityInitiative/images/wikiEditor/toolbar/',api:{addToToolbar:function(context,data){for(type in data){switch(type){case'sections':var $sections=context.modules.$toolbar.find('div.sections');var $tabs=context.modules.$toolbar.find('div.tabs');for(section in data[type]){if(section=='main'){context.modules.$toolbar.prepend($.wikiEditor.modules.toolbar.fn.buildSection(context,section,data[type][section]));continue;}
 73+var structure=buildStructure(outline);if($('input[name=wpSection]').val()=='')
 74+structure.unshift({'text':wgPageName.replace(/_/g,' '),'level':1,'index':0,'position':0});context.modules.$toc.html(buildList(structure));context.data.outline=outline;}}};})(jQuery);(function($){$.wikiEditor.modules.toolbar={imgPath:wgScriptPath+'/extensions/UsabilityInitiative/images/wikiEditor/toolbar/',api:{addToToolbar:function(context,data){for(type in data){switch(type){case'sections':var $sections=context.modules.$toolbar.find('div.sections');var $tabs=context.modules.$toolbar.find('div.tabs');for(section in data[type]){if(section=='main'){context.modules.$toolbar.prepend($.wikiEditor.modules.toolbar.fn.buildSection(context,section,data[type][section]));continue;}
7475 $sections.append($.wikiEditor.modules.toolbar.fn.buildSection(context,section,data[type][section]));$tabs.append($.wikiEditor.modules.toolbar.fn.buildTab(context,section,data[type][section]));}
7576 break;case'groups':if(!('section'in data)){continue;}
7677 var $section=context.modules.$toolbar.find('div[rel='+data.section+'].section');for(group in data[type]){$section.append($.wikiEditor.modules.toolbar.fn.buildGroup(context,group,data[type][group]));}

Status & tagging log