X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=client%2Fsrc%2Fapp.js;h=619507cc7e2569c22b6f35c2cf12d77573571142;hb=f91187cfa693c4093033f1698deb90e6b70a7acc;hp=5ed13c78a346d4a89a39d4f4a0b51d578f836dfd;hpb=299a4c35ee757ede991da70a4846914d1a70796b;p=KiwiIRC.git diff --git a/client/src/app.js b/client/src/app.js index 5ed13c7..619507c 100644 --- a/client/src/app.js +++ b/client/src/app.js @@ -8,6 +8,7 @@ _kiwi.misc = {}; _kiwi.model = {}; _kiwi.view = {}; _kiwi.applets = {}; +_kiwi.utils = {}; /** @@ -23,6 +24,7 @@ _kiwi.global = { rpc: undefined, // Instance of WebsocketRpc utils: {}, // References to misc. re-usable helpers / functions + // Make public some internal utils for plugins to make use of initUtils: function() { this.utils.randomString = randomString; this.utils.secondsToTime = secondsToTime; @@ -31,6 +33,9 @@ _kiwi.global = { this.utils.formatIRCMsg = formatIRCMsg; this.utils.styleText = styleText; this.utils.hsl2rgb = hsl2rgb; + + this.utils.notifications = _kiwi.utils.notifications; + this.utils.formatDate = _kiwi.utils.formatDate; }, addMediaMessageType: function(match, buildHtml) { @@ -188,6 +193,9 @@ _kiwi.global = { }; }); + // Give access to the control input textarea + obj.input = _kiwi.app.controlbox.$('.inp'); + return obj; } }, @@ -242,6 +250,9 @@ _kiwi.global = { _kiwi.global.plugins = new _kiwi.model.PluginManager(); callback(); + + }).then(null, function(err) { + console.error(err.stack); }); },