Confluence SideBar

Remove Confluence SideBar crap

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

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

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         Confluence SideBar
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Remove Confluence SideBar crap
// @author       You
// @license      GPL v3
// @match        https://*.atlassian.net/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=mozilla.org
// @require  http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @grant        none
// @run-at       document-idle
// ==/UserScript==

function sleep(ms)
{
    return new Promise(resolve => setTimeout(resolve, ms));
}

function shortcut_filter()
{
    return $(this).html() === "Shortcuts";
}

///////////////////////////////////////////////////
//////////////// END OF HEADER ////////////////////
///////////////////////////////////////////////////

var is_join = 0;
var is_min = 0;
var is_present = 0;

sleep(2000);

const autoAdmit = (mutation) =>
{
    if (!mutation.addedNodes)
    {
        return;
    }
    //var sh = $("div:contains('Shortcuts')");
    var sh = $("div").filter(shortcut_filter);
    var pr = sh.parent().parent().parent();
    var apps = $('div[data-testid="space-apps"]');
    var ss = $("span:contains('Space settings')");
    var ss_pr = ss.parent().parent();
    var at = $("span:contains('Automation')");
    var at_pr = at.parent().parent();
    var ac = $("span:contains('All content')");
    var ac_pr = ac.parent().parent();

    if( is_join==0 )
    {
        pr.remove();
        ss_pr.remove();
        at_pr.remove();
        ac_pr.remove();
        apps.remove();
        is_join = 1;
    }
};

const observer = new MutationObserver((mutations) => mutations.forEach(autoAdmit));

// Options for the observer (which mutations to observe)
const obs_config = { attributes: true, characterData: false, childList: true, subtree: true };

observer.observe(document.body, obs_config);