From 2197882bc5a131ed7c877505ac66cbfa02679273 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 11 Nov 2013 18:28:25 +0100 Subject: webchat: join and quit color via css --- webchat/public/handler.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'webchat/public/handler.js') diff --git a/webchat/public/handler.js b/webchat/public/handler.js index 2f9eb2a7..4c13ba80 100644 --- a/webchat/public/handler.js +++ b/webchat/public/handler.js @@ -4,27 +4,24 @@ handler.message = function(object) { var safe_message = $('
').text(object.msg).html(); safe_message = replaceURLWithHTMLLinks(safe_message); var safe_from = $('
').text(object.nick).html(); - return chatboxAppend(safe_from, safe_message) + return chatboxAppend(safe_from, safe_message, 'msg') }; handler.join = function(object) { var safe_from = $('
').text(object.from).html(); - $(''+getCurTime()+''+safe_from+'joined').insertBefore('#foot'); $('#nicklist').append('
' + safe_from + '
') ; + return chatboxAppend(safe_from, 'joined', 'join') }; handler.quit = function(object) { var safe_from = $('
').text(object.from).html(); - $(''+getCurTime()+''+safe_from+'quit').insertBefore('#foot'); - console.log('removing', safe_from); $(getNicklistElement(safe_from)).remove(); + return chatboxAppend(safe_from, 'quit', 'quit') }; handler.nicklist = function(object) { Object.keys(object.nicklist).forEach(function (nick) { -// console.log('nick',nick); var hash_from = btoa(nick).replace(/=/g,'_'); -// $('.name').each(function (i,e) { console.log(i,e); if (e.innerHTML === 'kweb') { $(e).attr("style", "color:green") } }) $('#nicklist').append('
' + nick + '
') ; }); }; @@ -32,7 +29,7 @@ handler.nicklist = function(object) { handler.nickchange = function(object) { var safe_from = $('
').text(object.nick).html(); var safe_newnick = $('
').text(object.newnick).html(); - $(''+getCurTime()+''+safe_from+'is now known as '+object.newnick+'').insertBefore('#foot'); $(getNicklistElement(safe_from)).remove(); $('#nicklist').append('
' + safe_newnick + '
') ; + return chatboxAppend(safe_from, 'is now known as ' + safe_newnick, 'nick'); }; -- cgit v1.2.3