$("#sone #notification-area").append(notification);
notification.slideDown();
}
+ setActivity();
});
$.each(data.removedNotifications, function(index, value) {
$("#sone #notification-area .notification#" + value.id).slideUp();
}
ajaxifyPost(newPost);
newPost.slideDown();
+ setActivity();
}
});
}
}
ajaxifyReply(newReply);
newReply.slideDown();
+ setActivity();
});
}
});
});
}
+function resetActivity() {
+ title = document.title;
+ if (title.indexOf('(') == 0) {
+ document.title = title.substr(title.indexOf(' ') + 1);
+ }
+}
+
+function setActivity() {
+ title = document.title;
+ if (title.indexOf('(') != 0) {
+ document.title = "(!) " + title;
+ }
+}
+
/**
* Creates a new notification.
*
/* activate status polling. */
setTimeout(getStatus, 5000);
+
+ /* reset activity counter when the page has focus. */
+ $(window).focus(function() {
+ resetActivity();
+ });
+
});