Florianschmidtwelzow has uploaded a new change for review. https://gerrit.wikimedia.org/r/206130
Change subject: Move Category button to beta ...................................................................... Move Category button to beta Pushing it to a wider audience for more testing, there aren't bug reports about it in the last time (and no open oney anymore). Moving mobile.categories module to getContextSpecificModules() and change visibility of getCategoryButton() from public to protected. Change-Id: I9e9080731d83bcf7cd481c0a43ea8efa0af1f60e --- M includes/skins/MinervaTemplateAlpha.php M includes/skins/MinervaTemplateBeta.php M includes/skins/SkinMinervaAlpha.php M includes/skins/SkinMinervaBeta.php 4 files changed, 33 insertions(+), 30 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/30/206130/1 diff --git a/includes/skins/MinervaTemplateAlpha.php b/includes/skins/MinervaTemplateAlpha.php index 655533b..9e888df 100644 --- a/includes/skins/MinervaTemplateAlpha.php +++ b/includes/skins/MinervaTemplateAlpha.php @@ -42,37 +42,10 @@ ); } - /** - * Get category button if categories are present - * @return array A map of the button's friendly name, "categories" to its - * spec if the button can be displayed. - */ - public function getCategoryButton() { - $skin = $this->getSkin(); - $categories = $skin->getCategoryLinks( false /* don't render the heading */ ); - - if ( !$categories ) { - return array(); - } - - return array( - 'categories' => array( - 'attributes' => array( - 'href' => '#/categories', - // add hidden class (the overlay works only, when JS is enabled (class will - // be removed in categories/init.js) - 'class' => 'category-button hidden', - ), - 'label' => wfMessage( 'categories' )->text() - ), - ); - } - /** @inheritdoc */ protected function getSecondaryActions() { $result = parent::getSecondaryActions(); $result += $this->getNearbyButton(); - $result += $this->getCategoryButton(); return $result; } diff --git a/includes/skins/MinervaTemplateBeta.php b/includes/skins/MinervaTemplateBeta.php index 972bda0..92c1803 100644 --- a/includes/skins/MinervaTemplateBeta.php +++ b/includes/skins/MinervaTemplateBeta.php @@ -26,6 +26,32 @@ } /** + * Get category button if categories are present + * @return array A map of the button's friendly name, "categories" to its + * spec if the button can be displayed. + */ + protected function getCategoryButton() { + $skin = $this->getSkin(); + $categories = $skin->getCategoryLinks( false /* don't render the heading */ ); + + if ( !$categories ) { + return array(); + } + + return array( + 'categories' => array( + 'attributes' => array( + 'href' => '#/categories', + // add hidden class (the overlay works only, when JS is enabled (class will + // be removed in categories/init.js) + 'class' => 'category-button hidden', + ), + 'label' => wfMessage( 'categories' )->text() + ), + ); + } + + /** * Get page secondary actions */ protected function getSecondaryActions() { @@ -41,6 +67,9 @@ 'label' => wfMessage( 'mobile-frontend-donate-button-label' )->text() ); } + + $result += $this->getCategoryButton(); + return $result; } diff --git a/includes/skins/SkinMinervaAlpha.php b/includes/skins/SkinMinervaAlpha.php index decc319..ec86270 100644 --- a/includes/skins/SkinMinervaAlpha.php +++ b/includes/skins/SkinMinervaAlpha.php @@ -20,9 +20,6 @@ $modules = parent::getDefaultModules(); $modules['alpha'] = array( 'skins.minerva.alpha.scripts' ); - if ( $this->getCategoryLinks( false ) ) { - $modules['categories'] = array( 'mobile.categories' ); - } return $modules; } diff --git a/includes/skins/SkinMinervaBeta.php b/includes/skins/SkinMinervaBeta.php index 5c6ab86..5a17f7f 100644 --- a/includes/skins/SkinMinervaBeta.php +++ b/includes/skins/SkinMinervaBeta.php @@ -80,6 +80,10 @@ $modules[] = 'mobile.talk'; } + if ( $this->getCategoryLinks( false ) ) { + $modules[] = 'mobile.categories'; + } + return $modules; } -- To view, visit https://gerrit.wikimedia.org/r/206130 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9e9080731d83bcf7cd481c0a43ea8efa0af1f60e Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Florianschmidtwelzow <florian.schmidt.wel...@t-online.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits