Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.templateEditor.js |
— | — | @@ -103,6 +103,7 @@ |
104 | 104 | $( this ).html() |
105 | 105 | .replace( /\{\{/, '<span class="wikiEditor-template-start">{{</span><span class="wikiEditor-template-inner-text">' ) |
106 | 106 | .replace( /\}\}$/, '</span><span class="wikiEditor-template-end">}}</span>' ) ) //grab the *last* {{ |
| 107 | + .css('visibility', 'hidden') |
107 | 108 | .parent() |
108 | 109 | .addClass( 'wikiEditor-template-collapsed' ) |
109 | 110 | .data( 'model', model ); |
— | — | @@ -126,8 +127,7 @@ |
127 | 128 | .append( $( '<span>F</span>' ) ) |
128 | 129 | .mousedown( function(){createDialog($template); return false;} )); |
129 | 130 | |
130 | | - |
131 | | - |
| 131 | + |
132 | 132 | // Expand |
133 | 133 | function expandTemplate( $displayDiv ) { |
134 | 134 | // Housekeeping |
— | — | @@ -484,7 +484,7 @@ |
485 | 485 | doneParsing = true; |
486 | 486 | } |
487 | 487 | nameMatch = sanatizedStr.substring( 0, divider ).match( /[^\s]/ ); |
488 | | - if ( nameMatch != undefined ) { |
| 488 | + if ( nameMatch != null ) { |
489 | 489 | ranges.push( new Range( 0 ,nameMatch.index ) ); //whitespace and squiggles upto the name |
490 | 490 | nameEndMatch = sanatizedStr.substring( 0 , divider ).match( /[^\s]\s*$/ ); //last nonwhitespace character |
491 | 491 | templateNameIndex = ranges.push( new Range( nameMatch.index, |
— | — | @@ -493,6 +493,10 @@ |
494 | 494 | ranges[templateNameIndex].old = wikitext.substring( ranges[templateNameIndex].begin, |
495 | 495 | ranges[templateNameIndex].end ); |
496 | 496 | } |
| 497 | + else{ |
| 498 | + ranges.push(new Range(0,0)); |
| 499 | + ranges[templateNameIndex].old = ""; |
| 500 | + } |
497 | 501 | params.push( ranges[templateNameIndex].old ); //put something in params (0) |
498 | 502 | /* |
499 | 503 | * Start looping over params |