Created
July 2, 2016 20:57
-
-
Save AldanaQuintana/84d8e66db41a63417ca1025c0d0807fc to your computer and use it in GitHub Desktop.
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
javascript:(function(){ | |
if(window.location["href"].match("trello") == null){ return; } | |
var uploadDom = function(){ | |
var lists = document.getElementsByClassName("js-list-content"); | |
for (var i = 0; i < lists.length; i++) { | |
var listStoryPoints = 0; | |
var list = lists[i]; | |
var headerTextArea = list.getElementsByClassName("list-header-name")[0]; | |
var headerContent = headerTextArea.textContent.split(" (")[0]; | |
var listCards = list.getElementsByClassName("list-card"); | |
if(listCards != undefined && listCards.length > 0){ | |
for (var j = 0; j < listCards.length; j++) { | |
var card = listCards[j]; | |
var cardId = card.getElementsByClassName("card-short-id")[0]; | |
var cardName = card.getElementsByClassName("js-card-name")[0]; | |
if(cardName != undefined && cardId != undefined){ | |
var textToTrim = cardId.textContent; | |
var cardContent = cardName.textContent; | |
cardContent = cardContent.split(textToTrim)[1]; | |
var splitted = cardContent.split("/SP"); | |
if(splitted.length == 2){ | |
listStoryPoints += parseInt(splitted[0]); | |
} | |
} | |
} | |
} | |
headerTextArea.textContent = headerContent + " (" + listStoryPoints.toString() + "/SP)"; | |
} | |
} | |
setInterval(uploadDom, 200); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment