Created
September 27, 2011 10:43
-
-
Save loranger/1244799 to your computer and use it in GitHub Desktop.
Trello badge userscript for FluidApp
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 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