summaryrefslogtreecommitdiff
path: root/static/js/away.js
diff options
context:
space:
mode:
authorsostler <sbostler@gmail.com>2010-05-20 20:36:33 -0400
committersostler <sbostler@gmail.com>2010-05-20 20:36:33 -0400
commit7cd97594cf46bb942d07099ffb05fcbceb609e9b (patch)
treedf701aa1a6a530175e0f3d80c60e6f473d2ea3ba /static/js/away.js
parent04bec93bf1d58e7a75268651b54fdce566c408b1 (diff)
Use function to startTitleUpdater
Diffstat (limited to 'static/js/away.js')
-rwxr-xr-xstatic/js/away.js28
1 files changed, 0 insertions, 28 deletions
diff --git a/static/js/away.js b/static/js/away.js
deleted file mode 100755
index cf4b19c..0000000
--- a/static/js/away.js
+++ /dev/null
@@ -1,28 +0,0 @@
-var UnseenMsgCounter = 0;
-var OrigTitle = $('title').text();
-var HasFocus = true;
-
-function onFocus() {
- HasFocus = true;
- UnseenMsgCounter = 0;
- $('title').text(OrigTitle);
-}
-
-function onBlur() {
- HasFocus = false;
-}
-
-$(window).blur(onBlur);
-$(window).focus(onFocus);
-
-function titleUpdater() {
- if (HasFocus || UnseenMsgCounter == 0 || $('title').text() != OrigTitle) {
- $('title').text(OrigTitle);
- } else {
- var plural = UnseenMsgCounter > 1 ? 's' : '';
- $('title').text(UnseenMsgCounter + ' new dump' + plural + '! | ' + OrigTitle);
- }
- setTimeout(titleUpdater, 2000);
-}
-
-setTimeout(titleUpdater, 2000); \ No newline at end of file