Slim JIRA issue search

Adds a button to hide the JIRA issue browser

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        Slim JIRA issue search
// @description Adds a button to hide the JIRA issue browser
// @namespace   https://www.pietz.me/
// @match       https://*.atlassian.net/browse/*
// @run-at      document-idle
// @grant       GM_addStyle
// @version     1.0
// @license     MIT
// ==/UserScript==

GM_addStyle(`
.toggle-search {
    background: none;
    border: none;
    height: 0.5rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    cursor: pointer;
    box-shadow: none;
}

.toggle-search-line {
    height: 1px;
    display: block;
    background-color: #e5e5e5;
    transition: all 0.2s ease-out;
    flex: 1;
}

.toggle-search:hover .toggle-search-line {
    background-color: #448ae5;
    height: 2px;
}
`)

const contentElement = document.querySelector('#global-issue-navigator-container .contained-content');
const savedSearchSelectorElement = contentElement.querySelector('.saved-search-selector');
const searchElement = contentElement.querySelector('.navigator-search');

const toggleButton = document.createElement('button');
toggleButton.classList.add('toggle-search');

const indicatorLine = document.createElement('span');
indicatorLine.classList.add('toggle-search-line');
toggleButton.appendChild(indicatorLine);

let visible = true;
toggleButton.addEventListener('click', () => {
    visible = !visible;
    if (visible) {
        savedSearchSelectorElement.style.removeProperty('display');
        searchElement.style.removeProperty('display');
    } else {
        savedSearchSelectorElement.style.display = 'none';
        searchElement.style.display = 'none';
    }
})


contentElement.insertBefore(toggleButton, searchElement.nextSibling)