Log client startup errors to console
[KiwiIRC.git] / client / src / app.js
index 5ed13c78a346d4a89a39d4f4a0b51d578f836dfd..619507cc7e2569c22b6f35c2cf12d77573571142 100644 (file)
@@ -8,6 +8,7 @@ _kiwi.misc = {};
 _kiwi.model = {};\r
 _kiwi.view = {};\r
 _kiwi.applets = {};\r
+_kiwi.utils = {};\r
 \r
 \r
 /**\r
@@ -23,6 +24,7 @@ _kiwi.global = {
     rpc: undefined, // Instance of WebsocketRpc\r
     utils: {}, // References to misc. re-usable helpers / functions\r
 \r
+    // Make public some internal utils for plugins to make use of\r
     initUtils: function() {\r
         this.utils.randomString = randomString;\r
         this.utils.secondsToTime = secondsToTime;\r
@@ -31,6 +33,9 @@ _kiwi.global = {
         this.utils.formatIRCMsg = formatIRCMsg;\r
         this.utils.styleText = styleText;\r
         this.utils.hsl2rgb = hsl2rgb;\r
+\r
+        this.utils.notifications = _kiwi.utils.notifications;\r
+        this.utils.formatDate = _kiwi.utils.formatDate;\r
     },\r
 \r
     addMediaMessageType: function(match, buildHtml) {\r
@@ -188,6 +193,9 @@ _kiwi.global = {
                 };\r
             });\r
 \r
+            // Give access to the control input textarea\r
+            obj.input = _kiwi.app.controlbox.$('.inp');\r
+\r
             return obj;\r
         }\r
     },\r
@@ -242,6 +250,9 @@ _kiwi.global = {
             _kiwi.global.plugins = new _kiwi.model.PluginManager();\r
 \r
             callback();\r
+\r
+        }).then(null, function(err) {\r
+            console.error(err.stack);\r
         });\r
     },\r
 \r