FANDOM


This Forum has been archived

Visit the new Forums
Forums: Index General Discussion "Night Chat"?
FANDOM's forums are a place for the community to help other members.
To contact staff directly or to report bugs, please use Special:Contact.

50px-Replacement filing cabinet.svg

Note: This topic has been unedited for 3014 days. It is considered archived - the discussion is over. Do not add to unless it really needs a response.


Um, sorry for bothering y'all, but does anyone know how to do something like Night Chat on the My Little Pony wiki? I'd like to implement the feature to my wiki, though I'm not sure how.. Thanks in advance! Shinigami CHOP! 01:48, June 30, 2012 (UTC)

What do you mean by "Night Chat"? How is it supposed to work? -- Sam Wang (talk) 03:20, June 30, 2012 (UTC)
If you mean "Chat", its in the Admin Dashboard. "Turn on or off a feature" — UltimateSupreme2212-3.png(T@lk) 04:14, June 30, 2012 (UTC)
As far as I'm aware, the "night chat" script gives users an option to make a chat be of a darker, more "night-like" color. The following JavaScript code is what the My Little Pony Wiki uses to allow change between "day" and "night":
//Switch to night button
var night_button = 'Switch to Night Chat';
 
//Switch to day button
 
var day_button = 'Switch to Day Chat';
 
 
//
//Color scheme for DAY Chat
//
  //Link color
    var linkColorDay = '#006CB0';
 
  //All text Color
    var textColorDay = '#000000';
 
  //Self text background color
    var selfTextColorDay = '#f5f5f5';
 
  //Chat background color
    var backgroundColorDay = '#e1e8f2';
 
  //Chat foreground color
    var foregroundColorDay = '#FFFFFF';
 
  //User stats foreground color
    var userStatsColorDay = '#cce1ef';
 
//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 = '#658DFF';
 
  //Chat background color
    var backgroundColor = '#050210';
 
  //Chat foreground color
    var foregroundColor = '#6265BB';
 
  //User stats foreground color
    var userStatsColor = '#0f50B0';
 
//END NIGHT Chat color scheme
 
// 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){
  if ($('.User.chat-mod .username').hasClass("modday")){
  $(".User.chat-mod .username").removeClass("modday");
  $(".User.chat-mod .username").addClass("modnight");
  }else{
  $(".User.chat-mod .username").addClass("modnight");
  }
 }else{
  if ($('.User.chat-mod .username').hasClass("modnight")){
  $(".User.chat-mod .username").removeClass("modnight");
  $(".User.chat-mod .username").addClass("modday");
  }else{
  $(".User.chat-mod .username").addClass("modday");
  }
 }
 
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: '+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(){
 
 if ($('.day-night-div').size() == 0){
 $('<div class="day-night-div" onclick="switch_view()"><a class="day-night-button wikia-button">'+night_button+'</a></div>').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();
 
}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-div').size() == 0){
addDayNightButton();
}

--Dser (wall | email) 05:15, 6/30/2012

This also means that you'll need to find their method through which they implement this code from MediaWiki:Chat.js to chat itself. Usually, a MediaWiki message always visible in chat is modified by adding an element that executes it upon being loaded. TK999 11:27, June 30, 2012 (UTC)
Community content is available under CC-BY-SA unless otherwise noted.