Change the Colour of Away Users
(Versions 1.6+)This Plug In will allow you to style the usernames of users who are "away" in the chatbox differently to everyone else. So you can dull them out, or make them a different colour, or make them italic or anything you like.
Start by installing this Javascript plug in, it's all laid out nicely so you can read and understand how AWC plug ins work, so you can maybe develop your own:
- Code:
(function(awc){
awc.add_event('onload', function() {
avacweb_chat.away_list = {};
});
awc.user_hook.push(function(row, username, userid) {
var away_list = $('.away', avacweb_chat.id('chatbox_members'))[0], id = 'u' + userid;
if(away_list && away_list.nextSibling.innerHTML.indexOf(row.innerHTML) !== -1) {
avacweb_chat.away_list[id] = 1;
row.getElementsByTagName('a')[0].className = 'away-user';
}
else {
delete avacweb_chat.away_list[id];
}
});
awc.message_hook.push(function(row, username, uid) {
if('u' + uid in avacweb_chat.away_list) {
row.getElementsByTagName('a')[0].className = 'away-user';
}
});
})(avacweb_chat_config);
This will mean a class of 'away-user' is given to users who are away. So you can then style it in the CSS with: [ic].away-user { color: blue; }[/ic] or whatever you'd like to do with it.
The away color will not overwrite the group color. If you want it to, let me know below.