MediaWiki:Chat.js

//Switch to night button var night_button = 'Nightime'; //Switch to day button var day_button = 'Daytime';

// //Color scheme for NIGHT Chat // //Link color var linkColor = '#fce300';

//All text Color var textColor = '#FFFFFF';

//Self text background color var selfTextColor = '#2B2B2B';

//Chat background color var backgroundColor = '#8404B3';

//Chat foreground color var foregroundColor = '#171717';

//User stats foreground color var userStatsColor = '#2B2B2B'; //END NIGHT Chat color scheme

$(function {	$('#ChatHeader .public.wordmark').prepend(' '+chatTopic+' ')	.find('a').attr('style','position:relative;text-decoration:underline;') }) $('#ChatHeader .public.wordmark div:not(:first-child)').remove // Change mod icons depending on the time // Written by Foodbandlt function nighttime_moon{ var night = new Date; var nighthour=night.getHours; if (nighthour >= 19 || nighthour <= 7){ $(".User.chat-mod .username").removeClass("modday"); $(".User.chat-mod .username").addClass("modnight"); }else{ $(".User.chat-mod .username").removeClass("modnight"); $(".User.chat-mod .username").addClass("modday"); } if ($('.User').size > 2){ $('.Rail .public .chevron').css("display", "block"); $('.Rail .public .chevron.closed').css("display", "block"); } setTimeout("nighttime_moon", 10*60*1000); } nighttime_moon; //Day and night color schemes //Written by Foodbandlt

function addDayStyle{ var styleElementDay = document.createElement('style'); styleElementDay.setAttribute("id", "day"); styleElementDay.innerHTML='body{background-color: '+backgroundColorDay+';}.username, .message, div.chattopic, .info .edits, .UserStatsMenu .info .since, #ChatHeader h1.private, .Write [name="message"]{color: '+textColorDay+';}.WikiaPage, .UserStatsMenu, .ChatHeader, .Write [name="message"]{background-color: '+foregroundColorDay+';}.Chat .you{background: '+selfTextColorDay+';}a{color: '+linkColorDay+';}.UserStatsMenu .info{background-color:'+userStatsColorDay+';}'; $('head').append(styleElementDay); }

function addNightStyle{ var styleElement = document.createElement('style'); styleElement.setAttribute("id", "night"); styleElement.innerHTML='body{background-color: '+backgroundColor+';}.username, .message, div.chattopic, .info .edits, .UserStatsMenu .info .since, #ChatHeader h1.private, .Write [name="message"]{color: '+textColor+';}.WikiaPage, .UserStatsMenu, .ChatHeader, .Write [name="message"]{background-color: '+foregroundColor+';}.Chat .you{background: '+selfTextColor+';}a{color: '+linkColor+';}.UserStatsMenu .info{background-color:'+userStatsColor+';}'; $('head').append(styleElement); }

function addDayNightButton{

$(''+night_button+' ').prependTo('.Rail'); if ($('style#night').size < 1 && $('style#nightUser').size < 1){ addDayStyle; } }

function day_night(which){ if (which == "night"){ $('style#day').remove; $('.Rail .day-night-div .day-night-button').text(day_button);

addNightStyle;

}else{ $('style#night').remove; $('.Rail .day-night-div .day-night-button').text(night_button);

addDayStyle; } }

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-button').text == ""){ addDayNightButton; } while ($('.Rail .day-night-div').size > 1){ $('.WikiaPage .Rail div:last-child').remove }