Skip to content

Instantly share code, notes, and snippets.

@underscorenygren
Created November 16, 2012 22:41
Show Gist options
  • Save underscorenygren/4091588 to your computer and use it in GitHub Desktop.
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.
(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