Skip to content

Instantly share code, notes, and snippets.

@ryszard
Created January 15, 2010 16:48
Show Gist options
  • Save ryszard/278193 to your computer and use it in GitHub Desktop.
Save ryszard/278193 to your computer and use it in GitHub Desktop.
(function () {
if (window.fluid) {
var unread = 0;
var focused = false;
window.fluid.dockBadge = "";
var orig = BLIP.updater.addUnreaded;
BLIP.updater.addUnreaded = function (a) {
orig(a);
unread += a;
if (unread != 0 && !focused) {
window.fluid.dockBadge = unread;
}
else {
window.fluid.dockBadge = "";
}
};
Event.observe(window, 'blur', function() { focused = false;});
Event.observe(window, 'focus', function() {
unread = 0;
focused = true;
window.fluid.dockBadge = "";
});
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment