Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js |
— | — | @@ -555,7 +555,7 @@ |
556 | 556 | // TODO get basename of file; Chrome does this C:\fakepath\something which is highly irritating |
557 | 557 | var path = _this.$fileInputCtrl.val(); |
558 | 558 | |
559 | | - // visible filenam. |
| 559 | + // visible filename |
560 | 560 | $j( _this.form ).find( '.mwe-upwiz-visible-file-filename-text' ).html( path ); |
561 | 561 | |
562 | 562 | _this.upload.title = new mw.Title( mw.UploadWizardUtil.getBasename( path ), 'file' ); |
— | — | @@ -1599,10 +1599,10 @@ |
1600 | 1600 | |
1601 | 1601 | $j( '.mwe-upwiz-button-begin' ) |
1602 | 1602 | .click( function() { _this.reset(); } ); |
1603 | | - |
| 1603 | + |
1604 | 1604 | $j( '.mwe-upwiz-button-home' ) |
1605 | 1605 | .click( function() { window.location.href = '/'; } ); |
1606 | | - |
| 1606 | + |
1607 | 1607 | // handler for next button |
1608 | 1608 | $j( '#mwe-upwiz-stepdiv-tutorial .mwe-upwiz-button-next') |
1609 | 1609 | .click( function() { |
— | — | @@ -1610,15 +1610,7 @@ |
1611 | 1611 | if ( $j('#mwe-upwiz-skip').is(':checked') ) { |
1612 | 1612 | _this.setSkipTutorialCookie(); |
1613 | 1613 | } |
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' ); |
1623 | 1615 | } ); |
1624 | 1616 | |
1625 | 1617 | $j( '#mwe-upwiz-add-file' ).button(); |
— | — | @@ -1692,27 +1684,17 @@ |
1693 | 1685 | } ); |
1694 | 1686 | |
1695 | 1687 | |
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(); |
1701 | 1688 | |
| 1689 | + // WIZARD |
| 1690 | + |
1702 | 1691 | // check to see if the the skip tutorial cookie is set |
1703 | 1692 | if ( document.cookie.indexOf('skiptutorial=1') != -1 ) { |
1704 | 1693 | // "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' ); |
1710 | 1695 | } else { |
1711 | 1696 | // "select" the first step - highlight, make it visible, hide all others |
1712 | 1697 | _this.moveToStep( 'tutorial' ); |
1713 | 1698 | } |
1714 | | - |
1715 | | - // Unveil the interface to the user |
1716 | | - $j( '#mwe-upwiz-content' ).show(); |
1717 | 1699 | |
1718 | 1700 | }, |
1719 | 1701 | |
— | — | @@ -1789,7 +1771,17 @@ |
1790 | 1772 | $j( '#mwe-upwiz-steps' ).arrowStepsHighlight( '#mwe-upwiz-step-' + selectedStepName ); |
1791 | 1773 | |
1792 | 1774 | _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 | + |
1794 | 1786 | $j.each( _this.uploads, function(i, upload) { |
1795 | 1787 | upload.state = selectedStepName; |
1796 | 1788 | } ); |
— | — | @@ -1815,7 +1807,6 @@ |
1816 | 1808 | var upload = new mw.UploadWizardUpload( _this.api, '#mwe-upwiz-filelist' ); |
1817 | 1809 | _this.uploadToAdd = upload; |
1818 | 1810 | |
1819 | | - upload.ui.moveFileInputToCover( '#mwe-upwiz-add-file' ); |
1820 | 1811 | // we bind to the ui div since unbind doesn't work for non-DOM objects |
1821 | 1812 | |
1822 | 1813 | $j( upload.ui.div ).bind( 'filenameAccepted', function(e) { _this.updateFileCounts(); e.stopPropagation(); } ); |
Index: trunk/extensions/UploadWizard/SpecialUploadWizard.php |
— | — | @@ -194,9 +194,9 @@ |
195 | 195 | . '</ul>' |
196 | 196 | |
197 | 197 | // the individual steps, all at once - hide until styled |
198 | | - . '<div id="mwe-upwiz-content" style="display:none;">' |
| 198 | + . '<div id="mwe-upwiz-content">' |
199 | 199 | |
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;">' |
201 | 201 | . '<div id="mwe-upwiz-tutorial">' |
202 | 202 | . $tutorialHtml |
203 | 203 | . '</div>' |
— | — | @@ -207,7 +207,7 @@ |
208 | 208 | . '</div>' |
209 | 209 | . '</div>' |
210 | 210 | |
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;">' |
212 | 212 | . '<div id="mwe-upwiz-files">' |
213 | 213 | . '<div id="mwe-upwiz-filelist" class="ui-corner-all"></div>' |
214 | 214 | . '<div id="mwe-upwiz-upload-ctrls" class="mwe-upwiz-file ui-helper-clearfix">' |
— | — | @@ -238,7 +238,7 @@ |
239 | 239 | . '</div>' |
240 | 240 | . '</div>' |
241 | 241 | |
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;">' |
243 | 243 | . '<div id="mwe-upwiz-deeds-thumbnails" class="ui-helper-clearfix"></div>' |
244 | 244 | . '<div id="mwe-upwiz-deeds" class="ui-helper-clearfix"></div>' |
245 | 245 | . '<div id="mwe-upwiz-deeds-custom" class="ui-helper-clearfix"></div>' |
— | — | @@ -247,7 +247,7 @@ |
248 | 248 | . '</div>' |
249 | 249 | . '</div>' |
250 | 250 | |
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;">' |
252 | 252 | . '<div id="mwe-upwiz-macro">' |
253 | 253 | . '<div id="mwe-upwiz-macro-progress" class="ui-helper-clearfix"></div>' |
254 | 254 | . '<div id="mwe-upwiz-macro-choice">' |
— | — | @@ -259,7 +259,7 @@ |
260 | 260 | . '</div>' |
261 | 261 | . '</div>' |
262 | 262 | |
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;">' |
264 | 264 | . '<div id="mwe-upwiz-thanks"></div>' |
265 | 265 | . '<div class="mwe-upwiz-buttons">' |
266 | 266 | . '<button class="mwe-upwiz-button-home">' . wfMsg( "mwe-upwiz-home" ) . '</button>' |