Skip to content

Commit 61024ff

Browse files
committed
change structure
1 parent e1573c8 commit 61024ff

File tree

10 files changed

+29
-11
lines changed

10 files changed

+29
-11
lines changed

Diff for: .gitignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
lib-cov
2+
*.seed
3+
*.log
4+
*.csv
5+
*.dat
6+
*.out
7+
*.pid
8+
*.gz
9+
10+
pids
11+
logs
12+
results
13+
build
14+
15+
node_modules

Diff for: app.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ var app = express();
33
var server = require('http').createServer(app);
44
var io = require('socket.io').listen(server);
55

6-
// server.listen(80);
7-
server.listen(process.env.PORT || 3000);
6+
server.listen(80); //for local test
7+
//server.listen(process.env.PORT || 3000);//for publish to heroku
88

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

Diff for: favicon.ico

0 Bytes
Binary file not shown.

Diff for: public/img/emoji/ghost_smile.png

2.18 KB
Loading

Diff for: public/img/favicon.ico

1.12 KB
Binary file not shown.

Diff for: public/img/ghost.png

8.68 KB
Loading

Diff for: public/img/ghost_white.png

12 KB
Loading

Diff for: public/index.html

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
<!DOCTYPE HTML>
22
<html>
33
<head>
4-
<title>Simple Chat</title>
5-
<link rel="stylesheet" type="text/css" href="style.css">
4+
<title>HiChat</title>
5+
<link rel="stylesheet" type="text/css" href="style/app.css">
6+
<link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon">
7+
<link rel="icon" href="img/favicon.ico" type="image/x-icon">
68
<script type="text/javascript" src="/socket.io/socket.io.js"></script>
79
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
8-
<script type="text/javascript" src="chat.js"></script>
10+
<script type="text/javascript" src="js/hichat.js"></script>
911
</head>
1012
<body>
1113
<div id="wrapper">
12-
<h1>Simple Chat</h1>
14+
<h1>HiChat</h1>
1315
<div id="messages"></div>
1416
<div class="nic">
1517
Your Name
@@ -18,10 +20,11 @@ <h1>Simple Chat</h1>
1820
<textarea id="message"></textarea>
1921
<input id="send" type="submit" value="Send"/>
2022
</div>
23+
<footer>Wayou-a web programmer who has free time | <a href="mailto:[email protected]" target="_blank">[email protected]</a></footer>
2124
<script type="text/javascript">
2225
$(document).ready(function() {
23-
// Chat.initialize('http://localhost/');
24-
Chat.initialize('http://hichat.herokuapp.com/');
26+
hiChat.initialize('http://localhost/');//for localhost test
27+
//hiChat.initialize('http://hichat.herokuapp.com/');//for publish
2528
});
2629
</script>
2730
</body>

Diff for: public/chat.js renamed to public/js/hichat.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
//Create a chat module to use.
22
(function () {
3-
window.Chat = {
3+
window.hiChat = {
44
socket : null,
55

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

99
//Send message on button click or enter
1010
$('#send').click(function() {
11-
Chat.send();
11+
hiChat.send();
1212
});
1313

1414
$('#message').keyup(function(evt) {
1515
if ((evt.keyCode || evt.which) == 13) {
16-
Chat.send();
16+
hiChat.send();
1717
return false;
1818
}
1919
});

Diff for: public/style.css renamed to public/style/app.css

File renamed without changes.

0 commit comments

Comments
 (0)