Skip to content

Commit

Permalink
Play a sound on new post or member entering a room
Browse files Browse the repository at this point in the history
  • Loading branch information
ozten committed Jan 25, 2013
1 parent d77eb2d commit 33ed7c1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Binary file added client/audio/Electro_-S_Bainbr-7955_hifi.wav
Binary file not shown.
Binary file added client/audio/scan_for-dont_kno-8102_hifi.wav
Binary file not shown.
10 changes: 8 additions & 2 deletions client/js/rooms.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,12 @@ window.connect = function(audience, roomId) {
$('#members').load('/widgets/members/' + roomId);
}
renderMessage(data);
new Audio('/audio/Electro_-S_Bainbr-7955_hifi.wav').play();
//window.scrollTo(0, 1000000);
});
socket.on('new user', function(profile) {
renderNewUser(profile);
new Audio('/audio/scan_for-dont_kno-8102_hifi.wav').play();
});
socket.on('sync update', function(data) {
console.log('SYNC UPDATE', data);
Expand Down Expand Up @@ -120,7 +122,9 @@ $('#new-room-tab, #new-room-button').click(function(e) {
if (! newRoomTabLoaded) {
newRoomTabLoaded = true;
$('#new-room-stub').load('/widgets/new_room_form', function() {
$('head').append('<link rel="stylesheet" media="screen,projection,tv" href="/css/home.css" />');
$('head').append(
'<link rel="stylesheet" media="screen,projection,tv" ' +
'href="/css/home.css" />');
initNewRoom();
$('.cancel', $('#new-room-stub')).click(function(e) {
e.preventDefault();
Expand All @@ -132,7 +136,9 @@ $('#new-room-tab, #new-room-button').click(function(e) {

});

$('button').bind('click', function(e) {e.preventDefault(); alert('Would eventually be a photo picker and uploader'); });
$('button').bind('click', function(e) {
e.preventDefault();
alert('Would eventually be a photo picker and uploader'); });
};

var layout = function() {
Expand Down

0 comments on commit 33ed7c1

Please sign in to comment.