From 54934a67b50d9e5f7b3050bb935b1a2a6997e578 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 6 Nov 2013 15:35:20 +0100 Subject: webchat: move stuff to local_config --- webchat/hello_web.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'webchat') diff --git a/webchat/hello_web.js b/webchat/hello_web.js index 4b7595d7..155a34f3 100644 --- a/webchat/hello_web.js +++ b/webchat/hello_web.js @@ -19,7 +19,7 @@ var irc_client = new irc.Client('irc.freenode.net', 'kweb', { secure: true, userName: 'kweb', realName: 'kweb', - password: fs.readFileSync(__dirname+'/irc.key').toString(), + password: fs.readFileSync(__dirname+'/local_config/irc.key').toString(), debug: true, showErrors: true, port: 6697, @@ -73,8 +73,8 @@ conn.on('close', function() { }); var options = { - key: fs.readFileSync(__dirname+'/server_npw.key'), - cert: fs.readFileSync(__dirname+'/server.crt'), + key: fs.readFileSync(__dirname+'/local_config/server_npw.key'), + cert: fs.readFileSync(__dirname+'/local_config/server.crt'), }; var app = connect() -- cgit v1.2.3 From a7f6ce941d3001649f7b51f53783e1c2e923b2c2 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 6 Nov 2013 15:36:30 +0100 Subject: webchat: clickable links --- webchat/public/client.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'webchat') diff --git a/webchat/public/client.js b/webchat/public/client.js index 119913ae..6bcb24cd 100644 --- a/webchat/public/client.js +++ b/webchat/public/client.js @@ -1,3 +1,8 @@ +function replaceURLWithHTMLLinks(text) { + var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig; + return text.replace(exp,"$1"); +} + $(function connect() { sock = new SockJS('/echo'); @@ -10,9 +15,10 @@ $(function connect() { try { var object = JSON.parse(e.data); console.log(object.message); - var safe_message = $('
').text(object.message).html() - var safe_from = $('
').text(object.from).html() - $('#chatbox').append(''+safe_from+''+safe_message+''); + 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+''); } catch (error) { console.log(error); -- cgit v1.2.3 From 1ec3ccd40e1486541aa75da5c6d6d663ee55ffb1 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 6 Nov 2013 15:36:46 +0100 Subject: better css --- webchat/public/reset.css | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'webchat') diff --git a/webchat/public/reset.css b/webchat/public/reset.css index 91b9a438..746b81c4 100644 --- a/webchat/public/reset.css +++ b/webchat/public/reset.css @@ -30,6 +30,8 @@ footer, header, hgroup, menu, nav, section { } body { line-height: 1; + background-color: black; + color: white; } ol, ul { list-style: none; @@ -42,14 +44,17 @@ q:before, q:after { content: ''; content: none; } -x-table { +#chatbox { border-collapse: collapse; border-spacing: 0; + border: solid 2px black; + background-color: white; + color: black; } -.from { +.chat_from { font-weight: bold; text-align: right; } -.from:after { +.chat_from:after { content: ":"; } -- cgit v1.2.3 [cgit] Unable to lock slot /tmp/cgit/c4000000.lock: Permission denied (13)