Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -88,16 +88,16 @@ |
89 | 89 | array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 12 ), |
90 | 90 | array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 40 ), |
91 | 91 | array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 10 ), |
92 | | - array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 58 ), |
| 92 | + array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 59 ), |
93 | 93 | array( 'src' => 'js/plugins/jquery.wikiEditor.preview.js', 'version' => 9 ), |
94 | 94 | array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 14 ), |
95 | 95 | array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 1 ), |
96 | 96 | ), |
97 | 97 | 'combined' => array( |
98 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 137 ), |
| 98 | + array( 'src' => 'js/plugins.combined.js', 'version' => 138 ), |
99 | 99 | ), |
100 | 100 | 'minified' => array( |
101 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 137 ), |
| 101 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 138 ), |
102 | 102 | ), |
103 | 103 | ), |
104 | 104 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toc.js |
— | — | @@ -22,6 +22,9 @@ |
23 | 23 | * Event handlers |
24 | 24 | */ |
25 | 25 | evt: { |
| 26 | + change: function( context, event ) { |
| 27 | + $.wikiEditor.modules.toc.fn.update( context ); |
| 28 | + }, |
26 | 29 | ready: function( context, event ) { |
27 | 30 | // Add the TOC to the document |
28 | 31 | $.wikiEditor.modules.toc.fn.build( context ); |
— | — | @@ -145,7 +148,8 @@ |
146 | 149 | * @param {Object} event Event object with context as data |
147 | 150 | */ |
148 | 151 | collapse: function( event ) { |
149 | | - var $this = $( this ), context = $this.data( 'context' ), |
| 152 | + var $this = $( this ), |
| 153 | + context = $this.data( 'context' ), |
150 | 154 | pT = $this.parent().position().top - 1; |
151 | 155 | $this.parent() |
152 | 156 | .css( { |
— | — | @@ -247,7 +251,7 @@ |
248 | 252 | .addClass( 'section-' + structure[i].index ) |
249 | 253 | .data( 'wrapper', wrapper ) |
250 | 254 | .click( function( event ) { |
251 | | - context.fn.scrollToTop( $(this).data( 'wrapper' ) ); |
| 255 | + context.fn.scrollToTop( $( this ).data( 'wrapper' ) ); |
252 | 256 | context.$textarea.textSelection( 'setSelection', { |
253 | 257 | 'start': 0, |
254 | 258 | 'startContainer': $(this).data( 'wrapper' ) |
— | — | @@ -255,7 +259,7 @@ |
256 | 260 | |
257 | 261 | // Highlight the clicked link |
258 | 262 | $.wikiEditor.modules.toc.fn.unhighlight( context ); |
259 | | - $(this).addClass( 'current' ); |
| 263 | + $( this ).addClass( 'current' ); |
260 | 264 | |
261 | 265 | if ( typeof $.trackAction != 'undefined' ) |
262 | 266 | $.trackAction( 'ntoc.heading' ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -8352,6 +8352,9 @@ |
8353 | 8353 | * Event handlers |
8354 | 8354 | */ |
8355 | 8355 | evt: { |
| 8356 | + change: function( context, event ) { |
| 8357 | + $.wikiEditor.modules.toc.fn.update( context ); |
| 8358 | + }, |
8356 | 8359 | ready: function( context, event ) { |
8357 | 8360 | // Add the TOC to the document |
8358 | 8361 | $.wikiEditor.modules.toc.fn.build( context ); |
— | — | @@ -8475,7 +8478,8 @@ |
8476 | 8479 | * @param {Object} event Event object with context as data |
8477 | 8480 | */ |
8478 | 8481 | collapse: function( event ) { |
8479 | | - var $this = $( this ), context = $this.data( 'context' ), |
| 8482 | + var $this = $( this ), |
| 8483 | + context = $this.data( 'context' ), |
8480 | 8484 | pT = $this.parent().position().top - 1; |
8481 | 8485 | $this.parent() |
8482 | 8486 | .css( { |
— | — | @@ -8577,7 +8581,7 @@ |
8578 | 8582 | .addClass( 'section-' + structure[i].index ) |
8579 | 8583 | .data( 'wrapper', wrapper ) |
8580 | 8584 | .click( function( event ) { |
8581 | | - context.fn.scrollToTop( $(this).data( 'wrapper' ) ); |
| 8585 | + context.fn.scrollToTop( $( this ).data( 'wrapper' ) ); |
8582 | 8586 | context.$textarea.textSelection( 'setSelection', { |
8583 | 8587 | 'start': 0, |
8584 | 8588 | 'startContainer': $(this).data( 'wrapper' ) |
— | — | @@ -8585,7 +8589,7 @@ |
8586 | 8590 | |
8587 | 8591 | // Highlight the clicked link |
8588 | 8592 | $.wikiEditor.modules.toc.fn.unhighlight( context ); |
8589 | | - $(this).addClass( 'current' ); |
| 8593 | + $( this ).addClass( 'current' ); |
8590 | 8594 | |
8591 | 8595 | if ( typeof $.trackAction != 'undefined' ) |
8592 | 8596 | $.trackAction( 'ntoc.heading' ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -553,7 +553,7 @@ |
554 | 554 | nameEndIndex=nameEnd.index+oldDivider+2;ranges.push(new Range(ranges[ranges.length-1].end,nameBeginIndex));nameIndex=ranges.push(new Range(nameBeginIndex,nameEndIndex))-1;currentValue=currentField.substring(currentField.indexOf('=')+1);oldDivider+=currentField.indexOf('=')+1;valueBegin=currentValue.match(/\S+/);if(valueBegin==null){continue;} |
555 | 555 | valueBeginIndex=valueBegin.index+oldDivider+1;valueEnd=currentValue.match(/[^\s]\s*$/);if(valueEnd==null){continue;} |
556 | 556 | valueEndIndex=valueEnd.index+oldDivider+2;equalsIndex=ranges.push(new Range(ranges[ranges.length-1].end,valueBeginIndex))-1;valueIndex=ranges.push(new Range(valueBeginIndex,valueEndIndex))-1;params.push(new Param(wikitext.substring(nameBeginIndex,nameEndIndex),wikitext.substring(valueBeginIndex,valueEndIndex),currentParamNumber,nameIndex,equalsIndex,valueIndex));paramsByName[wikitext.substring(nameBeginIndex,nameEndIndex)]=currentParamNumber;}} |
557 | | -ranges.push(new Range(valueEndIndex,wikitext.length));this.ranges=ranges;this.wikitext=wikitext;this.params=params;this.paramsByName=paramsByName;this.templateNameIndex=templateNameIndex;}}};})(jQuery);(function($){$.wikiEditor.modules.toc={cfg:{defaultWidth:'166px',minimumWidth:'70px',rtl:false},api:{},evt:{ready:function(context,event){$.wikiEditor.modules.toc.fn.build(context);context.$content.parent().blur(function(event){var context=event.data.context;$.wikiEditor.modules.toc.fn.unhighlight(context);});},resize:function(context,event){context.modules.toc.$toc.height(context.$ui.find('.wikiEditor-ui-left').height()- |
| 557 | +ranges.push(new Range(valueEndIndex,wikitext.length));this.ranges=ranges;this.wikitext=wikitext;this.params=params;this.paramsByName=paramsByName;this.templateNameIndex=templateNameIndex;}}};})(jQuery);(function($){$.wikiEditor.modules.toc={cfg:{defaultWidth:'166px',minimumWidth:'70px',rtl:false},api:{},evt:{change:function(context,event){$.wikiEditor.modules.toc.fn.update(context);},ready:function(context,event){$.wikiEditor.modules.toc.fn.build(context);context.$content.parent().blur(function(event){var context=event.data.context;$.wikiEditor.modules.toc.fn.unhighlight(context);});},resize:function(context,event){context.modules.toc.$toc.height(context.$ui.find('.wikiEditor-ui-left').height()- |
558 | 558 | context.$ui.find('.tab-toc').outerHeight());},mark:function(context,event){var markers=context.modules.highlight.markers;var tokenArray=context.modules.highlight.tokenArray;var outline=context.data.outline=[];var h=0;for(var i=0;i<tokenArray.length;i++){if(tokenArray[i].label!='TOC_HEADER'){continue;} |
559 | 559 | h++;markers.push({index:h,start:tokenArray[i].tokenStart,end:tokenArray[i].offset,afterWrap:function(node){var marker=$(node).data('marker');$(node).addClass('wikiEditor-toc-header').addClass('wikiEditor-toc-section-'+marker.index).data('section',marker.index);},getWrapper:function(ca1,ca2){return $(ca1.parentNode).is('div.wikiEditor-toc-header')&&ca1.previousSibling==null&&ca1.nextSibling==null?ca1.parentNode:null;}});outline.push({'text':tokenArray[i].match[2],'level':tokenArray[i].match[1].length,'index':h});} |
560 | 560 | $.wikiEditor.modules.toc.fn.build(context);$.wikiEditor.modules.toc.fn.update(context);}},exp:[{'regex':/^(={1,6})(.+?)\1\s*$/m,'label':'TOC_HEADER','markAfter':true}],fn:{create:function(context,config){if('$toc'in context.modules.toc){return;} |