c680b417d96c4bfccd6252649705c16e23dbe5f1
[KiwiIRC.git] / client_backbone / dev / app.js
1 // Holds anything kiwi client specific (ie. front, gateway, kiwi.plugs..)
2 /**
3 * @namespace
4 */
5 var kiwi = {};
6
7 kiwi.model = {};
8 kiwi.view = {};
9 kiwi.applets = {};
10
11
12 /**
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)
16 */
17 kiwi.global = {
18 utils: undefined, // Re-usable methods
19 gateway: undefined,
20 user: undefined,
21 server: undefined,
22 command: undefined, // The control box
23
24 // TODO: think of a better term for this as it will also refer to queries
25 channels: undefined,
26
27 // Entry point to start the kiwi application
28 start: function (opts) {
29 opts = opts || {};
30
31 kiwi.app = new kiwi.model.Application(opts);
32
33 if (opts.kiwi_server) {
34 kiwi.app.kiwi_server = opts.kiwi_server;
35 }
36
37 kiwi.app.start();
38
39 return true;
40 }
41 };
42
43
44
45 // If within a closure, expose the kiwi globals
46 if (typeof global !== 'undefined') {
47 global.kiwi = kiwi.global;
48 }