summary refs log tree commit diff
path: root/webclient/app-controller.js
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@matrix.org>2014-08-17 03:48:28 +0100
committerMatthew Hodgson <matthew@matrix.org>2014-08-17 03:48:28 +0100
commit60245c4f90f60dc7af79165cf074a4df57a02558 (patch)
tree0ceb74ee15def532e833d7f87c2052e13af7713b /webclient/app-controller.js
parentunbreak login sequence (which spuriously required a sydent server to be speci... (diff)
downloadsynapse-60245c4f90f60dc7af79165cf074a4df57a02558.tar.xz
implement html5 notifications. (have to be explicitly requested under Config)
Diffstat (limited to 'webclient/app-controller.js')
-rw-r--r--webclient/app-controller.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/webclient/app-controller.js b/webclient/app-controller.js
index 7fa87e30c1..ff4cb6e69e 100644
--- a/webclient/app-controller.js
+++ b/webclient/app-controller.js
@@ -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(){});
+        }
+    };
+    
+    
 }]);