GitHub Collapse Project Columns

makes project columns collapsible

اعتبارا من 06-11-2019. شاهد أحدث إصدار.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name         GitHub Collapse Project Columns
// @namespace    https://github.com/mestiez
// @version      1.1
// @description  makes project columns collapsible
// @author       mestiez
// @match        https://github.com/*/*/projects/*
// @grant        none
// @license MIT
// ==/UserScript==

var button = '<button type="button" class="float-right js-details-target btn-octicon p-1 tooltipped tooltipped-w hide-sm column-menu-item" aria-label="Collapse" aria-expanded="false"><svg class="octicon octicon-plus" viewBox="0 0 12 16" version="1.1" width="12" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M6 2L0 8l6 6V2z"></path></svg></button>';

(function () {
    "use strict";

    const column = document.getElementsByClassName("project-column");
    for (let i = 0; i < column.length; i++) {
        const element = column[i].children[0].children[0];
        column[i].addEventListener("click", ()=>{
            column[i].style = "";
        });
        element.innerHTML += (button);
        element.lastElementChild.addEventListener("click", (e) => {
            event.stopImmediatePropagation();
            column[i].style = "max-width: 40px !important;display: table !important;min-width: 40px !important;white-space: nowrap !important;";});
    }
})();