r56445 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56444‎ | r56445 | r56446 >
Date:21:32, 16 September 2009
Author:brion
Status:ok
Tags:
Comment:
merge r56444 wikibits.js fix
Modified paths:
  • /branches/wmf-deployment/includes/OutputPage.php (modified) (history)

Diff [purge]

Index: branches/wmf-deployment/includes/OutputPage.php
@@ -171,7 +171,7 @@
172172 * Add the core scripts that are included on every page, for later output into the header
173173 */
174174 function addCoreScripts2Top(){
175 - global $wgEnableScriptLoader, $wgJSAutoloadLocalClasses, $wgScriptPath, $wgEnableJS2system;
 175+ global $wgEnableScriptLoader, $wgJSAutoloadLocalClasses, $wgScriptPath, $wgStylePath, $wgEnableJS2system;
176176 // @todo We should deprecate wikibits in favor of mv_embed and jQuery
177177
178178 if( $wgEnableJS2system ){
@@ -186,7 +186,16 @@
187187 $so = '';
188188 foreach( $core_classes as $s ){
189189 if( isset( $wgJSAutoloadLocalClasses[$s] ) ){
190 - $so .= Html::linkedScript( "{$wgScriptPath}/{$wgJSAutoloadLocalClasses[$s]}?" . $this->getURIDparam() );
 190+ $path = $wgJSAutoloadLocalClasses[$s];
 191+ // @fixme this is an awful hack
 192+ if( substr( $path, 0, 4 ) == "http" || substr( $path, 0, 1 ) == '/' ) {
 193+ // Assume a full or local path
 194+ } elseif( substr( $path, 0, 6 ) == "skins/" ) {
 195+ $path = $wgStylePath . substr( $path, 5 );
 196+ } else {
 197+ $path = $wgScriptPath . "/" . $path;
 198+ }
 199+ $so .= Html::linkedScript( $path . "?" . $this->getURIDparam() );
191200 }
192201 }
193202 $this->mScripts = $so . $this->mScripts;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r56444Fix for wikibits.js loading when $wgStylePath != "$wgScriptPath/skins"brion21:31, 16 September 2009

Status & tagging log