Skip to content

Instantly share code, notes, and snippets.

@benburton
Created October 3, 2011 16:49
Show Gist options
  • Save benburton/1259574 to your computer and use it in GitHub Desktop.
Save benburton/1259574 to your computer and use it in GitHub Desktop.
Trello Userscript for Fluid
(function() {
$(document).ready(function(){
window.fluid.dockBadge = '';
var previousText;
var newPostCount = 0;
setInterval(function() {
var latestText = $('.list-actions .phenom-desc:first').text();
if (!previousText) {
previousText = latestText;
}
if (previousText != latestText) {
newPostCount += 1;
window.fluid.dockBadge = newPostCount;
previousText = latestText;
window.fluid.showGrowlNotification({
title: 'New Trello Activity',
description: latestText,
priority: 1,
sticky: false,
identifier: 'trello',
onclick: function() {
window.fluid.activate();
window.fluid.dockBadge = '';
},
icon: 'http://trello.com/images/favicon.png'
});
}
}, 5000);
$('*').click(function() {
newPostCount = 0;
window.fluid.dockBadge = '';
});
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment