r83204 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83203‎ | r83204 | r83205 >
Date:03:49, 4 March 2011
Author:kaldari
Status:deferred
Tags:
Comment:
better fix for Bug 25965
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
@@ -555,7 +555,7 @@
556556 // TODO get basename of file; Chrome does this C:\fakepath\something which is highly irritating
557557 var path = _this.$fileInputCtrl.val();
558558
559 - // visible filenam.
 559+ // visible filename
560560 $j( _this.form ).find( '.mwe-upwiz-visible-file-filename-text' ).html( path );
561561
562562 _this.upload.title = new mw.Title( mw.UploadWizardUtil.getBasename( path ), 'file' );
@@ -1599,10 +1599,10 @@
16001600
16011601 $j( '.mwe-upwiz-button-begin' )
16021602 .click( function() { _this.reset(); } );
1603 -
 1603+
16041604 $j( '.mwe-upwiz-button-home' )
16051605 .click( function() { window.location.href = '/'; } );
1606 -
 1606+
16071607 // handler for next button
16081608 $j( '#mwe-upwiz-stepdiv-tutorial .mwe-upwiz-button-next')
16091609 .click( function() {
@@ -1610,15 +1610,7 @@
16111611 if ( $j('#mwe-upwiz-skip').is(':checked') ) {
16121612 _this.setSkipTutorialCookie();
16131613 }
1614 - _this.moveToStep( 'file', function() {
1615 - // we explicitly move the file input at this point
1616 - // because it was probably jumping around due to other "steps" on this page during file construction.
1617 - // XXX using a timeout is lame, are there other options?
1618 - // XXX Trevor suggests that using addClass() may queue stuff unnecessarily; use 'concrete' HTML
1619 - setTimeout( function() {
1620 - upload.ui.moveFileInputToCover( '#mwe-upwiz-add-file' );
1621 - }, 300 );
1622 - } );
 1614+ _this.moveToStep( 'file' );
16231615 } );
16241616
16251617 $j( '#mwe-upwiz-add-file' ).button();
@@ -1692,27 +1684,17 @@
16931685 } );
16941686
16951687
1696 -
1697 - // WIZARD
1698 -
1699 - // add one upload field to start (this is the big one that asks you to upload something)
1700 - var upload = _this.newUpload();
17011688
 1689+ // WIZARD
 1690+
17021691 // check to see if the the skip tutorial cookie is set
17031692 if ( document.cookie.indexOf('skiptutorial=1') != -1 ) {
17041693 // "select" the second step - highlight, make it visible, hide all others
1705 - _this.moveToStep( 'file', function() {
1706 - setTimeout( function() {
1707 - upload.ui.moveFileInputToCover( '#mwe-upwiz-add-file' );
1708 - }, 300 );
1709 - } );
 1694+ _this.moveToStep( 'file' );
17101695 } else {
17111696 // "select" the first step - highlight, make it visible, hide all others
17121697 _this.moveToStep( 'tutorial' );
17131698 }
1714 -
1715 - // Unveil the interface to the user
1716 - $j( '#mwe-upwiz-content' ).show();
17171699
17181700 },
17191701
@@ -1789,7 +1771,17 @@
17901772 $j( '#mwe-upwiz-steps' ).arrowStepsHighlight( '#mwe-upwiz-step-' + selectedStepName );
17911773
17921774 _this.currentStepName = selectedStepName;
1793 -
 1775+
 1776+ if ( selectedStepName == 'file' ) {
 1777+ // add one upload field to start (this is the big one that asks you to upload something)
 1778+ 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 );
 1784+ }
 1785+
17941786 $j.each( _this.uploads, function(i, upload) {
17951787 upload.state = selectedStepName;
17961788 } );
@@ -1815,7 +1807,6 @@
18161808 var upload = new mw.UploadWizardUpload( _this.api, '#mwe-upwiz-filelist' );
18171809 _this.uploadToAdd = upload;
18181810
1819 - upload.ui.moveFileInputToCover( '#mwe-upwiz-add-file' );
18201811 // we bind to the ui div since unbind doesn't work for non-DOM objects
18211812
18221813 $j( upload.ui.div ).bind( 'filenameAccepted', function(e) { _this.updateFileCounts(); e.stopPropagation(); } );
Index: trunk/extensions/UploadWizard/SpecialUploadWizard.php
@@ -194,9 +194,9 @@
195195 . '</ul>'
196196
197197 // the individual steps, all at once - hide until styled
198 - . '<div id="mwe-upwiz-content" style="display:none;">'
 198+ . '<div id="mwe-upwiz-content">'
199199
200 - . '<div class="mwe-upwiz-stepdiv" id="mwe-upwiz-stepdiv-tutorial">'
 200+ . '<div class="mwe-upwiz-stepdiv" id="mwe-upwiz-stepdiv-tutorial" style="display:none;">'
201201 . '<div id="mwe-upwiz-tutorial">'
202202 . $tutorialHtml
203203 . '</div>'
@@ -207,7 +207,7 @@
208208 . '</div>'
209209 . '</div>'
210210
211 - . '<div class="mwe-upwiz-stepdiv ui-helper-clearfix" id="mwe-upwiz-stepdiv-file">'
 211+ . '<div class="mwe-upwiz-stepdiv ui-helper-clearfix" id="mwe-upwiz-stepdiv-file" style="display:none;">'
212212 . '<div id="mwe-upwiz-files">'
213213 . '<div id="mwe-upwiz-filelist" class="ui-corner-all"></div>'
214214 . '<div id="mwe-upwiz-upload-ctrls" class="mwe-upwiz-file ui-helper-clearfix">'
@@ -238,7 +238,7 @@
239239 . '</div>'
240240 . '</div>'
241241
242 - . '<div class="mwe-upwiz-stepdiv" id="mwe-upwiz-stepdiv-deeds">'
 242+ . '<div class="mwe-upwiz-stepdiv" id="mwe-upwiz-stepdiv-deeds" style="display:none;">'
243243 . '<div id="mwe-upwiz-deeds-thumbnails" class="ui-helper-clearfix"></div>'
244244 . '<div id="mwe-upwiz-deeds" class="ui-helper-clearfix"></div>'
245245 . '<div id="mwe-upwiz-deeds-custom" class="ui-helper-clearfix"></div>'
@@ -247,7 +247,7 @@
248248 . '</div>'
249249 . '</div>'
250250
251 - . '<div class="mwe-upwiz-stepdiv" id="mwe-upwiz-stepdiv-details">'
 251+ . '<div class="mwe-upwiz-stepdiv" id="mwe-upwiz-stepdiv-details" style="display:none;">'
252252 . '<div id="mwe-upwiz-macro">'
253253 . '<div id="mwe-upwiz-macro-progress" class="ui-helper-clearfix"></div>'
254254 . '<div id="mwe-upwiz-macro-choice">'
@@ -259,7 +259,7 @@
260260 . '</div>'
261261 . '</div>'
262262
263 - . '<div class="mwe-upwiz-stepdiv" id="mwe-upwiz-stepdiv-thanks">'
 263+ . '<div class="mwe-upwiz-stepdiv" id="mwe-upwiz-stepdiv-thanks" style="display:none;">'
264264 . '<div id="mwe-upwiz-thanks"></div>'
265265 . '<div class="mwe-upwiz-buttons">'
266266 . '<button class="mwe-upwiz-button-home">' . wfMsg( "mwe-upwiz-home" ) . '</button>'

Status & tagging log