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 ———————————————————————/// /**/

/* -- -- */
 * * Name:       Slash commands                                              |
 * * Author:     Cheeseskates                                                |
 * * Description: Using slash commands, I can generate preset messages       |
 * through typing a short word or phrase that would be similar |
 * to the preset message. This helps send messages quickly    |
 * while taking action as fast as possible.                   |
 * e.g. warning and kicking.                                  |
 * while taking action as fast as possible.                   |
 * e.g. warning and kicking.                                  |

$('[name="message"]').keypress(function(event) { if (32 == event.which || 13 == event.which) {    switch(this.value) {      case "/coppa":        this.value = "COPPA – You must be 13 or older to legally have an account on Wikia.";        break;      case "/h":        this.value = "o/ Hello, everyone! o/";        break;      case "/hu":        this.value = "o/ o/ Hello! o/ o/";        break;      case "/b":        this.value = "o/ Goodbye, everyone! o/";        break;      case "/bu":        this.value = "o/ o/ Farewell! o/ o/";        break;      case "/sc":        this.value = "You can use Special:Contact/general to contact Fandom Staff.";        break;    }  } });

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

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

// ChatBlockButton Configuration chatBlockReason = "Vandalism", "Gross incivility", "Excessive misconduct", "Troll", "Spam", "Flooding", "Accessory before the fact", "Conformity to disruption", "Harassment", "False accusation", "Defamation", "Gaming the system", "fraudulent impersonation", "Compromised", "Unauthorized bot", "Unsolicited canvassing", "Cross-wiki drama (Preventive)", "Banditry", "Shock", "Sockpuppetry", "Sockpuppet", "Meatpuppet", "Sharing illegal content", "Violating Fandom's Terms of Use"

// QuickModTools Configuration window.QuickModTools = { quickreasons: [ "Gross incivility", "Excessive misconduct", "Troll", "Spam", "Flooding", "Accessory before the fact", "Conformity to disruption", "Harassment", "False accusation", "Defamation", "Gaming the system", "fraudulent impersonation", "Compromised", "Unauthorized bot", "Unsolicited canvassing", "Cross-wiki drama (Preventive)", "Banditry", "Shock", "Sockpuppetry", "Sockpuppet", "Meatpuppet", "Sharing illegal content", "Violating Fandom'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:ChatOptions/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 ——————————————————— // ////