"മീഡിയവിക്കി:Common.js" എന്ന താളിന്റെ പതിപ്പുകൾ തമ്മിലുള്ള വ്യത്യാസം

(ചെ.)No edit summary
(ചെ.)No edit summary
വരി 1: വരി 1:
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Joeytje50/JWB.js/load.js&action=raw&ctype=text/javascript');
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Joeytje50/JWB.js/load.js&action=raw&ctype=text/javascript');


document.addEventListener("DOMContentLoaded", function () {
document.addEventListener("DOMContentLoaded", function () {
     // Find all images inside the leaflet-pane leaflet-marker-pane class
     // Wait for the map to load fully
    const images = document.querySelectorAll('.leaflet-pane.leaflet-marker-pane img');
    const observer = new MutationObserver(() => {
    images.forEach(function (img) {
        // Select all marker images within the leaflet-marker-pane
        img.src = "https://schoolwiki.in/extensions/Kartographer/lib/external/mapbox/images/marker-icon-2x.png";
        const markerImages = document.querySelectorAll('.leaflet-marker-pane img');
        markerImages.forEach(img => {
            if (img.src.includes("tile.openstreetmap.org")) {
                img.src = "https://schoolwiki.in/extensions/Kartographer/lib/external/mapbox/images/marker-icon-2x.png";
            }
        });
     });
     });
    // Observe changes in the leaflet-marker-pane
    const mapPane = document.querySelector('.leaflet-pane.leaflet-marker-pane');
    if (mapPane) {
        observer.observe(mapPane, { childList: true, subtree: true });
    }
});
});


"https://schoolwiki.in/മീഡിയവിക്കി:Common.js" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്