diff --git a/resources/skins.minerva.newusers/init.js b/resources/skins.minerva.newusers/init.js index adb5c4bca..3ad08e513 100644 --- a/resources/skins.minerva.newusers/init.js +++ b/resources/skins.minerva.newusers/init.js @@ -12,6 +12,7 @@ editable page whilst logged in, although you must be in test group A to see the ( function ( M, $ ) { var PageActionOverlay = require( 'mobile.pointerOverlay' ), skin = M.require( 'skins.minerva.scripts/skin' ), + mainMenu = M.require( 'skins.minerva.scripts.top/mainMenu' ), util = M.require( 'mobile.startup/util' ), escapeHash = util.escapeHash, inEditor = window.location.hash.indexOf( '#editor/' ) > -1, @@ -64,7 +65,7 @@ editable page whilst logged in, although you must be in test group A to see the confirmMsg: mw.msg( 'mobile-frontend-editor-tutorial-confirm' ), cancelMsg: mw.msg( 'mobile-frontend-editor-tutorial-cancel' ) } ); - skin.mainMenu.on( 'open', function () { + mainMenu.on( 'open', function () { editOverlay.hide(); } ); editOverlay.show(); diff --git a/resources/skins.minerva.notifications/init.js b/resources/skins.minerva.notifications/init.js index fe199064e..a503d385a 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/skin' ).getMainMenu(), + var mainMenu = M.require( 'skins.minerva.scripts.top/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/init.js b/resources/skins.minerva.scripts/init.js index d1b23b820..81086e37e 100644 --- a/resources/skins.minerva.scripts/init.js +++ b/resources/skins.minerva.scripts/init.js @@ -7,7 +7,8 @@ loader = M.require( 'mobile.startup/rlModuleLoader' ), router = require( 'mediawiki.router' ), context = M.require( 'mobile.startup/context' ), - overlayManager = M.require( 'skins.minerva.scripts/overlayManager' ), + OverlayManager = M.require( 'mobile.startup/OverlayManager' ), + overlayManager = new OverlayManager( require( 'mediawiki.router' ) ), page = M.getCurrentPage(), thumbs = page.getThumbnails(), experiments = mw.config.get( 'wgMFExperiments' ) || {}, @@ -243,4 +244,6 @@ initRegistrationInfo(); initHistoryLink( $( '.last-modifier-tagline a' ) ); } ); + + M.define( 'skins.minerva.scripts/overlayManager', overlayManager ); }( mw.mobileFrontend, jQuery ) ); diff --git a/resources/skins.minerva.scripts/initLogging.js b/resources/skins.minerva.scripts/initLogging.js index f75f35a6b..e7dfc5bae 100644 --- a/resources/skins.minerva.scripts/initLogging.js +++ b/resources/skins.minerva.scripts/initLogging.js @@ -1,9 +1,9 @@ // 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 skin = M.require( 'skins.minerva.scripts/skin' ); + var mainMenu = M.require( 'skins.minerva.scripts.top/mainMenu' ); $( function () { - skin.getMainMenu().enableLogging(); + mainMenu.enableLogging(); } ); }( mw.mobileFrontend, jQuery ) ); diff --git a/resources/skins.minerva.scripts/preInit.js b/resources/skins.minerva.scripts/preInit.js index 4736030ca..9b3056ed5 100644 --- a/resources/skins.minerva.scripts/preInit.js +++ b/resources/skins.minerva.scripts/preInit.js @@ -7,8 +7,6 @@ */ ( function ( M, $ ) { var currentPage, skin, - OverlayManager = M.require( 'mobile.startup/OverlayManager' ), - overlayManager = new OverlayManager( require( 'mediawiki.router' ) ), PageGateway = M.require( 'mobile.startup/PageGateway' ), gateway = new PageGateway( new mw.Api() ), Page = M.require( 'mobile.startup/Page' ), @@ -20,14 +18,14 @@ ), skinData = { el: 'body', - tabletModules: mw.config.get( 'skin' ) === 'minerva' ? [ 'skins.minerva.tablet.scripts' ] : [], + tabletModules: [ 'skins.minerva.tablet.scripts' ], page: getCurrentPage(), referencesGateway: ReferencesMobileViewGateway.getSingleton(), mainMenu: mainMenu }; skin = new Skin( skinData ); - M.define( 'skins.minerva.scripts/skin', skin ).deprecate( 'mobile.startup/skin' ); + M.define( 'skins.minerva.scripts/skin', skin ); ( function ( wgRedirectedFrom ) { // If the user has been redirected, then show them a toast message (see @@ -145,7 +143,4 @@ console.log( mw.msg( 'mobile-frontend-console-recruit' ) ); } /* eslint-enable no-console */ - - M.define( 'skins.minerva.scripts/overlayManager', overlayManager ) - .deprecate( 'mobile.startup/overlayManager' ); }( mw.mobileFrontend, jQuery ) );