Gitee 魔改计划
目前為
// ==UserScript==
// @name gitee tuning
// @namespace gitee
// @version 0.1.1
// @description Gitee 魔改计划
// @author BlindingDark
// @match https://gitee.com/oschina/dashboard/issues*
// @grant none
// ==/UserScript==
// 目前实现
// 1. 点击 issues 复制 issues 井号标识而不是链接
(function() {
'use strict';
// Tools
// 复制字符串到剪贴板
const copyToClipboard = str => {
const el = document.createElement('textarea');
el.value = str;
el.setAttribute('readonly', '');
el.style.position = 'absolute';
el.style.left = '-9999px';
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.body.removeChild(el);
};
// 点击 issues 复制 issues 井号标识而不是链接
$(".ent-issues").on("click", ".issue-number-button", (e) => {
window.setTimeout(() => copyToClipboard(e.target.textContent.trim()), 100);
});
})();