r63461 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63460‎ | r63461 | r63462 >
Date:11:09, 9 March 2010
Author:catrope
Status:ok
Tags:
Comment:
UsabilityInitiative: Assorted fixes
* Make sure the row recycling code is actually called by not destroying all rows beforehand
** Fix this code here and there so it actually works
* Purge offsets after highlighting things. Even though the offset of a given string ideally doesn't change (which it does seem to do ATM), textnode references become invalid or orphaned (i.e. parentNode is null) as we split and move stuff
* Fix r63443: update row recycling code as well, style fixes, don't autoEllipse everything after each addition (did O(n^2) autoEllipse calls)
* Bump and recombine for r63455, remove trailing tabs
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)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -72,20 +72,20 @@
7373 array( 'src' => 'js/plugins/jquery.delayedBind.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' => 160 ),
 76+ array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 161 ),
7777 array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 37 ),
7878 array( 'src' => 'js/plugins/jquery.wikiEditor.toolbar.js', 'version' => 52 ),
7979 array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 19 ),
8080 array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 97 ),
8181 array( 'src' => 'js/plugins/jquery.wikiEditor.preview.js', 'version' => 11 ),
82 - array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 40 ),
 82+ array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 41 ),
8383 array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 3 ),
8484 ),
8585 'combined' => array(
86 - array( 'src' => 'js/plugins.combined.js', 'version' => 309 ),
 86+ array( 'src' => 'js/plugins.combined.js', 'version' => 310 ),
8787 ),
8888 'minified' => array(
89 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 309 ),
 89+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 310 ),
9090 ),
9191 ),
9292 );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.templateEditor.js
@@ -231,7 +231,7 @@
232232 // Build the table
233233 // TODO: Be smart and recycle existing table
234234 var params = templateModel.getAllInitialParams();
235 - var $fields = $( this ).find( '.wikiEditor-template-dialog-fields' ).empty();
 235+ var $fields = $( this ).find( '.wikiEditor-template-dialog-fields' );
236236 // Do some bookkeeping so we can recycle existing rows
237237 var $rows = $fields.find( '.wikiEditor-template-dialog-field-wrapper' );
238238 for ( var paramIndex in params ) {
@@ -248,7 +248,10 @@
249249 // We have another row to recycle
250250 var $row = $rows.eq( 0 );
251251 $row.children( 'label' ).text( paramText );
252 - $row.children( 'input' ).val( paramVal );
 252+ $row.children( 'textarea' )
 253+ .data( 'name', param.name )
 254+ .val( paramVal )
 255+ .change();
253256 $rows = $rows.not( $row );
254257 } else {
255258 // Create a new row
@@ -260,8 +263,9 @@
261264 $( '<textarea />' )
262265 .data( 'name', param.name )
263266 .val( paramVal )
264 - .bind( 'cut paste keypress click', function() {
265 - $this = $(this);
 267+ .data( 'expanded', false )
 268+ .bind( 'cut paste keypress click change', function() {
 269+ var $this = $(this);
266270 setTimeout( function() {
267271 var expanded = $this.data( 'expanded' );
268272 if ( $this.val().length > 24 ) {
@@ -278,14 +282,15 @@
279283 }, 0 );
280284 } )
281285 .appendTo( $paramRow );
282 - $( '<div style="clear:both"></div>' )
283 - .appendTo( $paramRow );
284 - $fields.append( $paramRow );
 286+ $paramRow
 287+ .append( '<div style="clear:both"></div>' )
 288+ .appendTo( $fields );
285289 }
286 - // Remove any leftover rows
287 - $rows.remove();
288 - $fields.find( 'label' ).autoEllipsis();
289290 }
 291+
 292+ // Remove any leftover rows
 293+ $rows.remove();
 294+ $fields.find( 'label' ).autoEllipsis();
290295 // Ensure our close button doesn't recieve the ui-state-focus class
291296 $( this ).parent( '.ui-dialog' ).find( '.ui-dialog-titlebar-close' )
292297 .removeClass( 'ui-state-focus' );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js
@@ -443,7 +443,7 @@
444444 }
445445 t = t.next();
446446 }
447 - // MS Word + webkit
 447+ // MS Word + webkit
448448 context.$content.find( 'p:not(.wikiEditor) p:not(.wikiEditor)' )
449449 .each( function(){
450450 var outerParent = $(this).parent();
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.highlight.js
@@ -272,6 +272,8 @@
273273 }
274274 lastP = t.inP;
275275 }
 276+ // Moving nodes around like this invalidates offset objects
 277+ context.fn.purgeOffsets();
276278 }
277279
278280 // Now wrap everything between startNode and endNode (may be equal).
@@ -342,6 +344,10 @@
343345 $(this).replaceWith( this.childNodes );
344346 }
345347 });
 348+
 349+ // Purge offsets after we're done
 350+ // TODO: Ideally this is not needed
 351+ context.fn.purgeOffsets();
346352 }
347353 }
348354
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -6913,12 +6913,7 @@
69146914 context.oldHTML = newHTML;
69156915 event.data.scope = 'realchange';
69166916 }
6917 - // Are we deleting a <p> with one keystroke? if so, either remove preceding <br> or merge <p>s
6918 - switch ( event.which ) {
6919 - case 8: // backspace
6920 - // do something here...
6921 - break;
6922 - }
 6917+
69236918 return true;
69246919 },
69256920 'delayedChange': function( event ) {
@@ -6928,6 +6923,17 @@
69296924 context.oldDelayedHTML = newHTML;
69306925 event.data.scope = 'realchange';
69316926 }
 6927+
 6928+ //surround by <p> if it does not already have it
 6929+ var t = context.fn.getOffset();
 6930+ if ( t.node.parentNode.nodeName.toLowerCase() == 'body' ) {
 6931+ var cursorPos = context.fn.getCaretPosition()[0];
 6932+ $( t.node ).wrap( "<p></p>" );
 6933+ context.fn.refreshOffsets();
 6934+ context.fn.setSelection( { start: cursorPos, end: cursorPos } );
 6935+ }
 6936+
 6937+
69326938 context.fn.updateHistory( event.data.scope == 'realchange' );
69336939 return true;
69346940 },
@@ -8107,10 +8113,10 @@
81088114 end = e ? e.offset : null;
81098115 // Don't try to set the selection past the end of a node, causes errors
81108116 // Just put the selection at the end of the node in this case
8111 - if ( sc.nodeName == '#text' && start >= sc.nodeValue.length ) {
 8117+ if ( sc.nodeName == '#text' && start > sc.nodeValue.length ) {
81128118 start = sc.nodeValue.length - 1;
81138119 }
8114 - if ( ec.nodeName == '#text' && end >= ec.nodeValue.length ) {
 8120+ if ( ec.nodeName == '#text' && end > ec.nodeValue.length ) {
81158121 end = ec.nodeValue.length - 1;
81168122 }
81178123 }
@@ -8728,6 +8734,8 @@
87298735 }
87308736 lastP = t.inP;
87318737 }
 8738+ // Moving nodes around like this invalidates offset objects
 8739+ context.fn.purgeOffsets();
87328740 }
87338741
87348742 // Now wrap everything between startNode and endNode (may be equal).
@@ -8798,6 +8806,10 @@
87998807 $(this).replaceWith( this.childNodes );
88008808 }
88018809 });
 8810+
 8811+ // Purge offsets after we're done
 8812+ // TODO: Ideally this is not needed
 8813+ context.fn.purgeOffsets();
88028814 }
88038815 }
88048816
@@ -9333,7 +9345,7 @@
93349346 // Build the table
93359347 // TODO: Be smart and recycle existing table
93369348 var params = templateModel.getAllInitialParams();
9337 - var $fields = $( this ).find( '.wikiEditor-template-dialog-fields' ).empty();
 9349+ var $fields = $( this ).find( '.wikiEditor-template-dialog-fields' );
93389350 // Do some bookkeeping so we can recycle existing rows
93399351 var $rows = $fields.find( '.wikiEditor-template-dialog-field-wrapper' );
93409352 for ( var paramIndex in params ) {
@@ -9350,7 +9362,10 @@
93519363 // We have another row to recycle
93529364 var $row = $rows.eq( 0 );
93539365 $row.children( 'label' ).text( paramText );
9354 - $row.children( 'input' ).val( paramVal );
 9366+ $row.children( 'textarea' )
 9367+ .data( 'name', param.name )
 9368+ .val( paramVal )
 9369+ .change();
93559370 $rows = $rows.not( $row );
93569371 } else {
93579372 // Create a new row
@@ -9362,8 +9377,9 @@
93639378 $( '<textarea />' )
93649379 .data( 'name', param.name )
93659380 .val( paramVal )
9366 - .bind( 'cut paste keypress click', function() {
9367 - $this = $(this);
 9381+ .data( 'expanded', false )
 9382+ .bind( 'cut paste keypress click change', function() {
 9383+ var $this = $(this);
93689384 setTimeout( function() {
93699385 var expanded = $this.data( 'expanded' );
93709386 if ( $this.val().length > 24 ) {
@@ -9380,14 +9396,15 @@
93819397 }, 0 );
93829398 } )
93839399 .appendTo( $paramRow );
9384 - $( '<div style="clear:both"></div>' )
9385 - .appendTo( $paramRow );
9386 - $fields.append( $paramRow );
 9400+ $paramRow
 9401+ .append( '<div style="clear:both"></div>' )
 9402+ .appendTo( $fields );
93879403 }
9388 - // Remove any leftover rows
9389 - $rows.remove();
9390 - $fields.find( 'label' ).autoEllipsis();
93919404 }
 9405+
 9406+ // Remove any leftover rows
 9407+ $rows.remove();
 9408+ $fields.find( 'label' ).autoEllipsis();
93929409 // Ensure our close button doesn't recieve the ui-state-focus class
93939410 $( this ).parent( '.ui-dialog' ).find( '.ui-dialog-titlebar-close' )
93949411 .removeClass( 'ui-state-focus' );
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -460,8 +460,8 @@
461461 break;case 86:if(event.ctrlKey){context.evt.paste(event);}
462462 break;}
463463 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';}
464 -switch(event.which){case 8:break;}
465464 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';}
 465+var t=context.fn.getOffset();if(t.node.parentNode.nodeName.toLowerCase()=='body'){var cursorPos=context.fn.getCaretPosition()[0];$(t.node).wrap("<p></p>");context.fn.refreshOffsets();context.fn.setSelection({start:cursorPos,end:cursorPos});}
466466 context.fn.updateHistory(event.data.scope=='realchange');return true;},'cut':function(event){setTimeout(function(){context.$content.find('br').each(function(){if($(this).parent().is('body')){$(this).wrap($('<p></p>'));}});},100);return true;},'paste':function(event){var cursorPos=context.fn.getCaretPosition();var oldLength=context.fn.getContents().length;context.$content.find(':not(.wikiEditor)').addClass('wikiEditor');if($.layout.name!=='webkit'){context.$content.addClass('pasting');}
467467 setTimeout(function(){context.$content.find('script,style,img,input,select,textarea,hr,button,link,meta').remove();context.$content.find('*').each(function(){if($(this).children().length==0&&this.childNodes.length>0){$(this).text($(this).text());}});var t=context.fn.traverser(context.$content);while(t){if(t.node.nodeName=='#text'){if(t.node.nodeValue==='\n'){$('<p><br></p>').insertAfter($(t.node));var oldNode=t.node;t=t.next();$(oldNode).remove();continue;}
468468 else if((t.node.nodeValue.indexOf('\n')!=1||t.node.nodeValue.indexOf('\r')!=-1)){t.node.nodeValue=t.node.nodeValue.replace(/\r|\n/g,' ');}}
@@ -559,8 +559,8 @@
560560 if(periRange.text==periText){rawPeriText+="\r\n";}else{periFinished=true;}}}
561561 if(!postFinished){if(postRange.compareEndPoints("StartToEnd",postRange)==0){postFinished=true;}else{postRange.moveEnd("character",-1)
562562 if(postRange.text==postText){rawPostText+="\r\n";}else{postFinished=true;}}}}while((!postFinished||!periFinished||!postFinished));startPos=rawPreText.replace(/\r\n/g,"\n").length;endPos=startPos+rawPeriText.replace(/\r\n/g,"\n").length;}catch(e){startPos=endPos=0;}}
563 -return[startPos,endPos];},'setSelection':function(options){var sc=options.startContainer,ec=options.endContainer;sc=sc&&sc.jquery?sc[0]:sc;ec=ec&&ec.jquery?ec[0]:ec;if(context.$iframe[0].contentWindow.getSelection){var start=options.start,end=options.end;if(!sc||!ec){var s=context.fn.getOffset(start);var e=context.fn.getOffset(end);sc=s?s.node:null;ec=e?e.node:null;start=s?s.offset:null;end=e?e.offset:null;if(sc.nodeName=='#text'&&start>=sc.nodeValue.length){start=sc.nodeValue.length-1;}
564 -if(ec.nodeName=='#text'&&end>=ec.nodeValue.length){end=ec.nodeValue.length-1;}}
 563+return[startPos,endPos];},'setSelection':function(options){var sc=options.startContainer,ec=options.endContainer;sc=sc&&sc.jquery?sc[0]:sc;ec=ec&&ec.jquery?ec[0]:ec;if(context.$iframe[0].contentWindow.getSelection){var start=options.start,end=options.end;if(!sc||!ec){var s=context.fn.getOffset(start);var e=context.fn.getOffset(end);sc=s?s.node:null;ec=e?e.node:null;start=s?s.offset:null;end=e?e.offset:null;if(sc.nodeName=='#text'&&start>sc.nodeValue.length){start=sc.nodeValue.length-1;}
 564+if(ec.nodeName=='#text'&&end>ec.nodeValue.length){end=ec.nodeValue.length-1;}}
565565 if(!sc||!ec){return context.$textarea;}
566566 var sel=context.$iframe[0].contentWindow.getSelection();while(sc.firstChild&&sc.nodeName!='#text'){sc=sc.firstChild;}
567567 while(ec.firstChild&&ec.nodeName!='#text'){ec=ec.firstChild;}
@@ -598,7 +598,8 @@
599599 while(oldParent.firstChild){startNode.parentNode.insertBefore(oldParent.firstChild,afterStart);}}else{if(lastP!=t.inP){startNode.parentNode.appendChild(startNode.ownerDocument.createElement('br'));}
600600 while(oldParent.firstChild){startNode.parentNode.appendChild(oldParent.firstChild);}}
601601 oldParent.parentNode.removeChild(oldParent);}
602 -lastP=t.inP;}}
 602+lastP=t.inP;}
 603+context.fn.purgeOffsets();}
603604 var ca1=startNode,ca2=endNode;if(ca1&&ca2&&ca1.parentNode){var anchor=markers[i].getAnchor(ca1,ca2);if(!anchor){var commonAncestor=ca1.parentNode;if(markers[i].anchor=='wrap'){var newNode=ca1.ownerDocument.createElement('span');var nextNode=ca2.nextSibling;var n=ca1;while(n!=nextNode){var ns=n.nextSibling;newNode.appendChild(n);n=ns;}
604605 if(nextNode){commonAncestor.insertBefore(newNode,nextNode);}else{commonAncestor.appendChild(newNode);}
605606 anchor=newNode;}else if(markers[i].anchor=='tag'){anchor=commonAncestor;}
@@ -606,7 +607,7 @@
607608 visited[v++]=anchor;}}
608609 var j=0;context.$content.find('.wikiEditor-highlight').each(function(){if(visited[j]==this){j++;return true;}
609610 var marker=$(this).data('marker');if(marker&&typeof marker.beforeUnwrap=='function')
610 -marker.beforeUnwrap(this);if((marker&&marker.anchor=='tag')||$(this).is('p')){$(this).removeAttr('class');}else{$(this).replaceWith(this.childNodes);}});}}};})(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;}
 611+marker.beforeUnwrap(this);if((marker&&marker.anchor=='tag')||$(this).is('p')){$(this).removeAttr('class');}else{$(this).replaceWith(this.childNodes);}});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;}
611612 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;}
612613 context.modules.preview.$preview.find('.wikiEditor-preview-contents').empty();context.modules.preview.$preview.find('.wikiEditor-preview-loading').show();$.post(wgScriptPath+'/api.php',{'action':'parse','title':wgPageName,'text':wikitext,'prop':'text','pst':'','format':'json'},function(data){if(typeof data.parse=='undefined'||typeof data.parse.text=='undefined'||typeof data.parse.text['*']=='undefined'){return;}
613614 context.modules.preview.previewText=wikitext;context.modules.preview.$preview.find('.wikiEditor-preview-loading').hide();context.modules.preview.$preview.find('.wikiEditor-preview-contents').html(data.parse.text['*']).find('a:not([href^=#])').click(function(){return false;});},'json');}});context.$changesTab=context.fn.addView({'name':'changes','titleMsg':'wikieditor-preview-changes-tab','init':function(context){var wikitext=context.fn.getContents();if(context.modules.preview.changesText==wikitext){return;}
@@ -645,10 +646,9 @@
646647 <div class="wikiEditor-template-dialog-title" />\
647648 <div class="wikiEditor-template-dialog-fields" />\
648649 </fieldset>',init:function(){$(this).find('[rel]').each(function(){$(this).text(mw.usability.getMsg($(this).attr('rel')));});},dialog:{width:600,height:400,dialogClass:'wikiEditor-toolbar-dialog',buttons:{'wikieditor-template-editor-dialog-submit':function(){var $templateDiv=$(this).data('templateDiv');context.fn.highlightLine($templateDiv);var $templateText=$templateDiv.children('.wikiEditor-template-text');var templateModel=$templateText.data('model');$(this).find('.wikiEditor-template-dialog-field-wrapper textarea').each(function(){templateModel.setValue($(this).data('name'),$(this).val());});$.wikiEditor.modules.templateEditor.fn.updateModel($templateText,templateModel);$(this).dialog('close');}},open:function(){var $templateDiv=$(this).data('templateDiv');var $templateText=$templateDiv.children('.wikiEditor-template-text');var templateModel=$templateText.data('model');if($templateText.html()!=$templateText.data('oldHTML')){templateModel=$.wikiEditor.modules.templateEditor.fn.updateModel($templateText);}
649 -var params=templateModel.getAllInitialParams();var $fields=$(this).find('.wikiEditor-template-dialog-fields').empty();var $rows=$fields.find('.wikiEditor-template-dialog-field-wrapper');for(var paramIndex in params){var param=params[paramIndex];if(typeof param.name=='undefined'){continue;}
650 -var paramText=typeof param=='string'?param.name.replace(/[\_\-]/g,' '):param.name;var paramVal=templateModel.getValue(param.name);if($rows.length>0){var $row=$rows.eq(0);$row.children('label').text(paramText);$row.children('input').val(paramVal);$rows=$rows.not($row);}else{var $paramRow=$('<div />').addClass('wikiEditor-template-dialog-field-wrapper');$('<label />').text(paramText).appendTo($paramRow);$('<textarea />').data('name',param.name).val(paramVal).bind('cut paste keypress click',function(){$this=$(this);setTimeout(function(){var expanded=$this.data('expanded');if($this.val().length>24){if(!expanded){$this.animate({'height':'4.5em'},'fast');$this.data('expanded',true);}}else{if(expanded){$this.animate({'height':'1.5em'},'fast');$this.data('expanded',false);}}},0);}).appendTo($paramRow);$('<div style="clear:both"></div>').appendTo($paramRow);$fields.append($paramRow);}
651 -$rows.remove();$fields.find('label').autoEllipsis();}
652 -$(this).parent('.ui-dialog').find('.ui-dialog-titlebar-close').removeClass('ui-state-focus');}}};function createDialog($templateDiv){context.$textarea.wikiEditor('addDialog',{'templateEditor':dialog});$('#'+dialog.id).data('templateDiv',$templateDiv).dialog('open');}},unwrapTemplate:function($wrapper){$wrapper.parent().replaceWith($wrapper);},updateModel:function($templateText,model){var context=$templateText.data('marker').context;var text;if(typeof model=='undefined'){text=context.fn.htmlToText($templateText.html());}else{text=model.getText();}
 650+var params=templateModel.getAllInitialParams();var $fields=$(this).find('.wikiEditor-template-dialog-fields');var $rows=$fields.find('.wikiEditor-template-dialog-field-wrapper');for(var paramIndex in params){var param=params[paramIndex];if(typeof param.name=='undefined'){continue;}
 651+var paramText=typeof param=='string'?param.name.replace(/[\_\-]/g,' '):param.name;var paramVal=templateModel.getValue(param.name);if($rows.length>0){var $row=$rows.eq(0);$row.children('label').text(paramText);$row.children('textarea').data('name',param.name).val(paramVal).change();$rows=$rows.not($row);}else{var $paramRow=$('<div />').addClass('wikiEditor-template-dialog-field-wrapper');$('<label />').text(paramText).appendTo($paramRow);$('<textarea />').data('name',param.name).val(paramVal).data('expanded',false).bind('cut paste keypress click change',function(){var $this=$(this);setTimeout(function(){var expanded=$this.data('expanded');if($this.val().length>24){if(!expanded){$this.animate({'height':'4.5em'},'fast');$this.data('expanded',true);}}else{if(expanded){$this.animate({'height':'1.5em'},'fast');$this.data('expanded',false);}}},0);}).appendTo($paramRow);$paramRow.append('<div style="clear:both"></div>').appendTo($fields);}}
 652+$rows.remove();$fields.find('label').autoEllipsis();$(this).parent('.ui-dialog').find('.ui-dialog-titlebar-close').removeClass('ui-state-focus');}}};function createDialog($templateDiv){context.$textarea.wikiEditor('addDialog',{'templateEditor':dialog});$('#'+dialog.id).data('templateDiv',$templateDiv).dialog('open');}},unwrapTemplate:function($wrapper){$wrapper.parent().replaceWith($wrapper);},updateModel:function($templateText,model){var context=$templateText.data('marker').context;var text;if(typeof model=='undefined'){text=context.fn.htmlToText($templateText.html());}else{text=model.getText();}
653653 $templateText.text(text);$templateText.html($templateText.html().replace(/\n/g,'<br />'));$templateText.data('oldHTML',$templateText.html());if(typeof model=='undefined'){model=new $.wikiEditor.modules.templateEditor.fn.model(text);$templateText.data('model',model);}
654654 return model;},getTemplateInfo:function(templateName){var templateInfo='';return $(templateInfo);},model:function(wikitext){var collapsible=true;function Param(name,value,number,nameIndex,equalsIndex,valueIndex){this.name=name;this.value=value;this.number=number;this.nameIndex=nameIndex;this.equalsIndex=equalsIndex;this.valueIndex=valueIndex;}
655655 function Range(begin,end){this.begin=begin;this.end=end;}

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r63443Changed the layout of template dialogs to be more table-like. Added auto-sizi...tparscal23:24, 8 March 2010
r63455This should fix the some toc highlighting issues. Also bug 22642pdhanda03:26, 9 March 2010

Status & tagging log