r86029 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86028‎ | r86029 | r86030 >
Date:07:13, 14 April 2011
Author:neilk
Status:ok
Tags:
Comment:
faster, better resets
Modified paths:
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizard.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizardDeed.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardDeed.js
@@ -438,6 +438,10 @@
439439 }
440440 $form.slideDown( 500 );
441441 } );
 442+ },
 443+
 444+ remove: function() {
 445+ this.$selector.html('');
442446 }
443447
444448 };
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js
@@ -53,6 +53,9 @@
5454 */
5555 remove: function() {
5656 this.state = 'aborted';
 57+ if ( this.deedThumbnailDiv ) {
 58+ this.deedThumbnailDiv.remove();
 59+ }
5760 if ( this.details && this.details.div ) {
5861 this.details.div.remove();
5962 }
@@ -547,7 +550,14 @@
548551 * Depending on whether we split uploading / detailing, it may actually always be as simple as loading a URL
549552 */
550553 reset: function() {
551 - window.location = wgArticlePath.replace( '$1', 'Special:UploadWizard?skiptutorial=true' );
 554+ // window.location = wgArticlePath.replace( '$1', 'Special:UploadWizard?skiptutorial=true' );
 555+ var _this = this;
 556+ // deeds page
 557+ _this.deedChooser.remove();
 558+ _this.removeMatchingUploads( function() { return true; } );
 559+ // this could be slicker... need to reset the headline AND get rid of individual divs
 560+ $( '#mwe-upwiz-thanks' ).html( '' );
 561+ _this.moveToStep( 'file' );
552562 },
553563
554564
@@ -722,6 +732,7 @@
723733 '#mwe-upwiz-deeds',
724734 deeds,
725735 _this.uploads.length );
 736+
726737
727738 $j( '<div></div>' )
728739 .insertBefore( _this.deedChooser.$selector.find( '.mwe-upwiz-deed-ownwork' ) )
@@ -1352,6 +1363,7 @@
13531364 var thumbnailDiv = $j( '<div class="mwe-upwiz-thumbnail-small"></div>' );
13541365 $j( '#mwe-upwiz-deeds-thumbnails' ).append( thumbnailDiv );
13551366 _this.upload.setThumbnail( thumbnailDiv, mw.UploadWizard.config[ 'smallThumbnailWidth' ], mw.UploadWizard.config[ 'smallThumbnailMaxHeight' ] );
 1367+ _this.upload.deedThumbnailDiv = thumbnailDiv;
13561368 }
13571369 };
13581370

Status & tagging log