r61503 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61502‎ | r61503 | r61504 >
Date:22:57, 25 January 2010
Author:nimishg
Status:ok
Tags:
Comment:
bugfix when no name match found
Modified paths:
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.templateEditor.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.templateEditor.js
@@ -103,6 +103,7 @@
104104 $( this ).html()
105105 .replace( /\{\{/, '<span class="wikiEditor-template-start">{{</span><span class="wikiEditor-template-inner-text">' )
106106 .replace( /\}\}$/, '</span><span class="wikiEditor-template-end">}}</span>' ) ) //grab the *last* {{
 107+ .css('visibility', 'hidden')
107108 .parent()
108109 .addClass( 'wikiEditor-template-collapsed' )
109110 .data( 'model', model );
@@ -126,8 +127,7 @@
127128 .append( $( '<span>F</span>' ) )
128129 .mousedown( function(){createDialog($template); return false;} ));
129130
130 -
131 -
 131+
132132 // Expand
133133 function expandTemplate( $displayDiv ) {
134134 // Housekeeping
@@ -484,7 +484,7 @@
485485 doneParsing = true;
486486 }
487487 nameMatch = sanatizedStr.substring( 0, divider ).match( /[^\s]/ );
488 - if ( nameMatch != undefined ) {
 488+ if ( nameMatch != null ) {
489489 ranges.push( new Range( 0 ,nameMatch.index ) ); //whitespace and squiggles upto the name
490490 nameEndMatch = sanatizedStr.substring( 0 , divider ).match( /[^\s]\s*$/ ); //last nonwhitespace character
491491 templateNameIndex = ranges.push( new Range( nameMatch.index,
@@ -493,6 +493,10 @@
494494 ranges[templateNameIndex].old = wikitext.substring( ranges[templateNameIndex].begin,
495495 ranges[templateNameIndex].end );
496496 }
 497+ else{
 498+ ranges.push(new Range(0,0));
 499+ ranges[templateNameIndex].old = "";
 500+ }
497501 params.push( ranges[templateNameIndex].old ); //put something in params (0)
498502 /*
499503 * Start looping over params

Follow-up revisions

RevisionCommit summaryAuthorDate
r61517UsabilityInitiative: Bump and recombine for r61508, whitespace changes for r6...catrope14:20, 26 January 2010

Status & tagging log