User:Cheeseskates/chat.js

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

// ChatBlockButton Configuration chatBlockReason = [ "Vandalism", "Gross incivility", "Excessive misconduct", "Troll", "Spam", "Recidivism", "Disruption-only account", "Flooding", "Accessory before the fact", "Conformity to disruption", "Harassment", "False accusation", "Defamation", "GTS", "fraudulent impersonation", "Compromised", "Unauthorized bot", "Unsolicited canvassing", "Cross-wiki drama (Preventive)", "Banditry", "Shock", "Sockpuppetry", "Sockpuppet", "Meatpuppet", "Sharing illegal content", "Violating Fandom's ToU" ];

// QuickModTools Configuration window.QuickModTools = { quickreasons: [ "Gross incivility", "Excessive misconduct", "Troll", "Spam", "Recidivism", "Disruption-only account", "Flooding", "Accessory before the fact", "Conformity to disruption", "Harassment", "False accusation", "Defamation", "GTS", "fraudulent impersonation", "Compromised", "Unauthorized bot", "Unsolicited canvassing", "Cross-wiki drama (Preventive)", "Banditry", "Shock", "Sockpuppetry", "Sockpuppet", "Meatpuppet", "Sharing illegal content", "Violating Fandom's ToU" ],   defbanreason: "Sockpuppet", defbanlength: "infinite" };

// ChatPreloadButtons Configuration window.chatSendButtons = [{ label  : "SupEnd", message : "Welcomes. Anything else you need?" }, { label   : "GoAway", message : "w:c:dev:MessageBlocker. Solves everything." }, { label   : "S:C/F", message : "You are free to give feedback to FANDOM through Special:Contact/feedback." }, { label   : "S:C", message : "Was Special:Contact able to help you?" }, { label   : "Help", message : "Was Help:Contents able to help you?" }, { label   : "Google", message : "Google is your friend. Ask anything: https://www.google.com/" }, { label   : "ChatGone", message : "This thread explains the future of this chat. It'll come back after the end of February." }, { label   : "Topic", message : "You may start a topic to possibly make the chat active." }, { label   : "Welcome", message : "( Welcome. Enjoy yourself. | Bienvenido. Disfruta. | Добро пожаловать. Наслаждайся. )" }];

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

//———————————————————————————————————————————————————————————————————————————— // Imports /* Imports minify the rest of the JavaScript or CSS code and combines multiple HTTP requests into a single data transfer, making it save space and load faster than direct code. It is recommended to import this way. */ //————————————————————————————————————————————————————————————————————————————

//--- /* importscriptURL */ //--- // Add here

//--- /* importArticles */ //---

$(function { importArticles({ type: "script", articles: [ "u:dev:MediaWiki:BlinkingTabAlert.js",           // w:c:dev:BlinkingTabAlert "u:dev:MediaWiki:ChatButtonsCollectionDeluxe.js", // w:c:dev:ChatButtonsCollection "u:dev:MediaWiki:ChatModHover/code.js",          // w:c:dev:ChatModHover "u:dev:MediaWiki:ChatPreloadButtons.js",         // w:c:dev:ChatPreloadButtons "u:dev:MediaWiki:FasterBanModule/code.js",       // w:c:dev:FasterBanModule "u:dev:MediaWiki:IsTyping.js",                   // w:c:dev:IsTyping "u:dev:MediaWiki:MessageBlocker/code.js",        // w:c:dev:MessageBlocker "u:dev:MediaWiki:Pings.js",                      // w:c:dev:Pings "u:dev:MediaWiki:QuickModTools/code.js",         // w:c:dev:QuickModTools "u:dev:MediaWiki:ResponsivePrivateList/code.js", // w:c:dev:ResponsivePrivateList "u:doru:User:Dorumin/scrollfix.javascript",      // w:c:doru:User:Dorumin/scrollfix.javascript "u:steven-universe:User:Andrey Andrey/chat.js",  // w:c:su:User:Andrey Andrey/chat.js ] }); });

// It was recommended to me that I put this code below the import for it to work (function { function htmlEntities(fmt) {    return fmt.replace(/[-\/\\^$*+?.|[\]{}]/g, "\\$&");  }  if (wgCanonicalSpecialPageName != "Chat") {    return;  }  var fmt = mw.messages.get("chat-user-joined");  var name = mw.messages.get("chat-user-parted");  var filename = new RegExp(htmlEntities(fmt).split("\\$1").join("(.+)"));  var digits = new RegExp(htmlEntities(name).split("\\$1").join("(.+)"));  console.log(fmt, name, filename, digits);  mainRoom.model.chats.bind("afteradd", function(a) { if (!window.QuickModTools || !a.attributes.isInlineAlert) { return; }   var line = a.attributes.text; var name = line.match(filename); var num = line.match(digits); var detail = $("#entry-" + a.cid); if (name) { detail.contextmenu(function(evt) {       if (!evt.ctrlKey) {          return;        }        evt.preventDefault;        QuickModTools.fn.openMenu(name[1]);      }); } else { if (num) { detail.contextmenu(function(evt) {         if (!evt.ctrlKey) {            return;          }          evt.preventDefault;          QuickModTools.fn.openMenu(num[1]);        }); }   }  }); });