Last active
November 29, 2017 14:29
-
-
Save tanasecosminromeo/476e79563b2b14c0e43b50c123c17183 to your computer and use it in GitHub Desktop.
Ads card number to trello and gives an example of how you can also count the number of cards with a specific label. The current example is useful if you mange sprints to see how many of the tasks were critical and how many extra tasks were added into the sprint.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Trello Count | |
// @namespace https://tcrhd.net/ | |
// @version 0.2 | |
// @description Ads card number to trello and gives an example of how you can also count the number of cards with a specific label. The current example is useful if you mange sprints to see how many of the tasks were critical and how many extra tasks were added into the sprint. | |
// @author Cosmin-Romeo TANASE | |
// @include https://trello.com/* | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
if ($("#boards-drawer").length<=0) return; | |
function displayCardCount(){ | |
$("div.board-main-content div.list").each(function (){ | |
var cardsNo = $('a.list-card', this).length; | |
var criticalNo = $('span.card-label-red', this).length; | |
var extraNo = $('span.card-label-orange', this).length; | |
var label = cardsNo+' cards | '+criticalNo+' critical | '+extraNo+' extra'; | |
$('.js-num-cards', this).text(label).removeClass('hide'); | |
}); | |
} | |
setTimeout(displayCardCount, 2000); //Theoretically boards should be loaded now TODO: See how it can be injected when draw | |
setInterval(displayCardCount, 30000); //To display future updates TODO: See how it can be injected when redraw | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment