Created
November 27, 2012 16:21
-
-
Save underscorenygren/4155210 to your computer and use it in GitHub Desktop.
Calculate the points in an Asana Sprint (the number of rows starting with [XX])
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
(function () { | |
var reg = /\[(\d+)\]/, | |
elems = document.getElementsByClassName('task-row-text-input'), | |
total = 0, elem, | |
i, il; | |
for (i = 0, il = elems.length; i < il; i++) { | |
elem = elems[i]; | |
val = elem.value; | |
mat = val.match(reg); | |
if (mat) { | |
total += parseInt(mat[1]); | |
} | |
} | |
console.log ("Total in sprint: " + total); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment