Skip to content

Commit

Permalink
new launcher app is server.js
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismatthieu committed Mar 30, 2011
1 parent 3f9e4a5 commit 01f1724
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 221 deletions.
2 changes: 1 addition & 1 deletion README
Expand Up @@ -2,7 +2,7 @@ CHATS.iO (fork of https://github.com/chrismatthieu/CHATS.iO)
---------------------

!! You need the latest node.js !!
node server-io.js
node server.js

Change the entry in client-io.js to listen on port 8764 (it may be there currently, I'm not keeping track).

Expand Down
3 changes: 2 additions & 1 deletion client-io.html
Expand Up @@ -14,6 +14,7 @@
<link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>

<link rel="stylesheet" type="text/css" href="/client-io.css">
<link REL="SHORTCUT ICON" HREF="/public/favicon.ico">

</head>
<body>
Expand All @@ -29,7 +30,7 @@
<audio id="audio_new_pm" src="/audio/new_pm.mp3" preload="auto"></audio>
<audio id="audio_msg" src="/audio/sound.mp3" preload="auto"></audio>

<div id="rooms"><ul></ul> &nbsp; <p align="right">Chat commands: /nick your_nick, /join a_new_room, /leave</p></div>
<div id="rooms"><ul></ul> &nbsp; <p align="right">Chat commands: /nick your_name, /join a_new_room, /leave</p></div>

</body>
</html>
20 changes: 18 additions & 2 deletions client-io.js
Expand Up @@ -65,13 +65,16 @@ socket.on('message', function(message){
rooms[id]["to"] = message.name;
updateTitle("[PM] ");
var fname = message.name.split("~")[0];
try { $("#audio_new_pm")[0].play(); } catch(e) {}
try { $("#audio_new_pm")[0].play(); } catch(e) {}
// play('new_pm');
$('#rooms ul:first-child').append("<li class='pm' id='r_" + id + "'>@" + fname + "</li>");
addNewRoom(id);
room = id;
}
if(text != "") {
try { $("#audio_msg")[0].play(); } catch(e) {}
// play('sound');

if(rooms[id]["last_user"] != message.toname) {
var date = new Date(),
hour = date.getHours(),
Expand Down Expand Up @@ -102,6 +105,8 @@ socket.on('message', function(message){
}
else { // Normal message
try { $("#audio_msg")[0].play(); } catch(e) {}
// play('sound');

if(rooms[message.room]["last_user"] != message.from) {
var date = new Date(),
hour = date.getHours(),
Expand Down Expand Up @@ -453,4 +458,15 @@ $(window).keydown(function(e) {
}
return false;
}
});
});

// function play(sound, repeat){
// var audio = new Audio("/audio/" + sound + ".mp3");
//
// if(repeat){
// audio.loop = true;
// }
// audio.play();
//
// return audio;
// }
Binary file added public/favicon.ico
Binary file not shown.
217 changes: 0 additions & 217 deletions server-io.js

This file was deleted.

2 changes: 2 additions & 0 deletions server.js
Expand Up @@ -113,6 +113,8 @@ var httpServer = http.createServer(function(req, res) {
});

httpServer.listen(80);
// httpServer.listen(8764);


var socket = io.listen(httpServer);

Expand Down

0 comments on commit 01f1724

Please sign in to comment.