Customisable settings.json path
authorDarren <darren@darrenwhitlen.com>
Sat, 24 Aug 2013 15:35:38 +0000 (16:35 +0100)
committerDarren <darren@darrenwhitlen.com>
Sat, 24 Aug 2013 15:35:38 +0000 (16:35 +0100)
client/assets/src/index.html.tmpl
client/assets/src/models/application.js

index 80baa7de469b84181f2b6d13a6c59d20519438b3..7617aaedb575d42efd09cff816b8dd23627193ae 100644 (file)
             scripts = [],\r
             opts = {\r
                 container: $('#kiwi'),\r
-                base_path: base_path\r
+                base_path: base_path,\r
+                settings_path: base_path + '/assets/settings.json'\r
             };\r
 \r
         normalizeConsole();\r
         }\r
 \r
         // Load application settings\r
-        $.getJSON(base_path + '/assets/settings.json', function (data) {\r
+        $.getJSON(opts.settings_path, function (data) {\r
             scripts = scripts.concat(data.scripts);\r
             opts.server_settings = data.server_settings;\r
             opts.client_plugins = data.client_plugins;\r
index 70e1060fc25ab4f921cee746318cdab8be83e874..0612ce6c6b29b0f86c4ca9c3b968748784e5d540 100644 (file)
@@ -23,6 +23,12 @@ _kiwi.model.Application = function () {
             // The base url to the kiwi server\r
             this.set('base_path', options[0].base_path ? options[0].base_path : '/kiwi');\r
 \r
+            // Path for the settings.json file\r
+            this.set('settings_path', options[0].settings_path ?\r
+                    options[0].settings_path :\r
+                    this.get('base_path') + '/assets/settings.json'\r
+            );\r
+\r
             // Any options sent down from the server\r
             this.server_settings = options[0].server_settings || {};\r
             this.translations = options[0].translations || {};\r
@@ -417,7 +423,7 @@ _kiwi.model.Application = function () {
 \r
 \r
             gw.on('kiwi:reconfig', function () {\r
-                $.getJSON(that.get('base_path') + '/assets/settings.json', function (data) {\r
+                $.getJSON(that.get('settings_path'), function (data) {\r
                     that.server_settings = data.server_settings || {};\r
                     that.translations = data.translations || {};\r
                 });\r