MediaWiki:Common.js: Difference between revisions
Appearance
Created page with "→Any JavaScript here will be loaded for all users on every page load.: mw.hook('wikipage.maps').add(function () { mw.util.addCSS('.leaflet-marker-icon { margin-left: initial !important; margin-top: initial !important; width: auto !important; height: auto !important; }'); new MutationObserver(function (mutations) { mutations.forEach(function (mutation) { if (mutation.addedNodes.length) { mutation.addedNodes[0].src = "https://openlayers.org/api/img/marker.pn..." |
No edit summary |
||
| Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ | ||
mw.hook('wikipage.maps').add(function () { | /*mw.hook('wikipage.maps').add(function () { | ||
mw.util.addCSS('.leaflet-marker-icon { margin-left: initial !important; margin-top: initial !important; width: auto !important; height: auto !important; }'); | mw.util.addCSS('.leaflet-marker-icon { margin-left: initial !important; margin-top: initial !important; width: auto !important; height: auto !important; }'); | ||
new MutationObserver(function (mutations) { | new MutationObserver(function (mutations) { | ||
| Line 12: | Line 12: | ||
}); | }); | ||
}); | }); | ||
*/ | |||
Revision as of 16:18, 20 July 2026
/* Any JavaScript here will be loaded for all users on every page load. */
/*mw.hook('wikipage.maps').add(function () {
mw.util.addCSS('.leaflet-marker-icon { margin-left: initial !important; margin-top: initial !important; width: auto !important; height: auto !important; }');
new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
if (mutation.addedNodes.length) {
mutation.addedNodes[0].src = "https://openlayers.org/api/img/marker.png";
}
});
}).observe($('.leaflet-marker-pane').get(0), {
childList: true,
});
});
*/