From b2f25f45818428486ffc3aa0f5db9e12a9e9effe Mon Sep 17 00:00:00 2001 From: Darren Date: Sat, 6 Apr 2013 20:40:50 +0100 Subject: [PATCH] Mute message alert sounds option --- client/assets/dev/applet_settings.js | 7 +++++++ client/assets/dev/index.html.tmpl | 5 +++++ client/assets/dev/view.js | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/client/assets/dev/applet_settings.js b/client/assets/dev/applet_settings.js index bb6f35f..7bc1d4e 100644 --- a/client/assets/dev/applet_settings.js +++ b/client/assets/dev/applet_settings.js @@ -44,6 +44,12 @@ } else { this.$el.find('.setting-show_timestamps').attr('checked', true); } + + if (typeof settings.get('mute_sounds') === 'undefined' || settings.get('mute_sounds')) { + this.$el.find('.setting-mute_sounds').attr('checked', true); + } else { + this.$el.find('.setting-mute_sounds').attr('checked', false); + } }, @@ -59,6 +65,7 @@ settings.set('scrollback', $('.setting-scrollback', this.$el).val()); settings.set('show_joins_parts', $('.setting-show_joins_parts', this.$el).is(':checked')); settings.set('show_timestamps', $('.setting-show_timestamps', this.$el).is(':checked')); + settings.set('mute_sounds', $('.setting-mute_sounds', this.$el).is(':checked')); settings.save(); diff --git a/client/assets/dev/index.html.tmpl b/client/assets/dev/index.html.tmpl index 5d2641c..bff13ff 100644 --- a/client/assets/dev/index.html.tmpl +++ b/client/assets/dev/index.html.tmpl @@ -194,6 +194,11 @@ Show timestamps + + + Mute sounds + +
Saved! diff --git a/client/assets/dev/view.js b/client/assets/dev/view.js index dcc161b..817e52e 100644 --- a/client/assets/dev/view.js +++ b/client/assets/dev/view.js @@ -1418,6 +1418,10 @@ _kiwi.view.Application = Backbone.View.extend({ playSound: function (sound_id) { if (!this.sound_object) return; + + if (_kiwi.global.settings.get('mute_sounds')) + return; + soundManager.play(sound_id); } }); -- 2.25.1