From 63a1901ac392352f4ad4247a4fa6df57b4774df7 Mon Sep 17 00:00:00 2001 From: Marcelo Schmidt Date: Tue, 27 Dec 2016 14:03:08 -0200 Subject: [PATCH 01/20] Add audio notification choices to subscriptions --- .../server/models/Subscriptions.coffee | 1 + .../client/stylesheets/pushNotifications.less | 2 +- .../views/pushNotificationsFlexTab.html | 20 +++++ .../client/views/pushNotificationsFlexTab.js | 81 ++++++++++++++++-- .../methods/saveNotificationSettings.js | 7 +- .../server/models/Subscriptions.js | 15 ++++ .../rocketchat-ui/lib/notification.coffee | 17 +++- packages/rocketchat-ui/package.js | 1 + .../views/app/audioNotification.html | 9 +- .../views/app/audioNotification.js | 6 ++ ..._willy-ineedthatapp-com__droplet-good5.mp3 | Bin 0 -> 6059 bytes public/sounds/179132__alphahog__ding.mp3 | Bin 0 -> 24737 bytes .../sounds/218851__kellyconidi__highbell.mp3 | Bin 0 -> 65745 bytes public/sounds/320202__chelle19__dingmp3.mp3 | Bin 0 -> 33489 bytes .../335908__littlerainyseasons__correct.mp3 | Bin 0 -> 17664 bytes public/sounds/beep.mp3 | Bin 0 -> 6318 bytes public/sounds/ding.mp3 | Bin 0 -> 2688 bytes server/publications/subscription.coffee | 1 + 18 files changed, 148 insertions(+), 12 deletions(-) create mode 100644 packages/rocketchat-ui/views/app/audioNotification.js create mode 100644 public/sounds/167346__willy-ineedthatapp-com__droplet-good5.mp3 create mode 100644 public/sounds/179132__alphahog__ding.mp3 create mode 100644 public/sounds/218851__kellyconidi__highbell.mp3 create mode 100644 public/sounds/320202__chelle19__dingmp3.mp3 create mode 100644 public/sounds/335908__littlerainyseasons__correct.mp3 create mode 100644 public/sounds/beep.mp3 create mode 100644 public/sounds/ding.mp3 diff --git a/packages/rocketchat-lib/server/models/Subscriptions.coffee b/packages/rocketchat-lib/server/models/Subscriptions.coffee index ddeb5e4e357a..02eb16c3ca03 100644 --- a/packages/rocketchat-lib/server/models/Subscriptions.coffee +++ b/packages/rocketchat-lib/server/models/Subscriptions.coffee @@ -12,6 +12,7 @@ class ModelSubscriptions extends RocketChat.models._Base @tryEnsureIndex { 'unread': 1 } @tryEnsureIndex { 'ts': 1 } @tryEnsureIndex { 'ls': 1 } + @tryEnsureIndex { 'audioNotifications': 1 }, { sparse: 1 } @tryEnsureIndex { 'desktopNotifications': 1 }, { sparse: 1 } @tryEnsureIndex { 'mobilePushNotifications': 1 }, { sparse: 1 } @tryEnsureIndex { 'emailNotifications': 1 }, { sparse: 1 } diff --git a/packages/rocketchat-push-notifications/client/stylesheets/pushNotifications.less b/packages/rocketchat-push-notifications/client/stylesheets/pushNotifications.less index ad6f5d912f52..2cc8213e2a8c 100644 --- a/packages/rocketchat-push-notifications/client/stylesheets/pushNotifications.less +++ b/packages/rocketchat-push-notifications/client/stylesheets/pushNotifications.less @@ -28,7 +28,7 @@ text-align: center; } - [data-edit] { + [data-edit], [data-play] { cursor: pointer; } } diff --git a/packages/rocketchat-push-notifications/client/views/pushNotificationsFlexTab.html b/packages/rocketchat-push-notifications/client/views/pushNotificationsFlexTab.html index 695c96ae245f..df8f8a9cd19d 100644 --- a/packages/rocketchat-push-notifications/client/views/pushNotificationsFlexTab.html +++ b/packages/rocketchat-push-notifications/client/views/pushNotificationsFlexTab.html @@ -6,6 +6,26 @@

{{_ "Notifications"}}