Skip to content

Instantly share code, notes, and snippets.

@loranger
Created September 27, 2011 10:43
Show Gist options
  • Save loranger/1244799 to your computer and use it in GitHub Desktop.
Save loranger/1244799 to your computer and use it in GitHub Desktop.
Trello badge userscript for FluidApp
// ==UserScript==
// @name Fluid Dock Badge for Trello
// @namespace http://fluidapp.com
// @description Display a dock badge for the Trello Dashboard with the number of new notifications
// @include *.trello.com
// @author Laurent Goussard
// ==/UserScript==
if (!window.fluid) {
return;
}
try {
doBadgeUpdates(60000);
} catch(e) {
window.console.log(e);
}
function doBadgeUpdates(timeout) {
var unread = document.getElementById('header-user').getElementsByClassName('js-unread-note-count');
window.fluid.dockBadge = ( unread.length > 0 ) ? unread[0].innerHTML : "";
setTimeout(doBadgeUpdates, timeout);
//window.console.log(unread[0].innerHTML);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment