diff options
author | Yaco <franco@reevo.org> | 2021-10-19 20:24:11 -0300 |
---|---|---|
committer | Yaco <franco@reevo.org> | 2021-10-19 20:24:11 -0300 |
commit | e3880a1c86acaa3bbd05786ad2f5c586e6511a58 (patch) | |
tree | ec77bfc5b69f259a159c95188797bd0dade92357 /www/wiki/extensions/Maps/resources/GoogleMaps/ext.maps.googlemaps3.js | |
parent | 20ca0685509f8010580d3b45036a64ab48616af1 (diff) |
updates Maps to 7.13.0
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.js | 31 |
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 ); |