From: Trevor Parscal Date: Fri, 10 Sep 2010 20:42:44 +0000 (+0000) Subject: Moved mediaWiki.loader.go() up to be above scripts that are not wrapped, and need... X-Git-Tag: 1.31.0-rc.0~35039 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=a51a6cca91ff80be2909122a22998bae0011e12b;p=lhc%2Fweb%2Fwiklou.git Moved mediaWiki.loader.go() up to be above scripts that are not wrapped, and need access to stuff being loaded by go(). --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 67810d0f60..e502f1ba0c 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -2312,8 +2312,10 @@ class OutputPage { // Statup - this will immediately load jquery and mediawiki modules $scripts = self::makeResourceLoaderLink( $sk, 'startup', 'scripts' ); + // Configuration $scripts .= Skin::makeGlobalVariablesScript( $sk->getSkinName() ) . "\n"; + // Support individual script requests in debug mode if ( $wgRequest->getBool( 'debug' ) && $wgRequest->getVal( 'debug' ) !== 'false' ) { // Scripts @@ -2341,6 +2343,10 @@ class OutputPage { "if ( mediaWiki !== undefined ) { mediaWiki.loader.load( {$modules} ); }" ); } + + // Add code to fetch all requested modules + $scripts .= Html::inlineScript( "if ( mediaWiki !== undefined ) { mediaWiki.loader.go(); }" ); + // TODO: User Scripts should be included using the resource loader // Add user JS if enabled if( $this->isUserJsAllowed() && $wgUser->isLoggedIn() ) { @@ -2360,8 +2366,7 @@ class OutputPage { } } $scripts .= "\n" . $this->mScripts; - // This should be at the bottom of the body - below ALL other scripts - $scripts .= Html::inlineScript( "if ( mediaWiki !== undefined ) { mediaWiki.loader.go(); }" ); + // Add site JS if enabled if ( $wgUseSiteJs ) { $scripts .= self::makeResourceLoaderLink( $sk, 'sitejs', 'scripts' );