-
Notifications
You must be signed in to change notification settings - Fork 11.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NEW] Configurable Volume for Notifications #6087 #7517
Changes from 11 commits
1fd5b9f
145ec7c
fc0df6c
4c3124c
5d09a50
5ab0702
e309670
9635a06
1829aa8
dadde15
a95087b
5ae0f43
f269229
48cad72
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ | |
.env | ||
.externalToolBuilders | ||
.idea | ||
.vscode | ||
.loadpath | ||
.map | ||
.metadata | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,7 @@ email@1.2.3 | |
emojione:emojione@3.0.3 | ||
facebook-oauth@1.3.2 | ||
fastclick@1.0.13 | ||
fourseven:scss@4.5.4 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you remove that package? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed! |
||
francocatena:status@1.5.3 | ||
geojson-utils@1.0.10 | ||
github-oauth@1.2.0 | ||
|
@@ -105,7 +106,7 @@ oauth1@1.1.11 | |
oauth2@1.1.11 | ||
observe-sequence@1.0.16 | ||
ordered-dict@1.0.9 | ||
ostrio:cookies@2.2.1 | ||
ostrio:cookies@2.2.2 | ||
pauli:accounts-linkedin@2.1.3 | ||
pauli:linkedin-oauth@1.1.0 | ||
percolate:synced-cron@1.3.2 | ||
|
@@ -203,6 +204,7 @@ rocketchat:slashcommands-mute@0.0.1 | |
rocketchat:slashcommands-open@0.0.1 | ||
rocketchat:slashcommands-topic@0.0.1 | ||
rocketchat:slashcommands-unarchive@0.0.1 | ||
rocketchat:slider@0.0.1 | ||
rocketchat:smarsh-connector@0.0.1 | ||
rocketchat:sms@0.0.1 | ||
rocketchat:spotify@0.0.1 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -872,6 +872,7 @@ | |
"Nothing_found": "No se encontró nada", | ||
"Notification_Duration": "Duración de la notificación", | ||
"Notifications": "Notificaciones", | ||
"Notifications_Sound_Volume": "Notifications sound volume", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not correct There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed! |
||
"Notify_all_in_this_room": "Notificar a todos en este canal", | ||
"Num_Agents": "# de Agentes", | ||
"Number_of_messages": "Número de mensajes", | ||
|
@@ -1362,4 +1363,4 @@ | |
"Your_mail_was_sent_to_s": "Su correo electrónico fue enviado a %s", | ||
"Your_password_is_wrong": "Su contraseña es incorrecta!", | ||
"Your_push_was_sent_to_s_devices": "Su push fue enviado a los dispositivos %s" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -748,6 +748,7 @@ | |
"Nothing": "asgjë", | ||
"Nothing_found": "Asgjë për të gjetur", | ||
"Notifications": "Njoftime", | ||
"Notifications_Sound_Volume": "Notifications sound volume", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not correct There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed! |
||
"Notify_all_in_this_room": "Njoftojë të gjithë në këtë dhomë", | ||
"Num_Agents": "# Agents", | ||
"Number_of_messages": "Numri i mesazheve", | ||
|
@@ -1219,4 +1220,4 @@ | |
"Your_mail_was_sent_to_s": "maili juaj u dërgua në %s", | ||
"Your_password_is_wrong": "Fjalëkalimi juaj është e gabuar!", | ||
"Your_push_was_sent_to_s_devices": "shtytje juaj u dërgua në pajisjet %s" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -397,7 +397,6 @@ class ModelUsers extends RocketChat.models._Base { | |
requirePasswordChangeReason | ||
} | ||
}; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please, do not introduce unnecessary changes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry. Fixed! |
||
return this.update(_id, update); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,7 +70,6 @@ RocketChat.settings.addGroup('Accounts', function() { | |
type: 'boolean', | ||
'public': true | ||
}); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please, do not introduce unnecessary changes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry. Fixed! |
||
this.section('Registration', function() { | ||
this.add('Accounts_DefaultUsernamePrefixSuggestion', 'user', { | ||
type: 'string' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,7 +58,10 @@ this.visitor = new class { | |
|
||
// notification sound | ||
if (Session.equals('sound', true) && msg.u._id !== Meteor.userId()) { | ||
$('#chatAudioNotification')[0].play(); | ||
const audioVolume = Meteor.user().settings.preferences.notificationsSoundVolume || 100; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you check the properties here too? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Checked! |
||
const audio = $('#chatAudioNotification')[0]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you can use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for your feedback. Fixed! |
||
audio.volume = Number((audioVolume/100).toPrecision(2)); | ||
audio.play(); | ||
} | ||
} | ||
}); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -255,29 +255,37 @@ Template.pushNotificationsFlexTab.events({ | |
|
||
'click [data-play]'(e) { | ||
e.preventDefault(); | ||
|
||
let audio = $(e.currentTarget).data('play'); | ||
|
||
if (!audio || audio === 'none') { | ||
audio = Meteor.user().settings.preferences.newMessageNotification || 'chime'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed! |
||
} | ||
|
||
if (audio && audio !== 'none') { | ||
|
||
const audioVolume = Meteor.user().settings.preferences.notificationsSoundVolume || 100; | ||
const $audio = $(`audio#${ audio }`); | ||
|
||
if ($audio && $audio[0] && $audio[0].play) { | ||
$audio[0].volume = Number((audioVolume/100).toPrecision(2)); | ||
$audio[0].play(); | ||
} | ||
} else { | ||
audio = Meteor.user() && Meteor.user().settings && Meteor.user().settings.preferences && Meteor.user().settings.preferences.newMessageNotification || 'chime'; | ||
if (audio && audio !== 'none') { | ||
const $audio = $(`audio#${ audio }`); | ||
if ($audio && $audio[0] && $audio[0].play) { | ||
$audio[0].play(); | ||
} | ||
} | ||
} | ||
}, | ||
|
||
'change select[name=audioNotification]'(e) { | ||
e.preventDefault(); | ||
|
||
const audio = $(e.currentTarget).val(); | ||
|
||
if (audio && audio !== 'none') { | ||
|
||
const audioVolume = Meteor.user().settings.preferences.notificationsSoundVolume || 100; | ||
const $audio = $(`audio#${ audio }`); | ||
|
||
if ($audio && $audio[0] && $audio[0].play) { | ||
$audio[0].volume = Number((audioVolume/100).toPrecision(2)); | ||
$audio[0].play(); | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Package.describe({ | ||
name: 'rocketchat:slider', | ||
version: '0.0.1', | ||
summary: 'UI slider component for input range.', | ||
git: '', | ||
documentation: 'README.md' | ||
}); | ||
|
||
Package.onUse(function(api) { | ||
api.use('ecmascript'); | ||
api.use('templating', 'client'); | ||
api.use('fourseven:scss'); | ||
|
||
api.addFiles('rocketchat-slider.scss', 'client'); | ||
api.addFiles('rocketchat-slider.html', 'client'); | ||
api.addFiles('rocketchat-slider.js', 'client'); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<template name="slider"> | ||
<div class="range-slider"> | ||
<input class="range-slider__range" type="range" id="{{id}}" value="{{value}}" min="{{min}}" max="{{max}}"> | ||
<span class="range-slider__value" id="{{id}}__value"></span> | ||
</div> | ||
</template> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import './rocketchat-slider.scss'; | ||
import './rocketchat-slider.html'; | ||
|
||
Template.slider.onRendered(function() { | ||
const params = this.data; | ||
|
||
const rangeSlider = function() { | ||
|
||
const range = $(`#${ params.id }`); | ||
const labelValue = $(`#${ params.id }__value`); | ||
|
||
labelValue.html(params.value); | ||
|
||
range.on('input', function() { | ||
labelValue.html(this.value); | ||
}); | ||
}; | ||
|
||
rangeSlider(); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
$shade-10: #04436a !default; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't use scss, just cssnext and less(we will remove all less styles in the future). You need to add your style on rocketchat-theme package and set your custom colors there on variables.js and colors.less files. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for your feedback and explanation. I've done as you suggested. Fixed! |
||
$shade-1: #d7dcdf !default; | ||
$shade-0: #ffffff !default; | ||
$teal: #1abc9c !default; | ||
|
||
* { | ||
&, | ||
&::before, | ||
&::after { | ||
box-sizing: border-box; | ||
} | ||
} | ||
|
||
$range-width: 100% !default; | ||
|
||
.range-slider { | ||
margin: 0 0 0 0%; | ||
width: $range-width; | ||
} | ||
|
||
$range-handle-color: $shade-10 !default; | ||
$range-handle-color-hover: $teal !default; | ||
$range-handle-size: 20px !default; | ||
|
||
$range-track-color: $shade-1 !default; | ||
$range-track-height: 10px !default; | ||
|
||
$range-label-color: $shade-10 !default; | ||
$range-label-width: 60px !default; | ||
|
||
.range-slider__range { | ||
-webkit-appearance: none; | ||
width: calc(100% - (#{$range-label-width + 13px})); | ||
height: $range-track-height; | ||
border-radius: 5px; | ||
background: $range-track-color; | ||
outline: none; | ||
padding: 0; | ||
margin: 0; | ||
|
||
// Range Handle | ||
&::-webkit-slider-thumb { | ||
appearance: none; | ||
width: $range-handle-size; | ||
height: $range-handle-size; | ||
border-radius: 50%; | ||
background: $range-handle-color; | ||
cursor: pointer; | ||
transition: background 0.15s ease-in-out; | ||
|
||
&:hover { | ||
background: $range-handle-color-hover; | ||
} | ||
} | ||
|
||
&:active::-webkit-slider-thumb { | ||
background: $range-handle-color-hover; | ||
} | ||
|
||
&::-moz-range-thumb { | ||
width: $range-handle-size; | ||
height: $range-handle-size; | ||
border: 0; | ||
border-radius: 50%; | ||
background: $range-handle-color; | ||
cursor: pointer; | ||
transition: background 0.15s ease-in-out; | ||
|
||
&:hover { | ||
background: $range-handle-color-hover; | ||
} | ||
} | ||
|
||
&:active::-moz-range-thumb { | ||
background: $range-handle-color-hover; | ||
} | ||
} | ||
|
||
.range-slider__value { | ||
display: inline-block; | ||
position: relative; | ||
width: $range-label-width; | ||
color: $shade-0; | ||
line-height: 20px; | ||
text-align: center; | ||
border-radius: 3px; | ||
background: $range-label-color; | ||
padding: 5px 10px; | ||
margin-left: 8px; | ||
|
||
&::after { | ||
position: absolute; | ||
top: 8px; | ||
left: -7px; | ||
width: 0; | ||
height: 0; | ||
border-top: 7px solid transparent; | ||
border-right: 7px solid $range-label-color; | ||
border-bottom: 7px solid transparent; | ||
content: ''; | ||
} | ||
} | ||
|
||
::-moz-range-track { | ||
background: $range-track-color; | ||
border: 0; | ||
} | ||
|
||
input::-moz-focus-inner, | ||
input::-moz-focus-outer { | ||
border: 0; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use only cssnext as CSS post-processor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. SCSS removed.