r62534 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62533‎ | r62534 | r62535 >
Date:18:39, 15 February 2010
Author:catrope
Status:resolved
Tags:
Comment:
UsabilityInitiative: Fix handling of block elements in highlight module: markers can now specify they need to break out of <p>s, which templateEditor does for wrappers that are more than just a <span>. There's still some issues left, but most of them are probably bugs in the templateEditor module rather than inadequate support in the highlighter
Modified paths:
  • /trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins.combined.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.highlight.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.templateEditor.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toc.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -72,20 +72,20 @@
7373 array( 'src' => 'js/plugins/jquery.namespaceSelect.js', 'version' => 1 ),
7474 array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 7 ),
7575 array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 27 ),
76 - array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 131 ),
77 - array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 30 ),
 76+ array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 132 ),
 77+ array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 31 ),
7878 array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 49 ),
7979 array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 15 ),
80 - array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 86 ),
 80+ array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 87 ),
8181 array( 'src' => 'js/plugins/jquery.wikiEditor.preview.js', 'version' => 10 ),
82 - array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 17 ),
 82+ array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 18 ),
8383 array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 2 ),
8484 ),
8585 'combined' => array(
86 - array( 'src' => 'js/plugins.combined.js', 'version' => 253 ),
 86+ array( 'src' => 'js/plugins.combined.js', 'version' => 254 ),
8787 ),
8888 'minified' => array(
89 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 253 ),
 89+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 254 ),
9090 ),
9191 ),
9292 );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.templateEditor.js
@@ -53,24 +53,29 @@
5454 }
5555 }//while finding template ending
5656 if ( endIndex != -1 ) {
 57+ // Create a model for the template
 58+ var model = new $.wikiEditor.modules.templateEditor.fn.model(
 59+ context.fn.getContents().substring( tokenArray[beginIndex].offset,
 60+ tokenArray[endIndex].offset
 61+ )
 62+ );
5763 markers.push( {
5864 start: tokenArray[beginIndex].offset,
5965 end: tokenArray[endIndex].offset,
6066 type: 'template',
6167 anchor: 'wrap',
 68+ splitPs: model.isCollapsible(),
6269 afterWrap: $.wikiEditor.modules.templateEditor.fn.stylize,
6370 beforeUnwrap: function( node ) {
6471 $( node ).data( 'display' ).remove();
6572 },
66 - onSkip: function() { },
67 - getAnchor: function( ca1, ca2 ) {
 73+ onSkip: function() { }, // TODO update template info
 74+ getAnchor: function( ca1, ca2 ) {
6875 // FIXME: Relies on the current <span> structure that is likely to die
69 - return $( ca1.parentNode ).is( 'div.wikiEditor-template-text' ) &&
70 - $( ca1.parentNode.previousSibling )
71 - .is( 'ul.wikiEditor-template-modes' ) &&
72 - ca1.parentNode.nextSibling == null ?
 76+ return $( ca1.parentNode ).is( 'span.wikiEditor-template-text' ) ?
7377 ca1.parentNode : null;
74 - }
 78+ },
 79+ model: model
7580 } );
7681 } else { //else this was an unmatched opening
7782 tokenArray[beginIndex].label = 'TEMPLATE_FALSE_BEGIN';
@@ -107,15 +112,15 @@
108113 },
109114 stylize: function( wrappedTemplate ) {
110115 $( wrappedTemplate ).each( function() {
111 - if ( typeof $(this).data( 'model' ) != 'undefined' ) {
 116+ if ( typeof $(this).data( 'setupDone' ) != 'undefined' ) {
112117 // We have a model, so all this init stuff has already happened
113118 return;
114119 }
115 - // Build a model for this
116 - var model = new $.wikiEditor.modules.templateEditor.fn.model( $( this ).text() );
 120+ var model = $(this).data( 'marker' ).model;
117121
118122 //check if model is collapsible
119123 if ( !model.isCollapsible() ) {
 124+ $(this).addClass( 'wikiEditor-template-text' );
120125 return;
121126 }
122127
@@ -142,6 +147,8 @@
143148 .mousedown( toggleWikiTextEditor ) )
144149 .insertAfter( $template.find( '.wikiEditor-template-name' ) );
145150
 151+ $(this).data( 'setupDone', true );
 152+
146153 function toggleWikiTextEditor(){
147154 var $template = $( this ).closest( '.wikiEditor-template' );
148155 $template
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.toc.js
@@ -112,6 +112,7 @@
113113 end: tokenArray[i].offset,
114114 type: 'toc',
115115 anchor: 'before',
 116+ splitPs: false,
116117 afterWrap: function( node ) {
117118 var marker = $( node ).data( 'marker' );
118119 $( node ).addClass( 'wikiEditor-toc-header' )
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js
@@ -375,6 +375,11 @@
376376 },
377377 'delayedChange': function( event ) {
378378 event.data.scope = 'division';
 379+ var newHTML = context.$content.html();
 380+ if ( context.oldDelayedHTML != newHTML ) {
 381+ context.oldDelayedHTML = newHTML;
 382+ event.data.scope = 'realchange';
 383+ }
379384 context.fn.updateHistory();
380385 return true;
381386 },
@@ -1525,7 +1530,6 @@
15261531 .replace( /&amp;esc;&amp;lt;span&amp;nbsp;class=&amp;quot;wikiEditor-tab&amp;quot;&amp;gt;&amp;lt;\/span&amp;gt;/g, '&lt;span class="wikiEditor-tab"&gt;&lt;\/span&gt;' )
15271532 .replace( /&amp;esc;esc;/g, '&amp;esc;' );
15281533 context.$content.html( html );
1529 - context.oldHTML = html;
15301534
15311535 // Reflect direction of parent frame into child
15321536 if ( $( 'body' ).is( '.rtl' ) ) {
@@ -1537,6 +1541,8 @@
15381542 context.$iframe.show();
15391543 // Let modules know we're ready to start working with the content
15401544 context.fn.trigger( 'ready' );
 1545+ // Only save HTML now: ready handlers may have modified it
 1546+ context.oldHTML = context.oldDelayedHTML = context.$content.html();
15411547 //remove our temporary loading
15421548 /* Disaling our loading div for now
15431549 $( '.wikiEditor-ui-loading' ).fadeOut( 'fast', function() {
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.highlight.js
@@ -194,11 +194,23 @@
195195 if ( s.offset > 0 && s.node.nodeName == '#text' ) {
196196 // Split off the prefix
197197 // This leaves the prefix in the current node and puts
198 - // the rest in a new node which is our start node
 198+ // the rest in a new node which is our start node
199199 startNode = startNode.splitText( s.offset );
200200 // This also invalidates cached offset objects
201201 context.fn.purgeOffsets(); // TODO: Optimize better, get end offset object earlier
202202 }
 203+ // Because we can't put block elements in <p>s, we'll have to split the <p> as well
 204+ // if afterWrap() needs us to
 205+ if ( markers[i].splitPs && startNode.parentNode.nodeName == 'P' ) {
 206+ // Create a new <p> left of startNode, and append startNode's left siblings to it
 207+ var startP = startNode.ownerDocument.createElement( 'p' );
 208+ while ( startNode.parentNode.firstChild != startNode ) {
 209+ startP.appendChild( startNode.parentNode.firstChild );
 210+ }
 211+ if ( startP.firstChild ) {
 212+ startNode.parentNode.insertBefore( startP, startNode );
 213+ }
 214+ }
203215
204216 var end = markers[i].end;
205217 var e = context.fn.getOffset( end );
@@ -209,13 +221,25 @@
210222 var endNode = e.node;
211223 var endDepth = e.depth;
212224 if ( e.offset < e.length - 1 && e.node.nodeName == '#text' ) {
213 - // Split off the suffix - This puts the suffix in a new node and leaves the rest in the current
214 - // node.
215 - // endNode.nodeValue.length - ( newPos - markers[i].end )
216 - endNode.splitText( e.offset + 1 );
 225+ // Split off the suffix. This puts the suffix in a new node and leaves the rest in endNode
 226+ endNode.splitText( e.offset );
217227 // This also invalidates cached offset objects
218228 context.fn.purgeOffsets(); // TODO: Optimize better, get end offset object earlier
219229 }
 230+ // Split <p>s if needed, see above
 231+ if ( markers[i].splitPs && endNode.parentNode.nodeName == 'P' && endNode.parentNode.parentNode ) {
 232+ // Move textnodes preceding endNode out of the wrapping <p>
 233+ var endP = endNode.parentNode;
 234+ while ( endP.firstChild != endNode ) {
 235+ endP.parentNode.insertBefore( endP.firstChild, endP );
 236+ }
 237+ // Move endNode itself out as well
 238+ endP.parentNode.insertBefore( endNode, endP );
 239+ if ( !endP.firstChild ) {
 240+ // endP is empty, remove it
 241+ endP.parentNode.removeChild( endP );
 242+ }
 243+ }
220244
221245 // Don't wrap trailing BRs, doing that causes weird issues
222246 if ( endNode.nodeName == 'BR' ) {
@@ -261,12 +285,7 @@
262286 // properties
263287 var newNode = ca1.ownerDocument.createElement( 'span' );
264288 var commonAncestor = ca1.parentNode;
265 - // Special case: can't put block elements in a <p>
266 - if ( commonAncestor.nodeName == 'P' && commonAncestor.parentNode ) {
267 - commonAncestor = commonAncestor.parentNode;
268 - ca1 = ca1.parentNode;
269 - ca2 = ca2.parentNode;
270 - }
 289+
271290 var nextNode = ca2.nextSibling;
272291 if ( markers[i].anchor == 'wrap' ) {
273292 // Append all nodes between ca1 and ca2 (inclusive) to newNode
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -6808,6 +6808,11 @@
68096809 },
68106810 'delayedChange': function( event ) {
68116811 event.data.scope = 'division';
 6812+ var newHTML = context.$content.html();
 6813+ if ( context.oldDelayedHTML != newHTML ) {
 6814+ context.oldDelayedHTML = newHTML;
 6815+ event.data.scope = 'realchange';
 6816+ }
68126817 context.fn.updateHistory();
68136818 return true;
68146819 },
@@ -7958,7 +7963,6 @@
79597964 .replace( /&amp;esc;&amp;lt;span&amp;nbsp;class=&amp;quot;wikiEditor-tab&amp;quot;&amp;gt;&amp;lt;\/span&amp;gt;/g, '&lt;span class="wikiEditor-tab"&gt;&lt;\/span&gt;' )
79607965 .replace( /&amp;esc;esc;/g, '&amp;esc;' );
79617966 context.$content.html( html );
7962 - context.oldHTML = html;
79637967
79647968 // Reflect direction of parent frame into child
79657969 if ( $( 'body' ).is( '.rtl' ) ) {
@@ -7970,6 +7974,8 @@
79717975 context.$iframe.show();
79727976 // Let modules know we're ready to start working with the content
79737977 context.fn.trigger( 'ready' );
 7978+ // Only save HTML now: ready handlers may have modified it
 7979+ context.oldHTML = context.oldDelayedHTML = context.$content.html();
79747980 //remove our temporary loading
79757981 /* Disaling our loading div for now
79767982 $( '.wikiEditor-ui-loading' ).fadeOut( 'fast', function() {
@@ -8413,11 +8419,23 @@
84148420 if ( s.offset > 0 && s.node.nodeName == '#text' ) {
84158421 // Split off the prefix
84168422 // This leaves the prefix in the current node and puts
8417 - // the rest in a new node which is our start node
 8423+ // the rest in a new node which is our start node
84188424 startNode = startNode.splitText( s.offset );
84198425 // This also invalidates cached offset objects
84208426 context.fn.purgeOffsets(); // TODO: Optimize better, get end offset object earlier
84218427 }
 8428+ // Because we can't put block elements in <p>s, we'll have to split the <p> as well
 8429+ // if afterWrap() needs us to
 8430+ if ( markers[i].splitPs && startNode.parentNode.nodeName == 'P' ) {
 8431+ // Create a new <p> left of startNode, and append startNode's left siblings to it
 8432+ var startP = startNode.ownerDocument.createElement( 'p' );
 8433+ while ( startNode.parentNode.firstChild != startNode ) {
 8434+ startP.appendChild( startNode.parentNode.firstChild );
 8435+ }
 8436+ if ( startP.firstChild ) {
 8437+ startNode.parentNode.insertBefore( startP, startNode );
 8438+ }
 8439+ }
84228440
84238441 var end = markers[i].end;
84248442 var e = context.fn.getOffset( end );
@@ -8428,13 +8446,25 @@
84298447 var endNode = e.node;
84308448 var endDepth = e.depth;
84318449 if ( e.offset < e.length - 1 && e.node.nodeName == '#text' ) {
8432 - // Split off the suffix - This puts the suffix in a new node and leaves the rest in the current
8433 - // node.
8434 - // endNode.nodeValue.length - ( newPos - markers[i].end )
8435 - endNode.splitText( e.offset + 1 );
 8450+ // Split off the suffix. This puts the suffix in a new node and leaves the rest in endNode
 8451+ endNode.splitText( e.offset );
84368452 // This also invalidates cached offset objects
84378453 context.fn.purgeOffsets(); // TODO: Optimize better, get end offset object earlier
84388454 }
 8455+ // Split <p>s if needed, see above
 8456+ if ( markers[i].splitPs && endNode.parentNode.nodeName == 'P' && endNode.parentNode.parentNode ) {
 8457+ // Move textnodes preceding endNode out of the wrapping <p>
 8458+ var endP = endNode.parentNode;
 8459+ while ( endP.firstChild != endNode ) {
 8460+ endP.parentNode.insertBefore( endP.firstChild, endP );
 8461+ }
 8462+ // Move endNode itself out as well
 8463+ endP.parentNode.insertBefore( endNode, endP );
 8464+ if ( !endP.firstChild ) {
 8465+ // endP is empty, remove it
 8466+ endP.parentNode.removeChild( endP );
 8467+ }
 8468+ }
84398469
84408470 // Don't wrap trailing BRs, doing that causes weird issues
84418471 if ( endNode.nodeName == 'BR' ) {
@@ -8480,12 +8510,7 @@
84818511 // properties
84828512 var newNode = ca1.ownerDocument.createElement( 'span' );
84838513 var commonAncestor = ca1.parentNode;
8484 - // Special case: can't put block elements in a <p>
8485 - if ( commonAncestor.nodeName == 'P' && commonAncestor.parentNode ) {
8486 - commonAncestor = commonAncestor.parentNode;
8487 - ca1 = ca1.parentNode;
8488 - ca2 = ca2.parentNode;
8489 - }
 8514+
84908515 var nextNode = ca2.nextSibling;
84918516 if ( markers[i].anchor == 'wrap' ) {
84928517 // Append all nodes between ca1 and ca2 (inclusive) to newNode
@@ -8865,24 +8890,29 @@
88668891 }
88678892 }//while finding template ending
88688893 if ( endIndex != -1 ) {
 8894+ // Create a model for the template
 8895+ var model = new $.wikiEditor.modules.templateEditor.fn.model(
 8896+ context.fn.getContents().substring( tokenArray[beginIndex].offset,
 8897+ tokenArray[endIndex].offset
 8898+ )
 8899+ );
88698900 markers.push( {
88708901 start: tokenArray[beginIndex].offset,
88718902 end: tokenArray[endIndex].offset,
88728903 type: 'template',
88738904 anchor: 'wrap',
 8905+ splitPs: model.isCollapsible(),
88748906 afterWrap: $.wikiEditor.modules.templateEditor.fn.stylize,
88758907 beforeUnwrap: function( node ) {
88768908 $( node ).data( 'display' ).remove();
88778909 },
8878 - onSkip: function() { },
8879 - getAnchor: function( ca1, ca2 ) {
 8910+ onSkip: function() { }, // TODO update template info
 8911+ getAnchor: function( ca1, ca2 ) {
88808912 // FIXME: Relies on the current <span> structure that is likely to die
8881 - return $( ca1.parentNode ).is( 'div.wikiEditor-template-text' ) &&
8882 - $( ca1.parentNode.previousSibling )
8883 - .is( 'ul.wikiEditor-template-modes' ) &&
8884 - ca1.parentNode.nextSibling == null ?
 8913+ return $( ca1.parentNode ).is( 'span.wikiEditor-template-text' ) ?
88858914 ca1.parentNode : null;
8886 - }
 8915+ },
 8916+ model: model
88878917 } );
88888918 } else { //else this was an unmatched opening
88898919 tokenArray[beginIndex].label = 'TEMPLATE_FALSE_BEGIN';
@@ -8919,15 +8949,15 @@
89208950 },
89218951 stylize: function( wrappedTemplate ) {
89228952 $( wrappedTemplate ).each( function() {
8923 - if ( typeof $(this).data( 'model' ) != 'undefined' ) {
 8953+ if ( typeof $(this).data( 'setupDone' ) != 'undefined' ) {
89248954 // We have a model, so all this init stuff has already happened
89258955 return;
89268956 }
8927 - // Build a model for this
8928 - var model = new $.wikiEditor.modules.templateEditor.fn.model( $( this ).text() );
 8957+ var model = $(this).data( 'marker' ).model;
89298958
89308959 //check if model is collapsible
89318960 if ( !model.isCollapsible() ) {
 8961+ $(this).addClass( 'wikiEditor-template-text' );
89328962 return;
89338963 }
89348964
@@ -8954,6 +8984,8 @@
89558985 .mousedown( toggleWikiTextEditor ) )
89568986 .insertAfter( $template.find( '.wikiEditor-template-name' ) );
89578987
 8988+ $(this).data( 'setupDone', true );
 8989+
89588990 function toggleWikiTextEditor(){
89598991 var $template = $( this ).closest( '.wikiEditor-template' );
89608992 $template
@@ -9582,6 +9614,7 @@
95839615 end: tokenArray[i].offset,
95849616 type: 'toc',
95859617 anchor: 'before',
 9618+ splitPs: false,
95869619 afterWrap: function( node ) {
95879620 var marker = $( node ).data( 'marker' );
95889621 $( node ).addClass( 'wikiEditor-toc-header' )
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -454,7 +454,8 @@
455455 break;}
456456 return true;},'change':function(event){event.data.scope='division';var newHTML=context.$content.html();if(context.oldHTML!=newHTML){context.fn.purgeOffsets();context.oldHTML=newHTML;event.data.scope='realchange';}
457457 switch(event.which){case 8:break;}
458 -return true;},'delayedChange':function(event){event.data.scope='division';context.fn.updateHistory();return true;},'paste':function(event){context.$content.find(':not(.wikiEditor)').addClass('wikiEditor');if($.layout.name!=='webkit'){context.$content.addClass('pasting');}
 458+return true;},'delayedChange':function(event){event.data.scope='division';var newHTML=context.$content.html();if(context.oldDelayedHTML!=newHTML){context.oldDelayedHTML=newHTML;event.data.scope='realchange';}
 459+context.fn.updateHistory();return true;},'paste':function(event){context.$content.find(':not(.wikiEditor)').addClass('wikiEditor');if($.layout.name!=='webkit'){context.$content.addClass('pasting');}
459460 setTimeout(function(){var $selection=context.$content.find(':not(.wikiEditor)');while($selection.length&&$selection.length>0){var $currentElement=$selection.eq(0);while(!$currentElement.parent().is('body')&&!$currentElement.parent().is('.wikiEditor')){$currentElement=$currentElement.parent();}
460461 var text=$currentElement.text();if($currentElement.is('br')){$currentElement.addClass('wikiEditor');}else if($currentElement.is('span')&&text.length==0){$currentElement.remove();}else{$newElement=$('<p></p>').addClass('wikiEditor').insertAfter($currentElement);if(text.length){$newElement.text(text);}else{$newElement.append($('<br>').addClass('wikiEditor'));}
461462 $currentElement.remove();}
@@ -555,8 +556,8 @@
556557 context.$iframe[0].contentWindow.focus();context.savedSelection.select();context.savedSelection=null;},'updateHistory':function(){var newHTML=context.$content.html();var newSel=context.fn.getCaretPosition();if(context.history.length==0||(context.oldDelayedHTML!=newHTML&&newHTML!=context.history[context.history.length+context.historyPosition].html)){context.fn.purgeOffsets();context.oldDelayedHTML=newHTML;context.oldDelayedSel=newSel;if(context.historyPosition<-1){context.history.splice(context.history.length+context.historyPosition);context.historyPosition=-1;}
557558 context.history.push({'html':newHTML,'sel':newSel});while(context.history.length>10){context.history.shift();}}else if(context.oldDelayedSel!=newSel){context.oldDelayedSel=newSel;context.history[context.history.length+context.historyPosition].sel=newSel;}}};context.$textarea.wrapAll($('<div></div>').addClass('wikiEditor-ui')).wrapAll($('<div></div>').addClass('wikiEditor-ui-view wikiEditor-ui-view-wikitext')).wrapAll($('<div></div>').addClass('wikiEditor-ui-left')).wrapAll($('<div></div>').addClass('wikiEditor-ui-bottom')).wrapAll($('<div></div>').addClass('wikiEditor-ui-text'));context.$ui=context.$textarea.parent().parent().parent().parent().parent();context.$wikitext=context.$textarea.parent().parent().parent().parent();context.$wikitext.before($('<div></div>').addClass('wikiEditor-ui-controls').append($('<div></div>').addClass('wikiEditor-ui-tabs').hide()).append($('<div></div>').addClass('wikiEditor-ui-buttons'))).before($('<div style="clear:both;"></div>'));context.$controls=context.$ui.find('.wikiEditor-ui-buttons').hide();context.$buttons=context.$ui.find('.wikiEditor-ui-buttons');context.$tabs=context.$ui.find('.wikiEditor-ui-tabs');context.$ui.after($('<div style="clear:both;"></div>'));context.$wikitext.append($('<div></div>').addClass('wikiEditor-ui-right'));context.$wikitext.find('.wikiEditor-ui-left').prepend($('<div></div>').addClass('wikiEditor-ui-top'));context.view='wikitext';$(window).resize(function(event){context.fn.trigger('resize',event);});context.fn.setupIframe=function(){context.$iframe=$('<iframe></iframe>').attr({'frameBorder':0,'border':0,'tabindex':1,'src':wgScriptPath+'/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.html?'+'instance='+context.instance+'&ts='+(new Date()).getTime()+'&is=content','id':'wikiEditor-iframe-'+context.instance}).css({'backgroundColor':'white','width':'100%','height':context.$textarea.height(),'display':'none','overflow-y':'scroll','overflow-x':'hidden'}).insertAfter(context.$textarea).load(function(){if(!this.isSecondRun){context.$iframe[0].contentWindow.document.designMode='on';if($.browser.msie){this.isSecondRun=true;return;}}
558559 context.$content=$(context.$iframe[0].contentWindow.document.body);var html=context.$textarea.val().replace(/&esc;/g,'&esc;esc;').replace(/\<p\>/g,'&esc;&lt;p&gt;').replace(/\<\/p\>/g,'&esc;&lt;/p&gt;').replace(/\<span class="wikiEditor-tab"\>\<\/span\>/g,'&esc;&lt;span&nbsp;class=&quot;wikiEditor-tab&quot;&gt;&lt;/span&gt;').replace(/&nbsp;/g,'&esc;&amp;nbsp;');if($.browser.msie){html=html.replace(/\t/g,'<span class="wikiEditor-tab"></span>');if($.browser.versionNumber<=7){html=html.replace(/ /g,"&nbsp;");}else{html=html.replace(/(^|\n) /g,"$1&nbsp;");}}
559 -html=$('<div />').text('<p>'+html.replace(/\r?\n/g,'</p><p>')+'</p>').html().replace(/&amp;nbsp;/g,'&nbsp;').replace(/&lt;p&gt;/g,'<p>').replace(/&lt;\/p&gt;/g,'</p>').replace(/&lt;span( |&nbsp;)class=("|&quot;)wikiEditor-tab("|&quot;)&gt;&lt;\/span&gt;/g,'<span class="wikiEditor-tab"></span>').replace(/<p><\/p>/g,'<p><br></p>').replace(/&amp;esc;&amp;amp;nbsp;/g,'&amp;nbsp;').replace(/&amp;esc;&amp;lt;p&amp;gt;/g,'&lt;p&gt;').replace(/&amp;esc;&amp;lt;\/p&amp;gt;/g,'&lt;/p&gt;').replace(/&amp;esc;&amp;lt;span&amp;nbsp;class=&amp;quot;wikiEditor-tab&amp;quot;&amp;gt;&amp;lt;\/span&amp;gt;/g,'&lt;span class="wikiEditor-tab"&gt;&lt;\/span&gt;').replace(/&amp;esc;esc;/g,'&amp;esc;');context.$content.html(html);context.oldHTML=html;if($('body').is('.rtl')){context.$content.addClass('rtl').attr('dir','rtl');}
560 -context.$textarea.attr('disabled',true);context.$textarea.hide();context.$iframe.show();context.fn.trigger('ready');$(context.$iframe[0].contentWindow.document).bind('keydown',function(event){return context.fn.trigger('keydown',event);}).bind('paste',function(event){return context.fn.trigger('paste',event);}).bind('keyup paste mouseup cut encapsulateSelection',function(event){return context.fn.trigger('change',event);}).delayedBind(250,'keyup paste mouseup cut encapsulateSelection',function(event){context.fn.trigger('delayedChange',event);});});context.$textarea.closest('form').submit(function(){context.$textarea.attr('disabled',false);context.$textarea.val(context.$textarea.textSelection('getContents'));});context.fallbackWindowOnBeforeUnload=window.onbeforeunload;window.onbeforeunload=function(){context.$textarea.val(context.$textarea.textSelection('getContents'));if(context.fallbackWindowOnBeforeUnload){return context.fallbackWindowOnBeforeUnload();}};};}
 560+html=$('<div />').text('<p>'+html.replace(/\r?\n/g,'</p><p>')+'</p>').html().replace(/&amp;nbsp;/g,'&nbsp;').replace(/&lt;p&gt;/g,'<p>').replace(/&lt;\/p&gt;/g,'</p>').replace(/&lt;span( |&nbsp;)class=("|&quot;)wikiEditor-tab("|&quot;)&gt;&lt;\/span&gt;/g,'<span class="wikiEditor-tab"></span>').replace(/<p><\/p>/g,'<p><br></p>').replace(/&amp;esc;&amp;amp;nbsp;/g,'&amp;nbsp;').replace(/&amp;esc;&amp;lt;p&amp;gt;/g,'&lt;p&gt;').replace(/&amp;esc;&amp;lt;\/p&amp;gt;/g,'&lt;/p&gt;').replace(/&amp;esc;&amp;lt;span&amp;nbsp;class=&amp;quot;wikiEditor-tab&amp;quot;&amp;gt;&amp;lt;\/span&amp;gt;/g,'&lt;span class="wikiEditor-tab"&gt;&lt;\/span&gt;').replace(/&amp;esc;esc;/g,'&amp;esc;');context.$content.html(html);if($('body').is('.rtl')){context.$content.addClass('rtl').attr('dir','rtl');}
 561+context.$textarea.attr('disabled',true);context.$textarea.hide();context.$iframe.show();context.fn.trigger('ready');context.oldHTML=context.oldDelayedHTML=context.$content.html();$(context.$iframe[0].contentWindow.document).bind('keydown',function(event){return context.fn.trigger('keydown',event);}).bind('paste',function(event){return context.fn.trigger('paste',event);}).bind('keyup paste mouseup cut encapsulateSelection',function(event){return context.fn.trigger('change',event);}).delayedBind(250,'keyup paste mouseup cut encapsulateSelection',function(event){context.fn.trigger('delayedChange',event);});});context.$textarea.closest('form').submit(function(){context.$textarea.attr('disabled',false);context.$textarea.val(context.$textarea.textSelection('getContents'));});context.fallbackWindowOnBeforeUnload=window.onbeforeunload;window.onbeforeunload=function(){context.$textarea.val(context.$textarea.textSelection('getContents'));if(context.fallbackWindowOnBeforeUnload){return context.fallbackWindowOnBeforeUnload();}};};}
561562 var args=$.makeArray(arguments);if(typeof context.$iframe==='undefined'&&arguments[0]=='addModule'){var supported=false;for(module in arguments[1]){if($.wikiEditor.isSupported(module)&&module!=='toolbar'){supported=true;}}
562563 if(supported){context.fn.setupIframe();}}
563564 if(args.length>0){var call=args.shift();if(call in context.api){context.api[call](context,typeof args[0]=='undefined'?{}:args[0]);}}
@@ -574,14 +575,17 @@
575576 context.modules.highlight.markersStr=markersStr;var visited=[];for(var i=0;i<markers.length;i++){var start=markers[i].start;var s=context.fn.getOffset(start);if(!s){continue;}
576577 var startNode=s.node;var startDepth=s.depth;while(startNode.nodeName=='BR'||s.offset==startNode.nodeValue.length){start++;s=context.fn.getOffset(start);startNode=s.node;startDepth=s.depth;}
577578 if(s.offset>0&&s.node.nodeName=='#text'){startNode=startNode.splitText(s.offset);context.fn.purgeOffsets();}
 579+if(markers[i].splitPs&&startNode.parentNode.nodeName=='P'){var startP=startNode.ownerDocument.createElement('p');while(startNode.parentNode.firstChild!=startNode){startP.appendChild(startNode.parentNode.firstChild);}
 580+if(startP.firstChild){startNode.parentNode.insertBefore(startP,startNode);}}
578581 var end=markers[i].end;var e=context.fn.getOffset(end);if(!e){continue;}
579 -var endNode=e.node;var endDepth=e.depth;if(e.offset<e.length-1&&e.node.nodeName=='#text'){endNode.splitText(e.offset+1);context.fn.purgeOffsets();}
 582+var endNode=e.node;var endDepth=e.depth;if(e.offset<e.length-1&&e.node.nodeName=='#text'){endNode.splitText(e.offset);context.fn.purgeOffsets();}
 583+if(markers[i].splitPs&&endNode.parentNode.nodeName=='P'&&endNode.parentNode.parentNode){var endP=endNode.parentNode;while(endP.firstChild!=endNode){endP.parentNode.insertBefore(endP.firstChild,endP);}
 584+endP.parentNode.insertBefore(endNode,endP);if(!endP.firstChild){endP.parentNode.removeChild(endP);}}
580585 if(endNode.nodeName=='BR'){endNode=e.lastTextNode;endDepth=e.lastTextNodeDepth;}
581586 var ca1=startNode,ca2=endNode;if(startDepth>endDepth){for(var j=0;j<startDepth-endDepth&&ca1;j++){ca1=ca1.parentNode.firstChild==ca1?ca1.parentNode:null;}}
582587 else if(startDepth<endDepth){for(var j=0;j<endDepth-startDepth&&ca2;j++){ca2=ca2.parentNode.lastChild==ca2?ca2.parentNode:null;}}
583588 while(ca1&&ca2&&ca1.parentNode&&ca2.parentNode&&ca1.parentNode!=ca2.parentNode&&ca1.parentNode.firstChild&&ca2.parentNode.lastChild){ca1=ca1.parentNode.firstChild==ca1?ca1.parentNode:null;ca2=ca2.parentNode.lastChild==ca2?ca2.parentNode:null;}
584 -if(ca1&&ca2&&ca1.parentNode){var anchor=markers[i].getAnchor(ca1,ca2);if(!anchor){var newNode=ca1.ownerDocument.createElement('span');var commonAncestor=ca1.parentNode;if(commonAncestor.nodeName=='P'&&commonAncestor.parentNode){commonAncestor=commonAncestor.parentNode;ca1=ca1.parentNode;ca2=ca2.parentNode;}
585 -var nextNode=ca2.nextSibling;if(markers[i].anchor=='wrap'){var n=ca1;while(n!=nextNode){var ns=n.nextSibling;newNode.appendChild(n);n=ns;}
 589+if(ca1&&ca2&&ca1.parentNode){var anchor=markers[i].getAnchor(ca1,ca2);if(!anchor){var newNode=ca1.ownerDocument.createElement('span');var commonAncestor=ca1.parentNode;var nextNode=ca2.nextSibling;if(markers[i].anchor=='wrap'){var n=ca1;while(n!=nextNode){var ns=n.nextSibling;newNode.appendChild(n);n=ns;}
586590 if(nextNode){commonAncestor.insertBefore(newNode,nextNode);}else{commonAncestor.appendChild(newNode);}}else if(markers[i].anchor=='before'){commonAncestor.insertBefore(newNode,ca1);}else if(markers[i].anchor=='after'){if(nextNode){commonAncestor.insertBefore(newNode,nextNode);}else{commonAncestor.appendChild(newNode);}}
587591 $(newNode).data('marker',markers[i]).addClass('wikiEditor-highlight');visited[i]=newNode;markers[i].afterWrap(newNode,markers[i]);}else{visited[i]=anchor;$(anchor).data('marker',markers[i]);markers[i].onSkip(anchor);}}}
588592 var j=0;context.$content.find('.wikiEditor-highlight').each(function(){if(visited[j]==this){j++;return true;}
@@ -618,9 +622,9 @@
619623 $('#wikiEditor-'+context.instance+'-dialog-watch').hide();else if($('#wpWatchthis').is(':checked'))
620624 $('#wikiEditor-'+context.instance+'-dialog-watch').attr('checked','checked');$(this).find('form').submit(function(e){$(this).closest('.ui-dialog').find('button:first').click();e.preventDefault();});},dialog:{buttons:{'wikieditor-publish-dialog-publish':function(){var minorChecked=$('#wikiEditor-'+context.instance+'-dialog-minor').is(':checked')?'checked':'';var watchChecked=$('#wikiEditor-'+context.instance+'-dialog-watch').is(':checked')?'checked':'';$('#wpMinoredit').attr('checked',minorChecked);$('#wpWatchthis').attr('checked',watchChecked);$('#wpSummary').val($j('#wikiEditor-'+context.instance+'-dialog-summary').val());$('#editform').submit();},'wikieditor-publish-dialog-goback':function(){$(this).dialog('close');}},open:function(){$('#wikiEditor-'+context.instance+'-dialog-summary').focus();},width:500},resizeme:false}});context.fn.addButton({'captionMsg':'wikieditor-publish-button-publish','action':function(){$('#'+dialogID).dialog('open');return false;}});context.fn.addButton({'captionMsg':'wikieditor-publish-button-cancel','action':function(){}});}}};})(jQuery);(function($){$.wikiEditor.modules.templateEditor={'browsers':{'ltr':{'msie':[['>=',8]],'firefox':[['>=',3]],'opera':[['>=',10]],'safari':[['>=',4]]},'rtl':{'msie':[['>=',8]],'firefox':[['>=',3]],'opera':[['>=',10]],'safari':[['>=',4]]}},evt:{mark:function(context,event){var markers=context.modules.highlight.markers;var tokenArray=context.modules.highlight.tokenArray;var level=0;var tokenIndex=0;while(tokenIndex<tokenArray.length){while(tokenIndex<tokenArray.length&&tokenArray[tokenIndex].label!='TEMPLATE_BEGIN'){tokenIndex++;}
621625 if(tokenIndex<tokenArray.length){var beginIndex=tokenIndex;var endIndex=-1;var openTemplates=1;var templatesMatched=false;while(tokenIndex<tokenArray.length-1&&endIndex==-1){tokenIndex++;if(tokenArray[tokenIndex].label=='TEMPLATE_BEGIN'){openTemplates++;}else if(tokenArray[tokenIndex].label=='TEMPLATE_END'){openTemplates--;if(openTemplates==0){endIndex=tokenIndex;}}}
622 -if(endIndex!=-1){markers.push({start:tokenArray[beginIndex].offset,end:tokenArray[endIndex].offset,type:'template',anchor:'wrap',afterWrap:$.wikiEditor.modules.templateEditor.fn.stylize,beforeUnwrap:function(node){$(node).data('display').remove();},onSkip:function(){},getAnchor:function(ca1,ca2){return $(ca1.parentNode).is('div.wikiEditor-template-text')&&$(ca1.parentNode.previousSibling).is('ul.wikiEditor-template-modes')&&ca1.parentNode.nextSibling==null?ca1.parentNode:null;}});}else{tokenArray[beginIndex].label='TEMPLATE_FALSE_BEGIN';tokenIndex=beginIndex;}}}}},exp:[{'regex':/{{/,'label':"TEMPLATE_BEGIN"},{'regex':/}}/,'label':"TEMPLATE_END",'markAfter':true}],cfg:{},fn:{create:function(context,config){context.modules.templateEditor={};},stylize:function(wrappedTemplate){$(wrappedTemplate).each(function(){if(typeof $(this).data('model')!='undefined'){return;}
623 -var model=new $.wikiEditor.modules.templateEditor.fn.model($(this).text());if(!model.isCollapsible()){return;}
624 -var $template=$(this).wrap('<div class="wikiEditor-template"></div>').addClass('wikiEditor-template-text wikiEditor-nodisplay').parent().addClass('wikiEditor-template-collapsed').data('model',model);$('<span />').addClass('wikiEditor-template-name wikiEditor-noinclude').text(model.getName()).mousedown(function(){createDialog($template);}).prependTo($template);var $options=$('<ul />').addClass('wikiEditor-template-modes wikiEditor-noinclude').append($('<li />').addClass('wikiEditor-template-action-wikiText').append($('<img />').attr('src',$.wikiEditor.imgPath+'templateEditor/'+'wiki-text.png')).mousedown(toggleWikiTextEditor)).insertAfter($template.find('.wikiEditor-template-name'));function toggleWikiTextEditor(){var $template=$(this).closest('.wikiEditor-template');$template.toggleClass('wikiEditor-template-expanded').toggleClass('wikiEditor-template-collapsed');var $wikitext=$template.children('.wikiEditor-template-text');$wikitext.toggleClass('wikiEditor-nodisplay');if($template.hasClass('wikiEditor-template-collapsed')){var model=new $.wikiEditor.modules.templateEditor.fn.model($template.children('.wikiEditor-template-text').text());$template.data('model',model);$template.children('.wikiEditor-template-name').text(model.getName());}
 626+if(endIndex!=-1){var model=new $.wikiEditor.modules.templateEditor.fn.model(context.fn.getContents().substring(tokenArray[beginIndex].offset,tokenArray[endIndex].offset));markers.push({start:tokenArray[beginIndex].offset,end:tokenArray[endIndex].offset,type:'template',anchor:'wrap',splitPs:model.isCollapsible(),afterWrap:$.wikiEditor.modules.templateEditor.fn.stylize,beforeUnwrap:function(node){$(node).data('display').remove();},onSkip:function(){},getAnchor:function(ca1,ca2){return $(ca1.parentNode).is('span.wikiEditor-template-text')?ca1.parentNode:null;},model:model});}else{tokenArray[beginIndex].label='TEMPLATE_FALSE_BEGIN';tokenIndex=beginIndex;}}}}},exp:[{'regex':/{{/,'label':"TEMPLATE_BEGIN"},{'regex':/}}/,'label':"TEMPLATE_END",'markAfter':true}],cfg:{},fn:{create:function(context,config){context.modules.templateEditor={};},stylize:function(wrappedTemplate){$(wrappedTemplate).each(function(){if(typeof $(this).data('setupDone')!='undefined'){return;}
 627+var model=$(this).data('marker').model;if(!model.isCollapsible()){$(this).addClass('wikiEditor-template-text');return;}
 628+var $template=$(this).wrap('<div class="wikiEditor-template"></div>').addClass('wikiEditor-template-text wikiEditor-nodisplay').parent().addClass('wikiEditor-template-collapsed').data('model',model);$('<span />').addClass('wikiEditor-template-name wikiEditor-noinclude').text(model.getName()).mousedown(function(){createDialog($template);}).prependTo($template);var $options=$('<ul />').addClass('wikiEditor-template-modes wikiEditor-noinclude').append($('<li />').addClass('wikiEditor-template-action-wikiText').append($('<img />').attr('src',$.wikiEditor.imgPath+'templateEditor/'+'wiki-text.png')).mousedown(toggleWikiTextEditor)).insertAfter($template.find('.wikiEditor-template-name'));$(this).data('setupDone',true);function toggleWikiTextEditor(){var $template=$(this).closest('.wikiEditor-template');$template.toggleClass('wikiEditor-template-expanded').toggleClass('wikiEditor-template-collapsed');var $wikitext=$template.children('.wikiEditor-template-text');$wikitext.toggleClass('wikiEditor-nodisplay');if($template.hasClass('wikiEditor-template-collapsed')){var model=new $.wikiEditor.modules.templateEditor.fn.model($template.children('.wikiEditor-template-text').text());$template.data('model',model);$template.children('.wikiEditor-template-name').text(model.getName());}
625629 else{$wikitext.text($template.data('model').getText());}
626630 return false;};function expandTemplate($displayDiv){$displayDiv.removeClass('wikiEditor-template-collapsed');$displayDiv.addClass('wikiEditor-template-expanded');$displayDiv.unbind('mousedown');$keyValueTable=$('<table />').appendTo($displayDiv);$header_row=$('<tr />').appendTo($keyValueTable);$('<th />').attr('colspan','2').text(model.getName()).appendTo($header_row);for(param in model.getAllParamNames()){$keyVal_row=$('<tr />').appendTo($keyValueTable);$('<td />').text(param).appendTo($keyVal_row);$('<td />').text(model.getValue(param)).appendTo($keyVal_row);}};function collapseTemplate($displayDiv){$displayDiv.addClass('wikiEditor-template-collapsed');$displayDiv.removeClass('wikiEditor-template-expanded');$displayDiv.text(model.getName());};function createDialog($templateDiv){var $wikitext=$templateDiv.children('.wikiEditor-template-text');var templateModel=new $.wikiEditor.modules.templateEditor.fn.model($wikitext.text());$templateDiv.data('model',templateModel);var $dialog=$("<div></div>");var $title=$("<div>"+templateModel.getName()+"</div>").addClass('wikiEditor-template-dialog-title');var $table=$("<table></table>").addClass('wikiEditor-template-dialog-table').appendTo($dialog);var allInitialParams=templateModel.getAllInitialParams();for(var paramIndex in allInitialParams){var param=allInitialParams[paramIndex];if(typeof param.name=='undefined'){continue;}
627631 var $paramRow=$("<tr></tr>").addClass('wikiEditor-template-dialog-row');var $paramName=$("<td></td>").addClass('wikiEditor-template-dialog-name').text(param.name);var $paramVal=$("<td></td>").addClass('wikiEditor-template-dialog-value');var $paramInput=$("<input></input>").data('name',param.name).val(templateModel.getValue(param.name));$paramVal.append($paramInput);$paramRow.append($paramName).append($paramVal);$table.append($paramRow);}
@@ -662,7 +666,7 @@
663667 if(!context.modules.toc.$toc.data('collapsed')){context.modules.toc.$toc.height(context.$ui.find('.wikiEditor-ui-left').height()-
664668 context.$ui.find('.tab-toc').outerHeight());}
665669 context.modules.toc.$toc.data('previousWidth',context.$wikitext.width());},mark:function(context,event){var hash='';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;}
666 -h++;markers.push({index:h,start:tokenArray[i].tokenStart,end:tokenArray[i].offset,type:'toc',anchor:'before',afterWrap:function(node){var marker=$(node).data('marker');$(node).addClass('wikiEditor-toc-header').addClass('wikiEditor-toc-section-'+marker.index).data('section',marker.index);},onSkip:function(node){var marker=$(node).data('marker');if($(node).data('section')!=marker.index){$(node).removeClass('wikiEditor-toc-section-'+$(node).data('section')).addClass('wikiEditor-toc-section-'+marker.index).data('section',marker.index);}},getAnchor:function(ca1,ca2){return $(ca1.parentNode.previousSibling).is('.wikiEditor-toc-header')?ca1.parentNode.previousSibling:null;}});hash+=tokenArray[i].match[2]+'\n';outline.push({'text':tokenArray[i].match[2],'level':tokenArray[i].match[1].length,'index':h});}
 670+h++;markers.push({index:h,start:tokenArray[i].tokenStart,end:tokenArray[i].offset,type:'toc',anchor:'before',splitPs:false,afterWrap:function(node){var marker=$(node).data('marker');$(node).addClass('wikiEditor-toc-header').addClass('wikiEditor-toc-section-'+marker.index).data('section',marker.index);},onSkip:function(node){var marker=$(node).data('marker');if($(node).data('section')!=marker.index){$(node).removeClass('wikiEditor-toc-section-'+$(node).data('section')).addClass('wikiEditor-toc-section-'+marker.index).data('section',marker.index);}},getAnchor:function(ca1,ca2){return $(ca1.parentNode.previousSibling).is('.wikiEditor-toc-header')?ca1.parentNode.previousSibling:null;}});hash+=tokenArray[i].match[2]+'\n';outline.push({'text':tokenArray[i].match[2],'level':tokenArray[i].match[1].length,'index':h});}
667671 if(typeof context.modules.toc.lastHash=='undefined'||context.modules.toc.lastHash!==hash){$.wikiEditor.modules.toc.fn.build(context);$.wikiEditor.modules.toc.fn.update(context);context.modules.toc.lastHash=hash;}}},exp:[{'regex':/^(={1,6})([^\r\n]+?)\1\s*$/m,'label':'TOC_HEADER','markAfter':true}],fn:{create:function(context,config){if('$toc'in context.modules.toc){return;}
668672 $.wikiEditor.modules.toc.cfg.rtl=config.rtl;$.wikiEditor.modules.toc.cfg.flexProperty=config.rtl?'marginLeft':'marginRight';var height=context.$ui.find('.wikiEditor-ui-left').height();context.modules.toc.$toc=$('<div />').addClass('wikiEditor-ui-toc').data('context',context).data('positionMode','regular').data('collapsed',false);context.$ui.find('.wikiEditor-ui-right').append(context.modules.toc.$toc);context.modules.toc.$toc.height(context.$ui.find('.wikiEditor-ui-left').height());$.wikiEditor.modules.toc.fn.redraw(context,$.wikiEditor.modules.toc.cfg.defaultWidth);},redraw:function(context,fixedWidth){var fixedWidth=parseFloat(fixedWidth);if(context.modules.toc.$toc.data('positionMode')=='regular'){context.$ui.find('.wikiEditor-ui-right').css('width',fixedWidth+'px');context.$ui.find('.wikiEditor-ui-left').css($.wikiEditor.modules.toc.cfg.flexProperty,(-1*fixedWidth)+'px').children().css($.wikiEditor.modules.toc.cfg.flexProperty,fixedWidth+'px');}else if(context.modules.toc.$toc.data('positionMode')=='goofy'){context.$ui.find('.wikiEditor-ui-left').css('width',fixedWidth);context.$ui.find('.wikiEditor-ui-right').css($.wikiEditor.modules.toc.cfg.rtl?'right':'left',fixedWidth);context.$wikitext.css('height',context.$ui.find('.wikiEditor-ui-right').height());}},switchLayout:function(context){var width,height=context.$ui.find('.wikiEditor-ui-right').height();if(context.modules.toc.$toc.data('positionMode')=='regular'&&!context.modules.toc.$toc.data('collapsed')){context.modules.toc.$toc.data('positionMode','goofy');context.modules.toc.$toc.data('positionModeChangeAt',context.$ui.find('.wikiEditor-ui-right').width());width=$.wikiEditor.modules.toc.cfg.textMinimumWidth;context.$ui.find('.wikiEditor-ui-left').css($.wikiEditor.modules.toc.cfg.flexProperty,'').css({'position':'absolute','float':'none','left':$.wikiEditor.modules.toc.cfg.rtl?'auto':0,'right':$.wikiEditor.modules.toc.cfg.rtl?0:'auto'}).children().css($.wikiEditor.modules.toc.cfg.flexProperty,'');context.$ui.find('.wikiEditor-ui-right').css({'width':'auto','position':'absolute','float':'none','right':$.wikiEditor.modules.toc.cfg.rtl?'auto':0,'left':$.wikiEditor.modules.toc.cfg.rtl?0:'auto'});context.$wikitext.css('position','relative');}else if(context.modules.toc.$toc.data('positionMode')=='goofy'){context.modules.toc.$toc.data('positionMode','regular');width=context.$wikitext.width()-context.$ui.find('.wikiEditor-ui-left').width();if(width>context.modules.toc.$toc.data('positionModeChangeAt')){width=context.modules.toc.$toc.data('positionModeChangeAt');}
669673 context.$wikitext.css({'position':'','height':''});context.$ui.find('.wikiEditor-ui-right').css($.wikiEditor.modules.toc.cfg.flexProperty,'').css({'position':'','left':'','right':'','float':'','top':'','height':''});context.$ui.find('.wikiEditor-ui-left').css({'width':'','position':'','left':'','float':'','right':''});}

Follow-up revisions

RevisionCommit summaryAuthorDate
r62587Fix r62534: fixing a bug which prevent history states from being saved.adam19:26, 16 February 2010

Status & tagging log