mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-30 02:25:55 +01:00
added setting to disable notification sounds
This commit is contained in:
@@ -49,5 +49,7 @@
|
||||
|
||||
"paginate_description" : "Paginate topics and posts instead of using infinite scroll.",
|
||||
"topics_per_page": "Topics per Page",
|
||||
"posts_per_page": "Posts per Page"
|
||||
"posts_per_page": "Posts per Page",
|
||||
|
||||
"notification_sounds" : "Play a sound when you receive a notification."
|
||||
}
|
||||
|
||||
@@ -67,6 +67,9 @@ define(['buzz'], function(buzz) {
|
||||
};
|
||||
|
||||
Sounds.play = function(name) {
|
||||
if (!config.notificationSounds) {
|
||||
return;
|
||||
}
|
||||
var ready = function() {
|
||||
if (Sounds.mapping[name] && Sounds.loaded[Sounds.mapping[name]]) {
|
||||
Sounds.loaded[Sounds.mapping[name]].play();
|
||||
|
||||
@@ -47,6 +47,7 @@ apiController.getConfig = function(req, res, next) {
|
||||
config.usePagination = settings.usePagination;
|
||||
config.topicsPerPage = settings.topicsPerPage;
|
||||
config.postsPerPage = settings.postsPerPage;
|
||||
config.notificationSounds = settings.notificationSounds;
|
||||
|
||||
if (res.locals.isAPI) {
|
||||
res.json(200, config);
|
||||
|
||||
@@ -28,7 +28,7 @@ module.exports = function(User) {
|
||||
settings.usePagination = settings.usePagination ? parseInt(settings.usePagination, 10) === 1 : parseInt(meta.config.usePagination, 10) === 1;
|
||||
settings.topicsPerPage = settings.topicsPerPage ? parseInt(settings.topicsPerPage, 10) : parseInt(meta.config.topicsPerPage, 10) || 20;
|
||||
settings.postsPerPage = settings.postsPerPage ? parseInt(settings.postsPerPage, 10) : parseInt(meta.config.postsPerPage, 10) || 10;
|
||||
|
||||
settings.notificationSounds = settings.notificationSounds ? parseInt(settings.notificationSounds, 10) === 1 : true;
|
||||
callback(null, settings);
|
||||
});
|
||||
});
|
||||
@@ -46,7 +46,8 @@ module.exports = function(User) {
|
||||
showemail: data.showemail,
|
||||
usePagination: data.usePagination,
|
||||
topicsPerPage: data.topicsPerPage,
|
||||
postsPerPage: data.postsPerPage
|
||||
postsPerPage: data.postsPerPage,
|
||||
notificationSounds: data.notificationSounds
|
||||
}, callback);
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user