From 79ce309b9ec09a76506db28e8f1eb9a942bd2429 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 6 Nov 2013 19:03:30 +0100 Subject: webchat: renamed name to origin --- webchat/hello_web.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'webchat') diff --git a/webchat/hello_web.js b/webchat/hello_web.js index 6f658901..45f6fc56 100644 --- a/webchat/hello_web.js +++ b/webchat/hello_web.js @@ -49,8 +49,8 @@ var echo = sockjs.createServer(); echo.on('connection', function(conn) { var origin = '['+conn.remoteAddress+':'+conn.remotePort+']'; Clients.push(conn); - irc_client.say("#krebs", name + ' has joined'); Clients.broadcast({from: 'system', message: origin + ' has joined'}) + irc_client.say("#krebs", origin + ' has joined'); conn.write(JSON.stringify({from: 'system', message: 'hello'})) conn.on('data', function(data) { console.log('data:',data); @@ -73,8 +73,8 @@ echo.on('connection', function(conn) { }); conn.on('close', function() { Clients.splice(Clients.indexOf(conn)); - irc_client.say("#krebs", name + ' has quit'); Clients.broadcast({from: 'system', message: origin + ' has quit'}) + irc_client.say("#krebs", origin + ' has quit'); }); }); -- cgit v1.2.3 From bbab9d41b9574d65506d4b6cf73371e52b6026e9 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 6 Nov 2013 19:04:07 +0100 Subject: webchat: better style --- webchat/public/reset.css | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'webchat') diff --git a/webchat/public/reset.css b/webchat/public/reset.css index 46b52478..17e10567 100644 --- a/webchat/public/reset.css +++ b/webchat/public/reset.css @@ -47,16 +47,17 @@ q:before, q:after { #chatbox { border-collapse: collapse; border-spacing: 0; - border: solid 2px black; - background-color: white; - color: black; + background-color: black; + color: white; } .chat_from { + color:grey; font-weight: bold; text-align: right; } .chat_from:after { content: ":"; + padding-right: 6px; } #bg { background-image: url(krebs.png); @@ -66,3 +67,6 @@ q:before, q:after { left: 0; right: 0; } +a { + color: red; +} -- cgit v1.2.3 From af3a5da71316c355de04e64a5a34d4fc1856220e Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 6 Nov 2013 19:07:32 +0100 Subject: webchat: border around chatbox --- webchat/public/reset.css | 1 + 1 file changed, 1 insertion(+) (limited to 'webchat') diff --git a/webchat/public/reset.css b/webchat/public/reset.css index 17e10567..c291544d 100644 --- a/webchat/public/reset.css +++ b/webchat/public/reset.css @@ -49,6 +49,7 @@ q:before, q:after { border-spacing: 0; background-color: black; color: white; + border: 5px solid black; } .chat_from { color:grey; -- cgit v1.2.3 From aec1b767fd0223029332b14e5834c555efc345ff Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 6 Nov 2013 20:24:26 +0100 Subject: webchat: better layout --- webchat/hello_web.js | 7 +++---- webchat/public/client.js | 2 +- webchat/public/reset.css | 26 ++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 5 deletions(-) (limited to 'webchat') diff --git a/webchat/hello_web.js b/webchat/hello_web.js index 45f6fc56..dd2f26e3 100644 --- a/webchat/hello_web.js +++ b/webchat/hello_web.js @@ -93,11 +93,10 @@ var app = connect() res.write(''); res.write(''); res.write(''); - res.write('
'); + res.write('
'); res.write('hello, this is #krebs:
'); - res.write('
'); - res.end('
'); - res.write('
'); + res.write('
'); + res.end('
'); }) var server = http.createServer(options, app); diff --git a/webchat/public/client.js b/webchat/public/client.js index 95b67ad0..e13ab1f7 100644 --- a/webchat/public/client.js +++ b/webchat/public/client.js @@ -26,7 +26,7 @@ $(function connect() { var safe_message = $('
').text(object.message).html(); safe_message = replaceURLWithHTMLLinks(safe_message); var safe_from = $('
').text(object.from).html(); - $('#chatbox').append(''+safe_from+''+safe_message+''); + $(''+(new Date).getHours() + ':' + (new Date).getMinutes() + ':' + (new Date).getSeconds()+''+safe_from+''+safe_message+'').insertBefore('#foot'); } catch (error) { console.log(error); diff --git a/webchat/public/reset.css b/webchat/public/reset.css index c291544d..2b67f153 100644 --- a/webchat/public/reset.css +++ b/webchat/public/reset.css @@ -21,6 +21,7 @@ time, mark, audio, video { border: 0; font-size: 100%; font: inherit; + font-family: monospace; vertical-align: baseline; } /* HTML5 display-role reset for older browsers */ @@ -50,11 +51,21 @@ q:before, q:after { background-color: black; color: white; border: 5px solid black; + width: 100%; + height:100%; + opacity: 0.8; +} +#input{ + width: 100%; + background-color: black; + border: 1px solid black; + color: white; } .chat_from { color:grey; font-weight: bold; text-align: right; + font-size:12px; } .chat_from:after { content: ":"; @@ -68,6 +79,21 @@ q:before, q:after { left: 0; right: 0; } +#chatter { + width: 75%; +} +.chat_date,.chat_from,.chat_msg{ +} +.chat_msg{ + width: 100%; +} a { color: red; } +.chat_date { + color: green; +} +.chat_date:after { + content: ""; + padding-right: 4px; +} \ No newline at end of file -- cgit v1.2.3