r83206 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83205‎ | r83206 | r83207 >
Date:05:16, 4 March 2011
Author:kaldari
Status:deferred
Tags:
Comment:
moving moveFileInputToCover action back into newUpload (not sure which location makes more sense), adding check to make sure there is no existing upload before creating new one on moveToStep(file)
Modified paths:
  • /trunk/extensions/UploadWizard/SpecialUploadWizard.php (modified) (history)
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizard.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js
@@ -1772,14 +1772,9 @@
17731773
17741774 _this.currentStepName = selectedStepName;
17751775
1776 - if ( selectedStepName == 'file' ) {
 1776+ if ( selectedStepName == 'file' && _this.uploads.length === 0 ) {
17771777 // add one upload field to start (this is the big one that asks you to upload something)
17781778 var upload = _this.newUpload();
1779 - // XXX using a timeout is lame, are there other options?
1780 - // XXX Trevor suggests that using addClass() may queue stuff unnecessarily; use 'concrete' HTML
1781 - setTimeout( function() {
1782 - upload.ui.moveFileInputToCover( '#mwe-upwiz-add-file' );
1783 - }, 300 );
17841779 }
17851780
17861781 $j.each( _this.uploads, function(i, upload) {
@@ -1807,6 +1802,9 @@
18081803 var upload = new mw.UploadWizardUpload( _this.api, '#mwe-upwiz-filelist' );
18091804 _this.uploadToAdd = upload;
18101805
 1806+ // we explicitly move the file input to cover the upload button
 1807+ upload.ui.moveFileInputToCover( '#mwe-upwiz-add-file' );
 1808+
18111809 // we bind to the ui div since unbind doesn't work for non-DOM objects
18121810
18131811 $j( upload.ui.div ).bind( 'filenameAccepted', function(e) { _this.updateFileCounts(); e.stopPropagation(); } );
Index: trunk/extensions/UploadWizard/SpecialUploadWizard.php
@@ -193,7 +193,7 @@
194194 . '<li id="mwe-upwiz-step-thanks"><div>' . wfMsg( 'mwe-upwiz-step-thanks' ) . '</div></li>'
195195 . '</ul>'
196196
197 - // the individual steps, all at once - hide until styled
 197+ // the individual steps, all at once - hide until needed
198198 . '<div id="mwe-upwiz-content">'
199199
200200 . '<div class="mwe-upwiz-stepdiv" id="mwe-upwiz-stepdiv-tutorial" style="display:none;">'

Status & tagging log