User:Muhalid/chat.js

rtaspamhide = function(e) { if(e.attributes.text == "RTA fan joined the chat." || e.attributes.text == "RTA fan left the chat.") { $("#Chat_" + window.mainRoom.roomId + " .inline-alert:last").remove; m = $("#" + loadChatroomID + " > ul > li")[$("#" + loadChatroomID + " > ul > li").length - 2]; n = $("#" + loadChatroomID + " > ul > li")[$("#" + loadChatroomID + " > ul > li").length - 1]; p = $($("#" + loadChatroomID + " > ul > li")[$("#" + loadChatroomID + " > ul > li").length - 2]).attr('data-user'); q = $($("#" + loadChatroomID + " > ul > li")[$("#" + loadChatroomID + " > ul > li").length - 1]).attr('data-user'); if ($(n).hasClass("inline-alert") && $(m).hasClass("inline-alert") && !$(n).hasClass("continued")) { $(n).addClass("continued"); } // Make sure that the inline alerts don't mess up       if (p == q && !$(n).hasClass("continued")) { $(n).addClass("continued"); } // Check if the usernames are the same. If they are, make n continued if (p != q && $(n).hasClass("continued")) { $(n).removeClass("continued"); } // If the usernames aren't the same, we're going to make n not-continued } }

// Loader var RTAloader = setInterval(function {   if (typeof mainRoom !== "undefined") {        mainRoom.model.chats.bind("afteradd", function(e) { rtaspamhide(e); });       clearInterval(RTAloader);    } }, 200);