r72129 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72128‎ | r72129 | r72130 >
Date:18:03, 1 September 2010
Author:tparscal
Status:resolved
Tags:
Comment:
Changed the order in which different kinds of resources are added.
Modified paths:
  • /branches/resourceloader/phase3/includes/OutputPage.php (modified) (history)

Diff [purge]

Index: branches/resourceloader/phase3/includes/OutputPage.php
@@ -1604,7 +1604,6 @@
16051605 $sk = $wgUser->getSkin();
16061606
16071607 // Add base resources
1608 - $this->addModuleScripts( array( 'startup' ) );
16091608 $this->addModules( array( 'mediawiki.legacy.wikibits' ) );
16101609
16111610 // Add site JS if enabled
@@ -2313,17 +2312,9 @@
23142313 global $wgUser, $wgRequest, $wgJsMimeType;
23152314 global $wgStylePath, $wgStyleVersion;
23162315
2317 - $scripts = '';
 2316+ $scripts = self::makeResourceLoaderLink( $sk, 'startup', 'scripts' );
23182317 // Support individual script requests in debug mode
23192318 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 - }
23282319 // Configuration
23292320 $scripts .= Skin::makeGlobalVariablesScript( $sk->getSkinName() ) . "\n";
23302321 // Messages
@@ -2334,15 +2325,15 @@
23352326 foreach ( $this->getModules() as $name ) {
23362327 $scripts .= self::makeResourceLoaderLink( $sk, $name );
23372328 }
2338 - } else {
23392329 // 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' );
23422332 }
23432333 // 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' );
23462336 }
 2337+ } else {
23472338 // Configuration
23482339 $scripts .= Skin::makeGlobalVariablesScript( $sk->getSkinName() ) . "\n";
23492340 // Messages
@@ -2353,6 +2344,14 @@
23542345 if ( count( $this->getModules() ) ) {
23552346 $scripts .= self::makeResourceLoaderLink( $sk, $this->getModules() );
23562347 }
 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+ }
23572356 }
23582357 // add user JS if enabled
23592358 if( $this->isUserJsAllowed() && $wgUser->isLoggedIn() ) {

Status & tagging log