您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Toggle button for YouTrack sites
当前为
- // ==UserScript==
- // @name Toggl-Button YouTrack
- // @namespace https://github.com/jurgenhaas/toggl-button-greasemonkey
- // @version 1.1
- // @include http*://youtrack.*/*
- // @include http*://*/youtrack/*
- // @grant GM_xmlhttpRequest
- // @grant GM_addStyle
- // @grant GM_getResourceText
- // @grant GM_getValue
- // @grant GM_setValue
- // @grant GM_info
- // @grant GM_registerMenuCommand
- // @require https://greasyfork.org/scripts/2670-toggllibrary/code/TogglLibrary.js
- // @resource togglStyle https://raw.githubusercontent.com/jurgenhaas/toggl-button-greasemonkey/v1.1/TogglLibrary.css
- // @description Toggle button for YouTrack sites
- // ==/UserScript==
- new TogglButtonGM('.fsi-layout.container', function (elem) {
- var description, projectIds = [],
- numElem = elem.querySelector('.issueId', elem),
- titleElem = elem.querySelector('.issue-summary', elem),
- projectElem = document.querySelector('.fsi-properties .fsi-property .regCC a'),
- linkElem = document.querySelector('.fsi-content .links-panel .links .link');
- description = titleElem.textContent.trim();
- if (numElem !== null) {
- description = numElem.textContent.trim() + " " + description;
- }
- if (projectElem !== null) {
- projectIds.push(projectElem.textContent.trim());
- }
- if (linkElem !== null) {
- projectIds.push(linkElem.textContent.trim());
- }
- return {
- className: 'youtrack',
- description: description,
- projectIds: projectIds
- };
- });