1 // Holds anything kiwi client specific (ie. front, gateway, _kiwi.plugs..)
13 * A global container for third party access
14 * Will be used to access a limited subset of kiwi functionality
15 * and data (think: plugins)
20 utils
: undefined, // TODO: Re-usable methods
21 gateway
: undefined, // TODO: Access to gateway
22 user
: undefined, // TODO: Limited user methods
23 server
: undefined, // TODO: Limited server methods
24 command
: undefined, // The control box
26 // TODO: think of a better term for this as it will also refer to queries
27 channels
: undefined, // TODO: Limited access to panels list
29 // Entry point to start the kiwi application
30 start: function (opts
) {
33 // Load the plugin manager
34 _kiwi
.global
.plugins
= new _kiwi
.model
.PluginManager();
36 // Set up the settings datastore
37 _kiwi
.global
.settings
= _kiwi
.model
.DataStore
.instance('kiwi.settings');
38 _kiwi
.global
.settings
.load();
40 _kiwi
.app
= new _kiwi
.model
.Application(opts
);
42 if (opts
.kiwi_server
) {
43 _kiwi
.app
.kiwi_server
= opts
.kiwi_server
;
46 // Start the client up
55 // If within a closure, expose the kiwi globals
56 if (typeof global
!== 'undefined') {
57 global
.kiwi
= _kiwi
.global
;
59 // Not within a closure so set a var in the current scope
60 var kiwi
= _kiwi
.global
;