r83258 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83257‎ | r83258 | r83259 >
Date:00:08, 5 March 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
swicthing default service to google maps v3
Modified paths:
  • /branches/Maps0.8/Maps_Settings.php (modified) (history)
  • /branches/Maps0.8/includes/services/GoogleMaps/GoogleMaps.php (modified) (history)
  • /branches/Maps0.8/includes/services/GoogleMaps/Maps_GoogleMaps.php (modified) (history)
  • /branches/Maps0.8/includes/services/GoogleMaps/ext.maps.googlemaps2.js (modified) (history)
  • /branches/Maps0.8/includes/services/GoogleMaps3/GoogleMaps3.php (modified) (history)
  • /branches/Maps0.8/includes/services/GoogleMaps3/Maps_GoogleMaps3.php (modified) (history)
  • /branches/Maps0.8/includes/services/GoogleMaps3/Maps_GoogleMaps3DispMap.php (modified) (history)
  • /branches/Maps0.8/includes/services/GoogleMaps3/Maps_GoogleMaps3DispPoint.php (modified) (history)
  • /branches/Maps0.8/includes/services/GoogleMaps3/ext.maps.googlemaps3.js (added) (history)
  • /branches/Maps0.8/includes/services/GoogleMaps3/jquery.googlemap.js (added) (history)
  • /branches/Maps0.8/includes/services/OSM/Maps_OSMDispMap.php (modified) (history)
  • /branches/Maps0.8/includes/services/OpenLayers/Maps_OpenLayersDispMap.php (modified) (history)
  • /branches/Maps0.8/includes/services/OpenLayers/Maps_OpenLayersDispPoint.php (modified) (history)
  • /branches/Maps0.8/includes/services/YahooMaps/Maps_YahooMapsDispMap.php (modified) (history)
  • /branches/Maps0.8/includes/services/YahooMaps/Maps_YahooMapsDispPoint.php (modified) (history)

Diff [purge]

Index: branches/Maps0.8/Maps_Settings.php
@@ -21,8 +21,6 @@
2222
2323
2424
25 -$egMapsUseRL = false; //method_exists( 'OutputPage', 'addModules' );
26 -
2725 # Features configuration
2826 # Commenting out the inclusion of any feature will make Maps completely ignore it, and so improve performance.
2927
@@ -112,7 +110,7 @@
113111 # service is present in the $egMapsDefaultServices array for a certain feature.
114112 # A service that supports all features is recommended. This service needs to be
115113 # enabled, if not, the first one from the available services will be taken.
116 - $egMapsDefaultService = 'googlemaps2';
 114+ $egMapsDefaultService = 'googlemaps3';
117115
118116 # Array of String. The default mapping service for each feature, which will be
119117 # used when no valid service is provided by the user. Each service needs to be
Index: branches/Maps0.8/includes/services/GoogleMaps3/Maps_GoogleMaps3DispPoint.php
@@ -13,11 +13,11 @@
1414 /**
1515 * @see MapsBasePointMap::getMapHTML()
1616 */
17 - public function getMapHTML( array $params, Parser $parser ) {
 17+ public function getMapHTML( array $params, Parser $parser, $mapName ) {
1818 return Html::element(
1919 'div',
2020 array(
21 - 'id' => $this->service->getMapId(),
 21+ 'id' => $mapName,
2222 'style' => "width: {$params['width']}; height: {$params['height']}; background-color: #cccccc; overflow: hidden;",
2323 ),
2424 wfMsg( 'maps-loading-map' )
Index: branches/Maps0.8/includes/services/GoogleMaps3/jquery.googlemap.js
@@ -0,0 +1,11 @@
 2+(function( $ ){ $.fn.googlemaps = function() {
 3+
 4+ this.fadeOut( 'normal', function( options ) {
 5+
 6+
 7+
 8+ });
 9+
 10+ return this;
 11+
 12+}; })( jQuery );
\ No newline at end of file
Property changes on: branches/Maps0.8/includes/services/GoogleMaps3/jquery.googlemap.js
___________________________________________________________________
Added: svn:eol-style
113 + native
Index: branches/Maps0.8/includes/services/GoogleMaps3/Maps_GoogleMaps3DispMap.php
@@ -12,11 +12,11 @@
1313 /**
1414 * @see MapsBaseMap::getMapHTML()
1515 */
16 - public function getMapHTML( array $params, Parser $parser ) {
 16+ public function getMapHTML( array $params, Parser $parser, $mapName ) {
1717 return Html::element(
1818 'div',
1919 array(
20 - 'id' => $this->service->getMapId(),
 20+ 'id' => $mapName,
2121 'style' => "width: {$params['width']}; height: {$params['height']}; background-color: #cccccc; overflow: hidden;",
2222 ),
2323 wfMsg( 'maps-loading-map' )
Index: branches/Maps0.8/includes/services/GoogleMaps3/GoogleMaps3.php
@@ -20,6 +20,23 @@
2121 die( 'Not an entry point.' );
2222 }
2323
 24+$wgResourceModules['ext.maps.googlemaps3'] = array(
 25+ 'dependencies' => array( 'ext.maps.common' ),
 26+ 'localBasePath' => dirname( __FILE__ ),
 27+ 'remoteBasePath' => $egMapsScriptPath . '/includes/services/GoogleMaps3',
 28+ 'group' => 'ext.maps',
 29+ 'scripts' => array(
 30+ 'jquery.googlemaps.js',
 31+ 'ext.maps.googlemaps3.js',
 32+ ),/*
 33+ 'styles' => array(
 34+ 'ext.maps.googlemaps2.css',
 35+ ),*/
 36+ 'messages' => array(
 37+ 'maps-googlemaps3-incompatbrowser'
 38+ )
 39+);
 40+
2441 $wgHooks['MappingServiceLoad'][] = 'efMapsInitGoogleMaps3';
2542
2643 /**
Index: branches/Maps0.8/includes/services/GoogleMaps3/Maps_GoogleMaps3.php
@@ -21,7 +21,7 @@
2222 function __construct( $serviceName ) {
2323 parent::__construct(
2424 $serviceName,
25 - array( 'google3', 'googlemap3', 'gmap3', 'gmaps3' )
 25+ array( 'googlemaps', 'google' )
2626 );
2727 }
2828
@@ -129,8 +129,8 @@
130130 $languageCode = self::getMappedLanguageCode( $wgLang->getCode() );
131131
132132 return array(
133 - Html::linkedScript( "http://maps.google.com/maps/api/js?sensor=false&language=$languageCode" ),
134 - Html::linkedScript( "$egMapsScriptPath/includes/services/GoogleMaps3/GoogleMap3Functions.js?$egMapsStyleVersion" ),
 133+ //Html::linkedScript( "http://maps.google.com/maps/api/js?sensor=false&language=$languageCode" ),
 134+ //Html::linkedScript( "$egMapsScriptPath/includes/services/GoogleMaps3/GoogleMap3Functions.js?$egMapsStyleVersion" ),
135135 );
136136 }
137137
Index: branches/Maps0.8/includes/services/GoogleMaps3/ext.maps.googlemaps3.js
@@ -0,0 +1,25 @@
 2+/**
 3+ * JavasSript for Google Maps v3 maps in the Maps extension.
 4+ * @see http://www.mediawiki.org/wiki/Extension:Maps
 5+ *
 6+ * @author Jeroen De Dauw <jeroendedauw at gmail dot com>
 7+ */
 8+
 9+jQuery.getScript(
 10+ 'http://maps.google.com/maps/api/js?sensor=false',
 11+ function () {
 12+ if ( true ) {
 13+ for ( i in window.maps.googlemaps3 ) {
 14+ jQuery( '#' + i ).googlemaps( window.maps.googlemaps3[i] );
 15+ }
 16+ }
 17+ else {
 18+ alert( mediaWiki.msg( 'maps-googlemaps3-incompatbrowser' ) );
 19+
 20+ for ( i in window.maps.googlemaps3 ) {
 21+ jQuery( '#' + i ).text( mediaWiki.msg( 'maps-load-failed' ) );
 22+ }
 23+ }
 24+ }
 25+);
 26+
Property changes on: branches/Maps0.8/includes/services/GoogleMaps3/ext.maps.googlemaps3.js
___________________________________________________________________
Added: svn:eol-style
127 + native
Index: branches/Maps0.8/includes/services/YahooMaps/Maps_YahooMapsDispPoint.php
@@ -13,11 +13,11 @@
1414 /**
1515 * @see MapsBasePointMap::getMapHTML()
1616 */
17 - public function getMapHTML( array $params, Parser $parser ) {
 17+ public function getMapHTML( array $params, Parser $parser, $mapName ) {
1818 return Html::element(
1919 'div',
2020 array(
21 - 'id' => $this->service->getMapId(),
 21+ 'id' => $mapName,
2222 'style' => "width: {$params['width']}; height: {$params['height']}; background-color: #cccccc; overflow: hidden;",
2323 ),
2424 wfMsg( 'maps-loading-map' )
Index: branches/Maps0.8/includes/services/YahooMaps/Maps_YahooMapsDispMap.php
@@ -13,11 +13,11 @@
1414 /**
1515 * @see MapsBaseMap::getMapHTML()
1616 */
17 - public function getMapHTML( array $params, Parser $parser ) {
 17+ public function getMapHTML( array $params, Parser $parser, $mapName ) {
1818 return Html::element(
1919 'div',
2020 array(
21 - 'id' => $this->service->getMapId(),
 21+ 'id' => $mapName,
2222 'style' => "width: {$params['width']}; height: {$params['height']}; background-color: #cccccc; overflow: hidden;",
2323 ),
2424 wfMsg( 'maps-loading-map' )
Index: branches/Maps0.8/includes/services/OpenLayers/Maps_OpenLayersDispPoint.php
@@ -13,11 +13,11 @@
1414 /**
1515 * @see MapsBasePointMap::getMapHTML()
1616 */
17 - public function addSpecificMapHTML( array $params, Parser $parser ) {
 17+ public function addSpecificMapHTML( array $params, Parser $parser, $mapName ) {
1818 return Html::element(
1919 'div',
2020 array(
21 - 'id' => $this->service->getMapId(),
 21+ 'id' => $mapName,
2222 'style' => "width: {$params['width']}; height: {$params['height']}; background-color: #cccccc; overflow: hidden;",
2323 ),
2424 wfMsg( 'maps-loading-map' )
Index: branches/Maps0.8/includes/services/OpenLayers/Maps_OpenLayersDispMap.php
@@ -30,11 +30,11 @@
3131 /**
3232 * @see MapsBaseMap::getMapHTML
3333 */
34 - public function getMapHTML( array $params, Parser $parser ) {
 34+ public function getMapHTML( array $params, Parser $parser, $mapName ) {
3535 return Html::element(
3636 'div',
3737 array(
38 - 'id' => $this->service->getMapId(),
 38+ 'id' => $mapName,
3939 'style' => "width: {$params['width']}; height: {$params['height']}; background-color: #cccccc; overflow: hidden;",
4040 ),
4141 wfMsg( 'maps-loading-map' )
Index: branches/Maps0.8/includes/services/GoogleMaps/GoogleMaps.php
@@ -67,4 +67,4 @@
6868 $googleMaps->addFeature( 'display_map', 'MapsGoogleMapsDispMap' );
6969
7070 return true;
71 -}
\ No newline at end of file
 71+}
Index: branches/Maps0.8/includes/services/GoogleMaps/Maps_GoogleMaps.php
@@ -33,7 +33,7 @@
3434 function __construct( $serviceName ) {
3535 parent::__construct(
3636 $serviceName,
37 - array( 'googlemaps', 'google', 'googlemap', 'gmap', 'gmaps' )
 37+ array( 'googlemaps2', 'google2', 'gmap', 'gmaps' )
3838 );
3939 }
4040
Index: branches/Maps0.8/includes/services/GoogleMaps/ext.maps.googlemaps2.js
@@ -47,7 +47,6 @@
4848 alert( mediaWiki.msg( 'maps-googlemaps2-incompatbrowser' ) );
4949
5050 for ( i in window.maps.googlemaps2 ) {
51 - // FIXME: common module with message not getting loaded for some reason
5251 jQuery( '#' + i ).text( mediaWiki.msg( 'maps-load-failed' ) );
5352 }
5453 }
Index: branches/Maps0.8/includes/services/OSM/Maps_OSMDispMap.php
@@ -15,7 +15,7 @@
1616 /**
1717 * @see MapsBaseMap::getMapHTML()
1818 */
19 - public function getMapHTML( array $params, Parser $parser ) {
 19+ public function getMapHTML( array $params, Parser $parser, $mapName ) {
2020 global $wgLang;
2121
2222 $thumbs = $params['thumbs'] ? 'yes' : 'no';
@@ -26,7 +26,7 @@
2727 return Html::element(
2828 'iframe',
2929 array(
30 - 'id' => $this->service->getMapId(),
 30+ 'id' => $mapName,
3131 'style' => "width: {$params['width']}; height: {$params['height']}; clear: both;",
3232 'src' => "http://toolserver.org/~kolossos/openlayers/kml-on-ol.php?zoom={$params['zoom']}&lat={$params['centre']['lat']}&lon={$params['centre']['lon']}&lang=$lang&thumbs=$thumbs&photo=$photos"
3333 ),

Status & tagging log