@ -12,8 +12,6 @@
MESSAGE : 'message'
MESSAGE : 'message'
} ;
} ;
var sound = new Audio ( 'audio/NewMessage.mp3' ) ;
Whisper . Notifications = new ( Backbone . Collection . extend ( {
Whisper . Notifications = new ( Backbone . Collection . extend ( {
initialize : function ( ) {
initialize : function ( ) {
this . on ( 'add' , this . update ) ;
this . on ( 'add' , this . update ) ;
@ -34,9 +32,6 @@
return ;
return ;
}
}
var audioNotification = storage . get ( 'audio-notification' ) || false ;
var audioNotification = storage . get ( 'audio-notification' ) || false ;
if ( audioNotification ) {
sound . play ( ) ;
}
var setting = storage . get ( 'notification-setting' ) || 'message' ;
var setting = storage . get ( 'notification-setting' ) || 'message' ;
if ( setting === SETTINGS . OFF ) {
if ( setting === SETTINGS . OFF ) {
@ -70,9 +65,10 @@
break ;
break ;
}
}
var notification = new Notification ( title , {
var notification = new Notification ( title , {
body : message ,
body : message ,
icon : iconUrl ,
icon : iconUrl ,
tag : 'signal'
tag : 'signal' ,
silent : ! audioNotification
} ) ;
} ) ;
notification . onclick = this . onclick . bind ( this ) ;
notification . onclick = this . onclick . bind ( this ) ;
} ,
} ,