diff options
author | tv <tv@nomic.retiolum> | 2013-11-06 20:45:39 +0100 |
---|---|---|
committer | tv <tv@nomic.retiolum> | 2013-11-06 20:45:39 +0100 |
commit | d9b56ed3a1e1bb8a585c26301a979f1f2993a0eb (patch) | |
tree | c2661ccba67f1beaba1c47bf021db7a9401fffc9 /webchat/hello_web.js | |
parent | 01cac2ee2e6f6394e6bd33cb63bec1103a727d11 (diff) | |
parent | 1c815ad777fadd5cfa6f54b20d4a0f02206fe7b7 (diff) |
Merge branch 'master' of https://github.com/krebscode/painload
Diffstat (limited to 'webchat/hello_web.js')
-rw-r--r-- | webchat/hello_web.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/webchat/hello_web.js b/webchat/hello_web.js index 6f658901..dd2f26e3 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'); }); }); @@ -93,11 +93,10 @@ var app = connect() res.write('<script src="sockjs-0.3.min.js"></script>'); res.write('<script src="jquery-2.0.3.min.js"></script>'); res.write('<script src="client.js"></script>'); - res.write('<div id=bg>'); + res.write('<div id=bg><div id=chatter>'); res.write('hello, this is #krebs:<br>'); - res.write('<table id="chatbox"></table>'); - res.end('<input type="text" id="input"><br>'); - res.write('</div>'); + res.write('<table id="chatbox"><tr id="foot"><td></td><td></td><td><input type="text" id="input"></td></tr></table>'); + res.end('</div></div>'); }) var server = http.createServer(options, app); |