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

Change subject: Remove MinervaBottomLanguageButton
......................................................................


Remove MinervaBottomLanguageButton

The language button will show at the top of the page
for all pages except the main page where it will
show at the bottom of the page.

This removes the PointerOverlay code that points users
trying to use the old language button to the new language
button.

Depends-On: I1ac608388ec674e0f315c08208a66d299917a678
Bug: T143829
Bug: T130849
Change-Id: Ic1b81e142724030992e8b567b821c20a85dcb254
---
M README.md
M extension.json
M includes/skins/SkinMinerva.php
M includes/skins/SkinMinervaBeta.php
M resources/skins.minerva.scripts/init.js
5 files changed, 4 insertions(+), 80 deletions(-)

Approvals:
  jenkins-bot: Verified
  Phuedx: Looks good to me, approved



diff --git a/README.md b/README.md
index 6439c3b..5ca2504 100644
--- a/README.md
+++ b/README.md
@@ -247,15 +247,6 @@
 * Type: `String`
 * Default: `'X-Subdomain'`
 
-#### $wgMinervaBottomLanguageButton
-
-Whether the language button at the bottom of the page is enabled
-
-Whether to show the language switcher button even if no languages are 
available for the page.
-
-* Type: `Boolean`
-* Default: `true`
-
 #### $wgMinervaUseFooterV2
 
 A temporary configuration variable to control display of a new footer which 
impacts styling
diff --git a/extension.json b/extension.json
index efa101f..51605ef 100644
--- a/extension.json
+++ b/extension.json
@@ -2047,7 +2047,6 @@
                "MFSchemaEditSampleRate": 0.0625,
                "MFAllowNonJavaScriptEditing": false,
                "MinervaAlwaysShowLanguageButton": true,
-               "MinervaBottomLanguageButton": false,
                "MinervaUseFooterV2": true,
                "MFStripResponsiveImages": true,
                "MFResponsiveImageWhitelist": [
diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index 35b3e07..757225a 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -27,11 +27,6 @@
        /** @var ContentHandler Content handler of page; only access through 
getContentHandler */
        protected $contentHandler = null;
 
-       /**
-        * @var boolean Whether the language button should be included in the 
secondary
-        * actions HTML on non-main pages
-        */
-       protected $shouldSecondaryActionsIncludeLanguageBtn = true;
        /** @var bool Whether the page is also available in other languages or 
variants */
        protected $doesPageHaveLanguages = false;
 
@@ -936,11 +931,7 @@
                        }
                }
 
-               if ( $title->isMainPage() && $this->doesPageHaveLanguages || (
-                       MobileContext::singleton()->getMFConfig()->get( 
'MinervaBottomLanguageButton' ) &&
-                       $this->doesPageHaveLanguages &&
-                       $this->shouldSecondaryActionsIncludeLanguageBtn )
-               ) {
+               if ( $this->doesPageHaveLanguages && $title->isMainPage() ) {
                        $buttons['language'] = $this->getLanguageButton();
                }
 
diff --git a/includes/skins/SkinMinervaBeta.php 
b/includes/skins/SkinMinervaBeta.php
index 890f86a..4b62056 100644
--- a/includes/skins/SkinMinervaBeta.php
+++ b/includes/skins/SkinMinervaBeta.php
@@ -14,8 +14,6 @@
        public $template = 'MinervaTemplateBeta';
        /** @var string $mode Describes 'stability' of the skin - beta, stable 
*/
        protected $mode = 'beta';
-       /** @inheritdoc */
-       protected $shouldSecondaryActionsIncludeLanguageBtn = true;
 
        /**
         * Whether the new footer is to be used
diff --git a/resources/skins.minerva.scripts/init.js 
b/resources/skins.minerva.scripts/init.js
index 8e1d09c..aef48d7 100644
--- a/resources/skins.minerva.scripts/init.js
+++ b/resources/skins.minerva.scripts/init.js
@@ -14,8 +14,7 @@
                thumbs = page.getThumbnails(),
                experiments = mw.config.get( 'wgMFExperiments' ) || {},
                betaOptinPanel,
-               TOP_OF_ARTICLE = 'top-of-article',
-               BOTTOM_OF_ARTICLE = 'bottom-of-article';
+               TOP_OF_ARTICLE = 'top-of-article';
 
        /**
         * Event handler for clicking on an image thumbnail
@@ -41,39 +40,14 @@
        }
 
        /**
-        * Scroll viewport to top
-        * @return {jQuery.Promise} promise that resolves when the animation is
-        * complete
-        * @ignore
-        */
-       function scrollToTop() {
-               var deferred = $.Deferred();
-
-               $( 'html, body' ).animate( {
-                       scrollTop: 0
-               }, 400, 'swing', function () {
-                       deferred.resolve();
-               } );
-
-               return deferred.promise();
-       }
-
-       /**
         * Hijack the Special:Languages link and replace it with a trigger to a 
LanguageOverlay
         * that displays the same data
         * @ignore
         */
        function initButton() {
                var version = TOP_OF_ARTICLE,
-                       // FIXME: remove #language-switcher when cache clears 
(T139794)
-                       $legacyBtn = $( '#page-secondary-actions 
.language-selector, #language-switcher' ),
-                       $primaryBtn = $( '#page-actions .language-selector' );
-
-               if ( !$primaryBtn.length ) {
-                       $primaryBtn = $legacyBtn;
-                       $legacyBtn = null;
-                       version = BOTTOM_OF_ARTICLE;
-               }
+                       // This catches language selectors in page actions and 
in secondary actions (e.g. Main Page)
+                       $primaryBtn = $( '.language-selector' );
 
                /**
                 * Log impression when the language button is seen by the user
@@ -165,35 +139,6 @@
                                }
                                captureTap();
                        } );
-
-                       // If both buttons are shown setup switch behaviour.
-                       if ( ( $legacyBtn && $legacyBtn.length ) && 
$primaryBtn.length ) {
-                               $legacyBtn.on( 'click', function ( ev ) {
-                                       ev.preventDefault();
-
-                                       // Animate to top while loading the 
content overlays
-                                       $.when(
-                                               scrollToTop(),
-                                               mw.loader.using( 
'mobile.pointerOverlay' )
-                                       ).done( function () {
-                                               var po,
-                                                       PointerOverlay = 
require( 'mobile.pointerOverlay' );
-
-                                               // Show pointer toast in the 
new languages button
-                                               po = new PointerOverlay( {
-                                                       summary: mw.msg( 
'mobile-frontend-language-change' ),
-                                                       target: '#page-actions 
.language-selector',
-                                                       autoHide: true,
-                                                       isCompact: true,
-                                                       timeout: 5000,
-                                                       cancelMsg: null
-                                               } );
-                                               po.show();
-                                               $legacyBtn.blur();
-                                       } );
-
-                               } );
-                       }
                }
        }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic1b81e142724030992e8b567b821c20a85dcb254
Gerrit-PatchSet: 8
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: Bmansurov <[email protected]>
Gerrit-Reviewer: Jdlrobson <[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