r63013 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63012‎ | r63013 | r63014 >
Date:19:29, 26 February 2010
Author:catrope
Status:deferred
Tags:
Comment:
USabilityInitiative: Fix JS error about an offset being too high. Also tweak whitespace in templateEditor (no functional changes)
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.templateEditor.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -73,7 +73,7 @@
7474 array( 'src' => 'js/plugins/jquery.suggestions.js', 'version' => 7 ),
7575 array( 'src' => 'js/plugins/jquery.textSelection.js', 'version' => 27 ),
7676 array( 'src' => 'js/plugins/jquery.wikiEditor.js', 'version' => 155 ),
77 - array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 34 ),
 77+ array( 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', 'version' => 35 ),
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' => 94 ),
@@ -82,10 +82,10 @@
8383 array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 3 ),
8484 ),
8585 'combined' => array(
86 - array( 'src' => 'js/plugins.combined.js', 'version' => 291 ),
 86+ array( 'src' => 'js/plugins.combined.js', 'version' => 292 ),
8787 ),
8888 'minified' => array(
89 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 291 ),
 89+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 292 ),
9090 ),
9191 ),
9292 );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.templateEditor.js
@@ -75,7 +75,7 @@
7676 // FIXME: $( node ).data( 'display' ) doesn't exist any more
7777 //$( node ).data( 'display' ).remove();
7878 },
79 - onSkip: function() { }, // TODO update template info
 79+ onSkip: function() { },
8080 getAnchor: function( ca1, ca2 ) {
8181 // FIXME: Relies on the current <span> structure that is likely to die
8282 return $( ca1.parentNode ).is( 'span.wikiEditor-template-text' ) ?
@@ -226,54 +226,55 @@
227227 };
228228
229229
230 - function createDialog( $templateDiv ){
231 - var $wikitext = $templateDiv.children('.wikiEditor-template-text');
 230+ function createDialog( $templateDiv ) {
 231+ var $wikitext = $templateDiv.children( '.wikiEditor-template-text' );
232232 //TODO: check if template model has been changed
233233 var templateModel = new $.wikiEditor.modules.templateEditor.fn.model( $wikitext.text() );
234 - $templateDiv.data('model', templateModel);
235 - var $dialog = $("<div></div>");
236 - var $title =
237 - $("<div>" + templateModel.getName() + "</div>").addClass('wikiEditor-template-dialog-title');
238 - var $table = $("<table></table>")
239 - .addClass('wikiEditor-template-dialog-table')
240 - .appendTo($dialog);
 234+ $templateDiv.data( 'model', templateModel );
 235+ var $dialog = $( '<div />' );
 236+ var $title = $(' <div />' )
 237+ .text( templateModel.getName() )
 238+ .addClass( 'wikiEditor-template-dialog-title' );
 239+ var $table = $( '<table />' )
 240+ .addClass( 'wikiEditor-template-dialog-table' )
 241+ .appendTo( $dialog );
241242 var allInitialParams = templateModel.getAllInitialParams();
242 - for( var paramIndex in allInitialParams ){
 243+ for ( var paramIndex in allInitialParams ) {
243244 var param = allInitialParams[paramIndex];
244 - if(typeof param.name == 'undefined'){continue;} //param 0 is the name
245 - var $paramRow = $("<tr></tr>")
246 - .addClass('wikiEditor-template-dialog-row');
247 - var $paramName = $("<td></td>")
248 - .addClass('wikiEditor-template-dialog-name')
249 - .text( param.name );
250 - var $paramVal = $("<td></td>")
251 - .addClass('wikiEditor-template-dialog-value');
252 - var $paramInput =$("<input></input>")
253 - .data('name', param.name)
254 - .val( templateModel.getValue(param.name) );
255 - $paramVal.append($paramInput);
256 - $paramRow.append($paramName).append($paramVal);
257 - $table.append($paramRow);
 245+ if ( typeof param.name == 'undefined' ) {
 246+ //param 0 is the name
 247+ continue;
 248+ }
 249+ var $paramRow = $( '<tr />' )
 250+ .addClass( 'wikiEditor-template-dialog-row' );
 251+ var $paramName = $( '<td />' )
 252+ .addClass( 'wikiEditor-template-dialog-name' )
 253+ .text( param.name );
 254+ var $paramVal = $( '<td />' )
 255+ .addClass( 'wikiEditor-template-dialog-value' );
 256+ var $paramInput = $( '<input />' )
 257+ .data( 'name', param.name )
 258+ .val( templateModel.getValue( param.name ) );
 259+ $paramVal.append( $paramInput );
 260+ $paramRow.append( $paramName ).append( $paramVal );
 261+ $table.append( $paramRow );
258262 }
259263 //click handler for values
260 - $("<button></button>").click(function(){
261 - $('.wikiEditor-template-dialog-value input').each( function(){
 264+ $( '<button />' ).click( function() {
 265+ $( '.wikiEditor-template-dialog-value input' ).each( function(){
262266 templateModel.setValue( $(this).data('name'), $(this).val() );
263267 });
264268 //keep text consistent
265269 $wikitext.text( templateModel.getText() );
266270
267 - $dialog.dialog('close');
 271+ $dialog.dialog( 'close' );
268272
269 - }).text("OK").appendTo($dialog);
 273+ }).text( 'OK' ).appendTo( $dialog ); // FIXME: Internationalize 'OK'
270274 $dialog.dialog(); //opens dialog
271275 return false;
272276 };
273277
274 -
275 -
276 -
277 - function toggleWikiText( ) {
 278+ function toggleWikiText() {
278279 var $template = $( this ).closest( '.wikiEditor-template' );
279280 $template
280281 .toggleClass( 'wikiEditor-template-collapsed' )
@@ -282,14 +283,13 @@
283284 .toggleClass( 'wikiEditor-nodisplay' );
284285
285286 //if we just collapsed this
286 - if( $template.hasClass('wikiEditor-template-collapsed') ) {
 287+ if ( $template.hasClass( 'wikiEditor-template-collapsed' ) ) {
287288 var model = new $.wikiEditor.modules.templateEditor.fn.model(
288289 $template.children( '.wikiEditor-template-text' ).text()
289290 );
290291 $template.data( 'model' , model );
291292 $template.children( '.wikiEditor-template-name' ).text( model.getName() );
292 - }
293 - else{ //else we just expanded this
 293+ } else{ //else we just expanded this
294294 $template.children( '.wikiEditor-template-text' ).children('.wikiEditor-template-inner-text').text(
295295 $template.data('model')
296296 .getText()
@@ -301,21 +301,19 @@
302302 return false;
303303 }
304304
305 - function noEdit() {
306 - return false;
307 - }
308 -
 305+ function noEdit() {
 306+ return false;
 307+ }
309308 });
310309
311310 },
312311
313 -
314312 /**
315313 * Gets templateInfo node from templateInfo extension, if it exists
316314 */
317 - getTemplateInfo: function ( templateName ){
 315+ getTemplateInfo: function ( templateName ) {
318316 var templateInfo = '';
319 - //API call here
 317+ // TODO: API call here
320318 return $( templateInfo );
321319 },
322320
@@ -503,7 +501,7 @@
504502 };
505503
506504 //not collapsing "small" templates
507 - if( wikitext.length < 20 ){
 505+ if ( wikitext.length < 20 ) {
508506 collapsible = false;
509507 }
510508 // Whitespace* {{ whitespace* nonwhitespace:
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.highlight.js
@@ -199,7 +199,9 @@
200200 // Split off the prefix
201201 // This leaves the prefix in the current node and puts
202202 // the rest in a new node which is our start node
203 - startNode = startNode.splitText( s.offset );
 203+ startNode = startNode.splitText( s.offset < s.node.nodeValue.length ?
 204+ s.offset : s.node.nodeValue.length - 1
 205+ );
204206 // This also invalidates cached offset objects
205207 context.fn.purgeOffsets(); // TODO: Optimize better, get end offset object earlier
206208 }
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -8524,7 +8524,9 @@
85258525 // Split off the prefix
85268526 // This leaves the prefix in the current node and puts
85278527 // the rest in a new node which is our start node
8528 - startNode = startNode.splitText( s.offset );
 8528+ startNode = startNode.splitText( s.offset < s.node.nodeValue.length ?
 8529+ s.offset : s.node.nodeValue.length - 1
 8530+ );
85298531 // This also invalidates cached offset objects
85308532 context.fn.purgeOffsets(); // TODO: Optimize better, get end offset object earlier
85318533 }
@@ -9056,7 +9058,7 @@
90579059 // FIXME: $( node ).data( 'display' ) doesn't exist any more
90589060 //$( node ).data( 'display' ).remove();
90599061 },
9060 - onSkip: function() { }, // TODO update template info
 9062+ onSkip: function() { },
90619063 getAnchor: function( ca1, ca2 ) {
90629064 // FIXME: Relies on the current <span> structure that is likely to die
90639065 return $( ca1.parentNode ).is( 'span.wikiEditor-template-text' ) ?
@@ -9207,54 +9209,55 @@
92089210 };
92099211
92109212
9211 - function createDialog( $templateDiv ){
9212 - var $wikitext = $templateDiv.children('.wikiEditor-template-text');
 9213+ function createDialog( $templateDiv ) {
 9214+ var $wikitext = $templateDiv.children( '.wikiEditor-template-text' );
92139215 //TODO: check if template model has been changed
92149216 var templateModel = new $.wikiEditor.modules.templateEditor.fn.model( $wikitext.text() );
9215 - $templateDiv.data('model', templateModel);
9216 - var $dialog = $("<div></div>");
9217 - var $title =
9218 - $("<div>" + templateModel.getName() + "</div>").addClass('wikiEditor-template-dialog-title');
9219 - var $table = $("<table></table>")
9220 - .addClass('wikiEditor-template-dialog-table')
9221 - .appendTo($dialog);
 9217+ $templateDiv.data( 'model', templateModel );
 9218+ var $dialog = $( '<div />' );
 9219+ var $title = $(' <div />' )
 9220+ .text( templateModel.getName() )
 9221+ .addClass( 'wikiEditor-template-dialog-title' );
 9222+ var $table = $( '<table />' )
 9223+ .addClass( 'wikiEditor-template-dialog-table' )
 9224+ .appendTo( $dialog );
92229225 var allInitialParams = templateModel.getAllInitialParams();
9223 - for( var paramIndex in allInitialParams ){
 9226+ for ( var paramIndex in allInitialParams ) {
92249227 var param = allInitialParams[paramIndex];
9225 - if(typeof param.name == 'undefined'){continue;} //param 0 is the name
9226 - var $paramRow = $("<tr></tr>")
9227 - .addClass('wikiEditor-template-dialog-row');
9228 - var $paramName = $("<td></td>")
9229 - .addClass('wikiEditor-template-dialog-name')
9230 - .text( param.name );
9231 - var $paramVal = $("<td></td>")
9232 - .addClass('wikiEditor-template-dialog-value');
9233 - var $paramInput =$("<input></input>")
9234 - .data('name', param.name)
9235 - .val( templateModel.getValue(param.name) );
9236 - $paramVal.append($paramInput);
9237 - $paramRow.append($paramName).append($paramVal);
9238 - $table.append($paramRow);
 9228+ if ( typeof param.name == 'undefined' ) {
 9229+ //param 0 is the name
 9230+ continue;
 9231+ }
 9232+ var $paramRow = $( '<tr />' )
 9233+ .addClass( 'wikiEditor-template-dialog-row' );
 9234+ var $paramName = $( '<td />' )
 9235+ .addClass( 'wikiEditor-template-dialog-name' )
 9236+ .text( param.name );
 9237+ var $paramVal = $( '<td />' )
 9238+ .addClass( 'wikiEditor-template-dialog-value' );
 9239+ var $paramInput = $( '<input />' )
 9240+ .data( 'name', param.name )
 9241+ .val( templateModel.getValue( param.name ) );
 9242+ $paramVal.append( $paramInput );
 9243+ $paramRow.append( $paramName ).append( $paramVal );
 9244+ $table.append( $paramRow );
92399245 }
92409246 //click handler for values
9241 - $("<button></button>").click(function(){
9242 - $('.wikiEditor-template-dialog-value input').each( function(){
 9247+ $( '<button />' ).click( function() {
 9248+ $( '.wikiEditor-template-dialog-value input' ).each( function(){
92439249 templateModel.setValue( $(this).data('name'), $(this).val() );
92449250 });
92459251 //keep text consistent
92469252 $wikitext.text( templateModel.getText() );
92479253
9248 - $dialog.dialog('close');
 9254+ $dialog.dialog( 'close' );
92499255
9250 - }).text("OK").appendTo($dialog);
 9256+ }).text( 'OK' ).appendTo( $dialog ); // FIXME: Internationalize 'OK'
92519257 $dialog.dialog(); //opens dialog
92529258 return false;
92539259 };
92549260
9255 -
9256 -
9257 -
9258 - function toggleWikiText( ) {
 9261+ function toggleWikiText() {
92599262 var $template = $( this ).closest( '.wikiEditor-template' );
92609263 $template
92619264 .toggleClass( 'wikiEditor-template-collapsed' )
@@ -9263,14 +9266,13 @@
92649267 .toggleClass( 'wikiEditor-nodisplay' );
92659268
92669269 //if we just collapsed this
9267 - if( $template.hasClass('wikiEditor-template-collapsed') ) {
 9270+ if ( $template.hasClass( 'wikiEditor-template-collapsed' ) ) {
92689271 var model = new $.wikiEditor.modules.templateEditor.fn.model(
92699272 $template.children( '.wikiEditor-template-text' ).text()
92709273 );
92719274 $template.data( 'model' , model );
92729275 $template.children( '.wikiEditor-template-name' ).text( model.getName() );
9273 - }
9274 - else{ //else we just expanded this
 9276+ } else{ //else we just expanded this
92759277 $template.children( '.wikiEditor-template-text' ).children('.wikiEditor-template-inner-text').text(
92769278 $template.data('model')
92779279 .getText()
@@ -9282,21 +9284,19 @@
92839285 return false;
92849286 }
92859287
9286 - function noEdit() {
9287 - return false;
9288 - }
9289 -
 9288+ function noEdit() {
 9289+ return false;
 9290+ }
92909291 });
92919292
92929293 },
92939294
9294 -
92959295 /**
92969296 * Gets templateInfo node from templateInfo extension, if it exists
92979297 */
9298 - getTemplateInfo: function ( templateName ){
 9298+ getTemplateInfo: function ( templateName ) {
92999299 var templateInfo = '';
9300 - //API call here
 9300+ // TODO: API call here
93019301 return $( templateInfo );
93029302 },
93039303
@@ -9484,7 +9484,7 @@
94859485 };
94869486
94879487 //not collapsing "small" templates
9488 - if( wikitext.length < 20 ){
 9488+ if ( wikitext.length < 20 ) {
94899489 collapsible = false;
94909490 }
94919491 // Whitespace* {{ whitespace* nonwhitespace:
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -581,7 +581,7 @@
582582 if(context.modules.highlight.markersStr==markersStr){return;}
583583 context.modules.highlight.markersStr=markersStr;var visited=[],v=0;for(var i=0;i<markers.length;i++){var start=markers[i].start;var s=context.fn.getOffset(start);if(!s){continue;}
584584 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;}
585 -if(s.offset>0&&s.node.nodeName=='#text'){startNode=startNode.splitText(s.offset);context.fn.purgeOffsets();}
 585+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();}
586586 if(markers[i].splitPs&&startNode.parentNode.nodeName=='P'){var startP=startNode.ownerDocument.createElement('p');while(startNode.parentNode.firstChild!=startNode){startP.appendChild(startNode.parentNode.firstChild);}
587587 if(startP.firstChild){startNode.parentNode.insertBefore(startP,startNode);}}
588588 var end=markers[i].end;var e=context.fn.getOffset(end);if(!e){continue;}
@@ -635,10 +635,9 @@
636636 var model=$(this).data('marker').model;var context=$(this).data('marker').context;if(!model.isCollapsible()){return;}
637637 var $template=$(this).wrap('<span class="wikiEditor-template"></span>').addClass('wikiEditor-template-text wikiEditor-nodisplay').parent().addClass('wikiEditor-template-collapsed').data('model',model);var $templateName=$('<span />').addClass('wikiEditor-template-name wikiEditor-noinclude').text(model.getName()).mousedown(toggleWikiTextEditor).prependTo($template);var $templateExpand=$('<span />').addClass('wikiEditor-template-expand wikiEditor-noinclude').append('<img src="'+$.wikiEditor.imgPath+'/templateEditor/expand.png" width="12" height="16" />').append('<img src="'+$.wikiEditor.imgPath+'/templateEditor/collapse.png" width="12" height="16" style="display:none;" />').mousedown(toggleWikiTextEditor).prependTo($template);var $templateDialog=$('<span />').addClass('wikiEditor-template-dialog wikiEditor-noinclude').append('<img src="'+$.wikiEditor.imgPath+'/templateEditor/dialog-collapsed.png" width="22" height="16" />').append('<img src="'+$.wikiEditor.imgPath+'/templateEditor/dialog-expanded.png" width="22" height="16" style="display:none;" />').mousedown(function(){createDialog($template);return false;}).insertAfter($templateName);$(this).data('setupDone',true);function toggleWikiTextEditor(){context.fn.refreshOffsets();var $template=$(this).closest('.wikiEditor-template');$template.toggleClass('wikiEditor-template-expanded').toggleClass('wikiEditor-template-collapsed').find('img').each(function(){$(this).toggle();});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());}
638638 else{$wikitext.text($template.data('model').getText());}
639 -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;}
640 -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);}
641 -$("<button></button>").click(function(){$('.wikiEditor-template-dialog-value input').each(function(){templateModel.setValue($(this).data('name'),$(this).val());});$wikitext.text(templateModel.getText());$dialog.dialog('close');}).text("OK").appendTo($dialog);$dialog.dialog();return false;};function toggleWikiText(){var $template=$(this).closest('.wikiEditor-template');$template.toggleClass('wikiEditor-template-collapsed').toggleClass('wikiEditor-template-expanded').children('.wikiEditor-template-text, .wikiEditor-template-name, .wikiEditor-template-modes').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());}
642 -else{$template.children('.wikiEditor-template-text').children('.wikiEditor-template-inner-text').text($template.data('model').getText().replace(/\{\{/,'').replace(/\}\}$/,''));}
 639+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 />');var $title=$(' <div />').text(templateModel.getName()).addClass('wikiEditor-template-dialog-title');var $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;}
 640+var $paramRow=$('<tr />').addClass('wikiEditor-template-dialog-row');var $paramName=$('<td />').addClass('wikiEditor-template-dialog-name').text(param.name);var $paramVal=$('<td />').addClass('wikiEditor-template-dialog-value');var $paramInput=$('<input />').data('name',param.name).val(templateModel.getValue(param.name));$paramVal.append($paramInput);$paramRow.append($paramName).append($paramVal);$table.append($paramRow);}
 641+$('<button />').click(function(){$('.wikiEditor-template-dialog-value input').each(function(){templateModel.setValue($(this).data('name'),$(this).val());});$wikitext.text(templateModel.getText());$dialog.dialog('close');}).text('OK').appendTo($dialog);$dialog.dialog();return false;};function toggleWikiText(){var $template=$(this).closest('.wikiEditor-template');$template.toggleClass('wikiEditor-template-collapsed').toggleClass('wikiEditor-template-expanded').children('.wikiEditor-template-text, .wikiEditor-template-name, .wikiEditor-template-modes').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());}else{$template.children('.wikiEditor-template-text').children('.wikiEditor-template-inner-text').text($template.data('model').getText().replace(/\{\{/,'').replace(/\}\}$/,''));}
643642 return false;}
644643 function noEdit(){return false;}});},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;}
645644 function Range(begin,end){this.begin=begin;this.end=end;}

Status & tagging log