|
|
|
@ -1023,6 +1023,8 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', |
|
|
|
|
title += buffer.shortName; |
|
|
|
|
title += buffer.fullName.replace(/irc.([^\.]+)\..+/, " ($1)"); |
|
|
|
|
|
|
|
|
|
// Chrome for Android doesn't know this
|
|
|
|
|
if (typeof Notification !== 'undefined') { |
|
|
|
|
var notification = new Notification(title, { |
|
|
|
|
body: body, |
|
|
|
|
icon: 'assets/img/favicon.png' |
|
|
|
@ -1042,6 +1044,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', |
|
|
|
|
window.focus(); |
|
|
|
|
notification.close(); |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($scope.soundnotification) { |
|
|
|
|
// TODO fill in a sound file
|
|
|
|
@ -1049,6 +1052,13 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', |
|
|
|
|
var soundHTML = '<audio autoplay="autoplay"><source src="' + audioFile + '.ogg" type="audio/ogg" /><source src="' + audioFile + '.mp3" type="audio/mpeg" /></audio>'; |
|
|
|
|
document.getElementById("soundNotification").innerHTML = soundHTML; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (navigator.notification !== undefined) { |
|
|
|
|
console.log('vibrating!'); |
|
|
|
|
navigator.notification.vibrate(500); |
|
|
|
|
} else { |
|
|
|
|
console.log('no notification api :(', navigator.notification); |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
$scope.hasUnread = function(buffer) { |
|
|
|
|