r83651 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83650‎ | r83651 | r83652 >
Date:16:05, 10 March 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
added option to make maps resizable
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/jquery.googlemap2.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/jquery.googlemap.js (modified) (history)
  • /branches/Maps0.8/includes/services/OpenLayers/Maps_OpenLayers.php (modified) (history)
  • /branches/Maps0.8/includes/services/OpenLayers/OpenLayers.php (modified) (history)
  • /branches/Maps0.8/includes/services/OpenLayers/jquery.openlayers.js (modified) (history)
  • /branches/Maps0.8/includes/services/YahooMaps/Maps_YahooMaps.php (modified) (history)
  • /branches/Maps0.8/includes/services/YahooMaps/YahooMaps.php (modified) (history)
  • /branches/Maps0.8/includes/services/YahooMaps/jquery.yahoomaps.js (modified) (history)

Diff [purge]

Index: branches/Maps0.8/Maps_Settings.php
@@ -151,6 +151,8 @@
152152 # when the user does not provide one.
153153 $egMapsDefaultTitle = '';
154154 $egMapsDefaultLabel = '';
 155+
 156+ $egMapsResizableByDefault = false;
155157
156158
157159
Index: branches/Maps0.8/includes/services/GoogleMaps3/jquery.googlemap.js
@@ -126,6 +126,10 @@
127127 }
128128 }
129129
 130+ if ( options.resizable ) {
 131+ this.resizable()
 132+ }
 133+
130134 return this;
131135
132136 }; })( jQuery );
\ No newline at end of file
Index: branches/Maps0.8/includes/services/GoogleMaps3/GoogleMaps3.php
@@ -21,7 +21,7 @@
2222 }
2323
2424 $wgResourceModules['ext.maps.googlemaps3'] = array(
25 - 'dependencies' => array( 'ext.maps.common' ),
 25+ 'dependencies' => array( 'ext.maps.common', 'jquery.ui.resizable' ),
2626 'localBasePath' => dirname( __FILE__ ),
2727 'remoteBasePath' => $egMapsScriptPath . '/includes/services/GoogleMaps3',
2828 'group' => 'ext.maps',
Index: branches/Maps0.8/includes/services/GoogleMaps3/Maps_GoogleMaps3.php
@@ -82,6 +82,7 @@
8383 public function addParameterInfo( array &$params ) {
8484 global $egMapsGMaps3Type, $egMapsGMaps3Types, $egMapsGMaps3Controls, $egMapsGMaps3Layers;
8585 global $egMapsGMaps3DefTypeStyle, $egMapsGMaps3DefZoomStyle, $egMapsGMaps3AutoInfoWindows;
 86+ global $egMapsResizableByDefault;
8687
8788 $params['zoom']->addCriteria( new CriterionInRange( 0, 20 ) );
8889 $params['zoom']->setDefault( self::getDefaultZoom() );
@@ -123,7 +124,10 @@
124125 //$params['kml']->addManipulations( new MapsParamFile() );
125126
126127 $params['fusiontables'] = new ListParameter( 'fusiontables' );
127 - $params['fusiontables']->setDefault( array() );
 128+ $params['fusiontables']->setDefault( array() );
 129+
 130+ $params['resizable'] = new Parameter( 'resizable', Parameter::TYPE_BOOLEAN );
 131+ $params['resizable']->setDefault( $egMapsResizableByDefault, false );
128132 }
129133
130134 /**
Index: branches/Maps0.8/includes/services/YahooMaps/Maps_YahooMaps.php
@@ -43,7 +43,8 @@
4444 * @since 0.7
4545 */
4646 public function addParameterInfo( array &$params ) {
47 - global $egMapsYahooAutozoom, $egMapsYahooMapsType, $egMapsYahooMapsTypes, $egMapsYahooMapsZoom, $egMapsYMapControls;
 47+ global $egMapsYahooAutozoom, $egMapsYahooMapsType, $egMapsYahooMapsTypes;
 48+ global $egMapsYahooMapsZoom, $egMapsYMapControls, $egMapsResizableByDefault;
4849
4950 $params['zoom']->addCriteria( new CriterionInRange( 1, 13 ) );
5051 $params['zoom']->setDefault( self::getDefaultZoom() );
@@ -82,6 +83,9 @@
8384 Parameter::TYPE_BOOLEAN,
8485 $egMapsYahooAutozoom
8586 );
 87+
 88+ $params['resizable'] = new Parameter( 'resizable', Parameter::TYPE_BOOLEAN );
 89+ $params['resizable']->setDefault( $egMapsResizableByDefault, false );
8690 }
8791
8892 /**
Index: branches/Maps0.8/includes/services/YahooMaps/YahooMaps.php
@@ -21,6 +21,7 @@
2222 }
2323
2424 $wgResourceModules['ext.maps.yahoomaps'] = array(
 25+ 'dependencies' => array( 'ext.maps.common', 'jquery.ui.resizable' ),
2526 'localBasePath' => dirname( __FILE__ ),
2627 'remoteBasePath' => $egMapsScriptPath . '/includes/services/YahooMaps',
2728 'group' => 'ext.maps',
Index: branches/Maps0.8/includes/services/YahooMaps/jquery.yahoomaps.js
@@ -76,6 +76,10 @@
7777
7878 if ( options.centre !== false ) map.drawZoomAndCenter( new YGeoPoint( options.centre.lat, options.centre.lon ) );
7979
 80+ if ( options.resizable ) {
 81+ this.resizable()
 82+ }
 83+
8084 /**
8185 * Returns YMarker object on the provided location.
8286 * It will show a popup baloon with title and label when clicked, if either of these is set.
Index: branches/Maps0.8/includes/services/OpenLayers/Maps_OpenLayers.php
@@ -31,7 +31,7 @@
3232 * @since 0.7
3333 */
3434 public function addParameterInfo( array &$params ) {
35 - global $egMapsOLLayers, $egMapsOLControls;
 35+ global $egMapsOLLayers, $egMapsOLControls, $egMapsResizableByDefault;
3636
3737 $params['zoom']->addCriteria( new CriterionInRange( 0, 19 ) );
3838 $params['zoom']->setDefault( self::getDefaultZoom() );
@@ -48,6 +48,9 @@
4949 $params['layers']->setDoManipulationOfDefault( true );
5050 $params['layers']->addCriteria( new CriterionOLLayer() );
5151 $params['layers']->setDefault( $egMapsOLLayers );
 52+
 53+ $params['resizable'] = new Parameter( 'resizable', Parameter::TYPE_BOOLEAN );
 54+ $params['resizable']->setDefault( $egMapsResizableByDefault, false );
5255 }
5356
5457 /**
Index: branches/Maps0.8/includes/services/OpenLayers/OpenLayers.php
@@ -21,6 +21,7 @@
2222 }
2323
2424 $wgResourceModules['ext.maps.openlayers'] = array(
 25+ 'dependencies' => array( 'ext.maps.common', 'jquery.ui.resizable' ),
2526 'localBasePath' => dirname( __FILE__ ),
2627 'remoteBasePath' => $egMapsScriptPath . '/includes/services/OpenLayers',
2728 'group' => 'ext.maps',
Index: branches/Maps0.8/includes/services/OpenLayers/jquery.openlayers.js
@@ -65,11 +65,14 @@
6666 map.setCenter( centre );
6767 }
6868
69 -
7069 if ( options.zoom !== false ) {
7170 map.zoomTo( options.zoom );
72 - }
 71+ }
7372
 73+ if ( options.resizable ) {
 74+ this.resizable()
 75+ }
 76+
7477 function addControls( map, controls, mapElement ) {
7578 // Add the controls.
7679 for ( var i = controls.length - 1; i >= 0; i-- ) {
Index: branches/Maps0.8/includes/services/GoogleMaps/GoogleMaps.php
@@ -21,7 +21,7 @@
2222 }
2323
2424 $wgResourceModules['ext.maps.googlemaps2'] = array(
25 - 'dependencies' => array( 'ext.maps.common' ),
 25+ 'dependencies' => array( 'ext.maps.common', 'jquery.ui.resizable' ),
2626 'localBasePath' => dirname( __FILE__ ),
2727 'remoteBasePath' => $egMapsScriptPath . '/includes/services/GoogleMaps',
2828 'group' => 'ext.maps',
Index: branches/Maps0.8/includes/services/GoogleMaps/Maps_GoogleMaps.php
@@ -43,7 +43,8 @@
4444 * @since 0.7
4545 */
4646 public function addParameterInfo( array &$params ) {
47 - global $egMapsGoogleMapsType, $egMapsGoogleMapsTypes, $egMapsGoogleAutozoom, $egMapsGMapControls, $egMapsGMapOverlays;
 47+ global $egMapsGoogleMapsType, $egMapsGoogleMapsTypes, $egMapsGoogleAutozoom;
 48+ global $egMapsGMapControls, $egMapsGMapOverlays, $egMapsResizableByDefault;
4849
4950 $params['zoom']->addCriteria( new CriterionInRange( 0, 20 ) );
5051 $params['zoom']->setDefault( self::getDefaultZoom() );
@@ -91,6 +92,9 @@
9293 $params['overlays']->setDefault( $egMapsGMapOverlays );
9394 $params['overlays']->addCriteria( new CriterionGoogleOverlay( self::$overlayData ) );
9495 $params['overlays']->addManipulations( new ParamManipulationFunctions( 'strtolower' ) ); // TODO
 96+
 97+ $params['resizable'] = new Parameter( 'resizable', Parameter::TYPE_BOOLEAN );
 98+ $params['resizable']->setDefault( $egMapsResizableByDefault, false );
9599 }
96100
97101 /**
Index: branches/Maps0.8/includes/services/GoogleMaps/jquery.googlemap2.js
@@ -119,6 +119,10 @@
120120 map.addOverlay( new GGeoXml( options.kml[i] ) );
121121 }
122122
 123+ if ( options.resizable ) {
 124+ this.resizable()
 125+ }
 126+
123127 function ensureTypeIsSelectable( type, types ) {
124128 var typesContainType = false;
125129
@@ -182,7 +186,7 @@
183187 }
184188
185189 return marker;
186 - }
 190+ }
187191
188192 return this;
189193

Status & tagging log