您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Allows to fold any board in GitLab boards
当前为
- // ==UserScript==
- // @name Foldable GitLab boards
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description Allows to fold any board in GitLab boards
- // @author Himalay
- // @include https://gitlab.*
- // ==/UserScript==
- let foldableGitLabBoardsIntervalCount = 0
- const foldableGitLabBoardsInterval = setInterval(() => {
- const boards = [...document.querySelectorAll('.board.is-draggable')]
- if (foldableGitLabBoardsIntervalCount > 100) clearInterval(foldableGitLabBoardsInterval)
- if (boards.length) {
- clearInterval(foldableGitLabBoardsInterval)
- document.body.appendChild(
- Object.assign(document.createElement('style'), {
- textContent: `.board.is-collapsed .board-title>span {
- width: auto;
- margin-top: 24px;
- }`,
- }),
- )
- boards.forEach((board) => {
- const boardTitle = board.querySelector('.board-title')
- const toggleIcon = Object.assign(document.createElement('i'), {
- classList: 'fa fa-fw board-title-expandable-toggle fa-caret-down',
- style: 'cursor: pointer',
- })
- toggleIcon.addEventListener('click', (e) => {
- board.classList.toggle('is-collapsed')
- e.target.classList.toggle('fa-caret-down')
- e.target.classList.toggle('fa-caret-right')
- })
- boardTitle.prepend(toggleIcon)
- })
- }
- foldableGitLabBoardsIntervalCount++
- }, 100)