Skip to content

Instantly share code, notes, and snippets.

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