// ==UserScript==
// @name        Remove concourse elements
// @namespace   cloudpipeline.digital
// @description Strips away some of the cruft from the concourse pipeline view when showing it on monitoring screens.
// @include     https://deployer.*.cloudpipeline.digital/*
// @include     https://deployer.cloud.service.gov.uk/*
// @version     1
// @grant       none
// ==/UserScript==
var readyStateCheckInterval = setInterval(function() {
    if (document.readyState === "complete") {
        clearInterval(readyStateCheckInterval);

        console.log("Monitor mode is go");
        var element = document.getElementsByClassName("legend")[0];
        element.parentNode.removeChild(element);

        var element = document.getElementById("cli-downloads");
        element.parentNode.removeChild(element);

        var hostname = location.hostname.replace("deployer.", "").replace(".cloudpipeline.digital","")

        var element = document.getElementsByTagName("nav")[0];
        element.innerHTML = "&nbsp;<font size=5>" + hostname + "</font>";
    }
}, 10);

// ==UserScript==
// @name        Remove concourse elements
// @namespace   cloudpipeline.digital
// @description Strips away some of the cruft from the concourse pipeline view when showing it on monitoring screens.
// @include     https://deployer.*.cloudpipeline.digital/*
// @include     https://deployer.cloud.service.gov.uk/*
// @version     1
// @grant       none
// ==/UserScript==
var readyStateCheckInterval = setInterval(function() {
    if (document.readyState === "complete") {
        clearInterval(readyStateCheckInterval);

        console.log("Monitor mode is go");
        var element = document.getElementsByClassName("legend")[0];
        element.parentNode.removeChild(element);

        var element = document.getElementsByClassName("lower-right-info")[0];
        element.parentNode.removeChild(element);

        var hostname = location.hostname.replace("deployer.", "").replace(".cloudpipeline.digital","")

        var element = document.getElementsByTagName("nav")[0];
        element.innerHTML = "&nbsp;<font size=5>" + hostname + "</font>";
    }
}, 10);

Update concourse browser plugin for new version.
Update concourse browser plugin for new version.

Some of the markup has changed. In earlier versions, there was an
element with an id of 'cli-downloads' that contained the download links
in the lower left corner. With newer versions, this now also displays
the concourse version, and as a result the markup has changed, and
there's no longer an element with the relevant id. Instead, there's a
container with a class of "lower-right-info" that contains all these
details.
