r78848 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78847‎ | r78848 | r78849 >
Date:21:55, 22 December 2010
Author:neilk
Status:deferred
Tags:
Comment:
jslint fixes, formatting & indentation
Modified paths:
  • /trunk/extensions/UploadWizard/resources/language/mw.Parser.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/language/mw.Parser.js
@@ -114,7 +114,7 @@
115115 for ( var pInx = 0; pInx < paramSet.length; pInx++ ) {
116116 var paramString = paramSet[ pInx ];
117117 // check for empty param
118 - if ( paramString == '' ) {
 118+ if ( paramString === '' ) {
119119 templateObject.param[ pInx ] = '';
120120 continue;
121121 }
@@ -166,13 +166,13 @@
167167 text = text.replace( re , LINK_SWAP_STRING );
168168
169169 for( var i=0; i < matchSet.length; i++ ) {
170 - // Strip the leading [ and trailing ]
171 - var matchParts = matchSet[i].substr(1, matchSet[i].length-2);
172 -
173 - // Check for special jQuery type swap and replace inner JQUERY_SWAP_STRING not value
 170+ // Strip the leading [ and trailing ]
 171+ var matchParts = matchSet[i].substr(1, matchSet[i].length-2);
 172+
 173+ // Check for special jQuery type swap and replace inner JQUERY_SWAP_STRING not value
174174 if( matchParts.indexOf( JQUERY_SWAP_STRING ) !== -1 ) {
175175 // parse the link as html
176 - var $matchParts = $j('<span>' + matchParts + '</span>' );
 176+ var $matchParts = $j('<span>' + matchParts + '</span>' );
177177
178178 $jQuerySpan = $matchParts.find('#' +JQUERY_SWAP_STRING + i );
179179
@@ -182,14 +182,14 @@
183183
184184 text = text.replace( LINK_SWAP_STRING, $j('<span />' ).append( $jQuerySpan ).html() );
185185 } else {
186 - // do text string replace
187 - matchParts = matchParts.split(/ /);
188 - var link = matchParts[0];
189 - matchParts.shift();
190 - var linkText = matchParts.join(' ');
191 -
192 - text = text.replace( LINK_SWAP_STRING, '<a href="' + link + '">' + linkText + '</a>' );
193 - }
 186+ // do text string replace
 187+ matchParts = matchParts.split(/ /);
 188+ var link = matchParts[0];
 189+ matchParts.shift();
 190+ var linkText = matchParts.join(' ');
 191+
 192+ text = text.replace( LINK_SWAP_STRING, '<a href="' + link + '">' + linkText + '</a>' );
 193+ }
194194 }
195195 return text;
196196 }

Status & tagging log