mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-28 08:00:32 +00:00
Hygiene: Cleanup initialisation files
* Remove deprecated module definitions * Remove unnecessary check for Minerva skin (this is only ever run by Minerva skin) * Move overlayManager to place it is first used * Make Skin::getMainMenu method redundant Change-Id: I17ea52172e7fae0a8f0e06b8418c7ed5bb01ef64
This commit is contained in:
parent
69cb08262a
commit
38474ed73f
|
@ -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();
|
||||
|
|
|
@ -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' ),
|
||||
|
|
|
@ -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 ) );
|
||||
|
|
|
@ -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 ) );
|
||||
|
|
|
@ -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 ) );
|
||||
|
|
Loading…
Reference in a new issue