Jump to content
സഹായം

ಪ್ರವೇಶಿಸಿರಿ (ಸಹಾಯ)
உள்ளேற (உதவி)

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

570 ബൈറ്റുകൾ കൂട്ടിച്ചേർത്തിരിക്കുന്നു ,  7 ജനുവരി
(ചെ.)
തിരുത്തലിനു സംഗ്രഹമില്ല
(ചെ.)No edit summary
(ചെ.)No edit summary
വരി 3: വരി 3:


document.addEventListener("DOMContentLoaded", function () {
document.addEventListener("DOMContentLoaded", function () {
     // Select the target img element with the specific class and src
     // Create a MutationObserver to watch for changes in the DOM
    const markerIcons = document.querySelectorAll('.leaflet-marker-pane img[src="https://tile.openstreetmap.org/v4/marker/pin-m+7e7e7e@2x.png"]');
    const observer = new MutationObserver(function (mutations) {
   
        mutations.forEach(function (mutation) {
    markerIcons.forEach(function (img) {
            // Check if new nodes are added
        // Replace the src attribute with the new URL
            mutation.addedNodes.forEach(function (node) {
        img.src = "https://schoolwiki.in/extensions/Kartographer/lib/external/mapbox/images/marker-icon-2x.png";
                // Ensure the node is an element and has the target class
                if (node.nodeType === 1 && node.matches('.leaflet-marker-pane img')) {
                    const img = node;
                    if (img.src === "https://tile.openstreetmap.org/v4/marker/pin-m+7e7e7e@2x.png") {
                        // Replace the src attribute with the new URL
                        img.src = "https://schoolwiki.in/extensions/Kartographer/lib/external/mapbox/images/marker-icon-2x.png";
                    }
                }
            });
        });
    });
 
    // Start observing the body for added child elements
    observer.observe(document.body, {
        childList: true,
        subtree: true
     });
     });
});
});
"https://schoolwiki.in/പ്രത്യേകം:മൊബൈൽവ്യത്യാസം/2624647" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്