Created
November 16, 2012 22:41
-
-
Save underscorenygren/4091588 to your computer and use it in GitHub Desktop.
Calculates the points in the current Asana sprint. Sums each row that has a [XX] point value and displays in console. Works best as bookmarklet.
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; i < il; i++) { | |
elem = elems[i]; | |
val = elem.value; | |
mat = reg.match(val); | |
if (mat) { | |
total += parseInt(mat.groups(1)); | |
} | |
} | |
console.log ("Total in sprint: " + total); | |
})(); | |
(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