User:Annabeth and Percy/chat.js

importScriptPage('MediaWiki:ChatOptions/code.js', 'dev');

importArticles({   type: 'script',    articles: [        'u:dev:ChatSendButton.js'    ] });

importScriptPage('SpeedEmoticon/latest.js', 'korniux');

var chatags = { images: true, videos: true }; importScriptPage('MediaWiki:ChatTags/code.js', 'shining-armor');

importScriptPage('ChatTimestamps/code.js','dev');

importScriptPage('LightBlock/code.js', 'dev');

importScriptPage('MediaWiki:PrivateMessageAlert/code.js', 'dev'); var beepSound = 'http://soundbible.com/grab.php?id=1645&type=mp3'; var desktopNotifications = true;

(function {	if (mw.config.get('wgCanonicalSpecialPageName') !== 'Chat') return

function z(a, b) { var d = x if (b === 1) { if (d.indexOf(a) === -1) { d.push(a) $('li[data-user="' + a + '"]').hide y(d) }		} else if (b === 2) { if (d.indexOf(a) > -1) { d.pop(d.indexOf(a)) $('li[data-user="' + a + '"]').show y(d) }		} else if (b === 3) { $('.Chat ul').append('' + d.join(', ') + '') }	}

function y(a) { localStorage.setItem('mute', JSON.stringify(a)) }

function x { return JSON.parse(localStorage.getItem('mute') || '[]') }

$('textarea[name=message]').keypress(function(e) {		if (e.which == 13) {			var a = $(this).val,				b = a.substr(1, a.length),				c = b.split(' '),				d = b.split(' ');				d.shift				d = d.join(' ')			if (a[0] === '/' && a[1] + a[2] !== 'me') {				e.preventDefault				$(this).val()				if (c[0] === 'mute') {					z(d, 1)				} else if (c[0] === 'unmute') {					z(d, 2)				} else if (c[0] === 'list') {					z(, 3)				}			}		}	})

window.mainRoom.model.chats.bind('afteradd', function {		var a = x,			i = 0;		for (i; i < a.length; i++) {			$('li[data-user="' + a[i] + '"]').hide		}	}) });