Jump to content

MediaWiki:Common.js: Difference between revisions

From OnTrackWorld
No edit summary
No edit summary
 
Line 5: Line 5:
mutations.forEach(function (mutation) {
mutations.forEach(function (mutation) {
if (mutation.addedNodes.length) {
if (mutation.addedNodes.length) {
mutation.addedNodes[0].src = "https://https://ontrackworld.com/w/images/8/8f/Marker.png";
mutation.addedNodes[0].src = "https://ontrackworld.com/w/images/8/8f/Marker.png";
}
}
});
});

Latest revision as of 19:46, 23 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:-16 !important; margin-top:-16 !important; width: 32px !important; height: 32px !important; clip-path: none !important}');
	new MutationObserver(function (mutations) {
		mutations.forEach(function (mutation) {
			if (mutation.addedNodes.length) {
				mutation.addedNodes[0].src = "https://ontrackworld.com/w/images/8/8f/Marker.png";
			}
		});
	}).observe($('.leaflet-marker-pane').get(0), {
		childList: true,
	});
});