r72750 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72749‎ | r72750 | r72751 >
Date:20:42, 10 September 2010
Author:tparscal
Status:ok
Tags:
Comment:
Moved mediaWiki.loader.go() up to be above scripts that are not wrapped, and need access to stuff being loaded by go().
Modified paths:
  • /trunk/phase3/includes/OutputPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/OutputPage.php
@@ -2312,8 +2312,10 @@
23132313
23142314 // Statup - this will immediately load jquery and mediawiki modules
23152315 $scripts = self::makeResourceLoaderLink( $sk, 'startup', 'scripts' );
 2316+
23162317 // Configuration
23172318 $scripts .= Skin::makeGlobalVariablesScript( $sk->getSkinName() ) . "\n";
 2319+
23182320 // Support individual script requests in debug mode
23192321 if ( $wgRequest->getBool( 'debug' ) && $wgRequest->getVal( 'debug' ) !== 'false' ) {
23202322 // Scripts
@@ -2341,6 +2343,10 @@
23422344 "if ( mediaWiki !== undefined ) { mediaWiki.loader.load( {$modules} ); }"
23432345 );
23442346 }
 2347+
 2348+ // Add code to fetch all requested modules
 2349+ $scripts .= Html::inlineScript( "if ( mediaWiki !== undefined ) { mediaWiki.loader.go(); }" );
 2350+
23452351 // TODO: User Scripts should be included using the resource loader
23462352 // Add user JS if enabled
23472353 if( $this->isUserJsAllowed() && $wgUser->isLoggedIn() ) {
@@ -2360,8 +2366,7 @@
23612367 }
23622368 }
23632369 $scripts .= "\n" . $this->mScripts;
2364 - // This should be at the bottom of the body - below ALL other scripts
2365 - $scripts .= Html::inlineScript( "if ( mediaWiki !== undefined ) { mediaWiki.loader.go(); }" );
 2370+
23662371 // Add site JS if enabled
23672372 if ( $wgUseSiteJs ) {
23682373 $scripts .= self::makeResourceLoaderLink( $sk, 'sitejs', 'scripts' );

Status & tagging log