MarkAHershberger has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/308877

Change subject: Don't display place for tutorial if it is skipped
......................................................................

Don't display place for tutorial if it is skipped

This only works if the global or campaign settings say to skip it.  User
prefs that skip it still show the place.

This makes sense because the user cannot use the back button to reach
the “Learn” step, so showing that the step is being skipped is confusing.

Change-Id: I126a38c8bad4077e0dc885169f9be5ff55778577
---
M resources/mw.UploadWizard.js
M resources/uploadWizard.css
2 files changed, 44 insertions(+), 39 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/77/308877/1

diff --git a/resources/mw.UploadWizard.js b/resources/mw.UploadWizard.js
index 0334cf1..3ac4b41 100644
--- a/resources/mw.UploadWizard.js
+++ b/resources/mw.UploadWizard.js
@@ -137,7 +137,7 @@
                        this.initialiseSteps();
 
                        // "select" the first step - highlight, make it 
visible, hide all others
-                       this.steps.tutorial.moveTo();
+                       this.steps.firstStep.moveTo();
                },
 
                /**
@@ -146,48 +146,54 @@
                initialiseSteps: function () {
                        var wizard = this;
 
-                       this.steps = {
-                               tutorial: new uw.controller.Tutorial( this.api, 
this.config ),
+                       if ( !this.config.tutorial.skip ) {
+                               this.steps.tutorial = new 
uw.controller.Tutorial( this.api, this.config );
+                       }
+                       this.steps.file = new uw.controller.Upload( this.api, 
this.config )
+                               .on( 'flickr-ui-init', function () {
+                                       wizard.flickrInterfaceInit();
+                                       uw.eventFlowLogger.logEvent( 
'flickr-upload-button-clicked' );
+                               } )
 
-                               file: new uw.controller.Upload( this.api, 
this.config )
-                                       .on( 'flickr-ui-init', function () {
-                                               wizard.flickrInterfaceInit();
-                                               uw.eventFlowLogger.logEvent( 
'flickr-upload-button-clicked' );
-                                       } )
+                               .on( 'load', function () {
+                                       wizard.reset();
 
-                                       .on( 'load', function () {
-                                               wizard.reset();
+                                       // Check for iOS 5 Safari's lack of 
file uploads (T34328#364508).
+                                       // While this looks extremely unlikely 
to be right, it actually is. Blame Apple.
+                                       if ( $( '<input type="file">' ).prop( 
'disabled' ) ) {
+                                               $( '#mwe-upwiz-stepdiv-file' 
).replaceWith(
+                                                       $( '<span>' ).msg( 
'mwe-upwiz-file-upload-notcapable' )
+                                               );
+                                               $( '#mwe-upwiz-add-file' 
).hide();
+                                       }
+                               } );
 
-                                               // Check for iOS 5 Safari's 
lack of file uploads (T34328#364508).
-                                               // While this looks extremely 
unlikely to be right, it actually is. Blame Apple.
-                                               if ( $( '<input type="file">' 
).prop( 'disabled' ) ) {
-                                                       $( 
'#mwe-upwiz-stepdiv-file' ).replaceWith(
-                                                               $( '<span>' 
).msg( 'mwe-upwiz-file-upload-notcapable' )
-                                                       );
-                                                       $( 
'#mwe-upwiz-add-file' ).hide();
-                                               }
-                                       } ),
+                       this.steps.deeds = new uw.controller.Deed( this.api, 
this.config )
+                               .on( 'load', function () {
+                                       wizard.removeErrorUploads();
+                               } );
 
-                               deeds: new uw.controller.Deed( this.api, 
this.config )
-                                       .on( 'load', function () {
-                                               wizard.removeErrorUploads();
-                                       } ),
+                       this.steps.details = new uw.controller.Details( 
this.api, this.config )
+                               .on( 'details-error', function () {
+                                       wizard.steps.details.showErrors();
+                               } )
 
-                               details: new uw.controller.Details( this.api, 
this.config )
-                                       .on( 'details-error', function () {
-                                               
wizard.steps.details.showErrors();
-                                       } )
+                               .on( 'finalize-details-after-removal', function 
() {
+                                       wizard.removeErrorUploads();
+                                       wizard.steps.details.moveFrom();
+                               } );
 
-                                       .on( 'finalize-details-after-removal', 
function () {
-                                               wizard.removeErrorUploads();
-                                               wizard.steps.details.moveFrom();
-                                       } ),
+                       this.steps.thanks = new uw.controller.Thanks( this.api, 
this.config )
+                               .on( 'reset-wizard', function () {
+                                       wizard.reset();
+                               } );
 
-                               thanks: new uw.controller.Thanks( this.api, 
this.config )
-                                       .on( 'reset-wizard', function () {
-                                               wizard.reset();
-                                       } )
-                       };
+                       if ( !this.config.tutorial.skip ) {
+                               this.steps.tutorial.setNextStep( 
this.steps.file );
+                               this.steps.firstStep = this.steps.tutorial;
+                       } else {
+                               this.steps.firstStep = this.steps.file;
+                       }
 
                        $.each( this.steps, function ( name, step ) {
                                step
@@ -196,7 +202,6 @@
                                        } );
                        } );
 
-                       this.steps.tutorial.setNextStep( this.steps.file );
                        this.steps.file.setNextStep( this.steps.deeds );
                        this.steps.deeds.setNextStep( this.steps.details );
                        this.steps.details.setNextStep( this.steps.thanks );
diff --git a/resources/uploadWizard.css b/resources/uploadWizard.css
index 410c868..897a2f2 100644
--- a/resources/uploadWizard.css
+++ b/resources/uploadWizard.css
@@ -24,11 +24,11 @@
        border-bottom: solid 1px #a7d7f9;
 }
 
-#mwe-upwiz-step-tutorial {
+#mwe-upwiz-steps li:first-child {
        border-left: solid 1px #a7d7f9;
 }
 
-#mwe-upwiz-step-thanks {
+#mwe-upwiz-steps li:last-child {
        border-right: solid 1px #a7d7f9;
 }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/308877
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I126a38c8bad4077e0dc885169f9be5ff55778577
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: MarkAHershberger <m...@nichework.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to