r94105 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94104‎ | r94105 | r94106 >
Date:13:05, 9 August 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
do not load jQuery resizable by dfault, but fetch it when needed
Modified paths:
  • /trunk/extensions/Maps/Maps.php (modified) (history)
  • /trunk/extensions/Maps/RELEASE-NOTES (modified) (history)
  • /trunk/extensions/Maps/includes/services/GoogleMaps/GoogleMaps.php (modified) (history)
  • /trunk/extensions/Maps/includes/services/GoogleMaps/jquery.googlemap2.js (modified) (history)
  • /trunk/extensions/Maps/includes/services/GoogleMaps3/GoogleMaps3.php (modified) (history)
  • /trunk/extensions/Maps/includes/services/GoogleMaps3/jquery.googlemap.js (modified) (history)
  • /trunk/extensions/Maps/includes/services/OpenLayers/OpenLayers.php (modified) (history)
  • /trunk/extensions/Maps/includes/services/OpenLayers/jquery.openlayers.js (modified) (history)
  • /trunk/extensions/Maps/includes/services/YahooMaps/YahooMaps.php (modified) (history)
  • /trunk/extensions/Maps/includes/services/YahooMaps/jquery.yahoomaps.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/Maps.php
@@ -263,7 +263,11 @@
264264 )
265265 );
266266
 267+$wgResourceModules['ext.maps.resizable'] = array(
 268+ 'dependencies' => 'jquery.ui.resizable'
 269+);
267270
 271+
268272 /**
269273 * Initialization function for the Maps extension.
270274 *
Index: trunk/extensions/Maps/RELEASE-NOTES
@@ -16,6 +16,8 @@
1717
1818 * Fixed zoom parameter for Google Maps v3.
1919
 20+* Minor improvement to script loading.
 21+
2022 === Maps 1.0 ===
2123 (2011-07-19)
2224
Index: trunk/extensions/Maps/includes/services/GoogleMaps3/jquery.googlemap.js
@@ -7,6 +7,8 @@
88
99 (function( $, mw ){ $.fn.googlemaps = function( options ) {
1010
 11+ var _this = this;
 12+
1113 /**
1214 * All markers that are currently on the map.
1315 * @type {Array}
@@ -182,8 +184,10 @@
183185 }
184186
185187 if ( options.resizable ) {
186 - this.resizable()
187 - }
 188+ mw.loader.using( 'ext.maps.resizable', function() {
 189+ _this.resizable();
 190+ } );
 191+ }
188192
189193 return this;
190194
Index: trunk/extensions/Maps/includes/services/GoogleMaps3/GoogleMaps3.php
@@ -21,7 +21,7 @@
2222 }
2323
2424 $wgResourceModules['ext.maps.googlemaps3'] = array(
25 - 'dependencies' => array( 'ext.maps.common', 'jquery.ui.resizable' ),
 25+ 'dependencies' => array( 'ext.maps.common' ),
2626 'localBasePath' => dirname( __FILE__ ),
2727 'remoteBasePath' => $egMapsScriptPath . '/includes/services/GoogleMaps3',
2828 'group' => 'ext.maps',
Index: trunk/extensions/Maps/includes/services/YahooMaps/YahooMaps.php
@@ -21,7 +21,7 @@
2222 }
2323
2424 $wgResourceModules['ext.maps.yahoomaps'] = array(
25 - 'dependencies' => array( 'ext.maps.common', 'jquery.ui.resizable' ),
 25+ 'dependencies' => array( 'ext.maps.common' ),
2626 'localBasePath' => dirname( __FILE__ ),
2727 'remoteBasePath' => $egMapsScriptPath . '/includes/services/YahooMaps',
2828 'group' => 'ext.maps',
Index: trunk/extensions/Maps/includes/services/YahooMaps/jquery.yahoomaps.js
@@ -77,7 +77,9 @@
7878 if ( options.centre !== false ) map.drawZoomAndCenter( new YGeoPoint( options.centre.lat, options.centre.lon ) );
7979
8080 if ( options.resizable ) {
81 - this.resizable()
 81+ mw.loader.using( 'ext.maps.resizable', function() {
 82+ _this.resizable();
 83+ } );
8284 }
8385
8486 this.addMarker = function( location ) {
Index: trunk/extensions/Maps/includes/services/OpenLayers/OpenLayers.php
@@ -21,7 +21,7 @@
2222 }
2323
2424 $wgResourceModules['ext.maps.openlayers'] = array(
25 - 'dependencies' => array( 'ext.maps.common', 'jquery.ui.resizable' ),
 25+ 'dependencies' => array( 'ext.maps.common' ),
2626 'localBasePath' => dirname( __FILE__ ),
2727 'remoteBasePath' => $egMapsScriptPath . '/includes/services/OpenLayers',
2828 'group' => 'ext.maps',
Index: trunk/extensions/Maps/includes/services/OpenLayers/jquery.openlayers.js
@@ -173,7 +173,9 @@
174174 }
175175
176176 if ( options.resizable ) {
177 - this.resizable()
 177+ mw.loader.using( 'ext.maps.resizable', function() {
 178+ _this.resizable();
 179+ } );
178180 }
179181
180182 return this;
Index: trunk/extensions/Maps/includes/services/GoogleMaps/GoogleMaps.php
@@ -21,7 +21,7 @@
2222 }
2323
2424 $wgResourceModules['ext.maps.googlemaps2'] = array(
25 - 'dependencies' => array( 'ext.maps.common', 'jquery.ui.resizable' ),
 25+ 'dependencies' => array( 'ext.maps.common' ),
2626 'localBasePath' => dirname( __FILE__ ),
2727 'remoteBasePath' => $egMapsScriptPath . '/includes/services/GoogleMaps',
2828 'group' => 'ext.maps',
Index: trunk/extensions/Maps/includes/services/GoogleMaps/jquery.googlemap2.js
@@ -120,7 +120,9 @@
121121 }
122122
123123 if ( options.resizable ) {
124 - this.resizable()
 124+ mw.loader.using( 'ext.maps.resizable', function() {
 125+ _this.resizable();
 126+ } );
125127 }
126128
127129 function ensureTypeIsSelectable( type, types ) {