Index: branches/wmf-deployment/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -123,7 +123,7 @@ |
124 | 124 | * Adds scripts |
125 | 125 | */ |
126 | 126 | public static function addResources( $out ) { |
127 | | - global $wgScriptPath, $wgJsMimeType; |
| 127 | + global $wgExtensionAssetsPath, $wgJsMimeType; |
128 | 128 | |
129 | 129 | if ( !self::$doOutput ) |
130 | 130 | return true; |
— | — | @@ -131,14 +131,14 @@ |
132 | 132 | // Loops over each script |
133 | 133 | foreach ( self::$scripts as $script ) { |
134 | 134 | // Add javascript to document |
| 135 | + $src = "$wgExtensionAssetsPath/UsabilityInitiative/{$script['src']}"; |
| 136 | + $version = isset( $script['version'] ) ? $script['version'] : $wgStyleVersion; |
135 | 137 | $out->addScript( |
136 | 138 | Xml::element( |
137 | 139 | 'script', |
138 | 140 | array( |
139 | 141 | 'type' => $wgJsMimeType, |
140 | | - 'src' => $wgScriptPath . |
141 | | - "/extensions/UsabilityInitiative/" . |
142 | | - "{$script['src']}?{$script['version']}", |
| 142 | + 'src' => "$src?$version" |
143 | 143 | ), |
144 | 144 | '', |
145 | 145 | false |
— | — | @@ -169,8 +169,8 @@ |
170 | 170 | array( |
171 | 171 | 'rel' => 'stylesheet', |
172 | 172 | 'type' => 'text/css', |
173 | | - 'href' => $wgScriptPath . |
174 | | - "/extensions/UsabilityInitiative/" . |
| 173 | + 'href' => $wgExtensionAssetsPath . |
| 174 | + "/UsabilityInitiative/" . |
175 | 175 | "{$style['src']}?{$style['version']}", |
176 | 176 | ) |
177 | 177 | ); |