Mute message alert sounds option
authorDarren <darren@Darrens-MacBook-Pro.local>
Sat, 6 Apr 2013 19:40:50 +0000 (20:40 +0100)
committerDarren <darren@Darrens-MacBook-Pro.local>
Sat, 6 Apr 2013 19:40:50 +0000 (20:40 +0100)
client/assets/dev/applet_settings.js
client/assets/dev/index.html.tmpl
client/assets/dev/view.js

index bb6f35fe48c9759345bb45c93f1f3eeb07d07103..7bc1d4e75fdf4104510d089267ef21a876c10800 100644 (file)
             } else {\r
                 this.$el.find('.setting-show_timestamps').attr('checked', true);\r
             }\r
+\r
+            if (typeof settings.get('mute_sounds') === 'undefined' || settings.get('mute_sounds')) {\r
+                this.$el.find('.setting-mute_sounds').attr('checked', true);\r
+            } else {\r
+                this.$el.find('.setting-mute_sounds').attr('checked', false);\r
+            }\r
         },\r
 \r
 \r
@@ -59,6 +65,7 @@
             settings.set('scrollback', $('.setting-scrollback', this.$el).val());\r
             settings.set('show_joins_parts', $('.setting-show_joins_parts', this.$el).is(':checked'));\r
             settings.set('show_timestamps', $('.setting-show_timestamps', this.$el).is(':checked'));\r
+            settings.set('mute_sounds', $('.setting-mute_sounds', this.$el).is(':checked'));\r
 \r
             settings.save();\r
 \r
index 5d2641cb59bad842488fcf9e5a3af3904304be28..bff13ff8d2852df246cb5f5f80781ab0c72fa408 100644 (file)
                     <td class="label">Show timestamps</td>\r
                     <td class="setting"><input type="checkbox" class="setting-show_timestamps" /></td>\r
                 </tr>\r
+                \r
+                <tr>\r
+                    <td class="label">Mute sounds</td>\r
+                    <td class="setting"><input type="checkbox" class="setting-mute_sounds" /></td>\r
+                </tr>\r
 \r
                 <tr class="save">\r
                     <td colspan="2"><button class="save">Save</button><br/><span class="feedback">Saved!</span></td>\r
index dcc161b0302dffc9a5898f3d5cfbb5579420a606..817e52e9a8ada600a62341cbb83682977e27f29e 100644 (file)
@@ -1418,6 +1418,10 @@ _kiwi.view.Application = Backbone.View.extend({
 \r
     playSound: function (sound_id) {\r
         if (!this.sound_object) return;\r
+\r
+        if (_kiwi.global.settings.get('mute_sounds'))\r
+            return;\r
+        \r
         soundManager.play(sound_id);\r
     }\r
 });\r