User:Klonoamiyumi/chat.js

Features *  HTML in chat (Duh!) * * Supported tags: *   *    *    *    *    *   (for User:AnimatedCartoons, administrators, chat moderators, helpers, staff, and VSTF members only) *   *   (for User:AnimatedCartoons, administrators, chat moderators, helpers, staff, and VSTF members only) *   */ "use strict"; if (mediaWiki.config.get('wgServer') === 'http://theamazingworldofgumball.wikia.com' && mediaWiki.config.get('wgSiteName') === 'The Amazing World of Gumball Wiki') { // Bug fix $('.Chat li:not(.inline-alert)').remove;

// HTML in chat setInterval(function {        $('.Chat .message:contains("<audio"):contains(" "), .Chat .message:contains("<blockquote"):contains(" "), .Chat .message:contains("<div"):contains(" "), .Chat .message:contains("<object"):contains("<object"), .Chat .message:contains("<pre"):contains(" "), .Chat .message:contains("<span"):contains(" "), .Chat .message:contains("<video"):contains(" ")').each(function  { $(this).replaceWith(' ' + $(this).text + ' '); });

$('.Chat .message:contains("<script"):contains(" "), .Chat .message:contains("<style"):contains(" ")').each(function {            $(this).replaceWith($(this).text);        }); }, 1);

if (mediaWiki.config.get('wgUserName') !== 'AnimatedCartoons' || !mediaWiki.config.get('wgUserGroups').indexOf('chatmoderator') || !mediaWiki.config.get('wgUserGroups').indexOf('helper') || !mediaWiki.config.get('wgUserGroups').indexOf('sysop') || !mediaWiki.config.get('wgUserGroups').indexOf('staff') || !mediaWiki.config.get('wgUserGroups').indexOf('vstf')) { $('.Write [name="message"]').keypress(function (e) {           if (e.which === 13) {                this.value = this.value.replace(/ |<\/script>|<\/style>|<\/style>/gi, '');            }        }); } }