r54723 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54722‎ | r54723 | r54724 >
Date:14:45, 10 August 2009
Author:catrope
Status:deferred
Tags:
Comment:
NavigableTOC: Use full title with namespace prefix in TOC
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
@@ -18,13 +18,13 @@
1919 'raw' => array(
2020 array( 'src' => 'css/wikiEditor.css', 'version' => 4 ),
2121 array( 'src' => 'css/wikiEditor.toolbar.css', 'version' => 5 ),
22 - array( 'src' => 'css/wikiEditor.toc.css', 'version' => 4 ),
 22+ array( 'src' => 'css/wikiEditor.toc.css', 'version' => 5 ),
2323 ),
2424 'combined' => array(
25 - array( 'src' => 'css/combined.css', 'version' => 5 ),
 25+ array( 'src' => 'css/combined.css', 'version' => 6 ),
2626 ),
2727 'minified' => array(
28 - array( 'src' => 'css/combined.min.css', 'version' => 5 ),
 28+ array( 'src' => 'css/combined.min.css', 'version' => 6 ),
2929 ),
3030 )
3131 );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toc.js
@@ -217,7 +217,7 @@
218218 // Recursively build the structure and adds special item for section 0
219219 var structure = buildStructure( outline );
220220 structure.unshift(
221 - { 'text': wgTitle, 'level': 1, 'index': 0, 'position': 0 }
 221+ { 'text': wgPageName.replace(/_/g, ' '), 'level': 1, 'index': 0, 'position': 0 }
222222 );
223223 context.modules.$toc.html( buildList( structure ) );
224224 // Cache the outline for later use
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -859,7 +859,7 @@
860860 // Recursively build the structure and adds special item for section 0
861861 var structure = buildStructure( outline );
862862 structure.unshift(
863 - { 'text': wgTitle, 'level': 1, 'index': 0, 'position': 0 }
 863+ { 'text': wgPageName.replace(/_/g, ' '), 'level': 1, 'index': 0, 'position': 0 }
864864 );
865865 context.modules.$toc.html( buildList( structure ) );
866866 // Cache the outline for later use
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -62,7 +62,7 @@
6363 var lastLevel=0;var nLevel=0;for(var i=0;i<outline.length;i++){if(outline[i].level>lastLevel){nLevel++;}
6464 else if(outline[i].level<lastLevel){nLevel-=Math.max(1,lastLevel-outline[i].level);}
6565 outline[i].nLevel=nLevel;lastLevel=nLevel;}
66 -var structure=buildStructure(outline);structure.unshift({'text':wgTitle,'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){},modifyToolbar:function(context,data){},removeFromToolbar:function(context,data){if(typeof data.section=='string'){var selector='div[rel='+data.section+'].section';if(typeof data.group=='string'){selector+=' div[rel='+data.group+'].group';if(typeof data.tool=='string'){selector+=' div[rel='+data.tool+'].tool';}}
 66+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){},modifyToolbar:function(context,data){},removeFromToolbar:function(context,data){if(typeof data.section=='string'){var selector='div[rel='+data.section+'].section';if(typeof data.group=='string'){selector+=' div[rel='+data.group+'].group';if(typeof data.tool=='string'){selector+=' div[rel='+data.tool+'].tool';}}
6767 context.modules.$toolbar.find(selector).remove();}}},fn:{autoMsg:function(object,property){if(property in object){return object[property];}else if(property+'Msg'in object){return gM(object[property+'Msg']);}else{return'';}},create:function(context,config){if('$toolbar'in context.modules){return;}
6868 context.modules.$toolbar=$('<div></div>').addClass('wikiEditor-ui-toolbar').attr('id','wikiEditor-ui-toolbar');$.wikiEditor.modules.toolbar.fn.build(context,config);context.$ui.find('.wikiEditor-ui-top').append(context.modules.$toolbar);},doAction:function(context,action){switch(action.type){case'encapsulate':var parts={'pre':'','peri':'','post':''};for(part in parts){if(part+'Msg'in action.options){parts[part]=gM(action.options[part+'Msg'],(action.options[part]||null));}else{parts[part]=(action.options[part]||'')}}
6969 context.$textarea.encapsulateSelection(parts.pre,parts.peri,parts.post);break;default:break;}},buildSection:function(context,id,section){switch(section.type){case'toolbar':return $.wikiEditor.modules.toolbar.fn.buildToolbar(context,id,section);case'booklet':return $.wikiEditor.modules.toolbar.fn.buildBooklet(context,id,section);default:return null;}},buildToolbar:function(context,id,toolbar){var $toolbar=$('<div></div>').attr({'class':'toolbar section section-'+id,'rel':id});if('groups'in toolbar){for(group in toolbar.groups){$toolbar.append($.wikiEditor.modules.toolbar.fn.buildGroup(context,group,toolbar.groups[group]));}}

Status & tagging log