r60889 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60888‎ | r60889 | r60890 >
Date:10:41, 10 January 2010
Author:midom
Status:ok
Tags:
Comment:
MFT r60886 : Switch to using $wgExtensionAssetsPath for css/js includes
Modified paths:
  • /branches/wmf-deployment/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php (modified) (history)

Diff [purge]

Index: branches/wmf-deployment/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -123,7 +123,7 @@
124124 * Adds scripts
125125 */
126126 public static function addResources( $out ) {
127 - global $wgScriptPath, $wgJsMimeType;
 127+ global $wgExtensionAssetsPath, $wgJsMimeType;
128128
129129 if ( !self::$doOutput )
130130 return true;
@@ -131,14 +131,14 @@
132132 // Loops over each script
133133 foreach ( self::$scripts as $script ) {
134134 // Add javascript to document
 135+ $src = "$wgExtensionAssetsPath/UsabilityInitiative/{$script['src']}";
 136+ $version = isset( $script['version'] ) ? $script['version'] : $wgStyleVersion;
135137 $out->addScript(
136138 Xml::element(
137139 'script',
138140 array(
139141 'type' => $wgJsMimeType,
140 - 'src' => $wgScriptPath .
141 - "/extensions/UsabilityInitiative/" .
142 - "{$script['src']}?{$script['version']}",
 142+ 'src' => "$src?$version"
143143 ),
144144 '',
145145 false
@@ -169,8 +169,8 @@
170170 array(
171171 'rel' => 'stylesheet',
172172 'type' => 'text/css',
173 - 'href' => $wgScriptPath .
174 - "/extensions/UsabilityInitiative/" .
 173+ 'href' => $wgExtensionAssetsPath .
 174+ "/UsabilityInitiative/" .
175175 "{$style['src']}?{$style['version']}",
176176 )
177177 );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r60886Switch to using $wgExtensionAssetsPath for css/js includes, requires MW r60885midom10:20, 10 January 2010

Status & tagging log