Skip to content

Commit

Permalink
Working chat room.
Browse files Browse the repository at this point in the history
  • Loading branch information
firesock committed Nov 11, 2012
0 parents commit e728e4b
Show file tree
Hide file tree
Showing 552 changed files with 210,408 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*~
7 changes: 7 additions & 0 deletions client/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<html>
<head>
</head>
<body>
404
</body>
</html>
16 changes: 16 additions & 0 deletions client/css/client.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
textarea#channel_box {
top: 50%;
width: 100%;
height: 40%;
}

input#text_input {
width: 100%;
top: 90%;
height: 10%;
}

div#content {
margin-left: 20%;
margin-right: 20%;
}
16 changes: 16 additions & 0 deletions client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="/css/client.css" />
<script src="/socket.io/socket.io.js"></script>
<script src="/js/jquery-1.8.2.min.js"></script>
<script src="/js/client.js"></script>
</head>
<body>
<div id="content">
<textarea id = "channel_box"></textarea>
<input id = "text_input"></input>
</div>
</body>
</html>
21 changes: 21 additions & 0 deletions client/js/client.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
var socket = io.connect('http://localhost:8000');

socket.on('join', function (data) {
$('#channel_box').text('Name: ' + data.name + '\n');
});

$(document).keypress(function(e) {
if (e.which == 13) {
socket.emit('say', {msg: $('#text_input').val()});
$('#text_input').val('');
}
});

socket.on('msg', function(data) {
$('#channel_box').append(data.msg + '\n');
});


$(document).ready(function() {
$('#text_input').focus();
});
2 changes: 2 additions & 0 deletions client/js/jquery-1.8.2.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions node_modules/.bin/static

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions node_modules/node-static/.npmignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions node_modules/node-static/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

179 changes: 179 additions & 0 deletions node_modules/node-static/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions node_modules/node-static/benchmark/node-static-0.3.0.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e728e4b

Please sign in to comment.