JIRA Rapid Board Issue Tracker

Tracking issues on JIRA Rapid Board.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         JIRA Rapid Board Issue Tracker
// @namespace    http://www.kalee.hu
// @version      0.0.2
// @description  Tracking issues on JIRA Rapid Board.
// @author       Moondancer83
// @homepage     https://github.com/Moondancer83/JIRARapidBoardIssueTracker
// @include      /jira.*/secure/RapidBoard.jspa*/
// @grant        none
// @require      https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js
// ==/UserScript==
(function() {
    'use strict';

    var head = $("head");

    setTimeout(function() {
        setStyles();
        issueCounter();
    }, 2000);

    function setStyles() {
        head.append("<style>" +
                    ".ghx-badge-group {zoom: 145%;} " +
                    "</style>");
    }
    function issueCounter() {
        var sprintIssues = $(".ghx-backlog-container.ghx-sprint-active.js-sprint-container .js-issue.ghx-issue-compact").length;
        var issuesToGo = $(".ghx-backlog-container.ghx-sprint-active.js-sprint-container .js-issue.ghx-issue-compact:not(.ghx-done)").length;
        var badge = '<span class="aui-badge issue-counter" title=Issues (to go/all): "' + issuesToGo + ' / ' + sprintIssues + '">' + issuesToGo + ' / ' + sprintIssues + '</span>';
        $('.ghx-badge-group').prepend(badge);
    }
})();