[MediaWiki-commits] [Gerrit] Show similar experience for both WikiGrok versions A and B. - change (mediawiki...MobileFrontend)
jenkins-bot has submitted this change and it was merged. Change subject: Show similar experience for both WikiGrok versions A and B. .. Show similar experience for both WikiGrok versions A and B. * Both versions have the same first (welcome) and last (thanks) steps * Make 'no-thanks' not a permanent opt-out * Show 'tell me more' button in the last step Change-Id: Id86375a7e9a7aba1ec3db2a37d61c76413a88b63 --- M javascripts/modules/wikigrok/WikiGrokDialog.js M javascripts/modules/wikigrok/WikiGrokDialogB.js M javascripts/modules/wikigrok/wikigrok.js M less/modules/wikigrok/WikiGrokDialog.less M templates/modules/wikigrok/WikiGrokDialog.hogan M templates/modules/wikigrok/WikiGrokDialogB.hogan 6 files changed, 123 insertions(+), 71 deletions(-) Approvals: Jdlrobson: Looks good to me, approved jenkins-bot: Verified diff --git a/javascripts/modules/wikigrok/WikiGrokDialog.js b/javascripts/modules/wikigrok/WikiGrokDialog.js index e209ecb..97284e0 100644 --- a/javascripts/modules/wikigrok/WikiGrokDialog.js +++ b/javascripts/modules/wikigrok/WikiGrokDialog.js @@ -187,16 +187,10 @@ options.thankUser = true; if ( claimRecorded ) { options.contentMsg = 'You just made Wikipedia a little better, thanks!'; - options.buttons = [ - { classes: 'quit inline mw-ui-button mw-ui-progressive', label: 'Great!' } - ]; } else { options.contentMsg = 'That\'s OK, thanks for taking the time.'; - options.buttons = [ - { classes: 'quit inline mw-ui-button mw-ui-progressive', label: 'Done' } - ]; } - options.noticeMsg = 'a class=wg-notice-link href=#/wikigrok/aboutTell me more/a'; + options.noticeMsg = ''; // Re-render with new content for 'Thanks' step this.render( options ); this.log( 'widget-impression-success' ); @@ -282,17 +276,24 @@ this.log( 'page-impression' ); } }, - + /** +* @inheritdoc +*/ postRender: function ( options ) { var self = this; + + self.$( '.wg-link' ).hide(); // If you're wondering where the DOM insertion happens, look in wikigrokeval.js. // Initialize all the buttons and links // ...for final 'Thanks' step if ( options.thankUser ) { - this.$( '.wg-buttons .quit' ).on( 'click', function () { + self.$('.wg-buttons' ).hide(); + self.$('.wg-link' ).show(); + this.$( '.wg-link .tell-more' ).on( 'click', function () { self.hide(); + self.log( 'widget-click-moreinfo' ); } ); // ...for intermediate 'Question' step } else if ( options.beginQuestions ) { @@ -315,7 +316,6 @@ this.$( '.wg-buttons .cancel' ).on( 'click', function () { self.hide(); self.log( 'widget-click-nothanks' ); - M.settings.saveUserSetting( 'mfHideWikiGrok', 'true' ); } ); this.$( '.wg-buttons .proceed' ).on( 'click', function () { self.log( 'widget-click-accept' ); @@ -335,6 +335,7 @@ this.reveal( options ); }, + reveal: function ( options ) { var self = this; diff --git a/javascripts/modules/wikigrok/WikiGrokDialogB.js b/javascripts/modules/wikigrok/WikiGrokDialogB.js index 8630eab..ac4465e 100644 --- a/javascripts/modules/wikigrok/WikiGrokDialogB.js +++ b/javascripts/modules/wikigrok/WikiGrokDialogB.js @@ -15,10 +15,9 @@ WikiGrokDialogB = WikiGrokDialog.extend( { version: 'b', template: M.template.get( 'modules/wikigrok/WikiGrokDialogB.hogan' ), - initialize: function ( options ) { + initialize: function () { var self = this; - options.contentMsg = 'Which of these tags best describe ' + options.title + '?'; WikiGrokDialog.prototype.initialize.apply( this, arguments );
[MediaWiki-commits] [Gerrit] Show similar experience for both WikiGrok versions A and B. - change (mediawiki...MobileFrontend)
Bmansurov has uploaded a new change for review. https://gerrit.wikimedia.org/r/169544 Change subject: Show similar experience for both WikiGrok versions A and B. .. Show similar experience for both WikiGrok versions A and B. * Add 'welcome' screen to the version B * Make 'no-thanks' not permanent opt-out * Show 'tell me more' as the last step button in the version A. Change-Id: Id86375a7e9a7aba1ec3db2a37d61c76413a88b63 --- M javascripts/modules/wikigrok/WikiGrokDialog.js M javascripts/modules/wikigrok/WikiGrokDialogB.js M templates/modules/wikigrok/WikiGrokMoreInfo.hogan 3 files changed, 47 insertions(+), 14 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/44/169544/1 diff --git a/javascripts/modules/wikigrok/WikiGrokDialog.js b/javascripts/modules/wikigrok/WikiGrokDialog.js index 49c5d48..c81177e 100644 --- a/javascripts/modules/wikigrok/WikiGrokDialog.js +++ b/javascripts/modules/wikigrok/WikiGrokDialog.js @@ -186,16 +186,13 @@ options.thankUser = true; if ( claimRecorded ) { options.contentMsg = 'You just made Wikipedia a little better, thanks!'; - options.buttons = [ - { classes: 'quit inline mw-ui-button mw-ui-progressive', label: 'Great!' } - ]; } else { options.contentMsg = 'That\'s OK, thanks for taking the time.'; - options.buttons = [ - { classes: 'quit inline mw-ui-button mw-ui-progressive', label: 'Done' } - ]; } - options.noticeMsg = 'a class=wg-notice-link href=#/wikigrok/aboutTell me more/a'; + options.buttons = [ + { classes: 'quit inline mw-ui-button mw-ui-progressive', label: 'Tell me more' } + ]; + options.noticeMsg = ''; // Re-render with new content for 'Thanks' step this.render( options ); this.log( 'widget-impression-success' ); @@ -291,7 +288,10 @@ // ...for final 'Thanks' step if ( options.thankUser ) { this.$( '.wg-buttons .quit' ).on( 'click', function () { + // show the tell me more contents + window.location.hash = '#/wikigrok/about'; self.hide(); + self.log( 'widget-click-moreinfo' ); } ); // ...for intermediate 'Question' step } else if ( options.beginQuestions ) { @@ -314,7 +314,7 @@ this.$( '.wg-buttons .cancel' ).on( 'click', function () { self.hide(); self.log( 'widget-click-nothanks' ); - M.settings.saveUserSetting( 'mfHideWikiGrok', 'true' ); + //M.settings.saveUserSetting( 'mfHideWikiGrok', 'true', false ); } ); this.$( '.wg-buttons .proceed' ).on( 'click', function () { self.log( 'widget-click-accept' ); diff --git a/javascripts/modules/wikigrok/WikiGrokDialogB.js b/javascripts/modules/wikigrok/WikiGrokDialogB.js index 47d41b5..739023d 100644 --- a/javascripts/modules/wikigrok/WikiGrokDialogB.js +++ b/javascripts/modules/wikigrok/WikiGrokDialogB.js @@ -14,11 +14,12 @@ */ WikiGrokDialogB = WikiGrokDialog.extend( { version: 'b', - template: M.template.get( 'modules/wikigrok/WikiGrokDialogB.hogan' ), - initialize: function ( options ) { + // use version A template for rendering the welcome screen + // use bTemplate for rendering the rest of the workflow + bTemplate: M.template.get( 'modules/wikigrok/WikiGrokDialogB.hogan' ), + initialize: function () { var self = this; - options.contentMsg = 'Which of these tags best describe ' + options.title + '?'; WikiGrokDialog.prototype.initialize.apply( this, arguments ); // log page impression and widget impression when the widget is shown @@ -106,8 +107,14 @@ } ); } }, - postRender: function () { + + askWikidataQuestion: function (