Created
July 15, 2012 23:21
-
-
Save p4ul/3119138 to your computer and use it in GitHub Desktop.
JS Clips for trello
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
/** | |
sum everything in format ($100) for list one | |
**/ | |
var sum = 0; | |
$('.list:eq(0) .list-card-title').each(function(d,v){ | |
matches = $(v).text().match(/([0-9]+)(?=\))/); | |
if(matches !== null) { | |
sum += parseInt(matches.pop()); | |
} | |
}); | |
$('.list:eq(0) h2').append(" = $"+sum); | |
/** | |
sum everything task lists in ($100) format | |
**/ | |
var sum = 0; | |
$('.task-list').each(function(d,v){ | |
matches = $(v).text().match(/([0-9]+)(?=\))/); | |
if(matches !== null) { | |
sum += parseInt(matches.pop()); | |
} | |
}); | |
$('.window h2').append(" ~ $"+sum); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment