we can't reliably use messagecat with scripts that run before the onload event
[Evergreen.git] / Open-ILS / xul / staff_client / server / main / data.xul
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- Application: Evergreen Staff Client -->
3 <!-- Screen: Main, Authentication Window -->
4 <!--
5  vim:noet:sw=4:ts=4:
6 -->
7
8 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
9 <!-- PRESENTATION -->
10 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
11 <?xml-stylesheet href="chrome://open_ils_staff_client/skin/global.css" type="text/css"?>
12 <?xml-stylesheet href="chrome://open_ils_staff_client/skin/auth.css" type="text/css"?>
13 <!-- Load these just to cache them -->
14 <?xml-stylesheet href="/xul/server/skin/global.css" type="text/css"?>
15 <?xml-stylesheet href="/xul/server/skin/cat.css" type="text/css"?>
16 <?xml-stylesheet href="/xul/server/skin/circ.css" type="text/css"?>
17 <?xml-stylesheet href="/xul/server/skin/patron_display.css" type="text/css"?>
18 <?xml-stylesheet href="/xul/server/skin/patron_summary.css" type="text/css"?>
19 <?xml-stylesheet href="/xul/server/skin/simple_auth.css" type="text/css"?>
20
21
22 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
23 <!-- LOCALIZATION -->
24 <!DOCTYPE window PUBLIC "" ""[
25         <!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
26 ]>
27
28 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
29 <!-- OVERLAYS -->
30 <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
31
32 <window id="data_win" 
33         onload="try { data_init(); } catch(E) { alert(E); }"
34         title="&staff.auth.title;"
35         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
36
37
38         <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
39         <!-- BEHAVIOR -->
40         <script type="text/javascript">var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true; var g = {};</script>
41         <scripts id="openils_util_scripts"/>
42
43         <script type="text/javascript" src="chrome://open_ils_staff_client/content/main/JSAN.js"/>
44         <script>
45         <![CDATA[
46
47                 function data_init() {
48
49                         netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
50
51                         if (typeof JSAN == 'undefined') {
52                                 throw(document.getElementById("commonStrings").getString('common.jsan.missing'));
53                         }
54                         /////////////////////////////////////////////////////////////////////////////
55
56                         JSAN.errorLevel = "die"; // none, warn, or die
57                         JSAN.addRepository('/xul/server/');
58
59                         function cache_me(msg,how) {
60                                 try {
61                                         switch(how) {
62                                                 case 'jsan' : JSAN.use(msg); break;
63                                                 case 'http' :
64                                                         var x = new XMLHttpRequest();
65                                                         x.open("GET",msg,true);
66                                                         x.send(null);
67                                                 break;
68                                         }
69                                         dump(msg + '\n');
70                                         var x = document.getElementById('data_progress');
71                                         if (x) {
72                                                 x.appendChild( document.createTextNode( msg + ' ') );
73                                         }
74                                 } catch(E) {
75                                         dump(msg + '\n' + E);
76                                 }
77                         }
78
79                         // load these just so they'll get cached
80                         //cache_me('/xul/server//util/exec.js','http');
81                         //cache_me('/xul/server//util/barcode.js','http');  
82                         //cache_me('/xul/server//util/controller.js','http');  
83                         //cache_me('/xul/server//util/deck.js','http');  
84                         //cache_me('/xul/server//util/fm_utils.js','http');  
85                         //cache_me('/xul/server//util/list.js','http');  
86                         //cache_me('/xul/server//util/network.js','http'); 
87                         //cache_me('/xul/server//util/sound.js','http'); 
88                         //cache_me('/xul/server//util/widgets.js','http');  
89                         //cache_me('/xul/server//util/browser.js','http');  
90                         //cache_me('/xul/server//util/error.js','http');  
91                         //cache_me('/xul/server//util/file.js','http'); 
92                         //cache_me('/xul/server//util/functional.js','http');  
93                         //cache_me('/xul/server//util/money.js','http');  
94                         //cache_me('/xul/server//util/print.js','http');  
95                         //cache_me('/xul/server//util/text.js','http'); 
96                         //cache_me('/xul/server//util/window.js','http'); 
97
98                         cache_me('/xul/server/util/fancy_prompt.xul','http');
99                         //cache_me('/xul/server/util/browser.xul','http');
100                         //cache_me('/xul/server/util/rbrowser.xul','http');
101
102                         //cache_me('/xul/server//patron/display.js','http');  
103                         //cache_me('/xul/server//patron/bills.js','http');  
104                         //cache_me('/xul/server//patron/holds.js','http');  
105                         //cache_me('/xul/server//patron/items.js','http'); 
106                         //cache_me('/xul/server//patron/search_form.js','http');  
107                         //cache_me('/xul/server//patron/search_result.js','http');  
108                         //cache_me('/xul/server//patron/summary.js','http'); 
109                         //cache_me('/xul/server//patron/util.js','http'); 
110
111                         //cache_me('/xul/server/patron/display.xul','http');  
112                         //cache_me('/xul/server/patron/display_overlay.xul','http');  
113                         //cache_me('/xul/server/patron/bills.xul','http');  
114                         //cache_me('/xul/server/patron/bills_overlay.xul','http');  
115                         //cache_me('/xul/server/patron/holds.xul','http');  
116                         //cache_me('/xul/server/patron/holds_overlay.xul','http');  
117                         //cache_me('/xul/server/patron/items.xul','http'); 
118                         //cache_me('/xul/server/patron/items_overlay.xul','http'); 
119                         //cache_me('/xul/server/patron/search_form.xul','http');  
120                         //cache_me('/xul/server/patron/search_form_overlay.xul','http');  
121                         //cache_me('/xul/server/patron/search_result.xul','http');  
122                         //cache_me('/xul/server/patron/search_result_overlay.xul','http');  
123                         //cache_me('/xul/server/patron/summary.xul','http'); 
124                         //cache_me('/xul/server/patron/summary_overlay.xul','http'); 
125                         //cache_me('/xul/server/patron/barcode_entry.xul','http');
126
127                         //cache_me('/xul/server/patron/ue.xhtml','http');
128                         //cache_me('/xul/server/admin/adminlib.js','http');
129                         //cache_me('/xul/server/admin/admin.css','http');
130                         //cache_me('/xul/server/patron/ue_config.js','http');
131                         //cache_me('/xul/server/patron/ue_ui.js','http');
132                         //cache_me('/xul/server/patron/ue.js','http');
133                         //cache_me('/opac/common/js//config.js','http');
134                         //cache_me('/opac/common/js/Cookie.js','http');
135                         //cache_me('/opac/common/js/Cookies.js','http');
136                         //cache_me('/opac/common/js/opac_utils.js','http');
137                         //cache_me('/opac/common/js/init.js','http');
138                         //cache_me('/opac/common/js/jscalendar/calendar-brown.css','http');
139                         //cache_me('/opac/common/js/jscalendar/calendar.js','http');
140                         //cache_me('/opac/common/js/jscalendar/lang/calendar-en.js','http');
141                         //cache_me('/opac/common/js/jscalendar/calendar-setup.js','http');
142                         //cache_me('/opac/common/js/jscalendar/img.gif','http');
143
144                         //cache_me('/xul/server/skin/media/images/stop_sign.png','http');
145                         //cache_me('/xul/server/skin/media/images/bad_barcode.png','http');
146                         //cache_me('/xul/server/skin/media/images/grinder.gif','http');     
147                         //cache_me('/xul/server/skin/media/images/patron_left_arrow.png','http');
148                         //cache_me('/xul/server/skin/media/images/skull.png','http');
149                         //cache_me('/xul/server/skin/media/images/tools.png','http');
150                         //cache_me('/xul/server/skin/media/images/up_arrow.gif','http');
151                         //cache_me('/xul/server/skin/media/images/book_question.png','http');
152                         //cache_me('/xul/server/skin/media/images/down_arrow.gif','http');
153                         //cache_me('/xul/server/skin/media/images/icon_delete.gif','http');
154                         //cache_me('/xul/server/skin/media/images/patron_right_arrow.png','http');
155                         //cache_me('/xul/server/skin/media/images/turtle.gif','http');
156                         //cache_me('/xul/server/skin/media/audio/bonus.wav','http');
157                         //cache_me('/xul/server/skin/media/audio/question.wav','http');
158                         //cache_me('/xul/server/skin/media/audio/redalert.wav','http');
159                         //cache_me('/xul/server/skin/media/audio/toggled.wav','http');
160
161                         //cache_me('/xul/server//circ/checkin.js','http');  
162                         //cache_me('/xul/server//circ/checkout.js','http');  
163                         //cache_me('/xul/server//circ/copy_status.js','http'); 
164                         //cache_me('/xul/server//circ/hold_capture.js','http'); 
165                         //cache_me('/xul/server//circ/in_house_use.js','http');  
166                         //cache_me('/xul/server//circ/util.js','http'); 
167
168                         //cache_me('/xul/server/circ/checkout_overlay.xul','http');
169                         //cache_me('/xul/server/circ/checkout.xul','http');
170                         //cache_me('/xul/server/circ/checkin_overlay.xul','http');
171                         //cache_me('/xul/server/circ/checkin.xul','http');
172                         //cache_me('/xul/server/circ/circ_brief.xul','http');
173                         //cache_me('/xul/server/circ/circ_summary.xul','http');
174                         //cache_me('/xul/server/circ/copy_status.xul','http');
175                         //cache_me('/xul/server/circ/copy_status_overlay.xul','http');
176
177                         // ----
178
179                         JSAN.use('OpenILS.data');
180                         g.data = new OpenILS.data()
181                         g.data.on_error = xulG.auth.logoff;
182
183                         g.data.session = {};
184                         g.data.session.key = xulG.auth.session.key;
185                         g.data.session.authtime = xulG.auth.session.authtime;
186                         g.data.stash('session');
187                         g.data.on_complete = function () {
188
189                                 g.data.stash('list','hash','tree','temp');
190
191                                 g.data._debug_stash();
192
193                                 document.getElementById('iframe').setAttribute(
194                                         'src',
195                                         urls.XUL_OFFLINE_GENERATE_WIDGETS       
196                                 );
197
198                                 document.getElementById('caption').setAttribute('label', document.getElementById('commonStrings').getString('staff.main.data.loaded'));
199
200                                 xulG.window.open(urls.XUL_MENU_FRAME
201                                         + '?server='+window.escape(xulG.url),
202                                         'main'+xulG.window.window_name_increment(),'chrome,resizable'
203                                 );
204
205                         }
206
207                         g.data.init();
208         
209                         g.data.init_observer_functions();
210
211                 }
212         ]]>
213         </script>
214
215     <messagecatalog id="commonStrings" src="/xul/server/locale/<!--#echo var='locale'-->/common.properties" />
216
217         <groupbox id="data_groupbox" flex="1" class="my_overflow"> 
218                 <caption id="caption" label="&staff.main.data.loading;"/> 
219                 <description id="data_progress"/>
220                 <iframe id="iframe" />
221         </groupbox>
222
223 </window>
224