jenkins-bot has submitted this change and it was merged.

Change subject: Move redirect message to toast
......................................................................


Move redirect message to toast

Non-JS behavior unchanged.

Changes:
 * Hide '.mw-redirectedfrom' element
 * Add i18n message 'mobile-frontend-redirected-from'
 * Show toast on redirect

Bug: T146596
Change-Id: I3cf8c1aa75f30f71ae2f01f55f02e7f691e898be
---
M extension.json
M i18n/en.json
M i18n/qqq.json
M resources/skins.minerva.base.styles/common.less
M resources/skins.minerva.scripts/preInit.js
5 files changed, 13 insertions(+), 3 deletions(-)

Approvals:
  Bmansurov: Looks good to me, approved
  jenkins-bot: Verified
  Phuedx: Looks good to me, but someone else must approve



diff --git a/extension.json b/extension.json
index 5ec0593..5682dbb 100644
--- a/extension.json
+++ b/extension.json
@@ -1583,7 +1583,8 @@
                                "mobile-frontend-last-modified-with-user-years",
                                
"mobile-frontend-last-modified-with-user-just-now",
                                "mobile-frontend-cookies-required",
-                               "mobile-frontend-console-recruit"
+                               "mobile-frontend-console-recruit",
+                               "mobile-frontend-redirected-from"
                        ],
                        "scripts": [
                                "resources/skins.minerva.scripts/preInit.js",
diff --git a/i18n/en.json b/i18n/en.json
index 90fd10d..a465837 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -262,6 +262,7 @@
        "mobile-frontend-placeholder-beta": "Search {{SITENAME}} (Beta)",
        "mobile-frontend-privacy-link-text": "Privacy",
        "mobile-frontend-random-button": "Random",
+       "mobile-frontend-redirected-from": "Redirected from \"$1\"",
        "mobile-frontend-references-citation": "Citation",
        "mobile-frontend-references-citation-error": "An error occurred and it 
was not possible to load this citation.",
        "mobile-frontend-references-list": "View full list of citations",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 72a0400..472c54f 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -262,6 +262,7 @@
        "mobile-frontend-placeholder-beta": "Phrase used to prompt the user to 
use a search interface for a mobile full screen search with identifier that it 
is in beta mode",
        "mobile-frontend-privacy-link-text": "Custom version of \"Privacy 
policy\" link text for mobile footer, intended to be as brief as possible to 
take up as little screen real estate as possible.\n{{Identical|Privacy}}",
        "mobile-frontend-random-button": "This is the label of one of the 
buttons that appear if you click the wiki logo near the search box.\n\nThis 
buttons takes the user to a random page.\n{{Identical|Random}}",
+       "mobile-frontend-redirected-from": "Toast message informing the user 
that they were redirected from their original page. Parameters:\n* $1 - the 
original page title from which the user was redirected",
        "mobile-frontend-references-citation": "The title of the reference 
drawer that opens up when a reference link is clicked.\n{{Identical|Citation}}",
        "mobile-frontend-references-citation-error": "Error message body that 
shows when a citation fails to load via the API.",
        "mobile-frontend-references-list": "Label for a link to the list of the 
citations in the article.",
diff --git a/resources/skins.minerva.base.styles/common.less 
b/resources/skins.minerva.base.styles/common.less
index 1ed48a5..cde7c7e 100644
--- a/resources/skins.minerva.base.styles/common.less
+++ b/resources/skins.minerva.base.styles/common.less
@@ -56,6 +56,7 @@
 // We also need a more specific rule for tablet non-JS users who will load 
skins.minerva.tablet.styles
 .client-nojs .toc-mobile,
 .client-js .no-js-only,
+.client-js .mw-redirectedfrom,
 // FIXME: Use generic rule for print stylesheets
 .printfooter,
 .jsonly {
@@ -68,8 +69,8 @@
 .client-js .jsonly {
        display: inherit;
 }
-/* stylelint-enable no-descending-specificity */
 
+/* stylelint-enable no-descending-specificity */
 .position-fixed {
        // use !important to override more specific rules (e.g. in Overlay.less)
        position: fixed !important;
diff --git a/resources/skins.minerva.scripts/preInit.js 
b/resources/skins.minerva.scripts/preInit.js
index 3e2f5ee..c4ef782 100644
--- a/resources/skins.minerva.scripts/preInit.js
+++ b/resources/skins.minerva.scripts/preInit.js
@@ -13,6 +13,7 @@
                gateway = new PageGateway( new mw.Api() ),
                Page = M.require( 'mobile.startup/Page' ),
                mainMenu = M.require( 'skins.minerva.scripts.top/mainMenu' ),
+               toast = M.require( 'mobile.toast/toast' ),
                Skin = M.require( 'mobile.startup/Skin' ),
                ReferencesMobileViewGateway = M.require(
                        'mobile.references.gateway/ReferencesMobileViewGateway'
@@ -23,11 +24,16 @@
                        page: getCurrentPage(),
                        referencesGateway: 
ReferencesMobileViewGateway.getSingleton(),
                        mainMenu: mainMenu
-               };
+               },
+               redirectedFromTitle = mw.config.get( 'wgRedirectedFrom' );
 
        skin = new Skin( skinData );
        M.define( 'skins.minerva.scripts/skin', skin ).deprecate( 
'mobile.startup/skin' );
 
+       if ( redirectedFromTitle ) {
+               toast.show( mw.msg( 'mobile-frontend-redirected-from', 
redirectedFromTitle ) );
+       }
+
        /**
         * Given 2 functions, it returns a function that will run both with it's
         * context and parameters and return the results combined

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3cf8c1aa75f30f71ae2f01f55f02e7f691e898be
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jhobs <[email protected]>
Gerrit-Reviewer: Bmansurov <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Jhobs <[email protected]>
Gerrit-Reviewer: Phuedx <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to