Skip to content

Commit

Permalink
merged
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismatthieu committed Mar 20, 2011
2 parents a18cfe6 + 2f3ce78 commit bd7e23f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
Binary file added audio/new_pm.mp3
Binary file not shown.
Binary file added audio/sound.mp3
Binary file not shown.
4 changes: 2 additions & 2 deletions client-io.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
</div>


<audio id="audio_new_pm" src="/audio/new_pm.wav" preload="auto"></audio>
<audio id="audio_msg" src="/audio/sound.wav" preload="auto"></audio>
<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">Commands: /nick your_nick, /join a_new_room, /leave, <a href="/about.html" target="_blank">About Us</a></p></div>

Expand Down
2 changes: 1 addition & 1 deletion client-io.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ socket.on('message', function(message){
break;

case "/list":
$('#n_' + room).html("");
_.each(data.slice(1).join(" ").split(","), function(data) {
n = data.split(":");
var nh = "#n_" + room + "_" + n[0];
Expand Down Expand Up @@ -330,7 +331,6 @@ function displayRoom(r) {
}

function refreshList(r) {
$('#n_' + r).html("");
socket.send("/list " + r);
}

Expand Down
8 changes: 6 additions & 2 deletions server-io.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ var httpServer = http.createServer(function(req, res) {
} else {
var path = url.parse(req.url).pathname;

if(!/\.(js|html|swf|wav|css|png)$/.test(path)){
if(!/\.(js|html|swf|wav|css|png|mp3)$/.test(path)){
path = "/client-io.html";
}
switch (path) {
default:
if (/\.(js|html|swf|wav|css|png)$/.test(path)){
if (/\.(js|html|swf|wav|css|png|mp3)$/.test(path)){
try {

var ct = "text/html";
Expand All @@ -86,6 +86,10 @@ var httpServer = http.createServer(function(req, res) {
ct = "audio/x-wav";
mode = "binary";
}
if(path.substr(-4) === '.mp3') {
ct = "type/mpeg";
mode = "binary";
}
if(path.substr(-4) === '.png') {
ct = "image/png";
mode = "binary";
Expand Down

0 comments on commit bd7e23f

Please sign in to comment.