HWM_ReturnNormalClanIcons

Возврат стандартных (не праздничных) значков боевых кланов

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         HWM_ReturnNormalClanIcons
// @namespace    Небылица
// @version      2.1
// @description  Возврат стандартных (не праздничных) значков боевых кланов
// @author       Небылица
// @include      /^https{0,1}:\/\/((www|qrator)\.heroeswm\.ru|178\.248\.235\.15)\/.+/
// @exclude      /^https{0,1}:\/\/((www|qrator)\.heroeswm\.ru|178\.248\.235\.15)\/(login|war|cgame|frames|chat|chatonline|ch_box|chat_line|ticker|chatpost)\.php.*/
// ==/UserScript==

(function() {
    "use strict";

    // получаем все картинки на странице, задаём базу соответствий
    var icons = document.getElementsByTagName("img"),
        iconSrc,
        clanId,
        iconsVersions = {
            "13": "90",
            "14": "105",
            "15": "70",
            "17": "79",
            "18": "101",
            "26": "40",
            "27": "39",
            "41": "38",
            "57": "83",
            "73": "38",
            "85": "9",
            "86": "36",
            "88": "69",
            "100": "57",
            "104": "63",
            "126": "62",
            "149": "55",
            "170": "8",
            "176": "68",
            "211": "39",
            "236": "123",
            "249": "28",
            "250": "11",
            "256": "54",
            "259": "39",
            "276": "54",
            "292": "25",
            "302": "190",
            "326": "55",
            "346": "25",
            "361": "26",
            "387": "32",
            "407": "56",
            "414": "3",
            "433": "93",
            "464": "40",
            "468": "51",
            "476": "31",
            "485": "5",
            "492": "9",
            "493": "75",
            "522": "86",
            "528": "11",
            "590": "30",
            "644": "66",
            "691": "81",
            "708": "67",
            "713": "36",
            "719": "18",
            "728": "122",
            "756": "97",
            "766": "35",
            "782": "70",
            "783": "133",
            "785": "45",
            "823": "107",
            "825": "84",
            "834": "25",
            "846": "47",
            "928": "115",
            "933": "73",
            "965": "78",
            "997": "89",
            "1041": "66",
            "1138": "71",
            "1180": "278",
            "1209": "78",
            "1253": "23",
            "1254": "227",
            "1271": "55",
            "1306": "9",
            "1317": "103",
            "1332": "76",
            "1335": "58",
            "1355": "16",
            "1365": "7",
            "1382": "23",
            "1409": "148",
            "1436": "16",
            "1437": "36",
            "1464": "38",
            "1488": "62",
            "1499": "37",
            "1512": "60",
            "1519": "93",
            "1535": "96",
            "1540": "7",
            "1597": "83",
            "1631": "51",
            "1658": "72",
            "1685": "143",
            "1758": "37",
            "1787": "86",
            "1790": "5",
            "1803": "9",
            "1814": "1",
            "1849": "17",
            "1861": "81",
            "1888": "47",
            "1945": "50",
            "2037": "16",
            "2120": "55",
            "2135": "20",
            "2140": "80",
            "2163": "72",
            "2194": "26",
            "2196": "169",
            "2213": "71",
            "2226": "39",
            "2230": "38",
            "2266": "64",
            "2282": "37",
            "2301": "12",
            "2302": "46",
            "2303": "21",
            "2304": "12",
            "2336": "92",
            "2338": "85",
            "2422": "35",
            "2448": "18",
            "2454": "37",
            "2464": "32",
            "2473": "48",
            "2517": "64",
            "2544": "2",
            "2620": "24",
            "2687": "1",
            "2694": "1",
            "2728": "11",
            "2735": "84",
            "2745": "89",
            "2814": "3",
            "2854": "25",
            "2870": "171",
            "2894": "137",
            "2902": "56",
            "2911": "3",
            "2928": "20",
            "2939": "115",
            "2985": "7",
            "2999": "56",
            "3002": "401",
            "3015": "8",
            "3137": "24",
            "3146": "86",
            "3161": "85",
            "3201": "91",
            "3206": "2",
            "3229": "40",
            "3303": "56",
            "3304": "95",
            "3305": "81",
            "3333": "25",
            "3340": "12",
            "3344": "44",
            "3346": "104",
            "3352": "90",
            "3444": "1",
            "3474": "5",
            "3509": "109",
            "3564": "23",
            "3572": "36",
            "3589": "23",
            "3607": "144",
            "3670": "19",
            "3695": "43",
            "3816": "32",
            "3928": "22",
            "3975": "112",
            "3995": "149",
            "4001": "5",
            "4082": "40",
            "4129": "29",
            "4159": "2",
            "4201": "44",
            "4208": "57",
            "4222": "4",
            "4260": "110",
            "4370": "156",
            "4414": "58",
            "4486": "83",
            "4571": "24",
            "4601": "8",
            "4742": "522",
            "4776": "156",
            "4938": "33",
            "4976": "2",
            "5001": "47",
            "5041": "47",
            "5049": "1",
            "5053": "17",
            "5063": "138",
            "5095": "39",
            "5152": "23",
            "5169": "188",
            "5203": "33",
            "5283": "8",
            "5349": "71",
            "5385": "87",
            "5390": "83",
            "5555": "117",
            "5569": "6",
            "5581": "51",
            "5588": "39",
            "5604": "53",
            "5625": "20",
            "5689": "43",
            "5722": "15",
            "5736": "19",
            "5756": "73",
            "5757": "114",
            "5880": "28",
            "5941": "46",
            "6006": "48",
            "6055": "21",
            "6085": "45",
            "6109": "13",
            "6118": "2",
            "6145": "3",
            "6241": "33",
            "6259": "49",
            "6285": "44",
            "6311": "34",
            "6387": "28",
            "6396": "59",
            "6425": "24",
            "6561": "3",
            "6633": "6",
            "6712": "7",
            "6749": "15",
            "6812": "6",
            "6815": "29",
            "7127": "67",
            "7279": "26",
            "7360": "22",
            "7382": "124",
            "7490": "50",
            "7705": "105",
            "7736": "9",
            "7777": "41",
            "8026": "14",
            "8048": "6",
            "8100": "15",
            "8212": "32",
            "8224": "1",
            "8251": "2",
            "8382": "14",
            "8415": "16",
            "8433": "55",
            "8502": "6",
            "8652": "32",
            "9100": "119",
            "9213": "1",
            "9378": "4",
            "9595": "5",
            "9681": "92",
            "10058": "2",
            "10088": "132",
            "10133": "22",
            "10177": "9"
        };

    // запускаем по ним цикл
    var i,
        maxI = icons.length;
    for (i=0;i<maxI;i++){
        iconSrc = icons[i].src;
        if (iconSrc.indexOf("/i_clans/l_") !== -1){ // если это иконка клана
            clanId = iconSrc.match(/\/i_clans\/l_(\d+)\.gif/)[1];
            if (clanId in iconsVersions){ // если клан есть в базе
                icons[i].src = "https://dcdn.heroeswm.ru/i_clans/l_" + clanId + ".gif?v=" + iconsVersions[clanId]; // заменяем ссылку на версионную
            }
        }
    }
})();