r70019 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70018‎ | r70019 | r70020 >
Date:17:23, 27 July 2010
Author:neilk
Status:deferred
Tags:
Comment:
misc fixes for IE6 / strict JS linting
Modified paths:
  • /trunk/extensions/UploadWizard/js/jquery/plugins/jquery.tipsy.js (modified) (history)
  • /trunk/extensions/UploadWizard/js/mw.ApiUploadHandler.js (modified) (history)
  • /trunk/extensions/UploadWizard/js/mw.DestinationChecker.js (modified) (history)
  • /trunk/extensions/UploadWizard/js/mw.IframeTransport.js (modified) (history)
  • /trunk/extensions/UploadWizard/js/mw.LanguageUpWiz.js (modified) (history)
  • /trunk/extensions/UploadWizard/js/mw.MockUploadHandler.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/js/jquery/plugins/jquery.tipsy.js
@@ -179,7 +179,7 @@
180180 opacity: 1.0,
181181 title: 'title',
182182 trigger: 'hover',
183 - type: 'help',
 183+ type: 'help'
184184 };
185185
186186 // Overwrite this method to provide options on a per-element basis.
Index: trunk/extensions/UploadWizard/js/mw.LanguageUpWiz.js
@@ -26,8 +26,8 @@
2727 { code: "ace", text: "Ac\u00e8h" },
2828 { code: "af", text: "Afrikaans" },
2929 { code: "ak", text: "Akan" },
30 - { code: "als", text: "Alemannisch" }, // } XXX someone fix this please
31 - { code: "gsw", text: "Alemannisch" }, // }
 30+ { code: "als", text: "Alemannisch" }, // XXX someone fix this please
 31+ { code: "gsw", text: "Alemannisch" }, //
3232 { code: "ang", text: "Anglo-Saxon" },
3333 { code: "an", text: "Aragon\u00e9s" },
3434 { code: "roa-rup", text: "Arm\u00e3neashce" },
@@ -76,8 +76,8 @@
7777 { code: "ext", text: "Estreme\u00f1u" },
7878 { code: "eu", text: "Euskara" },
7979 { code: "ee", text: "E\u028begbe" },
80 - { code: "hif", text: "Fiji Hindi" }, // } XXX fix this
81 - { code: "hif-latn", text: "Fiji Hindi" }, // }
 80+ { code: "hif", text: "Fiji Hindi" }, // XXX fix this
 81+ { code: "hif-latn", text: "Fiji Hindi" }, //
8282 { code: "fr", text: "Fran\u00e7ais" },
8383 { code: "frc", text: "Fran\u00e7ais canadien" },
8484 { code: "fy", text: "Frysk" },
@@ -378,7 +378,7 @@
379379 { code: "ii", text: "\ua187\ua259" },
380380 { code: "ko", text: "\ud55c\uad6d\uc5b4" },
381381 { code: "ko-kp", text: "\ud55c\uad6d\uc5b4 (\uc870\uc120)" },
382 - { code: "got", text: "\ud800\udf32\ud800\udf3f\ud800\udf44\ud800\udf39\ud800\udf43\ud800\udf3a" },
 382+ { code: "got", text: "\ud800\udf32\ud800\udf3f\ud800\udf44\ud800\udf39\ud800\udf43\ud800\udf3a" }
383383 ],
384384
385385 /**
@@ -449,7 +449,7 @@
450450 return code;
451451 }
452452 return mw.LanguageUpWiz.getClosest( code.substring( 0, code.indexOf( '-' )) );
453 - },
 453+ }
454454
455455
456456 // enhance a simple text input to be an autocompleting language menu
@@ -489,4 +489,4 @@
490490 // although other info such as Information boxes was recorded correctly.
491491 // This is presumed not to apply to the shiny new world of JS2, where i18n is handled in other ways.
492492
493 -}
 493+};
Index: trunk/extensions/UploadWizard/js/mw.DestinationChecker.js
@@ -47,7 +47,7 @@
4848 $j( _this.selector )[eventName]( check );
4949 } );
5050
51 -}
 51+};
5252
5353 mw.DestinationChecker.prototype = {
5454
@@ -73,7 +73,7 @@
7474 * @param something
7575 * @return that same thing
7676 */
77 - preprocess: function(x) { return x },
 77+ preprocess: function(x) { return x; },
7878
7979 /**
8080 * fire when the input changes value or keypress
@@ -94,7 +94,7 @@
9595 function() { checker.checkUnique(); },
9696 checker.delay
9797 );
98 - }
 98+ };
9999 },
100100
101101 /**
@@ -165,10 +165,11 @@
166166 // Conflict found, this filename is NOT unique
167167 mw.log( " conflict! " );
168168
 169+ var ntitle;
169170 if ( data.query.normalized ) {
170 - var ntitle = data.query.normalized[0].to;
 171+ ntitle = data.query.normalized[0].to;
171172 } else {
172 - var ntitle = data.query.pages[ page_id ].title
 173+ ntitle = data.query.pages[ page_id ].title;
173174 }
174175
175176 var img = data.query.pages[ page_id ].imageinfo[0];
Index: trunk/extensions/UploadWizard/js/mw.ApiUploadHandler.js
@@ -20,8 +20,8 @@
2121 // can also use Xhr Binary depending on config
2222 _this.transport = new mw.IframeTransport(
2323 _this.upload.ui.form,
24 - function( fraction ){ _this.upload.setTransportProgress( fraction ) },
25 - function( result ) { _this.upload.setTransported( result ) }
 24+ function( fraction ){ _this.upload.setTransportProgress( fraction ); },
 25+ function( result ) { _this.upload.setTransported( result ); }
2626 );
2727
2828 };
@@ -72,7 +72,7 @@
7373 addFormInputIfMissing: function( name, value ) {
7474 var _this = this;
7575 var $jForm = $j( _this.upload.ui.form );
76 - if ( $jForm.find( "[name='" + name + "']" ).length == 0 ) {
 76+ if ( $jForm.find( "[name='" + name + "']" ).length === 0 ) {
7777 $jForm.append(
7878 $j( '<input />' )
7979 .attr( {
@@ -93,7 +93,7 @@
9494 _this.beginTime = ( new Date() ).getTime();
9595 _this.upload.ui.busy();
9696 $j( this.upload.ui.form ).submit();
97 - },
 97+ }
9898 };
9999
100100
Index: trunk/extensions/UploadWizard/js/mw.MockUploadHandler.js
@@ -28,9 +28,9 @@
2929 if (1.0 - _this.progress < delta) {
3030 _this.upload.setTransported();
3131 } else {
32 - setTimeout( function() { _this.nextState() }, 200 );
 32+ setTimeout( function() { _this.nextState(); }, 200 );
3333 }
34 - },
 34+ }
3535
3636 };
3737
Index: trunk/extensions/UploadWizard/js/mw.IframeTransport.js
@@ -29,7 +29,7 @@
3030 .attr( { 'src' : 'javascript:false;',
3131 'id' : _this.iframeId,
3232 'name' : _this.iframeId } )
33 - .load( function() { _this.configureForm() } )
 33+ .load( function() { _this.configureForm(); } )
3434 .css( 'display', 'none' );
3535
3636 $j( "body" ).append( iframe );
@@ -90,7 +90,7 @@
9191 // Get the json string
9292 // XXX wait... why are we grepping it out of an HTML doc? We requested jsonfm, why?
9393 json = $j( doc.body ).find( 'pre' ).text();
94 - mw.log( 'iframe:json::' + json )
 94+ mw.log( 'iframe:json::' + json );
9595 if ( json ) {
9696 response = window["eval"]( "( " + json + " )" );
9797 } else {

Status & tagging log