MediaWiki:Chat.js

importArticles({   type: 'script',    articles: [        'u:runescape:User:Joeytje50/tabinsert.js', //Tab Insert        'u:dev:AjaxEmoticons/code.js', //AjaxEmoticons (so users don't have to refresh the chat to see the latest emoticons)        'u:dev:ChatAnnouncements/code.js', //ChatAnnouncements (so that chat mods can make custom chat announcements within the chat)        'u:dev:ChatTags/code.js',        'u:dev:!mods/code.js',        'u:dev:ChatOptions/code.js',        'u:dev:!kick/code.js'    ] });

/* Add Buttons */ function addButtons { if ($('#chatOptionsButton').length === 0) { setTimeout(addButtons, 250); } else if ($('.chat-button').length === 0) { $('#chatOptionsButton').after(dayNightButton, clearChatText); } }

/* Clear chat */ function clearChatText { var $clearDiv = $(' ').addClass('chat-button'); var $clearLink = $('').addClass('wikia-button').text('Clear chat'); $clearDiv.html($clearLink); $clearLink.click(function {       $('.Chat li').remove;    }); return $clearDiv; }

/* Day/Night Switch Feature */ function dayNightButton {   var dayText = 'Day theme'; var nightText = 'Night theme'; var $dayNightButton = $(' ').addClass('chat-button'); var $dayNightLink = $('').addClass('wikia-button').text(dayText); var $body = $('body'); $dayNightButton.html($dayNightLink); $dayNightLink.click(function {       $body.toggleClass('day');        $body.toggleClass('night');        $(this).text(function(index, text) { return text === dayText ? nightText : dayText; });   });    $body.addClass('night'); return $dayNightButton; }

window.onload = addButtons; //Chat's topic. Remember to escape single quotes in the topic using \' to prevent this from breaking. var chatTopic = 'Welcome to the Steven Universe Wiki chat. Please read the rules before chatting.'; $(function { $('#ChatHeader .public.wordmark').prepend(''+chatTopic+' ') .find('a').attr('style','position:relative;text-decoration:none;'); }); $('#ChatHeader .public.wordmark div:not(:first-child)').remove;

/*Removed hilites for now, needs to be moved to CSS*/