Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toc.js |
— | — | @@ -187,7 +187,7 @@ |
188 | 188 | break; |
189 | 189 | } |
190 | 190 | } |
191 | | - // Use the lowest common denominator as the actual level |
| 191 | + // Use the lowest number of =s as the actual level |
192 | 192 | var level = Math.min( startLevel, endLevel ); |
193 | 193 | text = $.trim( text.substr( level, text.length - ( level * 2 ) ) ); |
194 | 194 | // Add the heading data to the outline |
— | — | @@ -212,7 +212,7 @@ |
213 | 213 | nLevel -= Math.max( 1, lastLevel - outline[i].level ); |
214 | 214 | } |
215 | 215 | outline[i].nLevel = nLevel; |
216 | | - lastLevel = nLevel; |
| 216 | + lastLevel = outline[i].level; |
217 | 217 | } |
218 | 218 | // Recursively build the structure and add special item for |
219 | 219 | // section 0, if needed |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -867,7 +867,7 @@ |
868 | 868 | break; |
869 | 869 | } |
870 | 870 | } |
871 | | - // Use the lowest common denominator as the actual level |
| 871 | + // Use the lowest number of =s as the actual level |
872 | 872 | var level = Math.min( startLevel, endLevel ); |
873 | 873 | text = $.trim( text.substr( level, text.length - ( level * 2 ) ) ); |
874 | 874 | // Add the heading data to the outline |
— | — | @@ -892,7 +892,7 @@ |
893 | 893 | nLevel -= Math.max( 1, lastLevel - outline[i].level ); |
894 | 894 | } |
895 | 895 | outline[i].nLevel = nLevel; |
896 | | - lastLevel = nLevel; |
| 896 | + lastLevel = outline[i].level; |
897 | 897 | } |
898 | 898 | // Recursively build the structure and add special item for |
899 | 899 | // section 0, if needed |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -68,7 +68,7 @@ |
69 | 69 | var level=Math.min(startLevel,endLevel);text=$.trim(text.substr(level,text.length-(level*2)));outline[h]={'text':text,'position':position,'level':level,'index':h+1};} |
70 | 70 | var lastLevel=0;var nLevel=0;for(var i=0;i<outline.length;i++){if(outline[i].level>lastLevel){nLevel++;} |
71 | 71 | else if(outline[i].level<lastLevel){nLevel-=Math.max(1,lastLevel-outline[i].level);} |
72 | | -outline[i].nLevel=nLevel;lastLevel=nLevel;} |
| 72 | +outline[i].nLevel=nLevel;lastLevel=outline[i].level;} |
73 | 73 | var structure=buildStructure(outline);if($('input[name=wpSection]').val()=='') |
74 | 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;} |
75 | 75 | $sections.append($.wikiEditor.modules.toolbar.fn.buildSection(context,section,data[type][section]));$tabs.append($.wikiEditor.modules.toolbar.fn.buildTab(context,section,data[type][section]));} |