diff options
author | Timo Tijhof <krinklemail@gmail.com> | 2015-07-27 16:40:52 -0700 |
---|---|---|
committer | Ori.livneh <ori@wikimedia.org> | 2015-07-30 18:22:46 +0000 |
commit | 59f1a1efa87f6e1563ad899f3aefeda59625d6d6 (patch) | |
tree | d9f73e96cc1c427688ba6bc79a23bdc449c87aca /resources/src/startup.js | |
parent | b80bcaaba3f8422637d3de4204ae75eaf5ea1bbe (diff) | |
download | mediawikicore-59f1a1efa87f6e1563ad899f3aefeda59625d6d6.tar.gz mediawikicore-59f1a1efa87f6e1563ad899f3aefeda59625d6d6.zip |
resourceloader: Convert inline statements to queued functions
Instead of having inline statements be plain statements wrapped
in an if-conditional block, convert them to inline functions
pushed into a queue.
The queue is kept in-memory until the startup module is loaded
at which point it transforms into a function that is immediately
invoked.
This is a prerequisite to making the top queue asynchronous.
Until then these functions will just run immediately as they
occur in the HTML after the startup module.
This is based on the previously reverted commit e86e5f8460.
Bug: T107399
Change-Id: Ifb38efca219c10ab973ad4c4ebb21c6a4239b005
Diffstat (limited to 'resources/src/startup.js')
-rw-r--r-- | resources/src/startup.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/resources/src/startup.js b/resources/src/startup.js index ac428541ca7d..133245940983 100644 --- a/resources/src/startup.js +++ b/resources/src/startup.js @@ -26,7 +26,7 @@ performance.mark( 'mediaWikiStartUp' ); */ /*jshint unused: false, evil: true */ -/*globals mw, $VARS, $CODE */ +/*globals mw, RLQ: true, $VARS, $CODE */ function isCompatible( ua ) { if ( ua === undefined ) { ua = navigator.userAgent; @@ -76,6 +76,16 @@ function startUp() { $CODE.registrations(); + window.RLQ = window.RLQ || []; + while ( RLQ.length ) { + RLQ.shift()(); + } + RLQ = { + push: function ( fn ) { + fn(); + } + }; + mw.config.set( $VARS.configuration ); } |