Permalink
Browse files

Remove the stupid /contrib/fluid/ nonsense and build Fluid badge supp…

…ort right inot the app.
  • Loading branch information...
1 parent 2235022 commit 4e84632c208bf55eef832da82c83f0783fef4ebe @gknauss gknauss committed Apr 11, 2011
Showing with 6 additions and 21 deletions.
  1. +0 −21 contrib/fluid/grumblechatnotify.user.js
  2. +6 −0 js/main.js
@@ -1,21 +0,0 @@
-// ==UserScript==
-// @name Grumble Chat Notify
-// @namespace http://grumblechat.com
-// @description Shows a Dock badge whenever a new message appears
-// @include http://grumblechat.com/*
-// @author Greg Knauss <greg@eod.com>
-// ==/UserScript==
-
-(function () {
-
- if (!window.fluid) { return; }
-
- function update() {
- messages = document.title.match(/\((\d+)\)/);
- window.fluid.dockBadge = messages?messages[1]:'';
- setTimeout(update,1000);
- }
-
- update();
-
-})();
View
@@ -314,6 +314,9 @@ var chat = function() {
// reset idleTimer too -- it doesn't detect window focus
$.idleTimer(idleTime);
missedMessageCount = 0;
+ if (window.fluid) {
+ window.fluid.dockBadge = '';
+ }
document.title = pristineTitle;
jQuery.favicon('/images/grumblechat.png');
}
@@ -325,6 +328,9 @@ var chat = function() {
});
soundManager.play('message_alert');
++missedMessageCount;
+ if (window.fluid) {
+ window.fluid.dockBadge = missedMessageCount;
+ }
document.title = '(' + missedMessageCount + ') ' + pristineTitle;
jQuery.favicon('/images/grumblechat-activity.png');
}

0 comments on commit 4e84632

Please sign in to comment.