jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354710 )
Change subject: MainMenu belongs to Minerva not MobileFrontend ...................................................................... MainMenu belongs to Minerva not MobileFrontend While trying to separate Minerva from MobileFrontend it became apparent the MainMenu as currently implemented is very Minerva specific. Special:MobileMenu remains a MobileFrontend construct. Style modules are added via the onSpecialPageBeforeExecute hook Change-Id: I695909d7ce81a7b2ca29d905650f5b09cc14337a --- M extension.json M includes/Minerva.hooks.php R includes/skins/MenuBuilder.php M includes/skins/MinervaTemplate.php M includes/specials/SpecialMobileMenu.php R resources/skins.minerva.mainMenu.icons/anonymous.svg R resources/skins.minerva.mainMenu.icons/contributions.svg R resources/skins.minerva.mainMenu.icons/home.svg R resources/skins.minerva.mainMenu.icons/logout.svg R resources/skins.minerva.mainMenu.icons/nearby.svg R resources/skins.minerva.mainMenu.icons/profile.svg R resources/skins.minerva.mainMenu.icons/random.svg R resources/skins.minerva.mainMenu.icons/settings.svg R resources/skins.minerva.mainMenu.icons/watchlist.svg R resources/skins.minerva.mainMenu.styles/mainmenu.less R resources/skins.minerva.mainMenu/MainMenu.js R resources/skins.minerva.mainMenu/menu.mustache R resources/skins.minerva.mainMenu/menuGroup.mustache M resources/skins.minerva.scripts.top/init.js 19 files changed, 36 insertions(+), 33 deletions(-) Approvals: Pmiazga: Looks good to me, approved jenkins-bot: Verified Jdlrobson: Looks good to me, approved diff --git a/extension.json b/extension.json index 1d0b25f..589b98b 100644 --- a/extension.json +++ b/extension.json @@ -86,8 +86,8 @@ "MFResourceLoaderParsedMessageModule": "includes/modules/MFResourceLoaderParsedMessageModule.php", "SkinMinerva": "includes/skins/SkinMinerva.php", "ICustomizableSkin": "includes/skins/ICustomizableSkin.php", - "MediaWiki\\Minerva\\MenuBuilder": "includes/MenuBuilder.php", - "MediaWiki\\Minerva\\MenuEntry": "includes/MenuBuilder.php", + "MediaWiki\\Minerva\\MenuBuilder": "includes/skins/MenuBuilder.php", + "MediaWiki\\Minerva\\MenuEntry": "includes/skins/MenuBuilder.php", "MobileFrontend\\Devices\\DeviceDetector": "includes/devices/DeviceDetector.php", "MobileFrontend\\Devices\\DeviceProperties": "includes/devices/DeviceProperties.php", "MobileFrontend\\Devices\\AMFDeviceDetector": "includes/devices/AMFDeviceDetector.php", @@ -285,48 +285,48 @@ "resources/skins.minerva.userpage.styles/userpage.less" ] }, - "mobile.mainMenu.icons": { + "skins.minerva.mainMenu.icons": { "class": "ResourceLoaderImageModule", "selector": ".mw-ui-icon-mf-{name}:before", "images": { - "anonymous": "resources/mobile.mainMenu.icons/anonymous.svg", - "home": "resources/mobile.mainMenu.icons/home.svg", - "logout": "resources/mobile.mainMenu.icons/logout.svg", - "nearby": "resources/mobile.mainMenu.icons/nearby.svg", - "profile": "resources/mobile.mainMenu.icons/profile.svg", - "random": "resources/mobile.mainMenu.icons/random.svg", - "settings": "resources/mobile.mainMenu.icons/settings.svg", - "watchlist": "resources/mobile.mainMenu.icons/watchlist.svg", - "contributions": "resources/mobile.mainMenu.icons/contributions.svg" + "anonymous": "resources/skins.minerva.mainMenu.icons/anonymous.svg", + "home": "resources/skins.minerva.mainMenu.icons/home.svg", + "logout": "resources/skins.minerva.mainMenu.icons/logout.svg", + "nearby": "resources/skins.minerva.mainMenu.icons/nearby.svg", + "profile": "resources/skins.minerva.mainMenu.icons/profile.svg", + "random": "resources/skins.minerva.mainMenu.icons/random.svg", + "settings": "resources/skins.minerva.mainMenu.icons/settings.svg", + "watchlist": "resources/skins.minerva.mainMenu.icons/watchlist.svg", + "contributions": "resources/skins.minerva.mainMenu.icons/contributions.svg" } }, - "mobile.mainMenu.styles": { + "skins.minerva.mainMenu.styles": { "targets": [ "mobile", "desktop" ], "styles": [ - "resources/mobile.mainMenu.styles/mainmenu.less" + "resources/skins.minerva.mainMenu.styles/mainmenu.less" ] }, - "mobile.mainMenu": { + "skins.minerva.mainMenu": { "targets": [ "mobile", "desktop" ], "dependencies": [ - "mobile.mainMenu.icons", - "mobile.mainMenu.styles", + "skins.minerva.mainMenu.icons", + "skins.minerva.mainMenu.styles", "mobile.startup", "mobile.loggingSchemas.mobileWebMainMenuClickTracking" ], "position": "bottom", "templates": { - "menu.hogan": "resources/mobile.mainMenu/menu.mustache", - "menuGroup.hogan": "resources/mobile.mainMenu/menuGroup.mustache" + "menu.hogan": "resources/skins.minerva.mainMenu/menu.mustache", + "menuGroup.hogan": "resources/skins.minerva.mainMenu/menuGroup.mustache" }, "scripts": [ - "resources/mobile.mainMenu/MainMenu.js" + "resources/skins.minerva.mainMenu/MainMenu.js" ] }, "mobile.messageBox.styles": { @@ -1382,7 +1382,7 @@ "mediawiki.router", "mediawiki.Title", "mobile.startup", - "mobile.mainMenu", + "skins.minerva.mainMenu", "mobile.issues", "mobile.search.api", "mobile.search", @@ -1432,7 +1432,7 @@ ], "position": "top", "dependencies": [ - "mobile.mainMenu" + "skins.minerva.mainMenu" ], "scripts": [ "resources/skins.minerva.scripts.top/init.js" @@ -1613,6 +1613,9 @@ "mediawiki.notification": [ "resources/mobile.startup/toast.less" ] + }, + "vector": { + "mobile.special.mobilemenu.styles": "skinStyles/mobile.special.mobilemenu.styles/vector.less" } }, "Hooks": { diff --git a/includes/Minerva.hooks.php b/includes/Minerva.hooks.php index 596c0f2..90bc80e 100644 --- a/includes/Minerva.hooks.php +++ b/includes/Minerva.hooks.php @@ -79,6 +79,12 @@ // FIXME: Upstream to core (?) if ( $skin instanceof SkinMinerva ) { switch ( $name ) { + case 'MobileMenu': + $out->addModules( [ + 'skins.minerva.mainMenu.icons', + 'skins.minerva.mainMenu' + ] ); + break; case 'Preferences': $out->addModules( 'skins.minerva.special.preferences.scripts' ); break; diff --git a/includes/MenuBuilder.php b/includes/skins/MenuBuilder.php similarity index 100% rename from includes/MenuBuilder.php rename to includes/skins/MenuBuilder.php diff --git a/includes/skins/MinervaTemplate.php b/includes/skins/MinervaTemplate.php index b2b1139..508529a 100644 --- a/includes/skins/MinervaTemplate.php +++ b/includes/skins/MinervaTemplate.php @@ -248,7 +248,7 @@ protected function getMainMenuHtml( $data ) { if ( $this->isSpecialMobileMenuPage ) { $templateParser = new TemplateParser( - __DIR__ . '/../../resources/mobile.mainMenu/' ); + __DIR__ . '/../../resources/skins.minerva.mainMenu/' ); return $templateParser->processTemplate( 'menu', $data['menu_data'] ); } else { diff --git a/includes/specials/SpecialMobileMenu.php b/includes/specials/SpecialMobileMenu.php index 8b8fff7..6a3cafb 100644 --- a/includes/specials/SpecialMobileMenu.php +++ b/includes/specials/SpecialMobileMenu.php @@ -31,11 +31,5 @@ $out = $this->getOutput(); $out->setPageTitle( $this->msg( 'mobile-frontend-main-menu-page-title' ) ); $out->setProperty( 'bodyClassName', 'navigation-enabled navigation-full-screen' ); - $out->addModuleStyles( - [ - 'mobile.mainMenu.icons', - 'mobile.mainMenu.styles', - ] - ); } } diff --git a/resources/mobile.mainMenu.icons/anonymous.svg b/resources/skins.minerva.mainMenu.icons/anonymous.svg similarity index 100% rename from resources/mobile.mainMenu.icons/anonymous.svg rename to resources/skins.minerva.mainMenu.icons/anonymous.svg diff --git a/resources/mobile.mainMenu.icons/contributions.svg b/resources/skins.minerva.mainMenu.icons/contributions.svg similarity index 100% rename from resources/mobile.mainMenu.icons/contributions.svg rename to resources/skins.minerva.mainMenu.icons/contributions.svg diff --git a/resources/mobile.mainMenu.icons/home.svg b/resources/skins.minerva.mainMenu.icons/home.svg similarity index 100% rename from resources/mobile.mainMenu.icons/home.svg rename to resources/skins.minerva.mainMenu.icons/home.svg diff --git a/resources/mobile.mainMenu.icons/logout.svg b/resources/skins.minerva.mainMenu.icons/logout.svg similarity index 100% rename from resources/mobile.mainMenu.icons/logout.svg rename to resources/skins.minerva.mainMenu.icons/logout.svg diff --git a/resources/mobile.mainMenu.icons/nearby.svg b/resources/skins.minerva.mainMenu.icons/nearby.svg similarity index 100% rename from resources/mobile.mainMenu.icons/nearby.svg rename to resources/skins.minerva.mainMenu.icons/nearby.svg diff --git a/resources/mobile.mainMenu.icons/profile.svg b/resources/skins.minerva.mainMenu.icons/profile.svg similarity index 100% rename from resources/mobile.mainMenu.icons/profile.svg rename to resources/skins.minerva.mainMenu.icons/profile.svg diff --git a/resources/mobile.mainMenu.icons/random.svg b/resources/skins.minerva.mainMenu.icons/random.svg similarity index 100% rename from resources/mobile.mainMenu.icons/random.svg rename to resources/skins.minerva.mainMenu.icons/random.svg diff --git a/resources/mobile.mainMenu.icons/settings.svg b/resources/skins.minerva.mainMenu.icons/settings.svg similarity index 100% rename from resources/mobile.mainMenu.icons/settings.svg rename to resources/skins.minerva.mainMenu.icons/settings.svg diff --git a/resources/mobile.mainMenu.icons/watchlist.svg b/resources/skins.minerva.mainMenu.icons/watchlist.svg similarity index 100% rename from resources/mobile.mainMenu.icons/watchlist.svg rename to resources/skins.minerva.mainMenu.icons/watchlist.svg diff --git a/resources/mobile.mainMenu.styles/mainmenu.less b/resources/skins.minerva.mainMenu.styles/mainmenu.less similarity index 100% rename from resources/mobile.mainMenu.styles/mainmenu.less rename to resources/skins.minerva.mainMenu.styles/mainmenu.less diff --git a/resources/mobile.mainMenu/MainMenu.js b/resources/skins.minerva.mainMenu/MainMenu.js similarity index 95% rename from resources/mobile.mainMenu/MainMenu.js rename to resources/skins.minerva.mainMenu/MainMenu.js index 70b7e46..5a45472 100644 --- a/resources/mobile.mainMenu/MainMenu.js +++ b/resources/skins.minerva.mainMenu/MainMenu.js @@ -20,10 +20,10 @@ /** @inheritdoc */ isTemplateMode: true, /** @inheritdoc */ - template: mw.template.get( 'mobile.mainMenu', 'menu.hogan' ), + template: mw.template.get( 'skins.minerva.mainMenu', 'menu.hogan' ), /** @inheritdoc */ templatePartials: { - menuGroup: mw.template.get( 'mobile.mainMenu', 'menuGroup.hogan' ) + menuGroup: mw.template.get( 'skins.minerva.mainMenu', 'menuGroup.hogan' ) }, /** @@ -159,6 +159,6 @@ } } ); - M.define( 'mobile.mainMenu/MainMenu', MainMenu ); + M.define( 'skins.minerva.mainMenu/MainMenu', MainMenu ); }( mw.mobileFrontend, jQuery ) ); diff --git a/resources/mobile.mainMenu/menu.mustache b/resources/skins.minerva.mainMenu/menu.mustache similarity index 100% rename from resources/mobile.mainMenu/menu.mustache rename to resources/skins.minerva.mainMenu/menu.mustache diff --git a/resources/mobile.mainMenu/menuGroup.mustache b/resources/skins.minerva.mainMenu/menuGroup.mustache similarity index 100% rename from resources/mobile.mainMenu/menuGroup.mustache rename to resources/skins.minerva.mainMenu/menuGroup.mustache diff --git a/resources/skins.minerva.scripts.top/init.js b/resources/skins.minerva.scripts.top/init.js index a0aae50..170c14e 100644 --- a/resources/skins.minerva.scripts.top/init.js +++ b/resources/skins.minerva.scripts.top/init.js @@ -1,5 +1,5 @@ ( function ( M, $ ) { - var MainMenu = M.require( 'mobile.mainMenu/MainMenu' ), + var MainMenu = M.require( 'skins.minerva.mainMenu/MainMenu' ), mainMenu = createMainMenu(); /** -- To view, visit https://gerrit.wikimedia.org/r/354710 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I695909d7ce81a7b2ca29d905650f5b09cc14337a Gerrit-PatchSet: 9 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Jdlrobson <jrob...@wikimedia.org> Gerrit-Reviewer: Jdlrobson <jrob...@wikimedia.org> Gerrit-Reviewer: Phuedx <samsm...@wikimedia.org> Gerrit-Reviewer: Pmiazga <pmia...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits