Skip to content

Commit d6d9bd0

Browse files
committed
added sounds
1 parent a43bab2 commit d6d9bd0

File tree

12 files changed

+2756
-3
lines changed

12 files changed

+2756
-3
lines changed

bower.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"backbone": "1.0.0",
2525
"underscore": "1.4.4",
2626
"socket.io-client": "0.9.11",
27-
"jquery": "1.9.0"
27+
"jquery": "1.9.0",
28+
"howler": "~1.1.26"
2829
}
2930
}

grunt/concat.js

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module.exports = {
88
'bower_components/jquery/jquery.js',
99
'bower_components/underscore/underscore.js',
1010
'bower_components/backbone/backbone.js',
11+
'bower_components/howler/howler.js',
1112
'bower_components/socket.io-client/dist/socket.io.js',
1213
'bower_components/SimpleWebRTC/simplewebrtc.bundle.js',
1314
'lib/libraries/require.js',

grunt/copy.js

+15-2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ module.exports = {
4242
nonull: true,
4343
flatten: true,
4444
filter: 'isFile'
45+
}, {
46+
src: 'sounds/**/*',
47+
expand: true,
48+
dest: 'serve-development/sounds',
49+
nonull: true,
50+
flatten: true,
51+
filter: 'isFile'
4552
}]
4653
},
4754
deploy: {
@@ -80,8 +87,14 @@ module.exports = {
8087
nonull: true,
8188
flatten: true,
8289
filter: 'isFile'
83-
},
84-
{
90+
}, {
91+
src: 'sounds/**/*',
92+
expand: true,
93+
dest: 'serve-production/sounds',
94+
nonull: true,
95+
flatten: true,
96+
filter: 'isFile'
97+
}, {
8598
src: 'bower_components/**/*',
8699
expand: true,
87100
dest: 'serve-production/js/'

lib/views/chatView.js

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@ C("ChatView", ["require", "exports", "module"], function (require, exports, modu
22
var chatView;
33

44
var Private = {
5+
initializeSounds: function() {
6+
this.sound = new Howl({
7+
urls: ['/sounds/sounds.mp3', '/sounds/sounds.ogg'],
8+
sprite: {
9+
laser: [3000, 700]
10+
}
11+
});
12+
},
513
incrementUnread: function() {
614
this.unreadMessages++;
715
this.$unread.html(this.unreadMessages);
@@ -34,6 +42,7 @@ C("ChatView", ["require", "exports", "module"], function (require, exports, modu
3442
this.$messages.animate({
3543
scrollTop: $html.offset().top
3644
}, 200);
45+
//this.sound.play('laser');
3746
},
3847
initialMessages: function() {
3948
var messages = this.messages.models;
@@ -174,6 +183,7 @@ C("ChatView", ["require", "exports", "module"], function (require, exports, modu
174183

175184

176185
Private.initialMessages.call(this);
186+
Private.initializeSounds.call(this);
177187
};
178188

179189
chatView.prototype.addParticipant = function (participant) {

0 commit comments

Comments
 (0)