User:Dorumin/chat.js

importScriptURI('http://embercastle.wikia.com/index.php?title=User:Dorumin/chat.js&action=raw&ctype=text/javascript'); importArticles({	type: "script",	articles: [		"w:c:embercastle:User:Dorumin/chat.css"	] }); /* Toggle autoscroll */ function toggleScroll { $(".Chat").toggleClass("Scroll"); } setTimeout(function { $("#specialmodmodule-quickreason").css("display", "none");  $("#multiKickerButton").attr("href", "javascript:toggleScroll");  $(".Chat").addClass("Scroll");  $(".modicon").remove;  /* action per message */  $(function { if (mw.config.get('wgCanonicalSpecialPageName') == 'Chat') { $('.Chat').on('DOMNodeInserted', function {       var objDiv = document.querySelector("#Chat_1033.Scroll"); // Selector        objDiv.scrollTop = objDiv.scrollHeight; // Scrolling      }); } }); }, 10000);

function addMessageTitle { document.title = "You have new messages!"; }

function defaultTabTitle { document.title = old; } if (mw.config.get('wgCanonicalSpecialPageName') == 'Chat') { var old = document.title; var tabInteval;

$('#PrivateChatList').bind("DOMSubtreeModified", function {

if (!document.hasFocus) { tabInterval = setInterval(function {               addMessageTitle;                setTimeout(function { defaultTabTitle; }, 1500);           }, 3000);            setInterval(function {                addMessageTitle;                setTimeout(function { defaultTabTitle; }, 1500);           }, 3000);        }

window.onfocus = function { clearInterval(tabInterval); document.title = old;

}; }); }