Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -72,13 +72,13 @@ |
73 | 73 | array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 12 ), |
74 | 74 | array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 17 ), |
75 | 75 | array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 7 ), |
76 | | - array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 23 ), |
| 76 | + array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 24 ), |
77 | 77 | ), |
78 | 78 | 'combined' => array( |
79 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 54 ), |
| 79 | + array( 'src' => 'js/plugins.combined.js', 'version' => 55 ), |
80 | 80 | ), |
81 | 81 | 'minified' => array( |
82 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 54 ), |
| 82 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 55 ), |
83 | 83 | ), |
84 | 84 | ), |
85 | 85 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toc.js |
— | — | @@ -136,24 +136,24 @@ |
137 | 137 | function buildList( structure ) { |
138 | 138 | var list = $( '<ul></ul>' ); |
139 | 139 | for ( i in structure ) { |
140 | | - var item = $( '<li></li>' ) |
141 | | - .append( |
142 | | - $( '<div></div>' ) |
143 | | - .attr( 'href', '#' ) |
144 | | - .addClass( 'section-' + structure[i].index ) |
145 | | - .data( 'textbox', context.$textarea ) |
146 | | - .data( 'position', structure[i].position ) |
147 | | - .bind( 'mousedown', function( event ) { |
148 | | - $(this).data( 'textbox' ) |
149 | | - .focus() |
150 | | - .setSelection( $(this).data( 'position' ) ) |
151 | | - .scrollToCaretPosition( true ); |
152 | | - if ( typeof $.trackAction != 'undefined' ) |
153 | | - $.trackAction( 'ntoc.heading' ); |
154 | | - event.preventDefault(); |
155 | | - } ) |
156 | | - .text( structure[i].text ) |
157 | | - ); |
| 140 | + var div = $( '<div></div>' ) |
| 141 | + .attr( 'href', '#' ) |
| 142 | + .addClass( 'section-' + structure[i].index ) |
| 143 | + .data( 'textbox', context.$textarea ) |
| 144 | + .data( 'position', structure[i].position ) |
| 145 | + .bind( 'mousedown', function( event ) { |
| 146 | + $(this).data( 'textbox' ) |
| 147 | + .focus() |
| 148 | + .setSelection( $(this).data( 'position' ) ) |
| 149 | + .scrollToCaretPosition( true ); |
| 150 | + if ( typeof $.trackAction != 'undefined' ) |
| 151 | + $.trackAction( 'ntoc.heading' ); |
| 152 | + event.preventDefault(); |
| 153 | + } ) |
| 154 | + .text( structure[i].text ); |
| 155 | + if ( structure[i].text == '' ) |
| 156 | + div.html( ' ' ); |
| 157 | + var item = $( '<li></li>' ).append( div ); |
158 | 158 | if ( structure[i].sections !== undefined ) { |
159 | 159 | item.append( buildList( structure[i].sections ) ); |
160 | 160 | } |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -2363,24 +2363,24 @@ |
2364 | 2364 | function buildList( structure ) { |
2365 | 2365 | var list = $( '<ul></ul>' ); |
2366 | 2366 | for ( i in structure ) { |
2367 | | - var item = $( '<li></li>' ) |
2368 | | - .append( |
2369 | | - $( '<div></div>' ) |
2370 | | - .attr( 'href', '#' ) |
2371 | | - .addClass( 'section-' + structure[i].index ) |
2372 | | - .data( 'textbox', context.$textarea ) |
2373 | | - .data( 'position', structure[i].position ) |
2374 | | - .bind( 'mousedown', function( event ) { |
2375 | | - $(this).data( 'textbox' ) |
2376 | | - .focus() |
2377 | | - .setSelection( $(this).data( 'position' ) ) |
2378 | | - .scrollToCaretPosition( true ); |
2379 | | - if ( typeof $.trackAction != 'undefined' ) |
2380 | | - $.trackAction( 'ntoc.heading' ); |
2381 | | - event.preventDefault(); |
2382 | | - } ) |
2383 | | - .text( structure[i].text ) |
2384 | | - ); |
| 2367 | + var div = $( '<div></div>' ) |
| 2368 | + .attr( 'href', '#' ) |
| 2369 | + .addClass( 'section-' + structure[i].index ) |
| 2370 | + .data( 'textbox', context.$textarea ) |
| 2371 | + .data( 'position', structure[i].position ) |
| 2372 | + .bind( 'mousedown', function( event ) { |
| 2373 | + $(this).data( 'textbox' ) |
| 2374 | + .focus() |
| 2375 | + .setSelection( $(this).data( 'position' ) ) |
| 2376 | + .scrollToCaretPosition( true ); |
| 2377 | + if ( typeof $.trackAction != 'undefined' ) |
| 2378 | + $.trackAction( 'ntoc.heading' ); |
| 2379 | + event.preventDefault(); |
| 2380 | + } ) |
| 2381 | + .text( structure[i].text ); |
| 2382 | + if ( structure[i].text == '' ) |
| 2383 | + div.html( ' ' ); |
| 2384 | + var item = $( '<li></li>' ).append( div ); |
2385 | 2385 | if ( structure[i].sections !== undefined ) { |
2386 | 2386 | item.append( buildList( structure[i].sections ) ); |
2387 | 2387 | } |
— | — | @@ -2402,7 +2402,7 @@ |
2403 | 2403 | $(this).find('ul:first').hide(); |
2404 | 2404 | } ) |
2405 | 2405 | .prev() |
2406 | | - .animate( {'marginRight': $e.outerWidth()+1}, 'fast', function(){ |
| 2406 | + .animate( {'marginRight': $e.outerWidth() + 1 }, 'fast', function(){ |
2407 | 2407 | $('#wikiEditor-ui-toc-collapse') |
2408 | 2408 | .removeClass('wikiEditor-ui-toc-collapse-open') |
2409 | 2409 | .addClass('wikiEditor-ui-toc-collapse-closed'); |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -149,8 +149,9 @@ |
150 | 150 | context.modules.$toc.scrollTop(scrollTop+relTop+sectionHeight-divHeight);}},build:function(context){function buildStructure(outline,offset,level){if(offset==undefined)offset=0;if(level==undefined)level=1;var sections=[];for(var i=offset;i<outline.length;i++){if(outline[i].nLevel==level){var sub=buildStructure(outline,i+1,level+1);if(sub.length){outline[i].sections=sub;} |
151 | 151 | sections[sections.length]=outline[i];}else if(outline[i].nLevel<level){break;}} |
152 | 152 | return sections;} |
153 | | -function buildList(structure){var list=$('<ul></ul>');for(i in structure){var item=$('<li></li>').append($('<div></div>').attr('href','#').addClass('section-'+structure[i].index).data('textbox',context.$textarea).data('position',structure[i].position).bind('mousedown',function(event){$(this).data('textbox').focus().setSelection($(this).data('position')).scrollToCaretPosition(true);if(typeof $.trackAction!='undefined') |
154 | | -$.trackAction('ntoc.heading');event.preventDefault();}).text(structure[i].text));if(structure[i].sections!==undefined){item.append(buildList(structure[i].sections));} |
| 153 | +function buildList(structure){var list=$('<ul></ul>');for(i in structure){var div=$('<div></div>').attr('href','#').addClass('section-'+structure[i].index).data('textbox',context.$textarea).data('position',structure[i].position).bind('mousedown',function(event){$(this).data('textbox').focus().setSelection($(this).data('position')).scrollToCaretPosition(true);if(typeof $.trackAction!='undefined') |
| 154 | +$.trackAction('ntoc.heading');event.preventDefault();}).text(structure[i].text);if(structure[i].text=='') |
| 155 | +div.html(' ');var item=$('<li></li>').append(div);if(structure[i].sections!==undefined){item.append(buildList(structure[i].sections));} |
155 | 156 | list.append(item);} |
156 | 157 | return list;} |
157 | 158 | function buildCollapseBar(){var $collapseBar=$('<div />').addClass('wikiEditor-ui-toc-collapse-open').attr('id','wikiEditor-ui-toc-collapse').data('oWidth',$.wikiEditor.modules.toc.defaults.width).bind('mouseup',function(){var $e=$(this);var close=$e.hasClass('wikiEditor-ui-toc-collapse-open');if(close){$e.parent().animate({'width':$e.outerWidth()},'fast',function(){$(this).find('ul:first').hide();}).prev().animate({'marginRight':$e.outerWidth()+1},'fast',function(){$('#wikiEditor-ui-toc-collapse').removeClass('wikiEditor-ui-toc-collapse-open').addClass('wikiEditor-ui-toc-collapse-closed');});}else{$e.siblings().show().parent().animate({'width':$e.data('oWidth')},'fast').prev().animate({'marginRight':$e.data('oWidth')},'fast',function(){$('#wikiEditor-ui-toc-collapse').removeClass('wikiEditor-ui-toc-collapse-closed').addClass('wikiEditor-ui-toc-collapse-open');});}});return $collapseBar;} |