BlueCat Address Manager Color Change

Change the color of the UI in BlueCat Address Manager

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        BlueCat Address Manager Color Change
// @namespace   *
// @description Change the color of the UI in BlueCat Address Manager
// @include     */app*
// @version     3
// @author      Marius Galm
// @copyright   2018, Marius Galm
// @license     MIT
// @grant       none
// @icon        https://www.bluecatnetworks.com/wp-content/uploads/2018/03/cropped-bluecat-favicon-32x32.png
// ==/UserScript==

// -----------------------------------------------------------------------
// Please Adjust this to reflect the hostname of the URL you access
// -> Can be a full qualified name or hostname only

var redHost = "bam-01.n3k.de";
var greenHost = "bam-02";
// -----------------------------------------------------------------------


// CODE

if (document.readyState === "interactive" ) {
    if (window.location.hostname == redHost) {
        //red
        rotateTo("165");
    } else if (window.location.hostname == greenHost) {
        //green
        rotateTo("-85");
    }
}

function rotateTo(value) {
    var rotation=value;
    var links = document.getElementsByTagName("link");
    var linksList = Array.prototype.slice.call(links);
    linksList.forEach(function(link) {
        if (link.href.includes("/cached-style/proteus-silver.css")) {
            var sheet = link.sheet;
            var rule = ".tab-bar { filter: hue-rotate("+rotation+"deg)}";
            var rule2 = "#banner { position: sticky; top: -3px; filter: hue-rotate("+rotation+"deg)}";
            var rule3 = ".navigation-bar { position: sticky; top: 54px;}";
            sheet.insertRule(rule,0);
            sheet.insertRule(rule2,0);
            sheet.insertRule(rule3,0);
        }
    });
};