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 = "Misbehaving", "Social disruption", "Troll", "Spam", "Excessive swearing", "Excessive capslock", "Excessive emoticons", "Excessive text", "Flooding", "Disregarding the moderators", "Malicious intention", "Accessory before the fact", "Harassment", "False accusation", "Gaming the system", "Superiority complex", "fraudulent impersonation", "Possibly compromised", "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 emoticons", "Excessive text", "Flooding", "Disregarding the moderators", "Malicious intention", "Accessory before the fact", "Harassment", "False accusation", "Gaming the system", "Superiority complex", "fraudulent impersonation", "Possibly compromised", "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: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 ——————————————————— // ////