Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -73,7 +73,7 @@ |
74 | 74 | array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 7 ), |
75 | 75 | array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 27 ), |
76 | 76 | array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 172 ), |
77 | | - array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 46 ), |
| 77 | + array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 47 ), |
78 | 78 | array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 52 ), |
79 | 79 | array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 21 ), |
80 | 80 | array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 97 ), |
— | — | @@ -82,10 +82,10 @@ |
83 | 83 | array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 3 ), |
84 | 84 | ), |
85 | 85 | 'combined' => array( |
86 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 345 ), |
| 86 | + array( 'src' => 'js/plugins.combined.js', 'version' => 346 ), |
87 | 87 | ), |
88 | 88 | 'minified' => array( |
89 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 345 ), |
| 89 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 346 ), |
90 | 90 | ), |
91 | 91 | ), |
92 | 92 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.highlight.js |
— | — | @@ -174,7 +174,7 @@ |
175 | 175 | // Store visited markers here so we know which markers should be removed |
176 | 176 | var visited = [], v = 0; |
177 | 177 | for ( var i = 0; i < markers.length; i++ ) { |
178 | | - if ( markers[i].skipDivision && ( division == markers[i].skipDivision ) ) { |
| 178 | + if ( typeof markers[i].skipDivision !== 'undefined' && ( division == markers[i].skipDivision ) ) { |
179 | 179 | continue; |
180 | 180 | } |
181 | 181 | |
— | — | @@ -344,6 +344,10 @@ |
345 | 345 | |
346 | 346 | // Remove this marker |
347 | 347 | var marker = $(this).data( 'marker' ); |
| 348 | + if ( typeof marker.skipDivision != 'undefined' && ( division == marker.skipDivision ) ) { |
| 349 | + // Don't remove these either |
| 350 | + return true; |
| 351 | + } |
348 | 352 | if ( marker && typeof marker.beforeUnwrap == 'function' ) |
349 | 353 | marker.beforeUnwrap( this ); |
350 | 354 | if ( ( marker && marker.anchor == 'tag' ) || $(this).is( 'p' ) ) { |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -8708,7 +8708,7 @@ |
8709 | 8709 | // Store visited markers here so we know which markers should be removed |
8710 | 8710 | var visited = [], v = 0; |
8711 | 8711 | for ( var i = 0; i < markers.length; i++ ) { |
8712 | | - if ( markers[i].skipDivision && ( division == markers[i].skipDivision ) ) { |
| 8712 | + if ( typeof markers[i].skipDivision !== 'undefined' && ( division == markers[i].skipDivision ) ) { |
8713 | 8713 | continue; |
8714 | 8714 | } |
8715 | 8715 | |
— | — | @@ -8878,6 +8878,10 @@ |
8879 | 8879 | |
8880 | 8880 | // Remove this marker |
8881 | 8881 | var marker = $(this).data( 'marker' ); |
| 8882 | + if ( typeof marker.skipDivision != 'undefined' && ( division == marker.skipDivision ) ) { |
| 8883 | + // Don't remove these either |
| 8884 | + return true; |
| 8885 | + } |
8882 | 8886 | if ( marker && typeof marker.beforeUnwrap == 'function' ) |
8883 | 8887 | marker.beforeUnwrap( this ); |
8884 | 8888 | if ( ( marker && marker.anchor == 'tag' ) || $(this).is( 'p' ) ) { |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -590,7 +590,7 @@ |
591 | 591 | tokenArray.push(new Token(match.index+oldOffset+markOffset,label,tokenStart,match));oldOffset+=match.index+match[0].length;newSubstring=text.substring(oldOffset);match=newSubstring.match(regex);}}}} |
592 | 592 | tokenArray.sort(function(a,b){return a.offset-b.offset||a.tokenStart-b.tokenStart;});context.fn.trigger('scan');},mark:function(context,division,tokens){var markers=context.modules.highlight.markers=[];context.fn.trigger('mark');markers.sort(function(a,b){return a.start-b.start||a.end-b.end;});var markersStr='';for(var i=0;i<markers.length;i++){markersStr+=markers[i].start+','+markers[i].end+','+markers[i].type+',';} |
593 | 593 | if(context.modules.highlight.markersStr==markersStr){return;} |
594 | | -context.modules.highlight.markersStr=markersStr;var visited=[],v=0;for(var i=0;i<markers.length;i++){if(markers[i].skipDivision&&(division==markers[i].skipDivision)){continue;} |
| 594 | +context.modules.highlight.markersStr=markersStr;var visited=[],v=0;for(var i=0;i<markers.length;i++){if(typeof markers[i].skipDivision!=='undefined'&&(division==markers[i].skipDivision)){continue;} |
595 | 595 | var start=markers[i].start;var s=context.fn.getOffset(start);if(!s){continue;} |
596 | 596 | var startNode=s.node;while(startNode.nodeName=='BR'||s.offset==startNode.nodeValue.length){start++;s=context.fn.getOffset(start);startNode=s.node;} |
597 | 597 | if(s.offset>0&&s.node.nodeName=='#text'){startNode=startNode.splitText(s.offset<s.node.nodeValue.length?s.offset:s.node.nodeValue.length-1);context.fn.purgeOffsets();} |
— | — | @@ -608,7 +608,8 @@ |
609 | 609 | $(anchor).data('marker',markers[i]).addClass('wikiEditor-highlight');markers[i].afterWrap(anchor,markers[i]);}else{$(anchor).data('marker',markers[i]);markers[i].onSkip(anchor);} |
610 | 610 | visited[v++]=anchor;}} |
611 | 611 | var j=0;context.$content.find('.wikiEditor-highlight').each(function(){if(visited[j]==this){j++;return true;} |
612 | | -var marker=$(this).data('marker');if(marker&&typeof marker.beforeUnwrap=='function') |
| 612 | +var marker=$(this).data('marker');if(typeof marker.skipDivision!='undefined'&&(division==marker.skipDivision)){return true;} |
| 613 | +if(marker&&typeof marker.beforeUnwrap=='function') |
613 | 614 | marker.beforeUnwrap(this);if((marker&&marker.anchor=='tag')||$(this).is('p')){$(this).removeAttr('class');}else{$(this).replaceWith(this.childNodes);} |
614 | 615 | context.fn.purgeOffsets();});}}};})(jQuery);(function($){$.wikiEditor.modules.preview={'browsers':{'ltr':{'msie':[['>=',7]],'firefox':[['>=',3]],'opera':[['>=',9.6]],'safari':[['>=',4]]},'rtl':{'msie':[['>=',8]],'firefox':[['>=',3]],'opera':[['>=',9.6]],'safari':[['>=',4]]}},fn:{create:function(context,config){if('initialized'in context.modules.preview){return;} |
615 | 616 | context.modules.preview={'initialized':true,'previewText':null,'changesText':null};context.modules.preview.$preview=context.fn.addView({'name':'preview','titleMsg':'wikieditor-preview-tab','init':function(context){var wikitext=context.fn.getContents();if(context.modules.preview.previewText==wikitext){return;} |