some thinkos, offline fixes, remote xul testing
[Evergreen.git] / Open-ILS / xul / staff_client / chrome / content / evergreen / main / main.js
1 dump('entering main/main.js\n');
2
3 function main_init() {
4         dump('entering main_init()\n');
5         try {
6                 if (typeof JSAN == 'undefined') {
7                         throw(
8                                 "The JSAN library object is missing."
9                         );
10                 }
11                 /////////////////////////////////////////////////////////////////////////////
12
13                 JSAN.errorLevel = "die"; // none, warn, or die
14                 JSAN.addRepository('..');
15
16                 //JSAN.use('test.test'); test.test.hello_world();
17
18                 var mw = self;
19                 var G =  {};
20                 G.OpenILS = {};
21                 G.OpenSRF = {};
22
23                 JSAN.use('util.error');
24                 G.error = new util.error( mw, G );
25
26                 JSAN.use('main.window');
27                 G.window = new main.window( mw, G );
28
29                 JSAN.use('main.network');
30                 G.network = new main.network( mw, G );
31
32                 G.test_array = [ "a", "b", "c" ];
33                 G.test_object = { "a" : "b", "c" : "d", "e" : "f" };
34                 G.test = function(t) {
35                         dump(js2JSON( t ) + '\n');
36                 }
37
38                 JSAN.use('auth.controller');
39                 G.auth = new auth.controller( mw, G );
40
41                 G.auth.on_login = function() {
42
43                         JSAN.use('OpenILS.data');
44                         G.OpenILS.data = new OpenILS.data( mw, G );
45                         G.OpenILS.data.on_complete = function () {
46
47                                 G.window.open('http://gapines.org/xul/test.xul','test','chrome');
48                         }
49                         G.OpenILS.data.init();
50                 }
51
52                 G.auth.init();
53
54                 /////////////////////////////////////////////////////////////////////////////
55
56         } catch(E) {
57                 var error = "!! This software has encountered an error.  Please tell your friendly " +
58                         "system administrator or software developer the following:\n" + E + '\n';
59                 try { G.error.sdump('D_ERROR',error); } catch(E) { dump(error); }
60                 alert(error);
61         }
62         dump('exiting main_init()\n');
63 }
64
65 dump('exiting main/main.js\n');