summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/Maps/resources/GoogleMaps/ext.maps.googlemaps3.js
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/Maps/resources/GoogleMaps/ext.maps.googlemaps3.js')
-rw-r--r--www/wiki/extensions/Maps/resources/GoogleMaps/ext.maps.googlemaps3.js31
1 files changed, 11 insertions, 20 deletions
diff --git a/www/wiki/extensions/Maps/resources/GoogleMaps/ext.maps.googlemaps3.js b/www/wiki/extensions/Maps/resources/GoogleMaps/ext.maps.googlemaps3.js
index ce5880c2..8a7b9b49 100644
--- a/www/wiki/extensions/Maps/resources/GoogleMaps/ext.maps.googlemaps3.js
+++ b/www/wiki/extensions/Maps/resources/GoogleMaps/ext.maps.googlemaps3.js
@@ -1,25 +1,16 @@
-/**
- * JavaScript for Google Maps v3 maps in the Maps extension.
- * @see https://www.mediawiki.org/wiki/Extension:Maps
- *
- * @licence GNU GPL v2+
- * @author Jeroen De Dauw <jeroendedauw at gmail dot com>
- */
-(function( $, mw ) {
-
- $( document ).ready( function() {
+window.mapsGoogleList = [];
- if ( typeof google === 'undefined' ) {
- $( '.maps-googlemaps3' ).text( mw.msg( 'maps-googlemaps3-incompatbrowser' ) );
- }
- else {
- $( '.maps-googlemaps3' ).each( function() {
+(function( $, mw ) {
+ mw.hook( 'wikipage.content' ).add( function ( $content ) {
+ if( typeof google === 'undefined' ) {
+ $content.find( '.maps-googlemaps3' ).text( mw.msg( 'maps-googlemaps3-incompatbrowser' ) );
+ } else {
+ $content.find( '.maps-googlemaps3' ).each( function() {
var $this = $( this );
- var map = $this.googlemaps( $.parseJSON( $this.find( 'div').text() ) );
- window.maps.googlemapsList.push(map);
+ window.mapsGoogleList.push(
+ $this.googlemaps( JSON.parse( $this.find( 'div.mapdata' ).text() ) )
+ );
} );
}
-
} );
-
-})( window.jQuery, mediaWiki );
+})( window.jQuery, window.mediaWiki );