Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toc.js |
— | — | @@ -391,17 +391,18 @@ |
392 | 392 | function buildList( structure ) { |
393 | 393 | var list = $( '<ul />' ); |
394 | 394 | for ( i in structure ) { |
395 | | - var wrapper = context.$content.find( '.wikiEditor-toc-section-' + structure[i].index ); |
396 | | - if ( wrapper.size() == 0 ) |
397 | | - wrapper = context.$content; |
398 | 395 | var div = $( '<div />' ) |
399 | 396 | .addClass( 'section-' + structure[i].index ) |
400 | | - .data( 'wrapper', wrapper ) |
| 397 | + .data( 'index', structure[i].index ) |
401 | 398 | .click( function( event ) { |
402 | | - context.fn.scrollToTop( $( this ).data( 'wrapper' ), true ); |
| 399 | + var wrapper = context.$content.find( |
| 400 | + '.wikiEditor-toc-section-' + $( this ).data( 'index' ) ); |
| 401 | + if ( wrapper.size() == 0 ) |
| 402 | + wrapper = context.$content; |
| 403 | + context.fn.scrollToTop( wrapper, true ); |
403 | 404 | context.$textarea.textSelection( 'setSelection', { |
404 | 405 | 'start': 0, |
405 | | - 'startContainer': $(this).data( 'wrapper' ) |
| 406 | + 'startContainer': wrapper |
406 | 407 | } ); |
407 | 408 | // Highlight the clicked link |
408 | 409 | $.wikiEditor.modules.toc.fn.unhighlight( context ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -9312,17 +9312,18 @@ |
9313 | 9313 | function buildList( structure ) { |
9314 | 9314 | var list = $( '<ul />' ); |
9315 | 9315 | for ( i in structure ) { |
9316 | | - var wrapper = context.$content.find( '.wikiEditor-toc-section-' + structure[i].index ); |
9317 | | - if ( wrapper.size() == 0 ) |
9318 | | - wrapper = context.$content; |
9319 | 9316 | var div = $( '<div />' ) |
9320 | 9317 | .addClass( 'section-' + structure[i].index ) |
9321 | | - .data( 'wrapper', wrapper ) |
| 9318 | + .data( 'index', structure[i].index ) |
9322 | 9319 | .click( function( event ) { |
9323 | | - context.fn.scrollToTop( $( this ).data( 'wrapper' ), true ); |
| 9320 | + var wrapper = context.$content.find( |
| 9321 | + '.wikiEditor-toc-section-' + $( this ).data( 'index' ) ); |
| 9322 | + if ( wrapper.size() == 0 ) |
| 9323 | + wrapper = context.$content; |
| 9324 | + context.fn.scrollToTop( wrapper, true ); |
9324 | 9325 | context.$textarea.textSelection( 'setSelection', { |
9325 | 9326 | 'start': 0, |
9326 | | - 'startContainer': $(this).data( 'wrapper' ) |
| 9327 | + 'startContainer': wrapper |
9327 | 9328 | } ); |
9328 | 9329 | // Highlight the clicked link |
9329 | 9330 | $.wikiEditor.modules.toc.fn.unhighlight( context ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -622,8 +622,8 @@ |
623 | 623 | var pT=$this.parent().position().top-1;context.modules.toc.$toc.data('collapsed',true);context.$ui.find('.wikiEditor-ui-left').animate({'marginRight':'-1px'},'fast',function(){$(this).css('marginRight',0);}).children().animate({'marginRight':'1px'},'fast',function(){$(this).css('marginRight',0);});context.$ui.find('.wikiEditor-ui-right').css({'marginTop':'1px','position':'absolute','left':$.wikiEditor.modules.toc.cfg.rtl?0:'auto','right':$.wikiEditor.modules.toc.cfg.rtl?'auto':0,'top':pT}).fadeOut('fast',function(){$(this).hide().css({'marginTop':'0','width':'1px'});context.$ui.find('.wikiEditor-ui-toc-expandControl').fadeIn('fast');context.fn.trigger('tocCollapse');context.fn.trigger('resize');});$.cookie('wikiEditor-'+context.instance+'-toc-width',0);return false;},expand:function(event){var $this=$(this),context=$this.data('context'),openWidth=parseFloat(context.modules.toc.$toc.data('openWidth')),availableSpace=context.$wikitext.width()-parseFloat($.wikiEditor.modules.toc.cfg.textMinimumWidth);if(availableSpace<$.wikiEditor.modules.toc.cfg.textMinmumWidth)return false;context.modules.toc.$toc.data('collapsed',false);if(availableSpace<openWidth)openWidth=availableSpace;context.$ui.find('.wikiEditor-ui-toc-expandControl').hide();context.$ui.find('.wikiEditor-ui-left').animate({'marginRight':(parseFloat(openWidth)*-1)},'fast').children().animate({'marginRight':openWidth},'fast');context.$ui.find('.wikiEditor-ui-right').show().css('marginTop','1px').animate({'width':openWidth},'fast',function(){context.$content.trigger('mouseup');$(this).css({'marginTop':'0','position':'relative','right':'auto','left':'auto','top':'auto'});context.fn.trigger('tocExpand');context.fn.trigger('resize');});$.cookie('wikiEditor-'+context.instance+'-toc-width',context.modules.toc.$toc.data('openWidth'));return false;},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;} |
624 | 624 | sections[sections.length]=outline[i];}else if(outline[i].nLevel<level){break;}} |
625 | 625 | return sections;} |
626 | | -function buildList(structure){var list=$('<ul />');for(i in structure){var wrapper=context.$content.find('.wikiEditor-toc-section-'+structure[i].index);if(wrapper.size()==0) |
627 | | -wrapper=context.$content;var div=$('<div />').addClass('section-'+structure[i].index).data('wrapper',wrapper).click(function(event){context.fn.scrollToTop($(this).data('wrapper'),true);context.$textarea.textSelection('setSelection',{'start':0,'startContainer':$(this).data('wrapper')});$.wikiEditor.modules.toc.fn.unhighlight(context);$(this).addClass('current');if(typeof $.trackAction!='undefined') |
| 626 | +function buildList(structure){var list=$('<ul />');for(i in structure){var div=$('<div />').addClass('section-'+structure[i].index).data('index',structure[i].index).click(function(event){var wrapper=context.$content.find('.wikiEditor-toc-section-'+$(this).data('index'));if(wrapper.size()==0) |
| 627 | +wrapper=context.$content;context.fn.scrollToTop(wrapper,true);context.$textarea.textSelection('setSelection',{'start':0,'startContainer':wrapper});$.wikiEditor.modules.toc.fn.unhighlight(context);$(this).addClass('current');if(typeof $.trackAction!='undefined') |
628 | 628 | $.trackAction('ntoc.heading');event.preventDefault();}).text(structure[i].text);if(structure[i].text=='') |
629 | 629 | div.html(' ');var item=$('<li />').append(div);if(structure[i].sections!==undefined){item.append(buildList(structure[i].sections));} |
630 | 630 | list.append(item);} |
Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -76,16 +76,16 @@ |
77 | 77 | array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 27 ), |
78 | 78 | array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 45 ), |
79 | 79 | array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 11 ), |
80 | | - array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 76 ), |
| 80 | + array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 77 ), |
81 | 81 | array( 'src' => 'js/plugins/jquery.wikiEditor.preview.js', 'version' => 10 ), |
82 | 82 | array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 17 ), |
83 | 83 | array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 2 ), |
84 | 84 | ), |
85 | 85 | 'combined' => array( |
86 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 205 ), |
| 86 | + array( 'src' => 'js/plugins.combined.js', 'version' => 206 ), |
87 | 87 | ), |
88 | 88 | 'minified' => array( |
89 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 205 ), |
| 89 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 206 ), |
90 | 90 | ), |
91 | 91 | ), |
92 | 92 | ); |