Index: trunk/extensions/UploadWizard/UploadWizard.config.php |
— | — | @@ -113,5 +113,8 @@ |
114 | 114 | |
115 | 115 | // Check if we have the firefogg upload api module enabled: |
116 | 116 | 'enableFirefoggChunkUpload' => isset( $wgAPIModules['firefoggupload'] )? true : false, |
| 117 | + |
| 118 | + // Set skipTutorial to true to always skip tutorial step |
| 119 | + 'skipTutorial' => false, |
117 | 120 | |
118 | 121 | ); |
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js |
— | — | @@ -519,7 +519,7 @@ |
520 | 520 | * Depending on whether we split uploading / detailing, it may actually always be as simple as loading a URL |
521 | 521 | */ |
522 | 522 | reset: function() { |
523 | | - window.location = wgArticlePath.replace( '$1', 'Special:UploadWizard' ); |
| 523 | + window.location = wgArticlePath.replace( '$1', 'Special:UploadWizard?skiptutorial=true' ); |
524 | 524 | }, |
525 | 525 | |
526 | 526 | |
— | — | @@ -641,7 +641,7 @@ |
642 | 642 | // WIZARD |
643 | 643 | |
644 | 644 | // check to see if the the skip tutorial cookie is set |
645 | | - if ( document.cookie.indexOf('skiptutorial=1') != -1 ) { |
| 645 | + if ( document.cookie.indexOf('skiptutorial=1') != -1 || UploadWizardConfig['skipTutorial'] ) { |
646 | 646 | // "select" the second step - highlight, make it visible, hide all others |
647 | 647 | _this.moveToStep( 'file' ); |
648 | 648 | } else { |
Index: trunk/extensions/UploadWizard/SpecialUploadWizard.php |
— | — | @@ -37,8 +37,8 @@ |
38 | 38 | * @param $subPage, e.g. the "foo" in Special:UploadWizard/foo. |
39 | 39 | */ |
40 | 40 | public function execute( $subPage ) { |
41 | | - global $wgLang, $wgUser, $wgOut, $wgExtensionAssetsPath, |
42 | | - $wgUploadWizardDisableResourceLoader; |
| 41 | + global $wgRequest, $wgLang, $wgUser, $wgOut, $wgExtensionAssetsPath, |
| 42 | + $wgUploadWizardDisableResourceLoader, $wgUploadWizardConfig; |
43 | 43 | |
44 | 44 | // side effects: if we can't upload, will print error page to wgOut |
45 | 45 | // and return false |
— | — | @@ -48,6 +48,11 @@ |
49 | 49 | |
50 | 50 | $this->setHeaders(); |
51 | 51 | $this->outputHeader(); |
| 52 | + |
| 53 | + // if query string includes 'skiptutorial=true' set config variable to true |
| 54 | + if ( $wgRequest->getText( 'skiptutorial' ) ) { |
| 55 | + $wgUploadWizardConfig['skipTutorial'] = true; |
| 56 | + } |
52 | 57 | |
53 | 58 | // fallback for non-JS |
54 | 59 | $wgOut->addHTML( '<noscript>' ); |
— | — | @@ -174,10 +179,12 @@ |
175 | 180 | * @return {String} html |
176 | 181 | */ |
177 | 182 | function getWizardHtml() { |
| 183 | + global $wgUploadWizardConfig; |
| 184 | + |
178 | 185 | $tutorialHtml = ''; |
179 | 186 | // only load the tutorial HTML if we aren't skipping the first step |
180 | 187 | // TODO should use user preference not a cookie ( so the user does not have to skip it for every browser ) |
181 | | - if ( !isset( $_COOKIE['skiptutorial'] ) ) { |
| 188 | + if ( !isset( $_COOKIE['skiptutorial'] ) && !$wgUploadWizardConfig['skipTutorial'] ) { |
182 | 189 | $tutorialHtml = UploadWizardTutorial::getHtml(); |
183 | 190 | } |
184 | 191 | // TODO move this into UploadWizard.js or some other javascript resource so the upload wizard |