Index: branches/resourceloader/phase3/includes/OutputPage.php |
— | — | @@ -1604,7 +1604,6 @@ |
1605 | 1605 | $sk = $wgUser->getSkin(); |
1606 | 1606 | |
1607 | 1607 | // Add base resources |
1608 | | - $this->addModuleScripts( array( 'startup' ) ); |
1609 | 1608 | $this->addModules( array( 'mediawiki.legacy.wikibits' ) ); |
1610 | 1609 | |
1611 | 1610 | // Add site JS if enabled |
— | — | @@ -2313,17 +2312,9 @@ |
2314 | 2313 | global $wgUser, $wgRequest, $wgJsMimeType; |
2315 | 2314 | global $wgStylePath, $wgStyleVersion; |
2316 | 2315 | |
2317 | | - $scripts = ''; |
| 2316 | + $scripts = self::makeResourceLoaderLink( $sk, 'startup', 'scripts' ); |
2318 | 2317 | // Support individual script requests in debug mode |
2319 | 2318 | if ( $wgRequest->getBool( 'debug' ) && $wgRequest->getVal( 'debug' ) !== 'false' ) { |
2320 | | - // Styles |
2321 | | - foreach ( $this->getModuleStyles() as $name ) { |
2322 | | - $scripts .= self::makeResourceLoaderLink( $sk, $name, 'styles' ); |
2323 | | - } |
2324 | | - // Scripts |
2325 | | - foreach ( $this->getModuleScripts() as $name ) { |
2326 | | - $scripts .= self::makeResourceLoaderLink( $sk, $name, 'scripts' ); |
2327 | | - } |
2328 | 2319 | // Configuration |
2329 | 2320 | $scripts .= Skin::makeGlobalVariablesScript( $sk->getSkinName() ) . "\n"; |
2330 | 2321 | // Messages |
— | — | @@ -2334,15 +2325,15 @@ |
2335 | 2326 | foreach ( $this->getModules() as $name ) { |
2336 | 2327 | $scripts .= self::makeResourceLoaderLink( $sk, $name ); |
2337 | 2328 | } |
2338 | | - } else { |
2339 | 2329 | // Styles |
2340 | | - if ( count( $this->getModuleStyles() ) ) { |
2341 | | - $scripts .= self::makeResourceLoaderLink( $sk, $this->getModuleStyles(), 'styles' ); |
| 2330 | + foreach ( $this->getModuleStyles() as $name ) { |
| 2331 | + $scripts .= self::makeResourceLoaderLink( $sk, $name, 'styles' ); |
2342 | 2332 | } |
2343 | 2333 | // Scripts |
2344 | | - if ( count( $this->getModuleScripts() ) ) { |
2345 | | - $scripts .= self::makeResourceLoaderLink( $sk, $this->getModuleScripts(), 'scripts' ); |
| 2334 | + foreach ( $this->getModuleScripts() as $name ) { |
| 2335 | + $scripts .= self::makeResourceLoaderLink( $sk, $name, 'scripts' ); |
2346 | 2336 | } |
| 2337 | + } else { |
2347 | 2338 | // Configuration |
2348 | 2339 | $scripts .= Skin::makeGlobalVariablesScript( $sk->getSkinName() ) . "\n"; |
2349 | 2340 | // Messages |
— | — | @@ -2353,6 +2344,14 @@ |
2354 | 2345 | if ( count( $this->getModules() ) ) { |
2355 | 2346 | $scripts .= self::makeResourceLoaderLink( $sk, $this->getModules() ); |
2356 | 2347 | } |
| 2348 | + // Styles |
| 2349 | + if ( count( $this->getModuleStyles() ) ) { |
| 2350 | + $scripts .= self::makeResourceLoaderLink( $sk, $this->getModuleStyles(), 'styles' ); |
| 2351 | + } |
| 2352 | + // Scripts |
| 2353 | + if ( count( $this->getModuleScripts() ) ) { |
| 2354 | + $scripts .= self::makeResourceLoaderLink( $sk, $this->getModuleScripts(), 'scripts' ); |
| 2355 | + } |
2357 | 2356 | } |
2358 | 2357 | // add user JS if enabled |
2359 | 2358 | if( $this->isUserJsAllowed() && $wgUser->isLoggedIn() ) { |