HWM Hidden Clans

HWM Mod - Создаёт спойлер для списка кланов на странице игрока

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name 		HWM Hidden Clans
// @version 	1.1
// @description 	HWM Mod - Создаёт спойлер для списка кланов на странице игрока
// @author 	СтепнойВарварка
// @namespace 	mod Mefistophel_Gr
// @homepage 	https://greasyfork.org/ru/users/9016-Mefistophel-Gr
// @include 	http://*heroeswm.ru/pl_info.php*
// @include 	http://178.248.235.15/pl_info.php*
// @include 	http://*.lordswm.com/pl_info.php*
// @grant		none
// ==/UserScript==


(function() {
    var hide_clans = false;
    
    var b = document.querySelector('td.wb>a[href*="clan_info.php?id="]>b');
    
    if (b) {
        var td = b.parentNode.parentNode; td.style.display = 'none';
        td.parentNode.previousSibling.addEventListener('click', expandClans);
    }

    function expandClans() {
        if (hide_clans) {
            td.style.display = 'none';
        } else {
            td.style.display = '';
        }
        hide_clans = !hide_clans;
    }

})();