]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/xul/staff_client/chrome/content/util/browser.xul
xul_param and modal xulG conversion
[working/Evergreen.git] / Open-ILS / xul / staff_client / chrome / content / util / browser.xul
1 <?xml version="1.0"?>
2 <!-- Application: Evergreen Staff Client -->
3 <!-- Screen: Patron Display -->
4
5 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
6 <!-- STYLESHEETS -->
7 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
8 <?xml-stylesheet href="chrome://open_ils_staff_client/skin/global.css" type="text/css"?>
9
10 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
11 <!-- LOCALIZATION -->
12 <!DOCTYPE window SYSTEM "chrome://open_ils_staff_client/locale/lang.dtd">
13
14 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
15 <!-- OVERLAYS -->
16 <?xul-overlay href="chrome://open_ils_staff_client/content/OpenILS/util_overlay.xul"?>
17
18 <window id="util_browser_win" 
19         onload="try { my_init(); font_helper(); } catch(E) { alert(E); }"
20         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
21
22         <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
23         <!-- BEHAVIOR -->
24         <script type="text/javascript">
25                 var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true; var g = {};
26                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
27         </script>
28         <scripts id="openils_util_scripts"/>
29
30         <script type="text/javascript" src="chrome://open_ils_staff_client/content/main/JSAN.js"/>
31         <script>
32         <![CDATA[
33                 function my_init() {
34                         try {
35                                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
36                                 if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
37                                 JSAN.errorLevel = "die"; // none, warn, or die
38                                 JSAN.addRepository('..');
39                                 JSAN.use('util.error'); g.error = new util.error();
40                                 g.error.sdump('D_TRACE','my_init() for util_browser.xul');
41
42                                 JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.init({'via':'stash'});
43                                 XML_HTTP_SERVER = data.server_unadorned;
44
45                                 var name = xul_param('tab_name') || xul_param('name') || null;
46                                 var url; try { url = xul_param('url'); } catch(E) { dump(E + '\n'); };
47                                 if (!url) url = urls.browser;
48
49                                 JSAN.use('util.browser'); g.browser = new util.browser();
50
51                                 var push_xulG = true;
52                                 if (xul_param('no_xulG')) push_xulG = false;
53
54                                 var alt_print = false;
55                                 if (xul_param('alternate_print')) alt_print = true;
56
57                                 var p = { 
58                                         'url' : url,
59                                         'push_xulG' : push_xulG,
60                                         'alt_print' : alt_print,
61                                         'debug_label' : 'debug',
62                                 };
63                                 if (typeof window.xulG == 'object' && typeof window.xulG.passthru_content_params == 'object') {
64                                         p.passthru_content_params = window.xulG.passthru_content_params;
65                                 }
66                                 if (typeof window.xulG == 'object' && typeof window.xulG.on_url_load == 'function') {
67                                         p.on_url_load = window.xulG.on_url_load;
68                                 }
69
70                                 g.browser.init( p );
71
72                                 if (typeof window.xulG == 'object' && typeof window.xulG.set_tab_name == 'function') {
73                                         if (name) try { window.xulG.set_tab_name(name); } catch(E) { alert(E); }
74                                 }
75                                 if (xul_param('show_nav_buttons')) {
76                                         document.getElementById('back').hidden = false;
77                                         document.getElementById('forward').hidden = false;
78                                 }
79                                 if (xul_param('show_print_button')) {
80                                         document.getElementById('browser_print').hidden = false;
81                                 }
82
83                                 if (xul_param('title')) {
84                                         try { document.title = xul_param('title'); } catch(E) {}
85                                         try { window.title = xul_param('title'); } catch(E) {}
86                                 }
87
88                         } catch(E) {
89                                 var err_msg = "!! This software has encountered an error.  Please tell your friendly " +
90                                         "system administrator or software developer the following:\n" + E + '\n';
91                                 try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
92                                 alert(err_msg);
93                         }
94                 }
95
96         ]]>
97         </script>
98
99         <commandset id="util_browser_cmds">
100                 <command id="cmd_broken" />
101                 <command id="cmd_print" />
102                 <command id="cmd_back" />
103                 <command id="cmd_forward" />
104         </commandset>
105
106         <vbox flex="1">
107                 <hbox>
108                         <button id="back" label="Go Back" command="cmd_back" accesskey="b" disabled="true" hidden="true"/>
109                         <button id="forward" label="Go Forward" command="cmd_forward" accesskey="d" disabled="true" hidden="true"/>
110                         <spacer flex="1"/>
111                         <label id="debug" value="Debug" disabled="true" onclick="var m = (this.getAttribute('tooltiptext')+'\n'); dump(m); alert(m);"/>
112                         <button id="browser_print" label="Print Page" command="cmd_print" hidden="true"/>
113                 </hbox>
114                 <browser id="browser_browser" flex="1" type="content"/>
115         </vbox>
116
117 </window>
118