r88184 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88183‎ | r88184 | r88185 >
Date:14:18, 15 May 2011
Author:mah
Status:ok
Tags:
Comment:
w/s and typo fix
Modified paths:
  • /trunk/phase3/resources/mediawiki/mediawiki.js (modified) (history)

Diff [purge]

Index: trunk/phase3/resources/mediawiki/mediawiki.js
@@ -55,10 +55,10 @@
5656 return true;
5757 },
5858 compareObject : function( objectA, objectB ) {
59 -
 59+
6060 // Do a simple check if the types match
6161 if ( typeof objectA == typeof objectB ) {
62 -
 62+
6363 // Only loop over the contents if it really is an object
6464 if ( typeof objectA == 'object' ) {
6565 // If they are aliases of the same object (ie. mw and mediaWiki) return now
@@ -249,7 +249,7 @@
250250 var index = parseInt( match, 10 ) - 1;
251251 return index in parameters ? parameters[index] : '$' + match;
252252 } );
253 -
 253+
254254 if ( this.format === 'plain' ) {
255255 return text;
256256 }
@@ -258,7 +258,7 @@
259259 // still todo
260260 return mw.html.escape( text );
261261 }
262 -
 262+
263263 /* This should be fixed up when we have a parser
264264 if ( this.format === 'parse' && 'language' in mediaWiki ) {
265265 text = mw.language.parse( text );
@@ -286,10 +286,10 @@
287287 this.format = 'plain';
288288 return this.toString();
289289 };
290 -
 290+
291291 /**
292292 * Changes the format to html escaped and converts message to string
293 - *
 293+ *
294294 * @return {string} String form of html escaped message
295295 */
296296 Message.prototype.escaped = function() {
@@ -323,10 +323,10 @@
324324
325325 /**
326326 * Generates a random user session ID (32 alpha-numeric characters).
327 - *
 327+ *
328328 * This information would potentially be stored in a cookie to identify a user during a
329329 * session or series of sessions. It's uniqueness should not be depended on.
330 - *
 330+ *
331331 * @return string random set of 32 alpha-numeric characters
332332 */
333333 function generateId() {
@@ -341,7 +341,7 @@
342342
343343 /**
344344 * Gets the current user's name.
345 - *
 345+ *
346346 * @return mixed user name string or null if users is anonymous
347347 */
348348 this.name = function() {
@@ -350,7 +350,7 @@
351351
352352 /**
353353 * Checks if the current user is anonymous.
354 - *
 354+ *
355355 * @return boolean
356356 */
357357 this.anonymous = function() {
@@ -359,14 +359,14 @@
360360
361361 /**
362362 * Gets a random session ID automatically generated and kept in a cookie.
363 - *
 363+ *
364364 * This ID is ephemeral for everyone, staying in their browser only until they close
365365 * their browser.
366 - *
 366+ *
367367 * Do not use this method before the first call to mw.loader.go(), it depends on
368368 * jquery.cookie, which is added to the first pay-load just after mediaWiki is defined, but
369369 * won't be loaded until the first call to go().
370 - *
 370+ *
371371 * @return string user name or random session ID
372372 */
373373 this.sessionId = function () {
@@ -380,15 +380,15 @@
381381
382382 /**
383383 * Gets the current user's name or a random ID automatically generated and kept in a cookie.
384 - *
 384+ *
385385 * This ID is persistent for anonymous users, staying in their browser up to 1 year. The
386386 * expiration time is reset each time the ID is queried, so in most cases this ID will
387387 * persist until the browser's cookies are cleared or the user doesn't visit for 1 year.
388 - *
 388+ *
389389 * Do not use this method before the first call to mw.loader.go(), it depends on
390390 * jquery.cookie, which is added to the first pay-load just after mediaWiki is defined, but
391391 * won't be loaded until the first call to go().
392 - *
 392+ *
393393 * @return string user name or random session ID
394394 */
395395 this.id = function() {
@@ -407,7 +407,7 @@
408408
409409 /**
410410 * Gets the user's bucket, placing them in one at random based on set odds if needed.
411 - *
 411+ *
412412 * @param key String: Name of bucket
413413 * @param options Object: Bucket configuration options
414414 * @param options.buckets Object: List of bucket-name/relative-probability pairs (required,
@@ -419,7 +419,7 @@
420420 * @param options.expires Number: Length of time (in days) until the user gets rebucketed
421421 * (optional, default: 30)
422422 * @return String: Bucket name - the randomly chosen key of the options.buckets object
423 - *
 423+ *
424424 * @example
425425 * mw.user.bucket( 'test', {
426426 * 'buckets': { 'ignored': 50, 'control': 25, 'test': 25 },
@@ -820,7 +820,7 @@
821821
822822 /**
823823 * Automatically executes jobs and modules which are pending with satistifed dependencies.
824 - *
 824+ *
825825 * This is used when dependencies are satisfied, such as when a module is executed.
826826 */
827827 function handlePending() {
@@ -916,7 +916,7 @@
917917 }
918918 return sorted;
919919 }
920 -
 920+
921921 /**
922922 * Converts a module map of the form { foo: [ 'bar', 'baz' ], bar: [ 'baz, 'quux' ] }
923923 * to a query string of the form foo.bar,baz|bar.baz,quux
@@ -933,7 +933,7 @@
934934 /**
935935 * Adds a script tag to the body, either using document.write or low-level DOM manipulation,
936936 * depending on whether document-ready has occured yet.
937 - *
 937+ *
938938 * @param src String: URL to script, will be used as the src attribute in the script tag
939939 * @param callback Function: Optional callback which will be run when the script is done
940940 */
@@ -1051,7 +1051,7 @@
10521052 var bytesAdded = prefix in reqs[r] ?
10531053 suffix.length + 3 : // '%2C'.length == 3
10541054 groups[group][i].length + 3; // '%7C'.length == 3
1055 -
 1055+
10561056 // If the request would become too long, create a new one,
10571057 // but don't create empty requests
10581058 if ( limit > 0 && reqs[r] != {} && l + bytesAdded > limit ) {
@@ -1085,7 +1085,7 @@
10861086 addScript( src );
10871087 }
10881088 };
1089 -
 1089+
10901090 /**
10911091 * Registers a module, letting the system know about it and its
10921092 * dependencies. loader.js files contain calls to this function.
@@ -1107,7 +1107,7 @@
11081108 throw new Error( 'module must be a string, not a ' + typeof module );
11091109 }
11101110 if ( typeof registry[module] !== 'undefined' ) {
1111 - throw new Error( 'module already implemeneted: ' + module );
 1111+ throw new Error( 'module already implemented: ' + module );
11121112 }
11131113 // List the module as registered
11141114 registry[module] = {
@@ -1130,9 +1130,9 @@
11311131 * Implements a module, giving the system a course of action to take
11321132 * upon loading. Results of a request for one or more modules contain
11331133 * calls to this function.
1134 - *
 1134+ *
11351135 * All arguments are required.
1136 - *
 1136+ *
11371137 * @param module String: Name of module
11381138 * @param script Mixed: Function of module code or String of URL to be used as the src
11391139 * attribute when adding a script element to the body

Status & tagging log