Separate startUp() call from main script of mediawiki module

This allows adding new functionality to the startup module in
separate files, without further growing mediawiki.js.

Bug: T85263
Change-Id: I41177b730a7370b4c9ca13d758d9f8493ff5192e
This commit is contained in:
Gergő Tisza 2015-02-02 23:29:28 +00:00
parent df52924986
commit 2ea420eed8
3 changed files with 16 additions and 8 deletions

View file

@ -765,7 +765,10 @@ return array(
/* MediaWiki */
'mediawiki' => array(
'scripts' => 'resources/src/mediawiki/mediawiki.js',
'scripts' => array(
'resources/src/mediawiki/mediawiki.js',
'resources/src/mediawiki/mediawiki.startUp.js',
),
'debugScripts' => 'resources/src/mediawiki/mediawiki.log.js',
'raw' => true,
'targets' => array( 'desktop', 'mobile' ),

View file

@ -2532,11 +2532,4 @@
// Attach to window and globally alias
window.mw = window.mediaWiki = mw;
// Auto-register from pre-loaded startup scripts
if ( $.isFunction( window.startUp ) ) {
window.startUp();
window.startUp = undefined;
}
}( jQuery ) );

View file

@ -0,0 +1,12 @@
/**
* Auto-register from pre-loaded startup scripts
* @ignore (this line will make JSDuck happy)
*/
( function ( $ ) {
'use strict';
if ( $.isFunction( window.startUp ) ) {
window.startUp();
window.startUp = undefined;
}
}( jQuery ) );