]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/xul/staff_client/external/dojo_template.js
Improve Firefox/XULRunner Support
[working/Evergreen.git] / Open-ILS / xul / staff_client / external / dojo_template.js
1 var error;
2
3 function my_init() {
4     try {
5         if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
6         JSAN.errorLevel = "die"; // none, warn, or die
7         JSAN.addRepository('/xul/server/');
8         JSAN.use('util.error'); error = new util.error();
9         error.sdump('D_TRACE','my_init() for main_test.xul');
10
11         dojo.require('openils.PermaCrud');
12
13         var types = new openils.PermaCrud(
14             {
15                 authtoken :ses()
16             }
17         ).retrieveAll('coust');
18
19         dojo.forEach(types,
20             function(type) {
21                 alert( js2JSON(type) );
22             }
23         );
24
25         if (typeof window.xulG == 'object' && typeof window.xulG.set_tab_name == 'function') {
26             try { window.xulG.set_tab_name('Test'); } catch(E) { alert(E); }
27         }
28
29     } catch(E) {
30         try { error.standard_unexpected_error_alert('main/test.xul',E); } catch(F) { alert(E); }
31     }
32 }
33
34