MediaWiki:Chat.js

/* DO NOT EDIT WITHOUT THE EXPRESS PERMISSION OF JERRICKS */

/* Chat Announcements */ importScriptPage('MediaWiki:ChatAnnouncements/code.js','dev'); /* Chat Tags */

var chatags = { images: true, videos: true }; importScriptPage('MediaWiki:ChatTags/code.js', 'shining-armor');

/* Chat Pings */

importScriptPage('ChatNotifications/code.js', 'dev');

/* Quickly View All Emoticons */

importScriptPage('SpeedEmoticon/latest.js', 'korniux');

/* Spam Prevention via Chat Delay */

window.dev = window.dev || {}; window.dev.chatdelay = { max: 4, mainOnly: true }; importArticles({	type: "script",	articles: [		"u:dev:ChatDelay/code.js"	] });

//Chat filter credit to disney wiki //	The following script blocks certain works in certain conditions ChatStringsBlocker = { "count": 0 }; $('textarea[name="message"]').on("keypress", function (e) {   if (e.keyCode == 13) {        var a = $('textarea[name="message"]').val.toLowerCase,            b = [                "buttwipe",                "cunt",                "jackass",                "motherfucker",                "fuck",                "dick",                "nigger",                "shit",                "unidad",                "bitch"            ],            c = false; // prevent duplication if blocked word was detected already        for (var i = 0; i < b.length; i++) { // loop through all words            var d = b[i];            if ( (           // possibilities start            a == d || // whole message equals the word            a.search(new RegExp(d + "[ ,\\.\\!\\?]")) === 0 || // starts with the word            a.search(new RegExp("[ ,\\.\\!\\?]" + d + "[ ,\\.\\!\\?]")) > -1 || // contains the word            a.substr(a.length - d.length - 1).search(new RegExp("[ ,\\.\\!\\?]" + d)) > -1 // end with the word            // possibilities end            ) && c === false) {                c = true;                $('textarea[name="message"]').val("");                ChatStringsBlocker.count++;                if (ChatStringsBlocker.count < 2) {                    alert("Please refrain from using crude language in the wiki chat.");                } else if (ChatStringsBlocker.count === 2) {                    alert("Final Warning.\nPlease know that this behaviour is not tolerated here.");                } else if (ChatStringsBlocker.count === 3) { window.close; // close on 3rd offense }           }        }    } });