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/about">Tell 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 ( options ) { var self = this; + + // render the version B template + options.contentMsg = 'Which of these tags best describe ' + options.title + '?'; + this.$el.html(this.bTemplate.render( options ) ); + this.$save = this.$( '.mw-ui-constructive' ); // hide the completion screen self.$( '.final-pane' ).hide(); @@ -144,7 +151,33 @@ // hide this Dialog when the user reads more about Wikigrok this.$( '.tell-more' ).on( 'click', function () { self.hide(); + self.log( 'widget-click-moreinfo' ); } ); + }, + + postRender: function ( options ) { + var self = this; + + // show the welcome screen once + if ( !options.beginQuestions ) { + options.beginQuestions = true; + this.$( '.wg-buttons .cancel' ).on( 'click', function () { + self.hide(); + self.log( 'widget-click-nothanks' ); + //M.settings.saveUserSetting( 'mfHideWikiGrok', 'true', false ); + } ); + this.$( '.wg-buttons .proceed' ).on( 'click', function () { + self.log( 'widget-click-accept' ); + // Proceed with asking the user a metadata question. + self.askWikidataQuestion( options ); + } ); + // Log more info clicks + this.$( '.wg-notice-link' ).on( 'click', function () { + self.log( 'widget-click-moreinfo' ); + } ); + + self.show(); + } } } ); diff --git a/templates/modules/wikigrok/WikiGrokMoreInfo.hogan b/templates/modules/wikigrok/WikiGrokMoreInfo.hogan index deb4bd4..873bbd7 100644 --- a/templates/modules/wikigrok/WikiGrokMoreInfo.hogan +++ b/templates/modules/wikigrok/WikiGrokMoreInfo.hogan @@ -1,6 +1,6 @@ <div class="content wg-moreinfo"> - <p><strong>Wikidata Game</strong> is an easy way to contribute to Wikipedia on mobile devices. All of your entries get submitted to <a href="//www.wikidata.org/">Wikidata</a>, the free knowledge base that powers Wikipedia.</p> - <p>All submissions are released freely under the <a href="//creativecommons.org/publicdomain/zero/1.0/">Creative Commons Public Domain Dedication</a> (CC0).</p> + <p><strong>Wikidata Game</strong> is an easy way to contribute to Wikipedia on mobile devices. All of your entries get submitted to <a href="//www.wikidata.org/" target="_blank">Wikidata</a>, the free knowledge base that powers Wikipedia.</p> + <p>All submissions are released freely under the <a href="//creativecommons.org/publicdomain/zero/1.0/" target="_blank">Creative Commons Public Domain Dedication</a> (CC0).</p> <p> <button class="cancel inline mw-ui-button mw-ui-progressive">Got it!</button> </p> -- To view, visit https://gerrit.wikimedia.org/r/169544 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id86375a7e9a7aba1ec3db2a37d61c76413a88b63 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Bmansurov <bmansu...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits