implement html5 notifications. (have to be explicitly requested under Config)

This commit is contained in:
Matthew Hodgson 2014-08-17 03:48:28 +01:00
parent 48f4497fe9
commit 60245c4f90
4 changed files with 37 additions and 3 deletions

View file

@ -45,6 +45,12 @@ angular.module('MatrixWebClientController', ['matrixService'])
$scope.config = matrixService.config();
}
};
$scope.closeConfig = function() {
if ($scope.config) {
$scope.config = undefined;
}
};
if (matrixService.config()) {
eventStreamService.resume();
@ -69,6 +75,15 @@ angular.module('MatrixWebClientController', ['matrixService'])
console.log("Invalid access token -> log user out");
$scope.logout();
});
$scope.requestNotifications = function() {
if (window.Notification) {
console.log("Notification.permission: " + window.Notification.permission);
window.Notification.requestPermission(function(){});
}
};
}]);