jenkins-bot has submitted this change and it was merged.

Change subject: Remove useless empty() methods
......................................................................


Remove useless empty() methods

These were used to reset the interface, back when that was
still being done by showing/hiding/changing elements.
With moveNext & movePrevious, that changed: moveFrom (now
unload) just detaches all elements, and instead of showing
the existing elements, moveTo (now load) properly initialized
them anew.
These empty methods are no longer needed.

Change-Id: I480033d266c741154cedcdfa4f1151df339fe311
---
M resources/controller/uw.controller.Deed.js
M resources/controller/uw.controller.Details.js
M resources/controller/uw.controller.Step.js
M resources/controller/uw.controller.Upload.js
M resources/mw.UploadWizard.js
M resources/ui/steps/uw.ui.Details.js
M resources/ui/steps/uw.ui.Thanks.js
M resources/ui/steps/uw.ui.Upload.js
M resources/ui/uw.ui.Step.js
9 files changed, 0 insertions(+), 91 deletions(-)

Approvals:
  Bartosz Dziewoński: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/resources/controller/uw.controller.Deed.js 
b/resources/controller/uw.controller.Deed.js
index e62773a..f6474bc 100644
--- a/resources/controller/uw.controller.Deed.js
+++ b/resources/controller/uw.controller.Deed.js
@@ -168,13 +168,4 @@
                }
        };
 
-       /**
-        * Empty out all upload information.
-        */
-       uw.controller.Deed.prototype.empty = function () {
-               if ( this.deedChooser !== undefined ) {
-                       this.deedChooser.remove();
-               }
-       };
-
 }( mediaWiki, mediaWiki.uploadWizard, jQuery, OO ) );
diff --git a/resources/controller/uw.controller.Details.js 
b/resources/controller/uw.controller.Details.js
index 082ed98..3c95548 100644
--- a/resources/controller/uw.controller.Details.js
+++ b/resources/controller/uw.controller.Details.js
@@ -152,10 +152,6 @@
                }
        };
 
-       uw.controller.Details.prototype.empty = function () {
-               this.ui.empty();
-       };
-
        /**
         * Start details submit.
         * TODO move the rest of the logic here from mw.UploadWizard
diff --git a/resources/controller/uw.controller.Step.js 
b/resources/controller/uw.controller.Step.js
index bee6297..83091f3 100644
--- a/resources/controller/uw.controller.Step.js
+++ b/resources/controller/uw.controller.Step.js
@@ -68,13 +68,6 @@
        OO.mixinClass( uw.controller.Step, OO.EventEmitter );
 
        /**
-        * Empty the step of all data.
-        */
-       uw.controller.Step.prototype.empty = function () {
-               this.ui.empty();
-       };
-
-       /**
         * Set the next step in the process.
         *
         * @param {uw.controller.Step} step
diff --git a/resources/controller/uw.controller.Upload.js 
b/resources/controller/uw.controller.Upload.js
index f873cd5..8e7f0ab 100644
--- a/resources/controller/uw.controller.Upload.js
+++ b/resources/controller/uw.controller.Upload.js
@@ -91,10 +91,6 @@
                this.ui.showTooManyFilesWarning( filesUploaded );
        };
 
-       uw.controller.Upload.prototype.empty = function () {
-               this.ui.empty();
-       };
-
        uw.controller.Upload.prototype.load = function ( uploads ) {
                var controller = this;
 
diff --git a/resources/mw.UploadWizard.js b/resources/mw.UploadWizard.js
index 786d171..20ea5ea 100644
--- a/resources/mw.UploadWizard.js
+++ b/resources/mw.UploadWizard.js
@@ -61,11 +61,6 @@
                bailAndloadFile: function () {
                        // destroy the flickr interface if it exists
                        this.flickrInterfaceDestroy();
-
-                       // fix various other pages that may have state
-                       $.each( this.steps, function ( i, step ) {
-                               step.empty();
-                       } );
                },
 
                /**
diff --git a/resources/ui/steps/uw.ui.Details.js 
b/resources/ui/steps/uw.ui.Details.js
index 9ca86b4..5e1a041 100644
--- a/resources/ui/steps/uw.ui.Details.js
+++ b/resources/ui/steps/uw.ui.Details.js
@@ -128,16 +128,6 @@
        };
 
        /**
-        * Empty out all upload information.
-        */
-       uw.ui.Details.prototype.empty = function () {
-               // reset buttons on the details page
-               this.$div.find( '.mwe-upwiz-file-next-some-failed' ).hide();
-               this.$div.find( '.mwe-upwiz-file-next-all-failed' ).hide();
-               this.$div.find( '.mwe-upwiz-file-next-all-ok' ).show();
-       };
-
-       /**
         * Hide buttons for moving to the next step.
         */
        uw.ui.Details.prototype.hideEndButtons = function () {
diff --git a/resources/ui/steps/uw.ui.Thanks.js 
b/resources/ui/steps/uw.ui.Thanks.js
index 23cc9b0..c556936 100644
--- a/resources/ui/steps/uw.ui.Thanks.js
+++ b/resources/ui/steps/uw.ui.Thanks.js
@@ -174,13 +174,6 @@
        };
 
        /**
-        * Empty out all upload information.
-        */
-       uw.ui.Thanks.prototype.empty = function () {
-               this.$div.find( '.mwe-upwiz-thanks' ).remove();
-       };
-
-       /**
         * Get button configuration options from a campaign definition
         *
         * @param {string} buttonName name of the button as defined in campaign 
configuration
diff --git a/resources/ui/steps/uw.ui.Upload.js 
b/resources/ui/steps/uw.ui.Upload.js
index c659aab..58c3b3e 100644
--- a/resources/ui/steps/uw.ui.Upload.js
+++ b/resources/ui/steps/uw.ui.Upload.js
@@ -246,46 +246,6 @@
                }
        };
 
-       /**
-        * Empties the upload list.
-        */
-       uw.ui.Upload.prototype.empty = function () {
-               this.$addFileContainer
-                       .add( this.$buttons )
-                       .add( this.$progress );
-
-               this.hideEndButtons();
-
-               this.$addFileContainer
-                       .add( this.$uploadCenterDivide )
-                       .add( this.$uploadCtrl )
-                       .show();
-
-               if ( this.isFlickrImportEnabled() ) {
-                       this.$flickrAddFileContainer
-                               .add( this.$uploadCenterDivide )
-                               .show();
-
-                       // changes the button back from "add more files from 
flickr" to the initial text
-                       this.addFlickrFile.setLabel( mw.message( 
'mwe-upwiz-add-file-flickr' ).text() );
-
-                       this.emptyFlickrLists();
-               }
-
-               // changes the button back from "add another file" to the 
initial centered invitation button
-               this.addFile.setLabel( mw.message( 'mwe-upwiz-add-file-0-free' 
).text() );
-       };
-
-       /**
-        * Empties the Flickr selection lists.
-        */
-       uw.ui.Upload.prototype.emptyFlickrLists = function () {
-               // empty the flickr lists
-               this.$flickrSelectList.empty();
-               this.$flickrSelectListContainer.unbind();
-               this.$flickrSelect.unbind();
-       };
-
        uw.ui.Upload.prototype.load = function ( uploads ) {
                uw.ui.Step.prototype.load.call( this, uploads );
 
diff --git a/resources/ui/uw.ui.Step.js b/resources/ui/uw.ui.Step.js
index fb167ee..2702d04 100644
--- a/resources/ui/uw.ui.Step.js
+++ b/resources/ui/uw.ui.Step.js
@@ -83,11 +83,6 @@
                this.$div.children().detach();
        };
 
-       /**
-        * Empty data from the step.
-        */
-       uw.ui.Step.prototype.empty = function () {};
-
        uw.ui.Step.prototype.enableNextButton = function () {
                this.nextButtonPromise.resolve();
        };

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I480033d266c741154cedcdfa4f1151df339fe311
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>
Gerrit-Reviewer: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to