Jforrester has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/247489

Change subject: build: Re-enable all whitesapce-related jscs rules and fix them
......................................................................

build: Re-enable all whitesapce-related jscs rules and fix them

Change-Id: Ib4f4e8ede9d409bd60c9a4786286131d53741f6d
---
M .jscsrc
M resources/handlers/mw.ApiUploadHandler.js
M resources/handlers/mw.FirefoggHandler.js
M resources/mw.DestinationChecker.js
M resources/mw.Firefogg.js
M resources/mw.FlickrChecker.js
M resources/mw.GroupProgressBar.js
M resources/mw.LanguageUpWiz.js
M resources/mw.UploadWizard.js
M resources/mw.UploadWizardDeed.js
M resources/mw.UploadWizardDescription.js
M resources/mw.UploadWizardDetails.js
M resources/mw.UploadWizardLicenseInput.js
M resources/mw.UploadWizardUpload.js
M resources/mw.UploadWizardUploadInterface.js
M resources/transports/mw.FirefoggTransport.js
M resources/transports/mw.FormDataTransport.js
M resources/transports/mw.IframeTransport.js
M resources/ui/uw.ui.Thanks.js
M resources/uw.EventFlowLogger.js
M tests/qunit/controller/uw.controller.Step.test.js
M tests/qunit/mw.FlickrChecker.test.js
M tests/qunit/mw.UploadWizardDetails.test.js
M tests/qunit/uw.EventFlowLogger.test.js
24 files changed, 151 insertions(+), 158 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/89/247489/1

diff --git a/.jscsrc b/.jscsrc
index 31d8acf..b201044 100644
--- a/.jscsrc
+++ b/.jscsrc
@@ -3,16 +3,9 @@
 
        "disallowImplicitTypeConversion": null,
        "disallowNewlineBeforeBlockStatements": null,
-       "disallowSpacesInCallExpression": null,
        "jsDoc": null,
        "requireDotNotation": null,
-       "requireSpaceAfterLineComment": null,
-       "requireSpaceBeforeKeywords": null,
-       "requireSpaceBeforeObjectValues": null,
-       "requireSpacesInsideBrackets": null,
-       "requireSpacesInsideParentheses": null,
        "requireVarDeclFirst": null,
-       "validateIndentation": null,
 
        "excludeFiles": [ "resources/jquery/**" ]
 }
diff --git a/resources/handlers/mw.ApiUploadHandler.js 
b/resources/handlers/mw.ApiUploadHandler.js
index 8343eba..7ae33b9 100644
--- a/resources/handlers/mw.ApiUploadHandler.js
+++ b/resources/handlers/mw.ApiUploadHandler.js
@@ -84,7 +84,7 @@
                 */
                addFormInputIfMissing: function ( name, value ) {
                        if ( this.$form.find( '[name="' + name + '"]' ).length 
=== 0 ) {
-                               this.$form.append( $( '<input type="hidden" />' 
) .attr( { name: name, value: value } ));
+                               this.$form.append( $( '<input type="hidden" />' 
) .attr( { name: name, value: value } ) );
                        }
                },
 
diff --git a/resources/handlers/mw.FirefoggHandler.js 
b/resources/handlers/mw.FirefoggHandler.js
index 3fec8f9..197ff04 100644
--- a/resources/handlers/mw.FirefoggHandler.js
+++ b/resources/handlers/mw.FirefoggHandler.js
@@ -67,7 +67,7 @@
                        if ( this.upload.file ) {
                                this.getFogg().setInput( this.upload.file );
 
-                               //This is required to get the right 
requestedTitle in UploadWizardUpload
+                               // This is required to get the right 
requestedTitle in UploadWizardUpload
                                title = this.getTransport().getFileName();
 
                                this.upload.setTitle( title );
diff --git a/resources/mw.DestinationChecker.js 
b/resources/mw.DestinationChecker.js
index df3b286..b94fae9 100644
--- a/resources/mw.DestinationChecker.js
+++ b/resources/mw.DestinationChecker.js
@@ -66,7 +66,7 @@
                 * @param something
                 * @return that same thing
                 */
-               preprocess: function (x) { return x; },
+               preprocess: function ( x ) { return x; },
 
                /**
                 * fire when the input changes value or keypress
@@ -113,7 +113,7 @@
                                        status.blacklist = result.blacklist;
                                }
 
-                               //$.extend( status, result );
+                               // $.extend( status, result );
                                if ( status.unique !== null && status.blacklist 
!== null ) {
                                        status.title = title;
                                        checker.processResult( status );
diff --git a/resources/mw.Firefogg.js b/resources/mw.Firefogg.js
index b8d1783..78c9488 100644
--- a/resources/mw.Firefogg.js
+++ b/resources/mw.Firefogg.js
@@ -21,7 +21,7 @@
                                        osLink = 
this.firefoggInstallLinks.linux;
                                } else if ( navigator.oscpu.search( 'Mac' ) >= 
0 ) {
                                        osLink = 
this.firefoggInstallLinks.macosx;
-                               } else if (navigator.oscpu.search( 'Win' ) >= 0 
) {
+                               } else if ( navigator.oscpu.search( 'Win' ) >= 
0 ) {
                                        osLink = 
this.firefoggInstallLinks.win32;
                                }
                        }
diff --git a/resources/mw.FlickrChecker.js b/resources/mw.FlickrChecker.js
index 0eac33f..f2ac9da 100644
--- a/resources/mw.FlickrChecker.js
+++ b/resources/mw.FlickrChecker.js
@@ -66,16 +66,16 @@
                 */
                checkFlickr: function ( flickrInputUrl ) {
                        this.url = flickrInputUrl;
-                       var photoIdMatches = 
this.url.match(/flickr\.com\/(?:x\/t\/[^\/]+\/)?photos\/[^\/]+\/([0-9]+)/),
-                               albumIdMatches = 
this.url.match(/flickr\.com\/photos\/[^\/]+\/sets\/([0-9]+)/),
-                               userCollectionMatches = 
this.url.match(/flickr\.com\/(?:x\/t\/[^\/]+\/)?photos\/[^\/]+\/collections\/?([0-9]+)?/),
-                               userPhotostreamMatches = 
this.url.match(/flickr\.com\/(?:x\/t\/[^\/]+\/)?photos\/([^\/]+)/),
-                               groupPoolMatches = 
this.url.match(/flickr\.com\/groups\/[^\/]+(?:\/pool\/([^\/]+))?/),
-                               userGalleryMatches = 
this.url.match(/flickr\.com\/(?:x\/t\/[^\/]+\/)?photos\/[^\/]+\/galleries\/([0-9]+)/),
-                               userFavoritesMatches = 
this.url.match(/flickr\.com\/(?:x\/t\/[^\/]+\/)?photos\/([^\/]+)\/favorites/);
+                       var photoIdMatches = this.url.match( 
/flickr\.com\/(?:x\/t\/[^\/]+\/)?photos\/[^\/]+\/([0-9]+)/ ),
+                               albumIdMatches = this.url.match( 
/flickr\.com\/photos\/[^\/]+\/sets\/([0-9]+)/ ),
+                               userCollectionMatches = this.url.match( 
/flickr\.com\/(?:x\/t\/[^\/]+\/)?photos\/[^\/]+\/collections\/?([0-9]+)?/ ),
+                               userPhotostreamMatches = this.url.match( 
/flickr\.com\/(?:x\/t\/[^\/]+\/)?photos\/([^\/]+)/ ),
+                               groupPoolMatches = this.url.match( 
/flickr\.com\/groups\/[^\/]+(?:\/pool\/([^\/]+))?/ ),
+                               userGalleryMatches = this.url.match( 
/flickr\.com\/(?:x\/t\/[^\/]+\/)?photos\/[^\/]+\/galleries\/([0-9]+)/ ),
+                               userFavoritesMatches = this.url.match( 
/flickr\.com\/(?:x\/t\/[^\/]+\/)?photos\/([^\/]+)\/favorites/ );
                        if ( photoIdMatches === null ) {
                                // try static urls
-                               photoIdMatches = 
this.url.match(/static\.?flickr\.com\/[^\/]+\/([0-9]+)_/);
+                               photoIdMatches = this.url.match( 
/static\.?flickr\.com\/[^\/]+\/([0-9]+)_/ );
                        }
                        if ( albumIdMatches || photoIdMatches || 
userCollectionMatches || userPhotostreamMatches ||
                                groupPoolMatches || userGalleryMatches || 
userFavoritesMatches ) {
diff --git a/resources/mw.GroupProgressBar.js b/resources/mw.GroupProgressBar.js
index 46497e8..472d99c 100644
--- a/resources/mw.GroupProgressBar.js
+++ b/resources/mw.GroupProgressBar.js
@@ -76,9 +76,9 @@
                                        if ( $.inArray( upload.state, 
bar.errorStates ) !== -1 ) {
                                                errorStateCount++;
                                        }
-                                       if (upload[ bar.progressProperty ] !== 
undefined) {
+                                       if ( upload[ bar.progressProperty ] !== 
undefined ) {
                                                fraction += upload[ 
bar.progressProperty ] * ( upload[ bar.weightProperty ] / totalWeight );
-                                               if (upload[ 
bar.progressProperty ] > 0 ) {
+                                               if ( upload[ 
bar.progressProperty ] > 0 ) {
                                                        hasData = true;
                                                }
                                        }
diff --git a/resources/mw.LanguageUpWiz.js b/resources/mw.LanguageUpWiz.js
index 9920db0..e7745d0 100644
--- a/resources/mw.LanguageUpWiz.js
+++ b/resources/mw.LanguageUpWiz.js
@@ -111,7 +111,7 @@
 
                        /* Pre select the 'code' language */
                        if ( code !== undefined && 
mw.LanguageUpWiz.checkForLang( code ) ) {
-                               $select.val( mw.LanguageUpWiz.getClosest( code 
));
+                               $select.val( mw.LanguageUpWiz.getClosest( code 
) );
                        }
 
                        return $select.get( 0 );
@@ -141,7 +141,7 @@
                        } else if ( mw.LanguageUpWiz.codes[ code ] !== 
undefined ) {
                                return code;
                        }
-                       return mw.LanguageUpWiz.getClosest( code.substring( 0, 
code.indexOf( '-' )) );
+                       return mw.LanguageUpWiz.getClosest( code.substring( 0, 
code.indexOf( '-' ) ) );
                }
        };
 }( mediaWiki, jQuery ) );
diff --git a/resources/mw.UploadWizard.js b/resources/mw.UploadWizard.js
index 79cb364..2e1c398 100644
--- a/resources/mw.UploadWizard.js
+++ b/resources/mw.UploadWizard.js
@@ -519,10 +519,10 @@
                                .attr( attrs )
                                .click( function () {
                                        if ( !this.displayed ) {
-                                               $ ( this ).tipsy( 'show' );
+                                               $( this ).tipsy( 'show' );
                                                this.displayed = true;
                                        } else {
-                                               $ ( this ).tipsy( 'hide' );
+                                               $( this ).tipsy( 'hide' );
                                                this.displayed = false;
                                        }
                                        return false;
@@ -539,7 +539,7 @@
         */
        jQuery.fn.growTextArea = function () {
                function resizeIfNeeded() {
-               // Begin stolen code from OOJS-UI's 
TextInputWidget.prototype.adjustSize
+                       // Begin stolen code from OOJS-UI's 
TextInputWidget.prototype.adjustSize
                        var $clone, scrollHeight, innerHeight, outerHeight, 
maxInnerHeight, measurementError, idealHeight,
                                $this = $( this );
 
diff --git a/resources/mw.UploadWizardDeed.js b/resources/mw.UploadWizardDeed.js
index f85ea11..f5e8dd0 100644
--- a/resources/mw.UploadWizardDeed.js
+++ b/resources/mw.UploadWizardDeed.js
@@ -195,7 +195,7 @@
                                $crossfader = $( '<div />' ).append( 
$standardDiv );
 
                                if ( this.showCustomDiv ) {
-                                       $customDiv = $('<div />').append(
+                                       $customDiv = $( '<div />' ).append(
                                                $( '<label for="author" 
generated="true" class="mwe-validator-error" style="display: block;" />' ),
                                                $( '<p></p>' ).msg( 
'mwe-upwiz-source-ownwork-assert-custom',
                                                        uploadCount,
@@ -214,7 +214,7 @@
                                                .msg( 
'mwe-upwiz-license-show-all' )
                                                .click( function () {
                                                        
thisDeed.formValidator.resetForm();
-                                                       if ( $crossfader.data( 
'crossfadeDisplay' ).get(0) === $customDiv.get(0) ) {
+                                                       if ( $crossfader.data( 
'crossfadeDisplay' ).get( 0 ) === $customDiv.get( 0 ) ) {
                                                                
thisDeed.licenseInput.setDefaultValues();
                                                                
$crossfader.morphCrossfade( $standardDiv );
                                                                $( this ).msg( 
'mwe-upwiz-license-show-all' );
@@ -240,7 +240,7 @@
                                                var thisInput = this,
                                                        thisVal = $( thisInput 
).val();
                                                $.each( $formFields.find( 
'.mwe-upwiz-sign' ), function ( i, input ) {
-                                                       if (thisInput !== 
input) {
+                                                       if ( thisInput !== 
input ) {
                                                                $( input ).val( 
thisVal );
                                                        }
                                                } );
@@ -254,7 +254,7 @@
                                rules = {
                                        author2: {
                                                required: function () {
-                                                       return 
$crossfader.data( 'crossfadeDisplay' ).get(0) === $standardDiv.get(0);
+                                                       return 
$crossfader.data( 'crossfadeDisplay' ).get( 0 ) === $standardDiv.get( 0 );
                                                },
                                                minlength: 
config.minAuthorLength,
                                                maxlength: 
config.maxAuthorLength
@@ -275,7 +275,7 @@
 
                                        rules.author = {
                                                required: function () {
-                                                       return 
$crossfader.data( 'crossfadeDisplay' ).get(0) === $customDiv.get(0);
+                                                       return 
$crossfader.data( 'crossfadeDisplay' ).get( 0 ) === $customDiv.get( 0 );
                                                },
                                                minlength: 
config.minAuthorLength,
                                                maxlength: 
config.maxAuthorLength
@@ -315,10 +315,10 @@
                        deed = new mw.UploadWizardDeed();
 
                deed.uploadCount = uploadCount ? uploadCount : 1;
-               deed.sourceInput = $('<textarea class="mwe-source 
mwe-long-textarea" name="source" rows="1" cols="40"></textarea>' )
+               deed.sourceInput = $( '<textarea class="mwe-source 
mwe-long-textarea" name="source" rows="1" cols="40"></textarea>' )
                                        .attr( 'id', 'mwe-source-' + 
deed.getInstanceCount() )
                                        .growTextArea();
-               deed.authorInput = $('<textarea class="mwe-author 
mwe-long-textarea" name="author" rows="1" cols="40"></textarea>' )
+               deed.authorInput = $( '<textarea class="mwe-author 
mwe-long-textarea" name="author" rows="1" cols="40"></textarea>' )
                                        .attr( 'id', 'mwe-author-' + 
deed.getInstanceCount() )
                                        .growTextArea();
                licenseInputDiv = $( '<div 
class="mwe-upwiz-deed-license-groups"></div>' );
@@ -347,7 +347,7 @@
                                        $formFields.append( $( '<div>' ).msg( 
'mwe-upwiz-source-thirdparty-custom-multiple-intro' ) );
                                }
 
-                               $formFields.append (
+                               $formFields.append(
                                        $( '<div 
class="mwe-upwiz-source-thirdparty-custom-multiple-intro" />' ),
                                        $( '<label generated="true" 
class="mwe-validator-error" style="display: block;" />' )
                                                .attr( 'for', 'mwe-source-' + 
this.getInstanceCount() ),
@@ -518,7 +518,7 @@
                        var valid = this.deed.valid();
                        // the only time we need to set an error message is if 
the null deed is selected.
                        // otherwise, we can assume that the widgets have 
already added error messages.
-                       if (valid) {
+                       if ( valid ) {
                                this.hideError();
                        }
                        return valid;
@@ -562,8 +562,8 @@
                        $.each( $deedSelector.find( '.mwe-upwiz-deed-form' ), 
function ( i, form ) {
                                var $form = $( form ),
                                        originalResetForm = $.fn.resetForm;
-                               $.each( $form.find('.mwe-upwiz-hint'), function 
( i, hint ) {
-                                       $( hint ).tipsy('hide');
+                               $.each( $form.find( '.mwe-upwiz-hint' ), 
function ( i, hint ) {
+                                       $( hint ).tipsy( 'hide' );
                                } );
                                // Remove errors
                                if ( originalResetForm ) {
@@ -607,7 +607,7 @@
                },
 
                remove: function () {
-                       this.$selector.html('');
+                       this.$selector.html( '' );
                }
 
        }; // end UploadWizardDeed.prototype
diff --git a/resources/mw.UploadWizardDescription.js 
b/resources/mw.UploadWizardDescription.js
index 2e60abd..b79898e 100644
--- a/resources/mw.UploadWizardDescription.js
+++ b/resources/mw.UploadWizardDescription.js
@@ -25,10 +25,10 @@
 
                // Logic copied from MediaWiki:UploadForm.js
                // Per request from Portuguese and Brazilian users, treat 
Brazilian Portuguese as Portuguese.
-               if (languageCode === 'pt-br') {
+               if ( languageCode === 'pt-br' ) {
                        languageCode = 'pt';
                // this was also in UploadForm.js, but without the heartwarming 
justification
-               } else if (languageCode === 'en-gb') {
+               } else if ( languageCode === 'en-gb' ) {
                        languageCode = 'en';
                }
 
@@ -50,7 +50,7 @@
                }
 
                // descriptions
-               this.div = $('<div 
class="mwe-upwiz-details-descriptions-container ui-helper-clearfix"></div>' )
+               this.div = $( '<div 
class="mwe-upwiz-details-descriptions-container ui-helper-clearfix"></div>' )
                                .append( errorLabelDiv, fieldnameDiv, 
this.languageMenu, this.input );
 
                this.description = new uw.model.Description( languageCode, 
initialValue, mw.UploadWizard.config.languageTemplateFixups );
@@ -98,7 +98,7 @@
                 * @param {string} ietfLanguageTag the selector should be set to
                 */
                setLanguage: function ( ietfLanguageTag ) {
-                       $( this.languageMenu ).val( 
ietfLanguageTag.replace(/_/g, '-').toLowerCase() );
+                       $( this.languageMenu ).val( ietfLanguageTag.replace( 
/_/g, '-' ).toLowerCase() );
                },
 
                /**
diff --git a/resources/mw.UploadWizardDetails.js 
b/resources/mw.UploadWizardDetails.js
index 48548ea..59e00fe 100644
--- a/resources/mw.UploadWizardDetails.js
+++ b/resources/mw.UploadWizardDetails.js
@@ -47,9 +47,9 @@
                        );
 
                // Commons specific help for titles
-               //      https://commons.wikimedia.org/wiki/Commons:File_naming
-               //      
https://commons.wikimedia.org/wiki/MediaWiki:Filename-prefix-blacklist
-               //      XXX make sure they can't use ctrl characters or returns 
or any other bad stuff.
+               //  https://commons.wikimedia.org/wiki/Commons:File_naming
+               //  
https://commons.wikimedia.org/wiki/MediaWiki:Filename-prefix-blacklist
+               // XXX make sure they can't use ctrl characters or returns or 
any other bad stuff.
                this.titleId = 'title' + this.upload.index;
                this.titleInput = this.makeTextInput( this.titleId, 'title', 
undefined, 250 )
                        .keyup( function () {
@@ -57,7 +57,7 @@
                        } )
                        .destinationChecked( {
                                api: this.upload.api,
-                               spinner: function (bool) { 
details.toggleDestinationBusy(bool); },
+                               spinner: function ( bool ) { 
details.toggleDestinationBusy( bool ); },
                                preprocess: function ( name ) {
                                        var cleanTitle;
 
@@ -100,7 +100,7 @@
                makeAndAppendTitleErrorLabel( 'mwe-upwiz-error-title-unique 
mwe-upwiz-validation-delayed' );
                makeAndAppendTitleErrorLabel( 'mwe-upwiz-error-recovery 
mwe-upwiz-validation-delayed' );
 
-               titleContainerDiv = $('<div 
class="mwe-upwiz-details-fieldname-input ui-helper-clearfix"></div>')
+               titleContainerDiv = $( '<div 
class="mwe-upwiz-details-fieldname-input ui-helper-clearfix"></div>' )
                        .append(
                                this.titleErrorDiv,
                                $( '<div 
class="mwe-upwiz-details-fieldname"></div>' )
@@ -112,7 +112,7 @@
 
                this.deedDiv = $( '<div class="mwe-upwiz-custom-deed" />' );
 
-               this.copyrightInfoFieldset = $('<fieldset class="mwe-fieldset 
mwe-upwiz-copyright-info"></fieldset>')
+               this.copyrightInfoFieldset = $( '<fieldset class="mwe-fieldset 
mwe-upwiz-copyright-info"></fieldset>' )
                        .hide()
                        .append(
                                $( '<legend class="mwe-legend">' ).text( 
mw.message( 'mwe-upwiz-copyright-info' ).text() ),
@@ -125,7 +125,7 @@
                                '<div class="mwe-upwiz-details-input"></div>' +
                        '</div>'
                );
-               commonsCategoriesLink = $( '<a>' ).attr( { target:'_blank', 
href:'https://commons.wikimedia.org/wiki/Commons:Categories' } );
+               commonsCategoriesLink = $( '<a>' ).attr( { target: '_blank', 
href: 'https://commons.wikimedia.org/wiki/Commons:Categories' } );
                categoriesHint = $( '<span>' ).msg( 
'mwe-upwiz-tooltip-categories', commonsCategoriesLink ).html();
                categoriesHinter = function () { return categoriesHint; };
                $categoriesDiv
@@ -135,7 +135,7 @@
 
                dateInputId = 'dateInput' + ( this.upload.index ).toString();
 
-               dateErrorDiv = $('<div 
class="mwe-upwiz-details-input-error"><label class="mwe-validator-error" for="' 
+ dateInputId + '" generated="true"/></div>');
+               dateErrorDiv = $( '<div 
class="mwe-upwiz-details-input-error"><label class="mwe-validator-error" for="' 
+ dateInputId + '" generated="true"/></div>' );
 
                this.dateInputWidgetMode = null; // or: 'calendar', 'arbitrary'
                this.dateInputWidgetToggler = new OO.ui.ButtonSelectWidget( {
@@ -168,7 +168,7 @@
 
                moreDetailsCtrlDiv = $( '<div 
class="mwe-upwiz-details-more-options"></div>' );
 
-               moreDetailsDiv = $('<div class="mwe-more-details"></div>');
+               moreDetailsDiv = $( '<div class="mwe-more-details"></div>' );
 
                otherInformationId = 'otherInformation' + this.upload.index;
                this.otherInformationInput = $( '<textarea id="' + 
otherInformationId + '" name="' + otherInformationId + '" 
class="mwe-upwiz-other-textarea" rows="2" cols="36"></textarea>' )
@@ -178,7 +178,7 @@
                                return false;
                        } );
 
-               otherInformationDiv = $('<div>')
+               otherInformationDiv = $( '<div>' )
                        .append( $( '<div 
class="mwe-upwiz-details-more-label"></div>' ).text( mw.message( 
'mwe-upwiz-other' ).text() ).addHint( 'other' ) )
                        .append( this.otherInformationInput );
 
@@ -191,7 +191,7 @@
                };
 
                locationDiv = $( '<div class="mwe-location 
mwe-upwiz-details-fieldname-input ui-helper-clearfix"></div>' )
-                       .append( $ ('<div class="mwe-location-label"></div>' )
+                       .append( $( '<div class="mwe-location-label"></div>' )
                                .append( mw.message( 'mwe-upwiz-location' 
).escaped() )
                                .addHint( 'location', locationHinter )
                        )
@@ -332,7 +332,7 @@
                        $fieldInput.rules( 'add', {
                                required: $fieldInput.data( 'field' ).required,
                                messages: {
-                                       required: mw.message( 
'mwe-upwiz-error-blank').escaped()
+                                       required: mw.message( 
'mwe-upwiz-error-blank' ).escaped()
                                }
                        } );
                } );
@@ -642,7 +642,7 @@
                                                        moreInfo.click();
                                                }
                                        }
-                               });
+                               } );
                        }
 
                        function oouiCopy( property, methods ) {
@@ -672,7 +672,7 @@
                                // number in the title. Note: We ignore numbers 
with more than three digits, because these
                                // are more likely to be years ("Wikimania 2011 
Celebration") or other non-sequence
                                // numbers.
-                               $( 'input[id^=title]:not(#title' + sourceId + 
')' ).each( function (i) {
+                               $( 'input[id^=title]:not(#title' + sourceId + 
')' ).each( function ( i ) {
                                        var currentTitle = $( this ).val();
                                        currentTitle = titleZero.replace( 
/(\D+)(\d{1,3})(\D*)$/,
                                                function ( str, m1, m2, m3 ) {
@@ -698,7 +698,7 @@
                                                                languageCode = 
srcDescription.getLanguage(),
                                                                allowRemoval = 
!isRequired,
                                                                descriptionText 
= srcDescription.getDescriptionText();
-                                                       
upload.details.addDescription ( isRequired, languageCode, allowRemoval, 
descriptionText );
+                                                       
upload.details.addDescription( isRequired, languageCode, allowRemoval, 
descriptionText );
                                                } );
                                        }
                                } );
@@ -745,7 +745,7 @@
                                        if ( field.wikitext ) {
                                                simpleCopy( 'field_' + i + '_', 
elementType );
                                        }
-                               });
+                               } );
 
                        } else {
                                throw new Error( 'Attempted to copy unsupported 
metadata type: ' + metadataType );
@@ -1297,7 +1297,7 @@
                                }
 
                                // Prefill useful stuff only
-                               if ( Number( m.gpslatitude ) && Number ( 
m.gpslongitude ) ) {
+                               if ( Number( m.gpslatitude ) && Number( 
m.gpslongitude ) ) {
                                        this.$latitudeInput.val( m.gpslatitude 
);
                                        this.$longitudeInput.val( 
m.gpslongitude );
                                } else if (
@@ -1403,7 +1403,7 @@
                                // sanity check the descriptions -- do not have 
two in the same lang
                                // all should be a known lang
                                if ( this.descriptions.length === 0 ) {
-                                       window.alert('something has gone 
horribly wrong, unimplemented error check for zero descriptions');
+                                       window.alert( 'something has gone 
horribly wrong, unimplemented error check for zero descriptions' );
                                        // XXX ruh roh
                                        // we should not even allow them to 
press the button ( ? ) but then what about the queue...
                                }
@@ -1438,7 +1438,7 @@
                                longitude = $.trim( this.$longitudeInput.val() 
);
                                heading = $.trim( this.$headingInput.val() );
 
-                               if ( Number( latitude ) && Number ( longitude ) 
) {
+                               if ( Number( latitude ) && Number( longitude ) 
) {
                                        locationThings = [ '{{Location dec', 
latitude, longitude ];
 
                                        if ( Number( heading ) ) {
@@ -1532,7 +1532,7 @@
                        var params, wikiText,
                                details = this;
 
-                       $('form', this.containerDiv).submit();
+                       $( 'form', this.containerDiv ).submit();
 
                        this.upload.state = 'submitting-details';
                        this.setStatus( mw.message( 
'mwe-upwiz-submitting-details' ).text() );
@@ -1597,10 +1597,10 @@
                                        if ( result.upload.stage === undefined 
&& window.console ) {
                                                return $.Deferred().reject( 
'no-stage', 'Unable to check file\'s status' );
                                        } else {
-                                               //Messages that can be returned:
-                                               // *mwe-upwiz-queued
-                                               // *mwe-upwiz-publish
-                                               // *mwe-upwiz-assembling
+                                               // Messages that can be 
returned:
+                                               // * mwe-upwiz-queued
+                                               // * mwe-upwiz-publish
+                                               // * mwe-upwiz-assembling
                                                this.setStatus( mw.message( 
'mwe-upwiz-' + result.upload.stage ).text() );
                                                setTimeout( function () {
                                                        if ( 
details.upload.state !== 'aborted' ) {
@@ -1846,7 +1846,7 @@
                setCleanTitle: function ( s ) {
                        var ext = this.upload.title.getExtension(),
                                re = new RegExp( '\\.' + 
this.upload.title.getExtension() + '$', 'i' ),
-                               cleaned = $.trim( s.replace( re, '').replace( 
/\.+$/g, '' ) );
+                               cleaned = $.trim( s.replace( re, '' ).replace( 
/\.+$/g, '' ) );
                        this.upload.title = 
mw.UploadWizardDetails.makeTitleInFileNS( cleaned + '.' + ext ) || 
this.upload.title;
                        return this.upload.title;
                },
@@ -1862,4 +1862,4 @@
                return this.optional( elem ) || mw.Title.newFromText( $.trim( s 
) );
        } );
 
-}) ( mediaWiki, mediaWiki.uploadWizard, jQuery, OO );
+} )( mediaWiki, mediaWiki.uploadWizard, jQuery, OO );
diff --git a/resources/mw.UploadWizardLicenseInput.js 
b/resources/mw.UploadWizardLicenseInput.js
index 9030c2e..bb1b26d 100644
--- a/resources/mw.UploadWizardLicenseInput.js
+++ b/resources/mw.UploadWizardLicenseInput.js
@@ -93,7 +93,7 @@
                if ( config.defaults && config.defaults[ 0 ] ) {
                        this.defaults = config.defaults;
                } else if ( config.licenses && config.licenses[ 0 ] ) {
-                       this.defaults = [ config.licenses[0 ] ];
+                       this.defaults = [ config.licenses[ 0 ] ];
                }
 
                mw.UploadWizardLicenseInput.prototype.count++;
@@ -184,7 +184,7 @@
                                if ( mw.UploadWizard.config.licenses[ 
licenseName ] !== undefined ) {
                                        var $customDiv,
                                                license = { name: licenseName, 
props: mw.UploadWizard.config.licenses[ licenseName ] },
-                                               templates = 
license.props.templates === undefined ? [ license.name ] : 
license.props.templates.slice(0),
+                                               templates = 
license.props.templates === undefined ? [ license.name ] : 
license.props.templates.slice( 0 ),
                                                $input = 
input.createInputElement( templates, config ),
                                                $label = 
input.createInputElementLabel( license, $input );
 
@@ -225,7 +225,7 @@
                                templates.unshift( config.template );
                                templates = [ templates.join( '|' ) ];
                        }
-                       var wikiTexts = $.map( templates, function (t) { return 
'{{' + t + '}}'; } );
+                       var wikiTexts = $.map( templates, function ( t ) { 
return '{{' + t + '}}'; } );
                        return wikiTexts.join( '' );
                },
 
@@ -285,7 +285,7 @@
                                } );
                        }
                        return $( '<label />' )
-                               .attr( { 'for': $input.attr('id') } )
+                               .attr( { 'for': $input.attr( 'id' ) } )
                                .msg( messageKey, this.count || 0, licenseLink )
                                .append( $icons ).addClass( 
'mwe-upwiz-copyright-info' );
                },
@@ -437,8 +437,8 @@
                /**
                 * Get the value of a particular input
                 */
-               getInputWikiText: function ( $input) {
-                       return $input.val() + '\n' + 
this.getInputTextAreaVal($input);
+               getInputWikiText: function ( $input ) {
+                       return $input.val() + '\n' + this.getInputTextAreaVal( 
$input );
                },
 
                /**
@@ -459,7 +459,7 @@
                 */
                getSelectedInputs: function () {
                        // not sure why filter(':checked') doesn't work
-                       return $( this.inputs ).filter( function (i, $x) { 
return $x.is(':checked'); } );
+                       return $( this.inputs ).filter( function ( i, $x ) { 
return $x.is( ':checked' ); } );
                },
 
                /**
@@ -481,7 +481,7 @@
                                // It's pretty hard to screw up a radio button, 
so if even one of them is selected it's okay.
                                // But also check that associated textareas are 
filled for if the input is selected, and that
                                // they are the appropriate size.
-                               $.each( selectedInputs, function (i, $input) {
+                               $.each( selectedInputs, function ( i, $input ) {
                                        if ( !$input.data( 'textarea' ) ) {
                                                return;
                                        }
diff --git a/resources/mw.UploadWizardUpload.js 
b/resources/mw.UploadWizardUpload.js
index b7acdeb..1393efa 100644
--- a/resources/mw.UploadWizardUpload.js
+++ b/resources/mw.UploadWizardUpload.js
@@ -110,7 +110,7 @@
         * @return {jQuery.Promise}
         */
        mw.UploadWizardUpload.prototype.start = function () {
-               this.setTransportProgress(0.0);
+               this.setTransportProgress( 0.0 );
 
                // handler -- usually ApiUploadHandler
                this.handler = this.getUploadHandler();
@@ -405,7 +405,7 @@
                        totalSize = 0;
                        $.each( files, function ( i, file ) {
                                totalSize += file.size;
-                       });
+                       } );
 
                        toobig = totalSize > 10000000;
 
@@ -743,7 +743,7 @@
                                }
                        }
 
-                       mw.log.warn( 'mw.UploadWizardUpload::getImageInfo> No 
data matching ' + requestedTitle + ' ? ');
+                       mw.log.warn( 'mw.UploadWizardUpload::getImageInfo> No 
data matching ' + requestedTitle + ' ? ' );
                        callback( null );
                }
 
@@ -787,7 +787,7 @@
                        var constructor;  // must be the name of a function in 
'mw' namespace
                        if ( mw.UploadWizard.config.enableFirefogg && 
mw.Firefogg.isInstalled() ) {
                                constructor = 'FirefoggHandler';
-                       } else if ( mw.UploadWizard.config.enableFormData && 
mw.fileApi.isAvailable() && mw.fileApi.isFormDataAvailable()) {
+                       } else if ( mw.UploadWizard.config.enableFormData && 
mw.fileApi.isAvailable() && mw.fileApi.isFormDataAvailable() ) {
                                constructor = 'ApiUploadFormDataHandler';
                        } else {
                                constructor = 'ApiUploadHandler';
@@ -973,8 +973,8 @@
                height = image.height * scaling;
 
                // Determine the offset required to center the image
-               dx = (constraints.width - width) / 2;
-               dy = (constraints.height - height) / 2;
+               dx = ( constraints.width - width ) / 2;
+               dy = ( constraints.height - height ) / 2;
 
                switch ( rotation ) {
                        // If a rotation is applied, the direction of the axis
@@ -1145,12 +1145,12 @@
                                first = true;
                                video = document.createElement( 'video' );
 
-                               video.addEventListener('loadedmetadata', 
function () {
-                                       //seek 2 seconds into video or to half 
if shorter
+                               video.addEventListener( 'loadedmetadata', 
function () {
+                                       // seek 2 seconds into video or to half 
if shorter
                                        video.currentTime = Math.min( 2, 
video.duration / 2 );
                                        video.volume = 0;
-                               });
-                               video.addEventListener('seeked', function () {
+                               } );
+                               video.addEventListener( 'seeked', function () {
                                        // Firefox 16 sometimes does not work 
on first seek, seek again
                                        if ( first ) {
                                                first = false;
@@ -1159,7 +1159,7 @@
                                        } else {
                                                // Chrome sometimes shows black 
frames if grabbing right away.
                                                // wait 500ms before grabbing 
frame
-                                               setTimeout(function () {
+                                               setTimeout( function () {
                                                        var context,
                                                                canvas = 
document.createElement( 'canvas' );
                                                        canvas.width = 100;
@@ -1168,9 +1168,9 @@
                                                        context.drawImage( 
video, 0, 0, canvas.width, canvas.height );
                                                        upload.loadImage( 
canvas.toDataURL() );
                                                        
upload.URL().revokeObjectURL( video.url );
-                                               }, 500);
+                                               }, 500 );
                                        }
-                               });
+                               } );
                                url = this.URL().createObjectURL( this.file );
                                video.src = url;
                        } else {
diff --git a/resources/mw.UploadWizardUploadInterface.js 
b/resources/mw.UploadWizardUploadInterface.js
index b935885..e5c216c 100644
--- a/resources/mw.UploadWizardUploadInterface.js
+++ b/resources/mw.UploadWizardUploadInterface.js
@@ -18,13 +18,13 @@
 
                // may need to collaborate with the particular upload type 
sometimes
                // for the interface, as well as the uploadwizard. OY.
-               this.$div = $('<div class="mwe-upwiz-file"></div>');
-               this.div = this.$div.get(0);
+               this.$div = $( '<div class="mwe-upwiz-file"></div>' );
+               this.div = this.$div.get( 0 );
 
                this.isFilled = false;
 
                this.$fileInputCtrl = $( '<input size="1" 
class="mwe-upwiz-file-input" name="file" type="file"/>' );
-               if (mw.UploadWizard.config.enableFormData && 
mw.fileApi.isFormDataAvailable() &&
+               if ( mw.UploadWizard.config.enableFormData && 
mw.fileApi.isFormDataAvailable() &&
                        mw.UploadWizard.config.enableMultiFileSelect && 
mw.UploadWizard.config.enableMultipleFiles ) {
                        // Multiple uploads requires the FormData transport
                        this.$fileInputCtrl.attr( 'multiple', '1' );
@@ -34,7 +34,7 @@
 
                this.$indicator = $( '<div 
class="mwe-upwiz-file-indicator"></div>' );
 
-               this.visibleFilenameDiv = $('<div 
class="mwe-upwiz-visible-file"></div>')
+               this.visibleFilenameDiv = $( '<div 
class="mwe-upwiz-visible-file"></div>' )
                        .append( this.$indicator )
                        .append(
                                '<div class="mwe-upwiz-visible-file-filename">' 
+
@@ -71,14 +71,14 @@
 
                // Add show thumbnail control
 
-               //this.errorDiv = $('<div class="mwe-upwiz-upload-error 
mwe-upwiz-file-indicator" style="display: none;"></div>').get(0);
+               // this.errorDiv = $('<div class="mwe-upwiz-upload-error 
mwe-upwiz-file-indicator" style="display: none;"></div>').get(0);
 
-               this.filenameCtrl = $('<input type="hidden" name="filename" 
value=""/>').get(0);
+               this.filenameCtrl = $( '<input type="hidden" name="filename" 
value=""/>' ).get( 0 );
 
                // this file Ctrl container is placed over other interface 
elements, intercepts clicks and gives them to the file input control.
                // however, we want to pass hover events to interface elements 
that we are over, hence the bindings.
                // n.b. not using toggleClass because it often gets this event 
wrong -- relies on previous state to know what to do
-               this.fileCtrlContainer = $('<div 
class="mwe-upwiz-file-ctrl-container">');
+               this.fileCtrlContainer = $( '<div 
class="mwe-upwiz-file-ctrl-container">' );
 
                // the css trickery (along with css)
                // here creates a giant size file input control which is 
contained within a div and then
@@ -302,7 +302,7 @@
                        if ( this.providedFile && 
!this.$fileInputCtrl.first().value ) {  // default to the fileinput if it's 
defined.
                                files[ 0 ] = this.providedFile;
                        } else {
-                               $.each( this.$fileInputCtrl.get(0).files, 
function ( i, file ) {
+                               $.each( this.$fileInputCtrl.get( 0 ).files, 
function ( i, file ) {
                                        files.push( file );
                                } );
                        }
@@ -316,7 +316,7 @@
         * @return {string}
         */
        mw.UploadWizardUploadInterface.prototype.getFilename = function () {
-               if ( this.providedFile && !this.$fileInputCtrl.get(0).value ) { 
 // default to the fileinput if it's defined.
+               if ( this.providedFile && !this.$fileInputCtrl.get( 0 ).value ) 
{  // default to the fileinput if it's defined.
                        if ( this.providedFile.fileName ) {
                                return this.providedFile.fileName;
                        } else {
@@ -324,7 +324,7 @@
                                return this.providedFile.name;
                        }
                } else {
-                       var input = this.$fileInputCtrl.get(0);
+                       var input = this.$fileInputCtrl.get( 0 );
                        // On IE 11, input.value is incorrect for <input 
type=file multiple>, like we're using here;
                        // the input.files interface is reliable. 
(T88223#1595320)
                        if ( input.files && input.files[ 0 ] && input.files[ 0 
].name ) {
@@ -416,7 +416,7 @@
                if ( mw.UploadWizard.config.enableFirefogg &&
                        $.inArray( extension.toLowerCase(), 
mw.UploadWizard.config.transcodeExtensionList ) !== -1
                ) {
-                       $errorMessage = $( '<p>' 
).msg('mwe-upwiz-upload-error-bad-extension-video-firefogg',
+                       $errorMessage = $( '<p>' ).msg( 
'mwe-upwiz-upload-error-bad-extension-video-firefogg',
                                        mw.Firefogg.getFirefoggInstallUrl(),
                                        
'https://commons.wikimedia.org/wiki/Help:Converting_video'
                                );
@@ -552,7 +552,7 @@
                        ui = this,
                        path = this.getFilename();
                // get basename of file; some browsers do this 
C:\fakepath\something
-               path = path.replace(/\w:.*\\(.*)$/, '$1');
+               path = path.replace( /\w:.*\\(.*)$/, '$1' );
 
                // visible filename
                $( this.form ).find( '.mwe-upwiz-visible-file-filename-text' 
).text( mw.UploadWizard.sanitizeFilename( path ) );
@@ -593,7 +593,7 @@
                                $( '#mwe-upwiz-filelist' )
                                        .children()
                                        .filter( function () { return this !== 
ui.div; } )
-                                       .removeClass('hover');
+                                       .removeClass( 'hover' );
                        } );
                        $div.bind( 'mouseleave mouseout', function () {
                                $div.removeClass( 'hover' );
@@ -610,7 +610,7 @@
         * XXX this should be changed to something Theme compatible
         */
        mw.UploadWizardUploadInterface.prototype.clearErrors = function () {
-               $( this.div ).removeClass( 'mwe-upwiz-upload-error ');
+               $( this.div ).removeClass( 'mwe-upwiz-upload-error ' );
                $( this.errorDiv ).hide().empty();
        };
 
@@ -645,7 +645,7 @@
                                        .siblings()
                                        .find( '.imgPicker' )
                                        .prop( 'checked', false );
-                               } ),
+                       } ),
 
                        $( '<label>' ).attr( {
                                'for': 'imgPicker' + index
diff --git a/resources/transports/mw.FirefoggTransport.js 
b/resources/transports/mw.FirefoggTransport.js
index b92cc62..b1f42c9 100644
--- a/resources/transports/mw.FirefoggTransport.js
+++ b/resources/transports/mw.FirefoggTransport.js
@@ -21,7 +21,7 @@
                var fileToUpload = this.fileToUpload,
                        deferred = $.Deferred();
 
-               //Encode or passthrough Firefogg before upload
+               // Encode or passthrough Firefogg before upload
                if ( this.isUploadFormat() ) {
                        return $.Deferred().resolve( fileToUpload );
                }
@@ -30,12 +30,12 @@
 
                this.fogg.encode( JSON.stringify( this.getEncodeSettings() ),
                        function ( result, file ) {
-                               result = JSON.parse(result);
+                               result = JSON.parse( result );
                                if ( result.progress === 1 ) {
-                                       //encoding done
+                                       // encoding done
                                        deferred.resolve( file );
                                } else {
-                                       //encoding failed
+                                       // encoding failed
                                        deferred.reject( {
                                                error: {
                                                        code: 500,
@@ -107,11 +107,11 @@
                var contentType = this.getSourceFileInfo().contentType;
                return contentType.indexOf( 'video/ogg' ) !== -1 ||
                        contentType.indexOf( 'application/ogg' ) !== -1 ||
-                       contentType.indexOf( 'audio/ogg') !== -1;
+                       contentType.indexOf( 'audio/ogg' ) !== -1;
        };
 
        mw.FirefoggTransport.prototype.isWebMFormat = function () {
-               return ( this.getSourceFileInfo().contentType.indexOf('webm') 
!== -1 );
+               return ( this.getSourceFileInfo().contentType.indexOf( 'webm' ) 
!== -1 );
        };
 
        /**
@@ -138,11 +138,11 @@
                        return this.fogg.sourceFilename;
                } else {
                        if ( this.isSourceAudio() ) {
-                               return 
this.fogg.sourceFilename.split('.').slice(0, -1).join('.') + '.oga';
+                               return this.fogg.sourceFilename.split( '.' 
).slice( 0, -1 ).join( '.' ) + '.oga';
                        }
                        if ( this.isSourceVideo() ) {
                                var ext = this.getEncodeExt();
-                               return 
this.fogg.sourceFilename.split('.').slice(0, -1).join('.') + '.' + ext;
+                               return this.fogg.sourceFilename.split( '.' 
).slice( 0, -1 ).join( '.' ) + '.' + ext;
                        }
                }
        };
diff --git a/resources/transports/mw.FormDataTransport.js 
b/resources/transports/mw.FormDataTransport.js
index 2034f9c..90dc24d 100644
--- a/resources/transports/mw.FormDataTransport.js
+++ b/resources/transports/mw.FormDataTransport.js
@@ -132,9 +132,9 @@
                // use timestamp + filename to avoid conflicts on server
                this.tempname = ( new Date() ).getTime().toString() + 
mw.UploadWizard.sanitizeFilename( file.name );
                // remove unicode characters, tempname is only used during 
upload
-               this.tempname = this.tempname.split('').map(function (c) {
-                       return c.charCodeAt(0) > 128 ? '_' : c;
-               }).join('');
+               this.tempname = this.tempname.split( '' ).map( function ( c ) {
+                       return c.charCodeAt( 0 ) > 128 ? '_' : c;
+               } ).join( '' );
                // Also limit length to 240 bytes (limit hardcoded in 
UploadBase.php).
                if ( this.tempname.length > 240 ) {
                        ext = this.tempname.split( '.' ).pop();
@@ -148,10 +148,10 @@
                        this.xhr = this.createXHR( deferred );
                        this.xhr.addEventListener( 'load', function ( evt ) {
                                deferred.resolve( transport.parseResponse( evt 
) );
-                       }, false);
+                       }, false );
                        this.xhr.addEventListener( 'error', function ( evt ) {
                                deferred.reject( transport.parseResponse( evt ) 
);
-                       }, false);
+                       }, false );
 
                        formData = this.createFormData( this.tempname );
                        formData.append( 'file', file );
@@ -181,14 +181,14 @@
                        }
                        return;
                }
-               //Slice API was changed and has vendor prefix for now
-               //new version now require start/end and not start/length
-               if (file.mozSlice) {
-                       chunk = file.mozSlice(offset, offset + this.chunkSize, 
file.type);
-               } else if (file.webkitSlice) {
-                       chunk = file.webkitSlice(offset, offset + 
this.chunkSize, file.type);
+               // Slice API was changed and has vendor prefix for now
+               // new version now require start/end and not start/length
+               if ( file.mozSlice ) {
+                       chunk = file.mozSlice( offset, offset + this.chunkSize, 
file.type );
+               } else if ( file.webkitSlice ) {
+                       chunk = file.webkitSlice( offset, offset + 
this.chunkSize, file.type );
                } else {
-                       chunk = file.slice(offset, offset + this.chunkSize, 
file.type);
+                       chunk = file.slice( offset, offset + this.chunkSize, 
file.type );
                }
 
                this.xhr = this.createXHR( deferred );
@@ -202,14 +202,14 @@
                        formData.append( 'async', true );
                }
 
-               if (this.filekey) {
-                       formData.append('filekey', this.filekey);
+               if ( this.filekey ) {
+                       formData.append( 'filekey', this.filekey );
                }
-               formData.append('filesize', bytesAvailable);
-               if (this.insufficientFormDataSupport) {
-                       formData.appendBlob('chunk', chunk, 'chunk.bin');
+               formData.append( 'filesize', bytesAvailable );
+               if ( this.insufficientFormDataSupport ) {
+                       formData.appendBlob( 'chunk', chunk, 'chunk.bin' );
                } else {
-                       formData.append('chunk', chunk);
+                       formData.append( 'chunk', chunk );
                }
 
                this.sendData( this.xhr, formData );
@@ -321,18 +321,18 @@
                        return;
                }
 
-               if (!this.firstPoll) {
+               if ( !this.firstPoll ) {
                        this.firstPoll = ( new Date() ).getTime();
                }
-               $.each(this.formData, function (key, value) {
+               $.each( this.formData, function ( key, value ) {
                        params[ key ] = value;
-               });
+               } );
                params.checkstatus =  true;
                params.filekey =  this.filekey;
                return this.api.post( params )
                        .then( function ( response ) {
                                if ( response.upload && response.upload.result 
=== 'Poll' ) {
-                                       //If concatenation takes longer than 10 
minutes give up
+                                       // If concatenation takes longer than 
10 minutes give up
                                        if ( ( ( new Date() ).getTime() - 
transport.firstPoll ) > 10 * 60 * 1000 ) {
                                                return $.Deferred().reject( {
                                                        code: 'server-error',
@@ -343,7 +343,7 @@
                                                        window.console.log( 
'Unable to check file\'s status' );
                                                        return 
$.Deferred().reject();
                                                } else {
-                                                       //Statuses that can be 
returned:
+                                                       // Statuses that can be 
returned:
                                                        // * queued
                                                        // * publish
                                                        // * assembling
@@ -366,7 +366,7 @@
                var response;
 
                try {
-                       response = $.parseJSON(evt.target.responseText);
+                       response = $.parseJSON( evt.target.responseText );
                } catch ( e ) {
                        response = {
                                error: {
@@ -390,7 +390,7 @@
                builder += dashdash + boundary + crlf;
 
                formData = {
-                       append: function (name, data) {
+                       append: function ( name, data ) {
                                // Generate headers.
                                builder += 'Content-Disposition: form-data; 
name="' + name + '"';
                                builder += crlf;
@@ -403,7 +403,7 @@
                                // Write boundary.
                                builder += dashdash + boundary + crlf;
                        },
-                       appendFile: function (name, data, type, filename) {
+                       appendFile: function ( name, data, type, filename ) {
                                builder += 'Content-Disposition: form-data; 
name="' + name + '"';
                                builder += '; filename="' + filename + '"';
                                builder += crlf;
@@ -418,23 +418,23 @@
                                // Write boundary.
                                builder += dashdash + boundary + crlf;
                        },
-                       appendBlob: function (name, blob, filename) {
+                       appendBlob: function ( name, blob, filename ) {
                                chunksRemaining++;
                                var reader = new FileReader();
-                               reader.onload = function (e) {
-                                       formData.appendFile(name, 
e.target.result,
-                                                                               
blob.type, filename);
+                               reader.onload = function ( e ) {
+                                       formData.appendFile( name, 
e.target.result,
+                                                                               
blob.type, filename );
                                        // Call onload after last Blob
                                        chunksRemaining--;
-                                       if (!chunksRemaining && formData.xhr) {
+                                       if ( !chunksRemaining && formData.xhr ) 
{
                                                onload();
                                        }
                                };
-                               reader.readAsBinaryString(blob);
+                               reader.readAsBinaryString( blob );
                        },
-                       send: function (xhr) {
+                       send: function ( xhr ) {
                                formData.xhr = xhr;
-                               if (!chunksRemaining) {
+                               if ( !chunksRemaining ) {
                                        onload();
                                }
                        }
@@ -448,7 +448,7 @@
                                'Content-type',
                                'multipart/form-data; boundary=' + boundary
                        );
-                       formData.xhr.sendAsBinary(builder);
+                       formData.xhr.sendAsBinary( builder );
                };
                return formData;
        };
diff --git a/resources/transports/mw.IframeTransport.js 
b/resources/transports/mw.IframeTransport.js
index 106e630..fa050c1 100644
--- a/resources/transports/mw.IframeTransport.js
+++ b/resources/transports/mw.IframeTransport.js
@@ -24,7 +24,7 @@
 
                this.iframeId = 'f_' + ( $( 'iframe' ).length + 1 );
 
-               //IE only works if you "create element with the name" ( not 
jquery style )
+               // IE only works if you "create element with the name" ( not 
jquery style )
                try {
                        iframe = document.createElement( '<iframe name="' + 
this.iframeId + '">' );
                } catch ( ex ) {
@@ -92,7 +92,7 @@
 
                        // check that the JSON is not an XML error message
                        // (this happens when user aborts upload, we get the 
API docs in XML wrapped in HTML)
-                       if ( json && json.substring(0, 5) !== '<?xml' ) {
+                       if ( json && json.substring( 0, 5 ) !== '<?xml' ) {
                                response = $.parseJSON( json );
                        } else {
                                response = {};
diff --git a/resources/ui/uw.ui.Thanks.js b/resources/ui/uw.ui.Thanks.js
index 927d2a0..ed3a222 100644
--- a/resources/ui/uw.ui.Thanks.js
+++ b/resources/ui/uw.ui.Thanks.js
@@ -128,7 +128,7 @@
                                                $( '<br />' ),
                                                this.makeReadOnlyInput( 
thumbWikiText )
                                        ),
-                               $('<p/>').text( mw.message( 
'mwe-upwiz-thanks-url' ).text() )
+                               $( '<p/>' ).text( mw.message( 
'mwe-upwiz-thanks-url' ).text() )
                                        .append(
                                                $( '<br />' ),
                                                this.makeReadOnlyInput( 
upload.imageinfo.descriptionurl )
diff --git a/resources/uw.EventFlowLogger.js b/resources/uw.EventFlowLogger.js
index 4f511d8..fc79d40 100644
--- a/resources/uw.EventFlowLogger.js
+++ b/resources/uw.EventFlowLogger.js
@@ -126,7 +126,7 @@
                this.log( 'UploadWizardErrorFlowEvent', {
                        step: step,
                        code: data.code,
-                       message: String(data.message) // could be a function 
which kills EventLogging
+                       message: String( data.message ) // could be a function 
which kills EventLogging
                } );
        };
 
diff --git a/tests/qunit/controller/uw.controller.Step.test.js 
b/tests/qunit/controller/uw.controller.Step.test.js
index 84fe770..081490d 100644
--- a/tests/qunit/controller/uw.controller.Step.test.js
+++ b/tests/qunit/controller/uw.controller.Step.test.js
@@ -28,7 +28,7 @@
                var tostub, promise,
                        donestub = this.sandbox.stub(),
                        ds = [ $.Deferred(), $.Deferred(), $.Deferred() ],
-                       ps = [ ds[0 ].promise(), ds[ 1 ].promise(), ds[ 2 
].promise() ],
+                       ps = [ ds[ 0 ].promise(), ds[ 1 ].promise(), ds[ 2 
].promise() ],
                        calls = [],
                        step = new uw.controller.Step( { on: $.noop }, {
                                maxSimultaneousConnections: 3
diff --git a/tests/qunit/mw.FlickrChecker.test.js 
b/tests/qunit/mw.FlickrChecker.test.js
index c0e07e1..0074d14 100644
--- a/tests/qunit/mw.FlickrChecker.test.js
+++ b/tests/qunit/mw.FlickrChecker.test.js
@@ -10,8 +10,8 @@
        function getInstance() {
                var wizard = new mw.UploadWizard( {} ),
                // FlickrChecker doesn't actually do much with the upload so we 
can omit some of its dependencies
-                       upload = new mw.UploadWizardUpload( wizard);
-               return new mw.FlickrChecker(wizard, upload);
+                       upload = new mw.UploadWizardUpload( wizard );
+               return new mw.FlickrChecker( wizard, upload );
        }
 
        QUnit.test( 'getFilenameFromItem() simple case', 1, function () {
@@ -90,4 +90,4 @@
                assert.ok( !sidstub.called );
                assert.strictEqual( upload.description, '' );
        } );
-} ( mediaWiki ) );
+}( mediaWiki ) );
diff --git a/tests/qunit/mw.UploadWizardDetails.test.js 
b/tests/qunit/mw.UploadWizardDetails.test.js
index ad4cce2..db070d6 100644
--- a/tests/qunit/mw.UploadWizardDetails.test.js
+++ b/tests/qunit/mw.UploadWizardDetails.test.js
@@ -40,4 +40,4 @@
                        );
                } );
        } );
-} ( mediaWiki, jQuery ) );
+}( mediaWiki, jQuery ) );
diff --git a/tests/qunit/uw.EventFlowLogger.test.js 
b/tests/qunit/uw.EventFlowLogger.test.js
index 20368d7..721ad21 100644
--- a/tests/qunit/uw.EventFlowLogger.test.js
+++ b/tests/qunit/uw.EventFlowLogger.test.js
@@ -35,4 +35,4 @@
                assert.strictEqual( eventLog.logEvent.firstCall.args[ 1 
].flowId,
                        eventLog.logEvent.thirdCall.args[ 1 ].flowId, 'flowId 
is constant' );
        } );
-} ( mediaWiki, mediaWiki.uploadWizard ) );
+}( mediaWiki, mediaWiki.uploadWizard ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/247489
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib4f4e8ede9d409bd60c9a4786286131d53741f6d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Jforrester <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to