Created
January 11, 2013 20:31
-
-
Save eykanal/4513738 to your computer and use it in GitHub Desktop.
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
// ==UserScript== | |
// @name Toodledo Add Goal Count | |
// @namespace | |
// @include http://www.toodledo.com/organize/goals.php | |
// @include https://www.toodledo.com/organize/goals.php | |
// ==/UserScript== | |
// for each higher-order goal: | |
// count how many lower-order goals have that stated as a higher-order goal | |
// display that number next to the higher-order goal | |
var AddGoalCount = function() | |
{ | |
for(var n=0; n<3; n++) | |
{ | |
$(".goalrow[level='"+n+"']").each(function() | |
{ | |
goalCount = $("option[value='668656'][selected='selected']").size(); | |
var useCount; | |
if($(this).find("useCount").size() === 0) | |
{ | |
useCount = $(this).find("input[name^='goal']").after("<div id='useCount'></div>"); | |
} else { | |
useCount = $(this).find("#useCount"); | |
} | |
useCount.text("Referenced by "+goalCount+" goals"); | |
}); | |
} | |
} | |
$(AddGoalCount()); | |
$("select[name^='cont']").click(function() { | |
AddGoalCount(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment