User:KCCreations/chat.js

//Took the following two code bits from User:Sophiedp, who I believe took them from User:Shining-Armor //Note that the first one has been modified to suit my needs $('[name="message"]').keypress(function (e) {   if (e.which == 32 || e.which == 13) {        switch (this.value) {        case '/rules':            this.value = 'The Community Central chat rules can be found here.';            break;        case '/changeusername':            this.value = 'You can request to change your username via Special:Contact/rename-account.';            break;        case '/changewikiname':            this.value = 'You can request to change your wiki\'s name or URL via Special:Contact/wiki-name-change.';            break;        case '/monstercat':            this.value = 'Monstercat is a Canadian electronic music record label from Vancouver. If you want to know more, go on Wikipedia or the wiki because I don\'t want to flood the chat.';            break;            case '/emotes':            this.value = 'The full list of emoticons here can be found at MediaWiki:Emoticons.'; break; case '/tou': this.value = 'Wikia\'s Terms of Use can be found here.'; break; case '/flight': this.value = 'https://www.youtube.com/watch?v=OVMuwa-HRCQ'; break; }   } });

$('[name="message"]').keypress(function (e) {   if (e.which == 13) {        var test = "/google";        if (this.value.indexOf(test) > -1 && this.value.indexOf(test) < 8) {            var query = this.value.replace('/google ', '');            var query = query.replace(/ /g, "+");            this.value = "http://www.lmgtfy.com/?q=" + query        }    } });

var beepSound = 'http://vignette1.wikia.nocookie.net/test-z/images/c/cf/Ping.ogg';

// Script imports window.importArticles( { type: 'script',  articles: [    'u:dev:MediaWiki:ChatOptions/code.js',    'u:dev:MediaWiki:ChatTimestamps/code.js',    "u:dev:MediaWiki:PrivateMessageAlert/code.js"  ] });