MediaWiki:Chat.js/inline.js

/** * * Create custom chat commands in chat. * @author Pepeal  * @author Orbacal . * @module Brought into this wiki by StrawberryMaster . * @notice Please, avoid spamming those commands in chat. * **/

var CustomAlerts = {}; // command list CustomAlerts.cmd = { waffles: "\\ OpieOP / Waffle party! \\ OpieOP /", gaben: "ALL HAIL LORD GABEN (gaben) ", nkech: " Hurricane " + ("CycloneNkechinyer").link("http://hypotheticalhurricanes.wikia.com/wiki/User:CycloneNkechinyer") + " has formed!", nkechd: " Hurricane " + ("CycloneNkechinyer").link("http://hypotheticalhurricanes.wikia.com/wiki/User:CycloneNkechinyer") + " has dissipated!", douglas: " Hurricane " + ("Hurricane news").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Hurricane_news") + " has formed!", douglasd: " Hurricane " + ("Hurricane news").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Hurricane_news") + " has dissipated!", emma: " Hurricane " + ("Emmaelise401").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Emmaelise401") + " has formed!", emmad: " Hurricane " + ("Emmaelise401").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Emmaelise401") + " has dissipated!", mabel: " Hurricane " + ("Mabel").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Mabel") + " has formed!", mabeld: " Hurricane " + ("Mabel").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Mabel") + " has dissipated", bob: " Hurricane " + ("Bobnekaro").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Bobnekaro") + " has formed!", bobd: " Hurricane " + ("Bobnekaro").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Bobnekaro") + " has dissipated!", sass: " Hurricane " + ("Sassmaster15").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Sassmaster15") + " has formed!", sassd: " Hurricane " + ("Sassmaster15").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Sassmaster15") + " has dissipated!", cardozo: " Hurricane " + ("SpcardozoComesBack").link("http://hypotheticalhurricanes.wikia.com/wiki/User:SpcardozoComesBack") + " has formed!", cardozod: " Hurricane " + ("SpcardozoComesBack").link("http://hypotheticalhurricanes.wikia.com/wiki/User:SpcardozoComesBack") + " has dissipated", layten: " Hurricane " + ("Hurricane Layten").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Hurricane Layten") + " has formed!", laytend: " Hurricane " + ("Hurricane Layten").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Hurricane Layten") + " has dissipated!", layten2: " Hurricane " + ("HurricanePatricia2015").link("http://hypotheticalhurricanes.wikia.com/wiki/User:HurricanePatricia2015") + " has formed!", layten2d: " Hurricane " + ("HurricanePatricia2015").link("http://hypotheticalhurricanes.wikia.com/wiki/User:HurricanePatricia2015") + " has dissipated!", hype: " Hurricane " + ("Hypercane").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Hypercane") + " has formed!", hyped: " Hurricane " + ("Hypercane").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Hypercane") + " has dissipated!", hypeteen: " Hurricane " + ("HypercaneTeen").link("http://hypotheticalhurricanes.wikia.com/wiki/User:HypercaneTeen") + " has formed!", hypeteend: " Hurricane " + ("HypercaneTeen").link("http://hypotheticalhurricanes.wikia.com/wiki/User:HypercaneTeen") + " has dissipated!", sjmaven: " Hurricane " + ("Sjmaven1993").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Sjmaven1993") + " has formed!", sjmavend: " Hurricane " + ("Sjmaven1993").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Sjmaven1993") + " has dissipated!", ryne: " Hurricane " + ("CycloneRyne94").link("http://hypotheticalhurricanes.wikia.com/wiki/User:CycloneRyne94") + " has formed!", ryned: " Hurricane " + ("CycloneRyne94").link("http://hypotheticalhurricanes.wikia.com/wiki/User:CycloneRyne94") + " has dissipated!", odile: " Hurricane " + ("HurricaneOdile").link("http://hypotheticalhurricanes.wikia.com/wiki/User:HurricaneOdile") + " has formed!", odile2: " Hurricane " + ("HurricaneOdile").link("http://hypotheticalhurricanes.wikia.com/wiki/User:HurricaneOdile") + " has dissipated!", collin: " Hurricane " + ("Cyclone-Snaggy123").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Cyclone-Snaggy123") + " has formed!", collind: " Hurricane " + ("Cyclone-Snaggy123").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Cyclone-Snaggy123") + " has dissipated!", collin2: " Hurricane " + ("SnaggyFTW").link("http://hypotheticalhurricanes.wikia.com/wiki/User:SnaggyFTW") + " has formed!", collin2d: " Hurricane " + ("SnaggyFTW").link("http://hypotheticalhurricanes.wikia.com/wiki/User:SnaggyFTW") + " has dissipated!", keranique: " Hurricane " + ("AGirlCalledKeranique").link("http://hypotheticalhurricanes.wikia.com/wiki/User:AGirlCalledKeranique") + " has formed!", floyd: " Hurricane " + ("StrawberryMaster").link("http://hypotheticalhurricanes.wikia.com/wiki/User:StrawberryMaster") + " has formed!", floydd: " Hurricane " + ("StrawberryMaster").link("http://hypotheticalhurricanes.wikia.com/wiki/User:StrawberryMaster") + " has dissipated!", pfm: " Hurricane " + ("PassionFruitMaster").link("http://hypotheticalhurricanes.wikia.com/wiki/User:PassionFruitMaster") + " has formed!", pfmd: " Hurricane " + ("PassionFruitMaster").link("http://hypotheticalhurricanes.wikia.com/wiki/User:PassionFruitMaster") + " has dissipated!", hh: " Hurricane " + ("HypotheticalHurricane").link("http://hypotheticalhurricanes.wikia.com/wiki/User:HypotheticalHurricane") + " has formed!", hhd: " Hurricane " + ("HypotheticalHurricane").link("http://hypotheticalhurricanes.wikia.com/wiki/User:HypotheticalHurricane") + " has dissipated!", jack: " Hurricane " + ("Leboringjack").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Leboringjack") + " has formed!", jackd: " Hurricane " + ("Leboringjack").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Leboringjack") + " has dissipated!", steve: " Hurricane " + ("Steve820").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Steve820") + " has formed!", steved: " Hurricane " + ("Steve820").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Steve820") + " has dissipated!", andrew: " Hurricane " + ("Andrew444").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Andrew444") + " has formed!", andrewd: " Hurricane " + ("Andrew444").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Andrew444") + " has dissipated!", bittersweet: " Hurricane " + ("A Bittersweet Journey").link("http://hypotheticalhurricanes.wikia.com/wiki/User:A Bittersweet Journey") + " has formed!", bittersweetd: " Hurricane " + ("A Bittersweet Journey").link("http://hypotheticalhurricanes.wikia.com/wiki/User:A Bittersweet Journey") + " has dissipated!", azure: " Hurricane " + ("AzureAzulCrash").link("http://hypotheticalhurricanes.wikia.com/wiki/User:AzureAzulCrash") + " has formed!", azured: " Hurricane " + ("AzureAzulCrash").link("http://hypotheticalhurricanes.wikia.com/wiki/User:AzureAzulCrash") + " has dissipated!", darren: " Hurricane " + ("DarrenDude").link("http://hypotheticalhurricanes.wikia.com/wiki/User:DarrenDude") + " has formed!", darrend: " Hurricane " + ("DarrenDude").link("http://hypotheticalhurricanes.wikia.com/wiki/User:DarrenDude") + " has dissipated!", destiny: " Hurricane " + ("UniversalSolo").link("http://hypotheticalhurricanes.wikia.com/wiki/User:UniversalSolo") + " has formed!", destinyd: " Hurricane " + ("UniversalSolo").link("http://hypotheticalhurricanes.wikia.com/wiki/User:UniversalSolo") + " has dissipated!", bumblebee: " Hurricane " + ("Bumblebee the transformer").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Bumblebee the transformer") + " has formed!", bumblebeed: " Hurricane " + ("Bumblebee the transformer").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Bumblebee the transformer") + " has dissipated!", rara: " Hurricane " + ("Raraahahahromaromamagagaoohlala").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Raraahahahromaromamagagaoohlala") + " has formed!", rarad: " Hurricane " + ("Raraahahahromaromamagagaoohlala").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Raraahahahromaromamagagaoohlala") + " has dissipated!", ndb: " Hurricane " + ("Not David Brown").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Not David Brown") + " has formed!", ndbd: " Hurricane " + ("Not David Brown").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Not David Brown") + " has dissipated!", austin: " Hurricane " + ("AustinD-3").link("http://hypotheticalhurricanes.wikia.com/wiki/User:AustinD-3") + " has formed!", austind: " Hurricane " + ("AustinD-3").link("http://hypotheticalhurricanes.wikia.com/wiki/User:AustinD-3") + " has dissipated!", logan: " Hurricane " + ("HiiTZLoGaN").link("http://hypotheticalhurricanes.wikia.com/wiki/User:HiiTZLoGaN") + " has formed!", logand: " Hurricane " + ("HiiTZLoGaN").link("http://hypotheticalhurricanes.wikia.com/wiki/User:HiiTZLoGaN") + " has dissipated!", jsky: " Hurricane " + ("Jskylinegtr").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Jskylinegtr") + " has formed!", jskyd: " Hurricane " + ("Jskylinegtr").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Jskylinegtr") + " has dissipated!", tornado: " Hurricane " + ("HypotheticalTornado").link("http://hypotheticalhurricanes.wikia.com/wiki/User:HypotheticalTornado") + " has formed!", tornadod: " Hurricane " + ("HypotheticalTornado").link("http://hypotheticalhurricanes.wikia.com/wiki/User:HypotheticalTornado") + " has dissipated!", puffle: " Hurricane " + ("PuffleXTREME").link("http://hypotheticalhurricanes.wikia.com/wiki/User:PuffleXTREME") + " has formed!", puffled: " Hurricane " + ("PuffleXTREME").link("http://hypotheticalhurricanes.wikia.com/wiki/User:PuffleXTREME") + " has dissipated!", trump: " Hurricane " + ("Donald Trump").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Donald Trump") + " has formed!", trumpd: " Hurricane " + ("Donald Trump").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Donald Trump") + " has dissipated!", bernie: " Hurricane " + ("Bernie Sanders").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Bernie Sanders") + " has formed!", bernied: " Hurricane " + ("Bernie Sanders").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Bernie Sanders") + " has dissipated!", kool: " Hurricane " + ("Koolturnip").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Koolturnip") + " has formed!", koold: " Hurricane " + ("Koolturnip").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Koolturnip") + " has dissipated!", hypebot: " Hurricane " + ("Hypercane Bot").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Hypercane Bot") + " has formed!", hypebotd: " Hurricane " + ("Hypercane Bot").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Hypercane Bot") + " has dissipated!", yolo: " Hurricane " + ("Heythereyolo123123123").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Heythereyolo123123123") + " has formed!", yolod: " Hurricane " + ("Heythereyolo123123123").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Heythereyolo123123123") + " has dissipated!", ef5:" Hurricane " + ("EF5tornado").link("http://hypotheticalhurricanes.wikia.com/wiki/User:EF5tornado") + " has formed!", ef5d:" Hurricane " + ("EF5tornado").link("http://hypotheticalhurricanes.wikia.com/wiki/User:EF5tornado") + " has dissipated!", h162:" Hurricane " + ("Hurricane162").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Hurricane162") + " has formed!", h162d:" Hurricane " + ("Hurricane162").link("http://hypotheticalhurricanes.wikia.com/wiki/User:Hurricane162") + " has dissipated!", sdt:" Hurricane " + ("SuperDestructiveTwiter").link("http://hypotheticalhurricanes.wikia.com/wiki/User:SuperDestructiveTwiter") + " has formed!", sdtd:" Hurricane " + ("SuperDestructiveTwiter").link("http://hypotheticalhurricanes.wikia.com/wiki/User:SuperDestructiveTwiter") + " has dissipated!", servalpro:" Hurricane " + ("ServalPRO").link("http://hypotheticalhurricanes.wikia.com/wiki/User:ServalPRO") + " has formed!", servalprod:" Hurricane " + ("ServalPRO").link("http://hypotheticalhurricanes.wikia.com/wiki/User:ServalPRO") + " has dissipated!", wb:" Hurricane " + ("WillyBilly2006").link("http://hypotheticalhurricanes.wikia.com/wiki/User:WillyBilly2006") + " has formed!", wbd:" Hurricane " + ("WillyBilly2006").link("http://hypotheticalhurricanes.wikia.com/wiki/User:WillyBilly2006") + " has dissipated!", hm:" Hurricane " + ("HurricaneMonster").link("http://hypotheticalhurricanes.wikia.com/wiki/User:HurricaneMonster") + " has formed!", hmd:" Hurricane " + ("HurricaneMonster").link("http://hypotheticalhurricanes.wikia.com/wiki/User:HurricaneMonster") + " has dissipated!", hm99:" Hurricane " + ("HurricaneMaker99").link("http://hypotheticalhurricanes.wikia.com/wiki/User:HurricaneMaker99") + " has formed!", hm99d:" Hurricane " + ("HurricaneMaker99").link("http://hypotheticalhurricanes.wikia.com/wiki/User:HurricaneMaker99") + " has dissipated!", maxf:" Hurricane " + ("MaxForce1").link("http://hypotheticalhurricanes.wikia.com/wiki/User:MaxForce1") + " has formed!", maxfd:" Hurricane " + ("MaxForce1").link("http://hypotheticalhurricanes.wikia.com/wiki/User:MaxForce1") + " has dissipated!", removekebab: "Kebab successfully removed.", VSL: "ENSO: Very Strong La Nina", SL: "ENSO: Strong La Nina", ML: "ENSO: Moderate La Nina", WL: "ENSO: Weak La Nina", NEU: "ENSO: Neutral", WE: "ENSO: Weak El Nino", ME: "ENSO: Moderate El Nino", SE: "ENSO: Strong El Nino", VSE: "ENSO: Very Strong El Nino", MKE: "ENSO: Modoki El Nino", wAMO: "AMO: Warm", cAMO: "AMO: Cold", kawaii_: ("✿(◕‿◕)✿").fontcolor("FF69B4"), kawaii: ("In ✿(◕‿◕)✿ we trust desu").fontcolor("FF69B4"), illu : (" (illu) Join us. (illu)").fontcolor("darkgreen"), plot : (" (dale_) PLOT TWIST (dale) ").fontcolor("blue"), salt: (" (illu) In Salt we Trust (illu) ").fontcolor("darkgreen"), revolution: (" (illu) THE REVOLUTION IS COMING! (illu) ").fontcolor("darkgreen"), emotes: ("-> List of all chat emotes <-").link("http://hypotheticalhurricanes.wikia.com/wiki/MediaWiki:Emoticons").fontsize(3), rules: ("-> Chat rules <-").link("http://hypotheticalhurricanes.wikia.com/wiki/Project:Guidelines#Chat_Rules").fontsize(3), };

CustomAlerts.modOnlyCmds = [ "waffles", "quiz1", "goldaccount", "fhai", "nuke", "beginchoices", "admapp", "zombies", "aj", "zj", "hkh", "gup", "puft", "stop" ]; // observer CustomAlerts.obs = new MutationObserver(function(a) {	for (var i in a) {		for (var j in a[i].addedNodes) {			var node = a[i].addedNodes[j],				isMsg = false;			try {				if ( node.nodeType == 1 && typeof $(node).attr("data-user") === "string" && !$(node).hasClass("inline-alert") && // make sure that 'CustomAlerts.implement' doesnt attempt to replace custom alerts when inserted $(node).parents.eq(1).hasClass("Chat") ) {					// this is a chat message by some user					isMsg = true;				}			} catch(err) {}			if (isMsg) {				var message = $(node).find(".message").html,					cmd = message.match(/^\!(.+)/),					user = $(node).attr("data-user");				if (cmd) {					// command pattern found					CustomAlerts.implement(node, cmd[1], user);				}			}		}	} }); // function for replacing a node CustomAlerts.implement = function(node, cmd, user) { if (CustomAlerts.cmd.hasOwnProperty(cmd)) { // command exists - replace message with inline alert if (!(CustomAlerts.modOnlyCmds.indexOf(cmd) > -1 && !mainRoom.viewUsers.model.users.findByName(user).attributes.isModerator)) { // make sure that a non-mod did not attempt to use a mod-only command var li = $(' '); $(li).attr({				"data-user": $(node).attr("data-user"),				"class": "inline-alert pseudo-inline-alert"			}).html(WikiaEmoticons.doReplacements( CustomAlerts.cmd[cmd], ChatView.prototype.emoticonMapping ));			$(node).replaceWith(li); }	} } // add css to treat continue-messages after an alert as new messages mw.util.addCSS(	'.pseudo-inline-alert + .continued {\n' +		'\tmin-height: 32px;\n' +		'\tmargin-bottom: 0;\n' +		'\tpadding-top: 18px;\n' +		'\ttop: 0;\n' +	'}\n' +	'.Chat .pseudo-inline-alert + .continued img, .pseudo-inline-alert + .continued .time {\n' +		'\tdisplay: inline;\n' +	'}\n' +	'.pseudo-inline-alert + .continued .username {\n' +		'\tdisplay: block;\n' +	'}' ); // start observing chat CustomAlerts.obs.observe(document.querySelector("#WikiaPage"), {	childList: true,	subtree: true });