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

No edit summary
No edit summary
 
(ഒരേ ഉപയോക്താവ് ചെയ്ത ഇടയ്ക്കുള്ള 3 നാൾപ്പതിപ്പുകൾ പ്രദർശിപ്പിക്കുന്നില്ല)
വരി 1: വരി 1:
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Joeytje50/JWB.js/load.js&action=raw&ctype=text/javascript');
/* ============================================================
/* ============================================================
   OpenStreetMap marker URL fix
   OpenStreetMap marker URL fix
   ============================================================ */
   ============================================================ */
mw.hook('kartographer.ready').add(function () {
window.onload = function () {
     if (!window.L) return;
     var images = document.querySelectorAll('img');
 
     for (var i = 0; i < images.length; i++) {
     var oldGetIconUrl = L.Icon.Default.prototype._getIconUrl;
        var img = images[i];
 
        if (
    L.Icon.Default.prototype._getIconUrl = function (name) {
            img.src &&
        var url = oldGetIconUrl.call(this, name);
            img.src.startsWith("https://tile.openstreetmap.org/v4/marker/")
        return url.replace(
        ) {
            'https://tile.openstreetmap.org/v4/marker/',
            img.src = img.src.replace(
            'https://maps.wikimedia.org/v4/marker/'
                'https://tile.openstreetmap.org/v4/marker/',
        );
                'https://maps.wikimedia.org/v4/marker/'
    };
            );
});
        }
 
};
 
};
 


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