\r
\r
},\r
- \r
\r
loadSettings: function () {\r
var settings = _kiwi.global.settings;\r
feedback;\r
\r
// Stop settings being updated while we're saving one by one\r
- _kiwi.global.settings.off('change', this.loadSettings, this);\r
+ settings.off('change', this.loadSettings, this);\r
\r
settings.set('theme', $('.setting-theme', this.$el).val());\r
settings.set('channel_list_style', $('.setting-channel_list_style', this.$el).val());\r
feedback = $('.feedback', this.$el);\r
feedback.fadeIn('slow', function () {\r
feedback.fadeOut('slow');\r
- })\r
+ });\r
\r
// Continue listening for setting changes\r
- _kiwi.global.settings.on('change', this.loadSettings, this);\r
+ settings.on('change', this.loadSettings, this);\r
}\r
});\r
\r
\r
this.initializeClient();\r
this.initializeGlobals();\r
+ this.applyDefaultClientSettings(this.server_settings.client.settings);\r
\r
this.view.barsHide(true);\r
\r
};\r
\r
\r
+ this.applyDefaultClientSettings = function (settings) {\r
+ _.each(settings, function (value, setting) {\r
+ if (typeof _kiwi.global.settings.get(setting) === 'undefined') {\r
+ _kiwi.global.settings.set(setting, value);\r
+ }\r
+ });\r
+ _kiwi.global.settings.save();\r
+ };\r
+\r
+\r
this.populateDefaultServerSettings = function (new_connection_dialog) {\r
var parts;\r
var defaults = {\r
port: 6697,
ssl: true,
channel: '#kiwiirc',
- nick: 'kiwi_?'
+ nick: 'kiwi_?',
+ settings: {
+ theme: 'relaxed',
+ channel_list_style: 'tabs',
+ scrollback: 250,
+ show_joins_parts: true,
+ show_timestamps: false,
+ mute_sounds: false
+ }
};