User:Sakaros/common.js

if (mw.config.get("wgCanonicalSpecialPageName") == "Chat") { function notificationsCheck { $.getJSON(mw.config.get("wgServer") + "/wikia.php?controller=WallNotificationsExternal&method=getUpdateCounts&format=json", function(data) {			var notifications = data.html,				notificationsNumber = notifications.split(' ')[1].split(" ")[0]			notificationsMessage = "You have " + (notificationsNumber == 0 ? "no" : notificationsNumber > 0 ? notificationsNumber : "") + " new message" + (notificationsNumber > 1 || notificationsNumber == 0 ? "s" : "") + ".";			$("#notifications > span").html(notificationsMessage);		}); }	$("header#ChatHeader > .private").before('Read Notifications Loading notifications... '); $("#notifications").mouseover(function {		notificationsCheck;		$("#notifications > span").slideToggle(300);	}); $("#notifications").mouseout(function {		$("#notifications > span").slideToggle(300);	}); setInterval(function {		if ($("#notifications > span").attr("style").indexOf("display: none;") > -1) {			notificationsCheck;			$("#notifications > span").slideToggle(300);			setTimeout(function { $("#notifications > span").slideToggle(300); },5000);		}	},180000); }