r72141 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72140‎ | r72141 | r72142 >
Date:18:25, 1 September 2010
Author:tparscal
Status:ok
Tags:
Comment:
Added todo and formatting
Modified paths:
  • /branches/resourceloader/phase3/includes/OutputPage.php (modified) (history)

Diff [purge]

Index: branches/resourceloader/phase3/includes/OutputPage.php
@@ -2348,7 +2348,8 @@
23492349 'mediaWiki.loader.load( ' . FormatJson::encode( $this->getModules() ) . ' )'
23502350 );
23512351 }
2352 - // add user JS if enabled
 2352+ // TODO: User Scripts should be included using the resource loader
 2353+ // Add user JS if enabled
23532354 if( $this->isUserJsAllowed() && $wgUser->isLoggedIn() ) {
23542355 $action = $wgRequest->getVal( 'action', 'view' );
23552356 if( $this->mTitle && $this->mTitle->isJsSubpage() && $sk->userCanPreview( $action ) ) {
@@ -2356,12 +2357,8 @@
23572358 $this->addInlineScript( $wgRequest->getText( 'wpTextbox1' ) );
23582359 } else {
23592360 $userpage = $wgUser->getUserPage();
2360 - $names = array( 'common', $sk->getSkinName() );
2361 - foreach( $names as $name ) {
2362 - $scriptpage = Title::makeTitleSafe(
2363 - NS_USER,
2364 - $userpage->getDBkey() . '/' . $name . '.js'
2365 - );
 2361+ foreach( array( 'common', $sk->getSkinName() ) as $name ) {
 2362+ $scriptpage = Title::makeTitleSafe( NS_USER, $userpage->getDBkey() . '/' . $name . '.js' );
23662363 if ( $scriptpage && $scriptpage->exists() && ( $scriptpage->getLength() > 0 ) ) {
23672364 $userjs = $scriptpage->getLocalURL( 'action=raw&ctype=' . $wgJsMimeType );
23682365 $this->addScriptFile( $userjs, $scriptpage->getLatestRevID() );

Status & tagging log