From: Darren Date: Sat, 24 Aug 2013 15:35:38 +0000 (+0100) Subject: Customisable settings.json path X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=bceb5db6ff157554846008f39b0538c5bddf7fd0;p=KiwiIRC.git Customisable settings.json path --- diff --git a/client/assets/src/index.html.tmpl b/client/assets/src/index.html.tmpl index 80baa7d..7617aae 100644 --- a/client/assets/src/index.html.tmpl +++ b/client/assets/src/index.html.tmpl @@ -348,7 +348,8 @@ scripts = [], opts = { container: $('#kiwi'), - base_path: base_path + base_path: base_path, + settings_path: base_path + '/assets/settings.json' }; normalizeConsole(); @@ -394,7 +395,7 @@ } // Load application settings - $.getJSON(base_path + '/assets/settings.json', function (data) { + $.getJSON(opts.settings_path, function (data) { scripts = scripts.concat(data.scripts); opts.server_settings = data.server_settings; opts.client_plugins = data.client_plugins; diff --git a/client/assets/src/models/application.js b/client/assets/src/models/application.js index 70e1060..0612ce6 100644 --- a/client/assets/src/models/application.js +++ b/client/assets/src/models/application.js @@ -23,6 +23,12 @@ _kiwi.model.Application = function () { // The base url to the kiwi server this.set('base_path', options[0].base_path ? options[0].base_path : '/kiwi'); + // Path for the settings.json file + this.set('settings_path', options[0].settings_path ? + options[0].settings_path : + this.get('base_path') + '/assets/settings.json' + ); + // Any options sent down from the server this.server_settings = options[0].server_settings || {}; this.translations = options[0].translations || {}; @@ -417,7 +423,7 @@ _kiwi.model.Application = function () { gw.on('kiwi:reconfig', function () { - $.getJSON(that.get('base_path') + '/assets/settings.json', function (data) { + $.getJSON(that.get('settings_path'), function (data) { that.server_settings = data.server_settings || {}; that.translations = data.translations || {}; });