http://www.mediawiki.org/wiki/Special:Code/MediaWiki/72750

Revision: 72750
Author:   tparscal
Date:     2010-09-10 20:42:44 +0000 (Fri, 10 Sep 2010)

Log Message:
-----------
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: trunk/phase3/includes/OutputPage.php
===================================================================
--- trunk/phase3/includes/OutputPage.php        2010-09-10 20:41:07 UTC (rev 
72749)
+++ trunk/phase3/includes/OutputPage.php        2010-09-10 20:42:44 UTC (rev 
72750)
@@ -2312,8 +2312,10 @@
                
                // 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 @@
                                "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 @@
                        }
                }
                $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' );



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to