mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-18 03:31:34 +00:00
01dc9de92e
Unlike other skins, Minerva wants to be in charge of when WikimediaEvents is loaded, so that it can guarantee load order happens at a time that suits it. WikimediaEvents will be loaded after initialisation of the interface. This allows Minerva to enable schemas such as ReadingDepth conditionally. Upon merging this patch, Ibb45f40ea301727c0c6480043760bd9426106845 can be merged which will revoke WikimediaEvent's ownership. Merging in this order will ensure that ReadingDepth is never removed from production. Bug: T204144 Change-Id: If8395033f31485aca0ca3b38fda1be985369b481
19 lines
599 B
JavaScript
19 lines
599 B
JavaScript
// 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' );
|
|
|
|
/**
|
|
* Enable WikimediaEvents including ReadingDepth schema
|
|
*/
|
|
function subscribeToWikimediaEvents() {
|
|
mw.loader.using( 'ext.wikimediaEvents' );
|
|
}
|
|
|
|
$( function () {
|
|
mainMenu.enableLogging();
|
|
} );
|
|
|
|
M.define( 'skins.minerva.scripts/subscribeToWikimediaEvents', subscribeToWikimediaEvents );
|
|
}( mw.mobileFrontend, jQuery ) );
|