Merge branch 'development' of https://github.com/CoryChaplin/KiwiIRC into text_themes
[KiwiIRC.git] / client / src / app.js
index b4f86f83d58546a1590febca0a8b1a60f7e2a432..094fbcdad36ae89d2a6952915c559a7e50aec4ed 100644 (file)
@@ -110,7 +110,7 @@ _kiwi.global = {
 \r
     // Entry point to start the kiwi application\r
     init: function (opts, callback) {\r
-        var continueStart, locale;\r
+        var continueStart, locale, igniteTextTheme, text_theme;\r
         opts = opts || {};\r
 \r
         continueInit = function (locale, s, xhr) {\r
@@ -119,7 +119,7 @@ _kiwi.global = {
             } else {\r
                 _kiwi.global.i18n = new Jed();\r
             }\r
-\r
+            \r
             _kiwi.app = new _kiwi.model.Application(opts);\r
 \r
             // Start the client up\r
@@ -130,6 +130,12 @@ _kiwi.global = {
 \r
             callback && callback();\r
         };\r
+        \r
+        igniteTextTheme = function(text_theme, s, xhr) {\r
+            _kiwi.global.text_theme = new _kiwi.view.TextTheme(text_theme);\r
+            \r
+            callback && callback();\r
+        }\r
 \r
         // Set up the settings datastore\r
         _kiwi.global.settings = _kiwi.model.DataStore.instance('kiwi.settings');\r
@@ -144,6 +150,13 @@ _kiwi.global = {
         } else {\r
             $.getJSON(opts.base_path + '/assets/locales/' + locale + '.json', continueInit);\r
         }\r
+\r
+        text_theme = opts.text_theme;\r
+        if (!text_theme) {\r
+            $.getJSON(opts.base_path + '/assets/text_themes/default.json', igniteTextTheme);\r
+        } else {\r
+            $.getJSON(opts.base_path + '/assets/text_themes/' + text_theme + '.json', igniteTextTheme);\r
+        }\r
     },\r
 \r
     start: function() {\r