summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/Maps/resources/leaflet/LeafletLoader.js
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/Maps/resources/leaflet/LeafletLoader.js')
-rw-r--r--www/wiki/extensions/Maps/resources/leaflet/LeafletLoader.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/www/wiki/extensions/Maps/resources/leaflet/LeafletLoader.js b/www/wiki/extensions/Maps/resources/leaflet/LeafletLoader.js
new file mode 100644
index 00000000..15776cf7
--- /dev/null
+++ b/www/wiki/extensions/Maps/resources/leaflet/LeafletLoader.js
@@ -0,0 +1,15 @@
+window.mapsLeafletList = [];
+
+(function( $, mw ) {
+ mw.hook( 'wikipage.content' ).add( function ( $content ) {
+ $content.find( '.maps-leaflet' ).each( function() {
+ let $this = $( this );
+
+ let jqueryMap = $this.leafletmaps(
+ JSON.parse( $this.find( 'div.mapdata' ).text() )
+ );
+
+ window.mapsLeafletList.push(jqueryMap);
+ } );
+ } );
+})( window.jQuery, window.mediaWiki );