User:Incongruence/chat.js/title.js

// Notification script that does that Twitter and Tumblr thing where the number of missed messages is in the title. // When you go back to the chat it'll clear. // By Incongruence & Dragonfree97

old = document.title; unread = 0;

mainRoom.model.chats.bind("afteradd", function { if(!document.hasFocus){     unread++;     document.title = "(" + unread + ") " + old;  } });

document.onfocus = function { document.title = old; unread = 0; }