User:Lesbian Wolf/Chat.js

//********************** //  Ratelimit Start //********************** var maxLimit = 5; var maxLength = 1250; var limitTimeout = 5000; var rate = 0; function ratelimit(e) { if (rate > maxLimit) { this.disabled = true;//disabling input in case they press ESC before the redirect is complete e.preventDefault; mainRoom.sendMessage({which : 13, shiftKey : false, preventDefault : function {} }) document.location.href = wgServer+"/wiki/Project:Chat/Ratelimit_triggered"; return false; }	if (this.value.length>=maxLength || this.value.split('\n').length>=6) { var val = this.value.substring(0,maxLength).split('\n'); val = val[0]+'\n'+val[1]+'\n'+val[2]+'\n'+val[3]+'\n'+val[4];//remove all lines after the 5th line. this.value = val; if (e.type == 'keypress') { e.preventDefault; return false; }	}	if (e.type == 'keypress' && e.which == 13 && !e.shiftKey && this.value != '') { rate += 1; setTimeout(function {			if (rate > 0) { rate -= 1 }		},limitTimeout); } } $('[name="message"]').keyup(ratelimit).keypress(ratelimit).keydown(ratelimit); //********************** //  Ratelimit End //********************** //********************** //  Chat Header Start //********************** var chatTopic = 'IF YOU ARE NEW READ THE RULES  HERE  AND THE SPINOFF RULE  HERE . ' $(function {	$('#ChatHeader .public.wordmark').prepend(' '+chatTopic+' ')	.find('a').attr('style','position:relative;text-decoration:underline;') }) $('#ChatHeader .public.wordmark div:not(:first-child)').remove //********************** //Chat Header End //********************** //********************** //  Mod Stars Start //********************** setInterval(function { $('#Rail .User.chat-mod:not(.admin) .username').each(function { if (!this.innerHTML.match(/Business Cat|Dream Hacked|Wolfenmaus/)) { $(this).parent.addClass('admin'); }  }); }, 1000) //********************** //   Mod Stars End //********************** //********************** //  Chat Options Start //********************** var chatOptionsLoaded; if (chatOptionsLoaded != 1){ chatOptionsLoaded = 1; importScriptPage('MediaWiki:Chat.js/options.js','cod'); } //********************** //  Chat Options End //**********************

//********************************************************************************* // // //                             CREDITS TO COD WIKI // // //*********************************************************************************