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

517 ബൈറ്റുകൾ നീക്കംചെയ്തിരിക്കുന്നു ,  25 ഫെബ്രുവരി
(ചെ.)
തിരുത്തലിനു സംഗ്രഹമില്ല
(ചെ.)No edit summary
(ചെ.)No edit summary
 
(2 ഉപയോക്താക്കൾ ചെയ്ത ഇടയ്ക്കുള്ള 37 നാൾപ്പതിപ്പുകൾ പ്രദർശിപ്പിക്കുന്നില്ല)
വരി 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');  
*/


window.onload = function () {
    // Find all image elements on the page
    var images = document.querySelectorAll('img');


document.addEventListener("DOMContentLoaded", function () {
    // Loop through the images and modify the `src` if it matches the criteria
    // Select the target img element with the specific class and src
    for (var i = 0; i < images.length; i++) {
    const markerIcons = document.querySelectorAll('.leaflet-marker-pane img[src="https://tile.openstreetmap.org/v4/marker/pin-m+7e7e7e@2x.png"]');
        var img = images[i];
   
       
    markerIcons.forEach(function (img) {
        // Check if the `src` starts with the specified URL
        // Replace the src attribute with the new URL
        if (img.src.startsWith("https://tile.openstreetmap.org/v4/marker/")) {
        img.src = "https://schoolwiki.in/extensions/Kartographer/lib/external/mapbox/images/marker-icon-2x.png";
            // Replace the `src` with the desired URL
    });
            var newSrc = img.src.replace("https://tile.openstreetmap.org/v4/marker/", "https://maps.wikimedia.org/v4/marker/");
});
            img.src = newSrc;


  console.log ("map replace");
         }
    function replaceMarkerImage(newUrl) {
        // Get all image elements with the target class
        const imageElements = document.querySelectorAll('img.leaflet-marker-icon');
 
        // Loop through each image element and update the src
        imageElements.forEach(image => {
            // Update the image source directly
            image.src = newUrl;
         });
     }
     }
 
};
    // Example usage:
    const newImageUrl = 'https://schoolwiki.in/extensions/Kartographer/lib/external/mapbox/images/marker-icon-2x.png'; // Replace with the new URL
 
    // Call the function to replace the marker images
    replaceMarkerImage(newImageUrl);
 
 


//Quick Edit Box  
//Quick Edit Box  
"https://schoolwiki.in/പ്രത്യേകം:മൊബൈൽവ്യത്യാസം/2624646...2651151" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്