Mooeypoo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/375097 )

Change subject: [wip] RCFilters: Add introduction tour when RCFilters comes out 
of beta
......................................................................

[wip] RCFilters: Add introduction tour when RCFilters comes out of beta

Bug: T169613
Change-Id: I9195e9a434b9d9ae0e928b089b7212ec2b779eba
---
M WikimediaMessages.hooks.php
M i18n/wikimedia/en.json
M i18n/wikimedia/qqq.json
A modules/rcfilters-intro-tour.js
A modules/rcfilters-intro-tour.less
5 files changed, 98 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMessages 
refs/changes/97/375097/1

diff --git a/WikimediaMessages.hooks.php b/WikimediaMessages.hooks.php
index e1ee79f..a349893 100644
--- a/WikimediaMessages.hooks.php
+++ b/WikimediaMessages.hooks.php
@@ -1276,6 +1276,8 @@
        }
 
        public static function onBeforePageDisplay( OutputPage &$out, Skin 
&$skin ) {
+               global $wgUseStructuredChangeFilters;
+
                if ( !class_exists( 'GuidedTourHooks' ) ) {
                        return;
                }
@@ -1287,8 +1289,12 @@
                        $user->isLoggedIn()
                ) {
                        if ( $user->getOption( 'rcenhancedfilters' ) ) {
+                               // $welcomeTourName = 
$wgUseStructuredChangeFilters ?
+                               //      'RcFiltersIntro' : 'RcFiltersBeta';
+                               $welcomeTourName = 'RcFiltersIntro';
+
                                if ( !$user->getOption( 
'rcenhancedfilters-seen-tour' ) ) {
-                                       GuidedTourLauncher::launchTourByCookie( 
'RcFiltersBeta', 'Welcome' );
+                                       GuidedTourLauncher::launchTourByCookie( 
$welcomeTourName, 'Welcome' );
                                        $out->addJsConfigVars( 
'wgRCFiltersORESAvailable', self::isOresAvailable() );
                                }
 
@@ -1320,6 +1326,7 @@
                                        'eri-rcfilters-tour-welcome-title',
                                        
'eri-rcfilters-tour-welcome-description',
                                        
'eri-rcfilters-tour-welcome-no-ores-description',
+                                       
'eri-rcfilters-tour-preferences-description',
                                        'eri-rcfilters-tour-welcome-button',
                                ],
                                'dependencies' => [
@@ -1327,6 +1334,24 @@
                                ],
                        ] );
 
+                       $resourceLoader->register( 
'ext.guidedTour.tour.RcFiltersIntro', [
+                               'localBasePath' => __DIR__ . '/modules',
+                               'remoteExtPath' => 'WikimediaMessages/modules',
+                               'scripts' => 'rcfilters-intro-tour.js',
+                               'styles' => 'rcfilters-intro-tour.less',
+                               'messages' => [
+
+
+                                       
'eri-rcfilters-intro-tour-welcome-title',
+                                       
'eri-rcfilters-intro-tour-welcome-description',
+                                       
'eri-rcfilters-intro-tour-welcome-no-ores-description',
+                                       
'eri-rcfilters-intro-tour-welcome-button',
+                               ],
+                               'dependencies' => [
+                                       'ext.guidedTour'
+                               ],
+                       ] );
+
                        $resourceLoader->register( 
'ext.guidedTour.tour.RcFiltersHighlight', [
                                'localBasePath' => __DIR__ . '/modules',
                                'remoteExtPath' => 'WikimediaMessages/modules',
diff --git a/i18n/wikimedia/en.json b/i18n/wikimedia/en.json
index e0c0948..4cfbcc6 100644
--- a/i18n/wikimedia/en.json
+++ b/i18n/wikimedia/en.json
@@ -287,7 +287,12 @@
        "eri-rcfilters-tour-welcome-title": "Introducing: New Filters for Edit 
Review (beta)",
        "eri-rcfilters-tour-welcome-description": "Combine improved tools, a 
new interface and the power of machine learning to fight vandalism and help new 
users.",
        "eri-rcfilters-tour-welcome-no-ores-description": "Review edits using 
an easier and more powerful interface, additional filters, user-defined 
highlighting and other improvements.",
+       "eri-rcfilters-tour-preferences-description": "Access your preferences 
any time to disable the improved version of Recent Changes.",
        "eri-rcfilters-tour-welcome-button": "OK, got it",
+       "eri-rcfilters-intro-tour-welcome-title": "Welcome to improved Recent 
Changes filtering",
+       "eri-rcfilters-intro-tour-welcome-description": "Review edits more 
efficiently using improved tools, a new interface and the power of machine 
learning.",
+       "eri-rcfilters-intro-tour-welcome-no-ores-description": "Review edits 
more efficiently using new filters, a more powerful interface, user-defined 
highlighting and and other improvements.",
+       "eri-rcfilters-intro-tour-welcome-button": "OK, got it",
        "eri-rcfilters-tour-highlight-title": "Color code your results",
        "eri-rcfilters-tour-highlight-description": "Use highlighting to 
visually distinguish selected properties.<br/><br/>You can combine highlights 
with filters or use highlighting independently.",
        "eri-rcfilters-tour-highlight-button": "OK, got it",
diff --git a/i18n/wikimedia/qqq.json b/i18n/wikimedia/qqq.json
index 2d29038..95fb2ee 100644
--- a/i18n/wikimedia/qqq.json
+++ b/i18n/wikimedia/qqq.json
@@ -317,6 +317,11 @@
        "eri-rcfilters-tour-welcome-description": "Description of the first 
step of the guided tour introducing the RC filters beta feature, if machine 
learning tools are available on this wiki.",
        "eri-rcfilters-tour-welcome-no-ores-description": "Description of the 
first step of the guided tour introducing the RC filters beta feature, if 
machine learning tools are not available on the wiki.",
        "eri-rcfilters-tour-welcome-button": "Text of the button to close the 
RC filters beta feature guided tour.",
+       "eri-rcfilters-intro-tour-welcome-title": "Title of the first step of 
the guided tour introducing the new Recent Changes filtering features.",
+       "eri-rcfilters-intro-tour-welcome-description": "Description of the 
first step of the guided tour introducing the new Recent Changes filtering 
features, if machine learning tools are available on this wiki.",
+       "eri-rcfilters-intro-tour-welcome-no-ores-description": "Description of 
the first step of the guided tour introducing the new Recent Changes filtering 
features, if machine learning tools are not available on the wiki.",
+       "eri-rcfilters-tour-preferences-description": "Description for the 
second step of the guided tour introducing the new Recent Changes filters, 
reminding the users they can disable the feature at any time through their 
preferences.",
+       "eri-rcfilters-intro-tour-welcome-button": "Text of the button to close 
the RC filters feature guided tour.",
        "eri-rcfilters-tour-highlight-title": "Title of the first step of the 
guided tour introducing the RC filters highlight feature.",
        "eri-rcfilters-tour-highlight-description": "Description of the first 
step of the guided tour introducing the RC filters highlight feature.",
        "eri-rcfilters-tour-highlight-button": "Text of the button to close the 
RC filters highlight feature guided tour.",
diff --git a/modules/rcfilters-intro-tour.js b/modules/rcfilters-intro-tour.js
new file mode 100644
index 0000000..b786e5e
--- /dev/null
+++ b/modules/rcfilters-intro-tour.js
@@ -0,0 +1,36 @@
+( function ( mw, gt ) {
+       var tour = new gt.TourBuilder( {
+                       name: 'RcFiltersIntro',
+                       shouldLog: true,
+                       isSinglePage: true
+               } );
+
+       tour.firstStep( {
+               name: 'Welcome',
+               titlemsg: 'eri-rcfilters-intro-tour-welcome-title',
+               descriptionmsg: mw.config.get( 'wgRCFiltersORESAvailable' ) ?
+                       'eri-rcfilters-tour-intro-welcome-description' :
+                       'eri-rcfilters-tour-intro-welcome-no-ores-description',
+               autoFocus: true,
+               allowAutomaticOkay: false,
+               allowAutomaticNext: false,
+               buttons: [
+                       {
+                               namemsg: 
'eri-rcfilters-intro-tour-welcome-button',
+                               onclick: function () {
+                                       mw.libs.guiders.next();
+                               }
+                       }
+               ],
+               onHide: function () {
+                       new mw.Api().saveOption( 'rcenhancedfilters-seen-tour', 
1 );
+               },
+       } ).next( 'Preferences' );
+
+       tour.step( {
+               name: 'Preferences',
+               descriptionmsg: 
'eri-rcfilters-tour-intro-preferences-description',
+               attachTo: '#pt-preferences a'
+       } );
+
+}( mediaWiki, mediaWiki.guidedTour ) );
diff --git a/modules/rcfilters-intro-tour.less 
b/modules/rcfilters-intro-tour.less
new file mode 100644
index 0000000..8630a3b
--- /dev/null
+++ b/modules/rcfilters-intro-tour.less
@@ -0,0 +1,26 @@
+.mw-guidedtour-tour-RcFiltersIntro {
+       padding: 40px;
+       width: 600px !important;
+       .guider_content {
+               background: url( images/rc-beta-tour-welcome-ltr.gif ) 
no-repeat;
+               // Ensure the background image appears on the left in LTR and 
on the right in RTL
+               background-position-x: 0%;
+               // Make space for the image
+               min-height: 170px;
+               padding-left: 234px;
+
+               .guider_close {
+                       display: none;
+               }
+
+               .guider_buttons > .mw-ui-button {
+                       float: left;
+                       margin-left: 0;
+               }
+
+               .guider_description {
+                       font-size: 1.2em;
+                       color: #808080;
+               }
+       }
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9195e9a434b9d9ae0e928b089b7212ec2b779eba
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaMessages
Gerrit-Branch: master
Gerrit-Owner: Mooeypoo <mor...@gmail.com>

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

Reply via email to