Skip to content
Permalink
Browse files

Fixing some stuff and some other stuff.

  • Loading branch information...
Depado committed May 21, 2014
1 parent dc975c6 commit d9b3e68998f6372a79cf8bb2fde33a9373ee4ed9
Showing with 3 additions and 2 deletions.
  1. +1 −0 app.js
  2. +2 −2 static/custom.js
1 app.js
@@ -92,6 +92,7 @@ io.sockets.on('connection', function (socket) {
socket.broadcast.emit('server-message', socket.username + ' has disconnected');
} else {
anon_users -= 1;
io.sockets.emit('updateusers', {'usernames': usernames, 'anon': anon_users});
}
});
});
@@ -35,12 +35,12 @@ socket.on('updatechat', function (username, data) {
if ("Notification" in window) {
if(Notification.permission === "granted") {
if($('#notify-on-message').is(':checked')) {
var notification = new Notification(username + ' : ' + data, {'icon': "/custom/favicon.gif"});
var notification = new Notification("New Message", {'body':username + ' : ' + data, 'icon': "/custom/favicon.gif"});
}
if ($('#notify-on-hl').is(':checked')) {
var patt = new RegExp("(^|\\W)"+selfusername+"(\\W|$)");
if(patt.test(data)) {
var notification = new Notification(username + ' highlighted you.', {'icon': "/custom/favicon.gif"});
var notification = new Notification("Highlight", {'body':username + ' highlighted you.', 'icon': "/custom/favicon.gif"});
}
}
}

0 comments on commit d9b3e68

Please sign in to comment.
You can’t perform that action at this time.