Jump to content

MediaWiki:Common.js: Difference between revisions

From OnTrackWorld
No edit summary
No edit summary
 
(7 intermediate revisions by the same user not shown)
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:-16 !important; margin-top:-16 !important; width: 32px !important; height: 32px !important; }');
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) {
new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
mutations.forEach(function (mutation) {
if (mutation.addedNodes.length) {
if (mutation.addedNodes.length) {
mutation.addedNodes[0].src = "https://relaxed-feynman.74-208-238-145.plesk.page/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,
	});
});