r85422 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85421‎ | r85422 | r85423 >
Date:05:00, 5 April 2011
Author:kaldari
Status:deferred
Tags:
Comment:
fix for Bug 26080
Modified paths:
  • /trunk/extensions/UploadWizard/SpecialUploadWizard.php (modified) (history)
  • /trunk/extensions/UploadWizard/UploadWizard.config.php (modified) (history)
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizard.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/UploadWizard.config.php
@@ -113,5 +113,8 @@
114114
115115 // Check if we have the firefogg upload api module enabled:
116116 'enableFirefoggChunkUpload' => isset( $wgAPIModules['firefoggupload'] )? true : false,
 117+
 118+ // Set skipTutorial to true to always skip tutorial step
 119+ 'skipTutorial' => false,
117120
118121 );
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js
@@ -519,7 +519,7 @@
520520 * Depending on whether we split uploading / detailing, it may actually always be as simple as loading a URL
521521 */
522522 reset: function() {
523 - window.location = wgArticlePath.replace( '$1', 'Special:UploadWizard' );
 523+ window.location = wgArticlePath.replace( '$1', 'Special:UploadWizard?skiptutorial=true' );
524524 },
525525
526526
@@ -641,7 +641,7 @@
642642 // WIZARD
643643
644644 // 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'] ) {
646646 // "select" the second step - highlight, make it visible, hide all others
647647 _this.moveToStep( 'file' );
648648 } else {
Index: trunk/extensions/UploadWizard/SpecialUploadWizard.php
@@ -37,8 +37,8 @@
3838 * @param $subPage, e.g. the "foo" in Special:UploadWizard/foo.
3939 */
4040 public function execute( $subPage ) {
41 - global $wgLang, $wgUser, $wgOut, $wgExtensionAssetsPath,
42 - $wgUploadWizardDisableResourceLoader;
 41+ global $wgRequest, $wgLang, $wgUser, $wgOut, $wgExtensionAssetsPath,
 42+ $wgUploadWizardDisableResourceLoader, $wgUploadWizardConfig;
4343
4444 // side effects: if we can't upload, will print error page to wgOut
4545 // and return false
@@ -48,6 +48,11 @@
4949
5050 $this->setHeaders();
5151 $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+ }
5257
5358 // fallback for non-JS
5459 $wgOut->addHTML( '<noscript>' );
@@ -174,10 +179,12 @@
175180 * @return {String} html
176181 */
177182 function getWizardHtml() {
 183+ global $wgUploadWizardConfig;
 184+
178185 $tutorialHtml = '';
179186 // only load the tutorial HTML if we aren't skipping the first step
180187 // 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'] ) {
182189 $tutorialHtml = UploadWizardTutorial::getHtml();
183190 }
184191 // TODO move this into UploadWizard.js or some other javascript resource so the upload wizard

Status & tagging log