Skip to content

Commit

Permalink
change structure
Browse files Browse the repository at this point in the history
  • Loading branch information
wayou committed Dec 3, 2013
1 parent e1573c8 commit 61024ff
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 11 deletions.
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz

pids
logs
results
build

node_modules
4 changes: 2 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ var app = express();
var server = require('http').createServer(app);
var io = require('socket.io').listen(server);

// server.listen(80);
server.listen(process.env.PORT || 3000);
server.listen(80); //for local test
//server.listen(process.env.PORT || 3000);//for publish to heroku

app.use("/", express.static(__dirname + '/public'));

Expand Down
Binary file modified favicon.ico
Binary file not shown.
Binary file added public/img/emoji/ghost_smile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/favicon.ico
Binary file not shown.
Binary file added public/img/ghost.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/ghost_white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 9 additions & 6 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Simple Chat</title>
<link rel="stylesheet" type="text/css" href="style.css">
<title>HiChat</title>
<link rel="stylesheet" type="text/css" href="style/app.css">
<link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon">
<link rel="icon" href="img/favicon.ico" type="image/x-icon">
<script type="text/javascript" src="/socket.io/socket.io.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript" src="chat.js"></script>
<script type="text/javascript" src="js/hichat.js"></script>
</head>
<body>
<div id="wrapper">
<h1>Simple Chat</h1>
<h1>HiChat</h1>
<div id="messages"></div>
<div class="nic">
Your Name
Expand All @@ -18,10 +20,11 @@ <h1>Simple Chat</h1>
<textarea id="message"></textarea>
<input id="send" type="submit" value="Send"/>
</div>
<footer>Wayou-a web programmer who has free time | <a href="mailto:[email protected]" target="_blank">[email protected]</a></footer>
<script type="text/javascript">
$(document).ready(function() {
// Chat.initialize('http://localhost/');
Chat.initialize('http://hichat.herokuapp.com/');
hiChat.initialize('http://localhost/');//for localhost test
//hiChat.initialize('http://hichat.herokuapp.com/');//for publish
});
</script>
</body>
Expand Down
6 changes: 3 additions & 3 deletions public/chat.js → public/js/hichat.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
//Create a chat module to use.
(function () {
window.Chat = {
window.hiChat = {
socket : null,

initialize : function(socketURL) {
this.socket = io.connect(socketURL);

//Send message on button click or enter
$('#send').click(function() {
Chat.send();
hiChat.send();
});

$('#message').keyup(function(evt) {
if ((evt.keyCode || evt.which) == 13) {
Chat.send();
hiChat.send();
return false;
}
});
Expand Down
File renamed without changes.

0 comments on commit 61024ff

Please sign in to comment.