-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinit.js
More file actions
25 lines (21 loc) · 709 Bytes
/
init.js
File metadata and controls
25 lines (21 loc) · 709 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const { ClientPrefsHandler } = require( './core/ClientPrefsHandler.js' );
const { getCompanionConfigs } = require( './companionConfigs.js' );
/**
* Initialize wp25EasterEggs extension
*
* @return {void}
*/
const init = () => {
const assetsPath = `${ mw.config.get( 'wgExtensionAssetsPath' ) }/WP25EasterEggs/resources/media`;
const companionConfigs = getCompanionConfigs( assetsPath );
const companionConfigCreator = ClientPrefsHandler.getCurrentCompanionConfigCreator(
companionConfigs );
if ( !companionConfigCreator ) {
return;
}
const clientPrefsHandler = new ClientPrefsHandler( companionConfigCreator );
clientPrefsHandler.setup();
};
$( () => {
mw.requestIdleCallback( init );
} );