diff options
author | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-09-17 18:27:47 +0100 |
---|---|---|
committer | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-09-17 18:27:47 +0100 |
commit | 4571cf7baadf360e27e05a73142571da9f165d47 (patch) | |
tree | ed5850f285a35df2353b3562ed4bca1fd34d5324 /webclient/settings | |
parent | Remark on remaining storage modules that still need unit tests (diff) | |
parent | WEB-35: joins/parts should trigger desktop notifications (diff) | |
download | synapse-4571cf7baadf360e27e05a73142571da9f165d47.tar.xz |
Merge branch 'develop' into test-sqlite-memory
Diffstat (limited to 'webclient/settings')
-rw-r--r-- | webclient/settings/settings-controller.js | 11 | ||||
-rw-r--r-- | webclient/settings/settings.html | 11 |
2 files changed, 20 insertions, 2 deletions
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..0a5a3db51f 100644 --- a/webclient/settings/settings.html +++ b/webclient/settings/settings.html @@ -51,7 +51,16 @@ <h3>Desktop notifications</h3> <div class="section" ng-switch="settings.notifications"> <div ng-switch-when="granted"> - Notifications are enabled. + Notifications are enabled. You will be alerted when a message contains your user ID or display name. + <div class="section"> + <h4>Additional words to alert on:</h4> + <p>Leave blank to alert on all messages.</p> + <input size=40 name="bingWords" ng-model="settings.bingWords" ng-list placeholder="Enter words separated with , (supports regex)" + ng-blur="saveBingWords()"/> + <ul> + <li ng-repeat="word in settings.bingWords">{{word}}</li> + </ul> + </div> </div> <div ng-switch-when="denied"> You have denied permission for notifications.<br/> |