MediaWiki:Chat.js

/* Tab Insert */

importScriptPage('User:Joeytje50/tabinsert.js', 'runescape');

//Chat's topic. Remember to escape single quotes in the topic using \' to prevent this from breaking. var chatTopic = '         Welcome to the Clone Wars Adventures Character wiki Chat!' $(function {	$('#ChatHeader .public.wordmark').prepend(''+chatTopic+' ')	.find('a').attr('style','position:relative;text-decoration:underline;') })

//Switch to night button var night_button = 'Switch to Default Chat'; //Switch to day button var day_button = 'Switch to Grid Chat';

// //Color scheme for DAY Chat // //Link color var linkColorDay = '#94E1FB'; //All text Color var textColorDay = '#FFFFFF'; //Self text background color var selfTextColorDay = '#0A2C51'; //Chat background color var backgroundColorDay = '#050210'; //Chat foreground color var foregroundColorDay = 'url("http://images2.wikia.nocookie.net/__cb20120403001138/clonewarsadventurescharacter/images/6/60/Grid.png")'

//User stats foreground color var userStatsColorDay = '#0f50B0'; //END DAY Chat color scheme

// //Color scheme for Night Chat // //Link color var linkColor = '#94E1FB';

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

//Self text background color var selfTextColor = '#143457';

//Chat background color var backgroundColor = '#071427';

//Chat foreground color var foregroundColor = '#0A2C51';

//User stats foreground color var userStatsColor = '#3B4940';

//END Night Chat color scheme //Day and night color schemes //Written by Foodbandlt

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"]{color: '+textColorDay+';}.WikiaPage, .UserStatsMenu, .ChatHeader, .Write [name="message"]{background: '+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"]{color: '+textColor+';}.WikiaPage, .UserStatsMenu, .ChatHeader, .Write [name="message"]{background: '+foregroundColor+';}.Chat .you{background: '+selfTextColor+';}a{color: '+linkColor+';}.UserStatsMenu .info{background:'+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 }