diff --git a/includes/MinervaHooks.php b/includes/MinervaHooks.php index de5408ca8..b4b48374a 100644 --- a/includes/MinervaHooks.php +++ b/includes/MinervaHooks.php @@ -143,9 +143,6 @@ class MinervaHooks { 'skins.minerva.mainMenu.icons', 'skins.minerva.mainMenu.styles', ] ); - $out->addModules( [ - 'skins.minerva.mainMenu' - ] ); break; case 'Userlogin': case 'CreateAccount': diff --git a/includes/skins/MinervaTemplate.php b/includes/skins/MinervaTemplate.php index 15d474986..a3cf84109 100644 --- a/includes/skins/MinervaTemplate.php +++ b/includes/skins/MinervaTemplate.php @@ -216,7 +216,7 @@ class MinervaTemplate extends BaseTemplate { protected function getMainMenuHtml( $data ) { if ( $this->isSpecialMobileMenuPage ) { $templateParser = new TemplateParser( - __DIR__ . '/../../resources/skins.minerva.mainMenu/' ); + __DIR__ . '/../../resources/skins.minerva.scripts/menu/' ); return $templateParser->processTemplate( 'menu', $data['menu_data'] ); } else { diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php index be5d46281..2c4a7aaa0 100644 --- a/includes/skins/SkinMinerva.php +++ b/includes/skins/SkinMinerva.php @@ -1389,7 +1389,6 @@ class SkinMinerva extends SkinTemplate { $modules['minerva'] = array_merge( $this->getContextSpecificModules(), [ - 'skins.minerva.scripts.top', 'skins.minerva.scripts' ] ); diff --git a/resources/skins.minerva.notifications/init.js b/resources/skins.minerva.notifications/init.js index 1af1f31bc..1a89eea57 100644 --- a/resources/skins.minerva.notifications/init.js +++ b/resources/skins.minerva.notifications/init.js @@ -3,7 +3,7 @@ * with the Toast notifications defined by common/toast.js. */ ( function ( M ) { - var mainMenu = M.require( 'skins.minerva.scripts.top/mainMenu' ), + var mainMenu = M.require( 'skins.minerva.scripts/mainMenu' ), router = require( 'mediawiki.router' ), NotificationBadge = M.require( 'skins.minerva.notifications/NotificationBadge' ), overlayManager = M.require( 'skins.minerva.scripts/overlayManager' ), diff --git a/resources/skins.minerva.scripts/initLogging.js b/resources/skins.minerva.scripts/initLogging.js index f30f07661..d5f7d9c48 100644 --- a/resources/skins.minerva.scripts/initLogging.js +++ b/resources/skins.minerva.scripts/initLogging.js @@ -1,7 +1,7 @@ // This initialises EventLogging for main menu and some prominent links in the UI. // This code should only be loaded on the Minerva skin, it does not apply to other skins. ( function ( M ) { - var mainMenu = M.require( 'skins.minerva.scripts.top/mainMenu' ); + var mainMenu = M.require( 'skins.minerva.scripts/mainMenu' ); $( function () { mainMenu.enableLogging(); diff --git a/resources/skins.minerva.scripts.top/init.js b/resources/skins.minerva.scripts/menu.js similarity index 86% rename from resources/skins.minerva.scripts.top/init.js rename to resources/skins.minerva.scripts/menu.js index 610f5381c..af7757365 100644 --- a/resources/skins.minerva.scripts.top/init.js +++ b/resources/skins.minerva.scripts/menu.js @@ -1,5 +1,5 @@ ( function ( M ) { - var MainMenu = M.require( 'skins.minerva.mainMenu/MainMenu' ), + var MainMenu = M.require( 'skins.minerva.scripts/MainMenu' ), mainMenu = createMainMenu(); /** @@ -29,5 +29,5 @@ } } ); - M.define( 'skins.minerva.scripts.top/mainMenu', mainMenu ); + M.define( 'skins.minerva.scripts/mainMenu', mainMenu ); }( mw.mobileFrontend ) ); diff --git a/resources/skins.minerva.mainMenu/MainMenu.js b/resources/skins.minerva.scripts/menu/MainMenu.js similarity index 94% rename from resources/skins.minerva.mainMenu/MainMenu.js rename to resources/skins.minerva.scripts/menu/MainMenu.js index 913387d44..0bc131b01 100644 --- a/resources/skins.minerva.mainMenu/MainMenu.js +++ b/resources/skins.minerva.scripts/menu/MainMenu.js @@ -18,9 +18,9 @@ OO.mfExtend( MainMenu, View, { isTemplateMode: true, - template: mw.template.get( 'skins.minerva.mainMenu', 'menu.hogan' ), + template: mw.template.get( 'skins.minerva.scripts', 'menu.hogan' ), templatePartials: { - menuGroup: mw.template.get( 'skins.minerva.mainMenu', 'menuGroup.hogan' ) + menuGroup: mw.template.get( 'skins.minerva.scripts', 'menuGroup.hogan' ) }, /** @@ -130,6 +130,6 @@ } } ); - M.define( 'skins.minerva.mainMenu/MainMenu', MainMenu ); + M.define( 'skins.minerva.scripts/MainMenu', MainMenu ); }( mw.mobileFrontend ) ); diff --git a/resources/skins.minerva.mainMenu/menu.mustache b/resources/skins.minerva.scripts/menu/menu.mustache similarity index 100% rename from resources/skins.minerva.mainMenu/menu.mustache rename to resources/skins.minerva.scripts/menu/menu.mustache diff --git a/resources/skins.minerva.mainMenu/menuGroup.mustache b/resources/skins.minerva.scripts/menu/menuGroup.mustache similarity index 100% rename from resources/skins.minerva.mainMenu/menuGroup.mustache rename to resources/skins.minerva.scripts/menu/menuGroup.mustache diff --git a/resources/skins.minerva.mainMenu/schema.js b/resources/skins.minerva.scripts/menu/schema.js similarity index 96% rename from resources/skins.minerva.mainMenu/schema.js rename to resources/skins.minerva.scripts/menu/schema.js index 257550d2a..3547e13e9 100644 --- a/resources/skins.minerva.mainMenu/schema.js +++ b/resources/skins.minerva.scripts/menu/schema.js @@ -1,5 +1,5 @@ /** - * This module is loaded by resources/skins.minerva.mainMenu/MainMenu.js + * This module is loaded by resources/skins.minerva.scripts/menu/MainMenu.js * inside the Minerva skin. It should be moved to Minerva at our earliest possible * convenience. */ diff --git a/resources/skins.minerva.scripts/preInit.js b/resources/skins.minerva.scripts/preInit.js index 32a86433d..d4d52e916 100644 --- a/resources/skins.minerva.scripts/preInit.js +++ b/resources/skins.minerva.scripts/preInit.js @@ -7,7 +7,7 @@ */ ( function ( M ) { var skin = M.require( 'mobile.init/skin' ), - mainMenu = M.require( 'skins.minerva.scripts.top/mainMenu' ), + mainMenu = M.require( 'skins.minerva.scripts/mainMenu' ), toast = M.require( 'mobile.startup' ).toast; // Proxy to MobileFrontend defined skin diff --git a/skin.json b/skin.json index 460aa8008..10eccfad5 100644 --- a/skin.json +++ b/skin.json @@ -338,26 +338,6 @@ "resources/skins.minerva.mainMenu.styles/mainmenu.less" ] }, - "skins.minerva.mainMenu": { - "targets": [ - "mobile", - "desktop" - ], - "dependencies": [ - "skins.minerva.icons.images.variants", - "skins.minerva.mainMenu.icons", - "skins.minerva.mainMenu.styles", - "mobile.startup" - ], - "templates": { - "menu.hogan": "resources/skins.minerva.mainMenu/menu.mustache", - "menuGroup.hogan": "resources/skins.minerva.mainMenu/menuGroup.mustache" - }, - "scripts": [ - "resources/skins.minerva.mainMenu/schema.js", - "resources/skins.minerva.mainMenu/MainMenu.js" - ] - }, "skins.minerva.loggedin.styles": { "targets": [ "mobile", @@ -373,15 +353,16 @@ "desktop" ], "dependencies": [ + "skins.minerva.icons.images.variants", + "skins.minerva.mainMenu.icons", + "skins.minerva.mainMenu.styles", "jquery.cookie", "mobile.init", "skins.minerva.icons.images.scripts", - "skins.minerva.scripts.top", "mediawiki.util", "mediawiki.router", "mediawiki.Title", "mobile.startup", - "skins.minerva.mainMenu", "mediawiki.user", "mediawiki.storage", "mediawiki.experiments" @@ -407,9 +388,14 @@ "resources/skins.minerva.scripts/page-issues/overlay/PageIssuesOverlay.less" ], "templates": { - "IssueNotice.hogan": "resources/skins.minerva.scripts/page-issues/overlay/IssueNotice.hogan" + "IssueNotice.hogan": "resources/skins.minerva.scripts/page-issues/overlay/IssueNotice.hogan", + "menu.hogan": "resources/skins.minerva.scripts/menu/menu.mustache", + "menuGroup.hogan": "resources/skins.minerva.scripts/menu/menuGroup.mustache" }, "scripts": [ + "resources/skins.minerva.scripts/menu/schema.js", + "resources/skins.minerva.scripts/menu/MainMenu.js", + "resources/skins.minerva.scripts/menu.js", "resources/skins.minerva.scripts/errorLogging.js", "resources/skins.minerva.scripts/preInit.js", "resources/skins.minerva.scripts/downloadPageAction.js", @@ -433,11 +419,9 @@ "desktop" ], "dependencies": [ - "skins.minerva.mainMenu" + "skins.minerva.scripts" ], - "scripts": [ - "resources/skins.minerva.scripts.top/init.js" - ] + "deprecated": true }, "skins.minerva.notifications.badge": { "messages": [