User:Cheeseskates/chat.js

////////////////////////////////////////////////////////////////////////////////

/* -- -- */ ////////////////////////////////////////////////////////////////////////////////
 * * Name:       Global Chat JavaScript                                      |
 * * Author:     Sophiedp - Cheeseskates                                     |
 * * Description: This is my chat.js that can load on all wikis like         |
 * global.js can. It is thanks to Sophiedp's script you can   |
 * put in TamperMonkey.                                       |
 * https://openuserjs.org/scripts/LunarTwilight/Load_global.js_in_chat/source |
 * put in TamperMonkey.                                       |
 * https://openuserjs.org/scripts/LunarTwilight/Load_global.js_in_chat/source |
 * https://openuserjs.org/scripts/LunarTwilight/Load_global.js_in_chat/source |

//————————————————————————————————————————————————————————————————————————————// // Direct JavaScript code // //————————————————————————————————————————————————————————————————————————————//

/**/ ///————————————————————— Major Direct JavaScript code ———————————————————————/// /**/

/* -- -- */ // Load up the ping color var PING_COLOR = "#F00";
 * * Name:       PICCOLO                                                     |
 * * Author:     Akivirus                                                    |
 * * Description: steven-universe : User blog:Akrivus/Akri's Amazing Script  |
 * * Description: steven-universe : User blog:Akrivus/Akri's Amazing Script  |
 * * Description: steven-universe : User blog:Akrivus/Akri's Amazing Script  |

// Loads the styles for the script. importArticles({ type: "style",  articles: [    "u:akrivus:User:Akrivus/chat.css",    "User:Akrivus/chat.css"  ] });

// Load the script up itself. importArticles({ type: "script",  articles: [    "u:akrivus:User:Akrivus/chat.js"  ] });

/* -- -- */
 * * Name:       WordFilter                                                  |
 * * Author:     Drew1200 and Curiouscrab                                    |
 * * Description: Sets a word filter to warn me if a swear is in my message. |
 * * Description: Sets a word filter to warn me if a swear is in my message. |
 * * Description: Sets a word filter to warn me if a swear is in my message. |

var alertMessage; window.outputWarning = ""; window.badWords = (window.badWords || []).concat(["omfg", "pussy", "boner", "fuck", "shit", "bastard", "bitch", "faggot", "fag", "nigger", "dick", "whore", "cunt", "wtf", "stfu", "slut"]); $("#Write textarea").keydown(function(event) { if (event.keyCode == 13 && (wordFilter === true && mainRoom.active === true)) {    var characterPosition = 0;    for (characterPosition < window.badWords.length;characterPosition += 1) {      window.outputWarning = $("#Write textarea").val;    }    $("div.Chat>ul").append("" + (alertMessage || "WARNING: The message you just posted contains words marked as inappropriate. Are you sure you want to send this message?") + " ~  ~ Continue or Cancel ");    $(this).unbind("keypress").val("");  } }); function ignoreWarning { mainRoom.socket.send((new models.ChatEntry({   roomId : this.roomId,    name : wgUserName,    text : window.outputWarning  })).xport); $("#temporary").remove; } function endMessage { $("#temporary").remove; } function wordFilter { var i = 0; for (i < window.badWords.length;i += 1) { if ($("#Write textarea").val.toLowerCase.indexOf(window.badWords[i]) > -1) { return true; } } }

/**/ ///————————————————————— Minor Direct JavaScript code ———————————————————————/// /**/ // Add when necessary

//// // ——————————————————— End Direct Import JavaScript Code ———————————————————— // ////

//————————————————————————————————————————————————————————————————————————————// // Script Configurations -// //————————————————————————————————————————————————————————————————————————————//

// ChatBlockButton Configuration chatBlockReason = "Misbehaving", "Social disruption", "Troll.", "Spam", "Excessive swearing", "Excessive capslock", "Excessive text", "Flooding", "Disregarding the moderators", "Malicious intention", "Accessory before the fact", "Harassment", "False accusation", "Gaming the system", "Superiority complex", "Fraudulant impersonation", "Unsolicited canvassing", "Cross-wiki drama", "Banditry", "Shock", "Proxy offense (Sniper)", "Meatpuppet", "Sockpuppet", "Sharing illegal content", "Violating Wikia's Terms of Use"

// QuickModTools Configuration window.QuickModTools = { quickreasons: [ "Misbehaving", "Social disruption", "Troll.", "Spam", "Excessive swearing", "Excessive capslock", "Excessive text", "Flooding", "Disregarding the moderators", "Malicious intention", "Accessory before the fact", "Harassment", "False accusation", "Gaming the system", "Superiority complex", "Fraudulant impersonation", "Unsolicited canvassing", "Cross-wiki drama", "Banditry", "Shock", "Proxy offense (Sniper)", "Meatpuppet", "Sockpuppet", "Sharing illegal content", "Violating Wikia's Terms of Use" ] };

//// // ——————————————————————— End Configuration Section ———————————————————————— // ////

//————————————————————————————————————————————————————————————————————————————// // Imports ---// //————————————————————————————————————————————————————————————————————————————//

$(function { importArticles({ type: "script", articles: [ "u:dev:MediaWiki:BlinkingTabAlert.js", "u:dev:MediaWiki:ChatButtonsCollectionDeluxe.js", "u:dev:MediaWiki:ChatMessageWallCount.js", "u:dev:MediaWiki:ChatModHover/code.js", "u:dev:MediaWiki:ChatNotifications/code.js", "u:dev:MediaWiki:FasterBanModule/code.js", "u:dev:MediaWiki:MessageBlocker/code.js", "u:dev:MediaWiki:QuickModTools/code.js", "u:dev:MediaWiki:ResponsivePrivateList/code.js" ] }); });

//// // —————————————————— End ImportArticles section and page ——————————————————— // ////