Node.js based forum software built for the modern web
Address review issues
Peter Jaszkowiak9f1500824746
diff --git a/public/src/modules/sounds.js b/public/src/modules/sounds.jsindex 8fdd5173d0..26d64079ca 100644--- a/public/src/modules/sounds.js+++ b/public/src/modules/sounds.js@@ -65,10 +65,15 @@ define('sounds', function () {}if (id) {- if (localStorage.getItem('sounds.handled:' + id)) {+ var item = 'sounds.handled:' + id;+ if (sessionStorage.getItem(item)) {return;}- localStorage.setItem('sounds.handled:' + id, true);+ sessionStorage.setItem(item, true);++ setTimeout(function () {+ sessionStorage.removeItem(item);+ }, 5000);}Sounds.playSound(soundMap[type]);diff --git a/src/controllers/accounts/settings.js b/src/controllers/accounts/settings.jsindex e4dc33bd89..68cef8be5f 100644--- a/src/controllers/accounts/settings.js+++ b/src/controllers/accounts/settings.js@@ -75,7 +75,7 @@ settingsController.get = function (req, res, callback) {};});- userData[type.replace('-', '_') + '_sound'] = soundpacks;+ userData[type + '-sound'] = soundpacks;// fallbackuserData[aliases[type]] = soundpacks.concat.apply([], soundpacks.map(function (pack) {return pack.sounds.map(function (sound) {diff --git a/src/controllers/admin/sounds.js b/src/controllers/admin/sounds.jsindex 185b09ec4c..b042048313 100644--- a/src/controllers/admin/sounds.js+++ b/src/controllers/admin/sounds.js@@ -37,7 +37,7 @@ soundsController.get = function (req, res, next) {};});- output[type.replace('-', '_') + '_sound'] = soundpacks;+ output[type + '-sound'] = soundpacks;});res.render('admin/general/sounds', output);diff --git a/src/plugins/load.js b/src/plugins/load.jsindex c7dd924e37..c6a9429667 100644--- a/src/plugins/load.js+++ b/src/plugins/load.js@@ -37,11 +37,11 @@ module.exports = function (Plugins) {};Plugins.prepareForBuild = function (callback) {- Plugins.cssFiles = [];- Plugins.lessFiles = [];- Plugins.clientScripts = [];- Plugins.acpScripts = [];- Plugins.soundpacks = [];+ Plugins.cssFiles.length = 0;+ Plugins.lessFiles.length = 0;+ Plugins.clientScripts.length = 0;+ Plugins.acpScripts.length = 0;+ Plugins.soundpacks.length = 0;async.waterfall([async.apply(Plugins.getPluginPaths),diff --git a/src/views/admin/general/sounds.tpl b/src/views/admin/general/sounds.tplindex fc8f572b37..79b99229f5 100644--- a/src/views/admin/general/sounds.tpl+++ b/src/views/admin/general/sounds.tpl@@ -9,15 +9,15 @@<div class="form-group col-xs-9"><select class="form-control" id="notification" name="notification"><option value="">[[user:no-sound]]</option>- <!-- BEGIN notification_sound -->- <optgroup label="{notification_sound.name}">- <!-- BEGIN notification_sound.sounds -->- <option value="{notification_sound.sounds.value}" <!-- IF notification_sound.sounds.selected -->selected<!-- ENDIF notification_sound.sounds.selected -->>- {notification_sound.sounds.name}+ <!-- BEGIN notification-sound -->+ <optgroup label="{notification-sound.name}">+ <!-- BEGIN notification-sound.sounds -->+ <option value="{notification-sound.sounds.value}" <!-- IF notification-sound.sounds.selected -->selected<!-- ENDIF notification-sound.sounds.selected -->>+ {notification-sound.sounds.name}</option>- <!-- END notification_sound.sounds -->+ <!-- END notification-sound.sounds --></optgroup>- <!-- END notification_sound -->+ <!-- END notification-sound --></select></div><div class="btn-group col-xs-3">@@ -35,15 +35,15 @@<div class="form-group col-xs-9"><select class="form-control" id="chat-incoming" name="chat-incoming"><option value="">[[user:no-sound]]</option>- <!-- BEGIN chat_incoming_sound -->- <optgroup label="{chat_incoming_sound.name}">- <!-- BEGIN chat_incoming_sound.sounds -->- <option value="{chat_incoming_sound.sounds.value}" <!-- IF chat_incoming_sound.sounds.selected -->selected<!-- ENDIF chat_incoming_sound.sounds.selected -->>- {chat_incoming_sound.sounds.name}+ <!-- BEGIN chat-incoming-sound -->+ <optgroup label="{chat-incoming-sound.name}">+ <!-- BEGIN chat-incoming-sound.sounds -->+ <option value="{chat-incoming-sound.sounds.value}" <!-- IF chat-incoming-sound.sounds.selected -->selected<!-- ENDIF chat-incoming-sound.sounds.selected -->>+ {chat-incoming-sound.sounds.name}</option>- <!-- END chat_incoming_sound.sounds -->+ <!-- END chat-incoming-sound.sounds --></optgroup>- <!-- END chat_incoming_sound -->+ <!-- END chat-incoming-sound --></select></div><div class="btn-group col-xs-3">@@ -56,15 +56,15 @@<div class="form-group col-xs-9"><select class="form-control" id="chat-outgoing" name="chat-outgoing"><option value="">[[user:no-sound]]</option>- <!-- BEGIN chat_outgoing_sound -->- <optgroup label="{chat_outgoing_sound.name}">- <!-- BEGIN chat_outgoing_sound.sounds -->- <option value="{chat_outgoing_sound.sounds.value}" <!-- IF chat_outgoing_sound.sounds.selected -->selected<!-- ENDIF chat_outgoing_sound.sounds.selected -->>- {chat_outgoing_sound.sounds.name}+ <!-- BEGIN chat-outgoing-sound -->+ <optgroup label="{chat-outgoing-sound.name}">+ <!-- BEGIN chat-outgoing-sound.sounds -->+ <option value="{chat-outgoing-sound.sounds.value}" <!-- IF chat-outgoing-sound.sounds.selected -->selected<!-- ENDIF chat-outgoing-sound.sounds.selected -->>+ {chat-outgoing-sound.sounds.name}</option>- <!-- END chat_outgoing_sound.sounds -->+ <!-- END chat-outgoing-sound.sounds --></optgroup>- <!-- END chat_outgoing_sound -->+ <!-- END chat-outgoing-sound --></select></div><div class="btn-group col-xs-3">