JS-Inject
JS-Inject copied to clipboard
Userscript for MinuteDock Fluid apps
This works as a user-script to inject the MinuteDock script into a Fluid app, and also shows a dock badge when you need to work more time :)
var script = document.createElement("script");
script.src = "https://github.com/DrummerHead/JS-Inject/raw/master/examples/minutedock.js";
document.body.appendChild(script);
function checkTimeProgress() {
var requiresAttention = false;
$$(".mini_goal").each(function(goal) {
var progress = goal.select(".progress_bar .progress").map(function(bar) {
return parseFloat(bar.getStyle("width"));
});
if (progress.length > 1) {
requiresAttention = requiresAttention || (progress[1] > progress[0]);
}
});
window.fluid.dockBadge = requiresAttention ? "!" : "";
}
setInterval(checkTimeProgress, 5000);