MediaWiki:Chat.js

// Heading var heading = 'Welcome to Nitrome Towers!'; $(function {    $('#ChatHeader .public.wordmark').prepend(' ' + heading + ' ').find('a').attr('style', 'position:relative;text-decoration:underline;'); }); $('#ChatHeader .public.wordmark div:not(:first-child)').remove;

// Credits to the My Little Pony Friendship is Magic Wiki /* Night mode Modified by AnimatedCartoons Original code (http://mlp.wikia.com/wiki/MediaWiki:Chat.js) written by Foodbandlt */ var night_button = 'Switch to Night Chat'; var day_button = 'Switch to Day Chat'; var linkColorDay = '#15B2A3'; var textColorDay = '#3A3A3A'; var selfTextColorDay = '#F5F5E6'; var backgroundColorDay = '#F1F1F1'; var foregroundColorDay = '#FFFFF0'; var userStatsColorDay = '#D0EFE0'; var linkColor = '#02A4F7'; var textColor = '#C5C5C5'; var selfTextColor = '#0A0A19'; var backgroundColor = '#00000F'; var foregroundColor = '#00000F'; var userStatsColor = '#00000F'; function addDayStyle { var styleElementDay = document.createElement('style'); styleElementDay.setAttribute("id", "day"); styleElementDay.innerHTML = 'body{background: ' + backgroundColorDay + ';}.username, .message, div.chattopic, .info .edits, .UserStatsMenu .info .since, #ChatHeader h1.private, .Write [name="message"], .label, .Chat .username:after{color: ' + textColorDay + ';}.WikiaPage, #WikiaPage, .UserStatsMenu, .ChatHeader, .Write [name="message"], .Write .message, .Write, .Rail, .Chat{background: ' + foregroundColorDay + '; background-color: ' + foregroundColorDay + ';}.Chat .you{background: ' + selfTextColorDay + ';}a{color: ' + linkColorDay + ';}.UserStatsMenu .info{background:' + userStatsColorDay + ';}'; $('head').append(styleElementDay); } function addNightStyle { var styleElement = document.createElement('style'); styleElement.setAttribute("id", "night"); styleElement.innerHTML = 'body{background: ' + backgroundColor + ';}.username, .message, div.chattopic, .info .edits, .UserStatsMenu .info .since, #ChatHeader h1.private, .Write [name="message"], .label, .Chat .username:after{color: ' + textColor + ';}.WikiaPage, #WikiaPage, .UserStatsMenu, .ChatHeader, .Write [name="message"], .Write .message, .Write, .Rail, .Chat{background: ' + foregroundColor + '; background-color: ' + foregroundColor + ';}.Chat .you{background: ' + selfTextColor + ';}a{color: ' + linkColor + ';}.UserStatsMenu .info{background:' + userStatsColor + ';}'; $('head').append(styleElement); } function addDayNightButton { if ($('.day-night-div').size == 0) { $('' + night_button + ' ').prependTo('.Rail'); }   if ($('style#night').size == 0 && $('style#nightUser').size == 0) { addDayStyle; } } function day_night(which) { if (which == "night") { $('style#day').remove; $('.Rail .day-night-div .day-night-button').text(day_button); addNightStyle; clearInterval(test); } else { $('style#night').remove; $('.Rail .day-night-div .day-night-button').text(night_button); addDayStyle; clearInterval(test); } } function switch_view { if ($('.Rail .day-night-div .day-night-button').text == night_button) { day_night("night"); } else { day_night("day"); } } if ($('.Rail .day-night-div').size == 0) { addDayNightButton; } while ($('.Rail .day-night-div').size > 1) { $('.WikiaPage .Rail div:last-child').remove;