„MediaWiki:Gadget-OpenStreetMap.js“ – Versionsunterschied
Erscheinungsbild
Inhalt gelöscht Inhalt hinzugefügt
Maintenance: Add explicit preload for "mediawiki.util", which is used by m:MediaWiki:OSM.js |
Maintenance: Apply the same performance optimisation as enwiki - only download the extra map code on articles with coordinates |
||
Zeile 1: | Zeile 1: | ||
// dewiki:MediaWiki:Gadget-OpenStreetMap |
// dewiki:MediaWiki:Gadget-OpenStreetMap |
||
( function () { |
$( function () { |
||
// Only load the JavaScript on articles that need it |
|||
"use strict"; |
|||
// Same selector as inside [[m:MediaWiki:OSM.js]] |
|||
⚫ | |||
if ( $( "#coordinates a" ).length ) { |
|||
⚫ | |||
⚫ | |||
osm_proj_map_postfix: "", |
|||
⚫ | |||
⚫ | |||
osm_proj_map_postfix: "", |
|||
⚫ | |||
⚫ | |||
} ); |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
} |
|||
⚫ |
Aktuelle Version vom 17. August 2019, 22:51 Uhr
// dewiki:MediaWiki:Gadget-OpenStreetMap
$( function () {
// Only load the JavaScript on articles that need it
// Same selector as inside [[m:MediaWiki:OSM.js]]
if ( $( "#coordinates a" ).length ) {
mw.config.set( { osm_proj_map_prefix: " | ",
osm_proj_map: "<img src='/media/wikipedia/commons/thumb/b/b0/Openstreetmap_logo.svg/17px-Openstreetmap_logo.svg.png' width='17px' height='17px' alt='OSM'>",
osm_proj_map_postfix: "",
osm_proj_lang: "de"
} );
// depending on "mediawiki.util":
mw.loader.load( "mediawiki.util" );
mw.loader.load( "https://meta.wikimedia.org/w/index.php?title=MediaWiki:OSM.js&action=raw&ctype=text/javascript" );
}
} );