Index: trunk/extensions/Maps/Services/GoogleMaps3/Maps_GoogleMaps3.php |
— | — | @@ -161,7 +161,7 @@ |
162 | 162 | } |
163 | 163 | else if ( $parserOrOut instanceof OutputPage ) { |
164 | 164 | $out = $parserOrOut; |
165 | | - $out->addScriptFile( "http://maps.google.com/maps/api/js?sensor=false&language=$languageCode" ); |
| 165 | + MapsMapper::addScriptFile( $out, "http://maps.google.com/maps/api/js?sensor=false&language=$languageCode" ); |
166 | 166 | $out->addScriptFile( "$egMapsScriptPath/Services/GoogleMaps3/GoogleMap3Functions{$egMapsJsExt}?$egMapsStyleVersion" ); |
167 | 167 | } |
168 | 168 | } |
Index: trunk/extensions/Maps/Services/YahooMaps/Maps_YahooMaps.php |
— | — | @@ -185,7 +185,7 @@ |
186 | 186 | } |
187 | 187 | else if ( $parserOrOut instanceof OutputPage ) { |
188 | 188 | $out = $parserOrOut; |
189 | | - $out->addScriptFile( "http://api.maps.yahoo.com/ajaxymap?v=3.8&appid=$egYahooMapsKey" ); |
| 189 | + MapsMapper::addScriptFile( $out, "http://api.maps.yahoo.com/ajaxymap?v=3.8&appid=$egYahooMapsKey" ); |
190 | 190 | $out->addScriptFile( "$egMapsScriptPath/Services/YahooMaps/YahooMapFunctions{$egMapsJsExt}?$egMapsStyleVersion" ); |
191 | 191 | } |
192 | 192 | } |
Index: trunk/extensions/Maps/Services/GoogleMaps/Maps_GoogleMaps.php |
— | — | @@ -234,9 +234,9 @@ |
235 | 235 | } |
236 | 236 | else if ( $parserOrOut instanceof OutputPage ) { |
237 | 237 | $out = $parserOrOut; |
238 | | - $out->addScriptFile( "http://maps.google.com/maps?file=api&v=2&key=$egGoogleMapsKey&hl=$langCode" ); |
| 238 | + MapsMapper::addScriptFile( $out, "http://maps.google.com/maps?file=api&v=2&key=$egGoogleMapsKey&hl=$langCode" ); |
239 | 239 | $out->addScriptFile( "$egMapsScriptPath/Services/GoogleMaps/GoogleMapFunctions{$egMapsJsExt}?$egMapsStyleVersion" ); |
240 | | - } |
| 240 | + } |
241 | 241 | } |
242 | 242 | } |
243 | 243 | |
Index: trunk/extensions/Maps/Maps.php |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | echo '<b>Warning:</b> You need to have <a href="http://www.mediawiki.org/wiki/Extension:Validator">Validator</a> installed in order to use <a href="http://www.mediawiki.org/wiki/Extension:Maps">Maps</a>.'; |
35 | 35 | } |
36 | 36 | else { |
37 | | - define( 'Maps_VERSION', '0.6 a20' ); |
| 37 | + define( 'Maps_VERSION', '0.6 rc1' ); |
38 | 38 | |
39 | 39 | // The different coordinate notations. |
40 | 40 | define( 'Maps_COORDS_FLOAT', 'float' ); |
Index: trunk/extensions/Maps/Maps_Mapper.php |
— | — | @@ -220,6 +220,25 @@ |
221 | 221 | } |
222 | 222 | |
223 | 223 | /** |
| 224 | + * Add a JavaScript file out of skins/common, or a given relative path. |
| 225 | + * |
| 226 | + * This is a copy of the native function in OutputPage to work around a pre 1.16 bug. |
| 227 | + * Should be used for adding external files, like the Google Maps API. |
| 228 | + * |
| 229 | + * @param OutputPage $out |
| 230 | + * @param string $file |
| 231 | + */ |
| 232 | + public static function addScriptFile( OutputPage $out, $file ) { |
| 233 | + global $wgStylePath, $wgStyleVersion; |
| 234 | + if( substr( $file, 0, 1 ) == '/' || preg_match( '#^[a-z]*://#i', $file ) ) { |
| 235 | + $path = $file; |
| 236 | + } else { |
| 237 | + $path = "{$wgStylePath}/common/{$file}"; |
| 238 | + } |
| 239 | + $out->addScript( Html::linkedScript( wfAppendQuery( $path, $wgStyleVersion ) ) ); |
| 240 | + } |
| 241 | + |
| 242 | + /** |
224 | 243 | * This function returns the definitions for the parameters used by every map feature. |
225 | 244 | * |
226 | 245 | * @return array |