From b170fe921e327d8d1be9768d30305ba953ccae9f Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Tue, 16 Sep 2014 14:20:26 +0100 Subject: Added a section on bing words if you enable desktop notifications. --- webclient/room/room-controller.js | 2 +- webclient/settings/settings-controller.js | 11 ++++++++++- webclient/settings/settings.html | 8 ++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index 2c9a3836e7..4a91d298bc 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -139,7 +139,7 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) if (isLive && event.room_id === $scope.room_id) { scrollToBottom(); - + if (window.Notification) { // Show notification when the window is hidden, or the user is idle if (document.hidden || matrixService.presence.unavailable === mPresence.getState()) { diff --git a/webclient/settings/settings-controller.js b/webclient/settings/settings-controller.js index 8c877a24e9..9cdace704a 100644 --- a/webclient/settings/settings-controller.js +++ b/webclient/settings/settings-controller.js @@ -194,7 +194,16 @@ angular.module('SettingsController', ['matrixService', 'mFileUpload', 'mFileInpu /*** Desktop notifications section ***/ $scope.settings = { - notifications: undefined + notifications: undefined, + bingWords: matrixService.config().bingWords + }; + + $scope.saveBingWords = function() { + console.log("Saving words: "+JSON.stringify($scope.settings.bingWords)); + var config = matrixService.config(); + config.bingWords = $scope.settings.bingWords; + matrixService.setConfig(config); + matrixService.saveConfig(); }; // If the browser supports it, check the desktop notification state diff --git a/webclient/settings/settings.html b/webclient/settings/settings.html index c358a6e9d8..3b3dd3dadd 100644 --- a/webclient/settings/settings.html +++ b/webclient/settings/settings.html @@ -52,6 +52,14 @@
Notifications are enabled. +
+

Words to alert on:

+ +
    +
  • {{word}}
  • +
+
You have denied permission for notifications.
-- cgit 1.4.1