]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul
JSAN libraries shouldn't be looking at xulG
[working/Evergreen.git] / Open-ILS / xul / staff_client / chrome / content / util / rbrowser.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 <?xml-stylesheet href="/xul/server/skin/global.css" type="text/css"?>
10
11 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
12 <!-- LOCALIZATION -->
13 <!DOCTYPE window SYSTEM "chrome://open_ils_staff_client/locale/lang.dtd">
14
15 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
16 <!-- OVERLAYS -->
17 <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
18
19 <window id="util_browser_win" 
20         onload="my_init()"
21         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
22
23         <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
24         <!-- BEHAVIOR -->
25         <script type="text/javascript">
26                 var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true; var g = {};
27                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
28         </script>
29         <scripts id="openils_util_scripts"/>
30
31         <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
32         <script>
33         <![CDATA[
34                 function my_init() {
35                         try {
36                                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
37                                 if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
38                                 JSAN.errorLevel = "die"; // none, warn, or die
39                                 JSAN.addRepository('/xul/server/');
40                                 JSAN.use('util.error'); g.error = new util.error();
41                                 g.error.sdump('D_TRACE','my_init() for util_browser.xul');
42
43                                 g.cgi = new CGI();
44                                 var name = g.cgi.param('tab_name') || g.cgi.param('name') || null;
45                                 if (!name) {
46                                         if (typeof window.xulG == 'object') {
47                                                 name = window.xulG.name || window.xulG.tab_name || null;
48                                         }
49                                 }
50                                 var url; try { url = g.cgi.param('url') || xulG.url } catch(E) { dump(E + '\n'); };
51                                 if (!url) url = urls.browser;
52
53                                 JSAN.use('util.browser'); g.browser = new util.browser();
54
55                                 var push_xulG = true;
56                                 if (g.cgi.param('no_xulG') || (typeof xulG == 'object' ? xulG.no_xulG : false)) push_xulG = false;
57
58                                 var alt_print = false;
59                                 if (g.cgi.param('alternate_print') || (typeof xulG == 'object' ? xulG.alternate_print : false)) alt_print = true;
60
61                                 var p = { 
62                                         'url' : url,
63                                         'push_xulG' : push_xulG,
64                                         'alt_print' : alt_print,
65                                 } 
66                                 if (typeof window.xulG == 'object' && typeof window.xulG.passthru_content_params == 'object') {
67                                         p.passthru_content_params = window.xulG.passthru_content_params;
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 (g.cgi.param('show_nav_buttons')||(typeof window.xulG == 'object' && window.xulG.show_nav_buttons)) {
76                                         document.getElementById('back').hidden = false;
77                                         document.getElementById('forward').hidden = false;
78                                 }
79                                 if (g.cgi.param('show_print_button')||(typeof window.xulG == 'object' && window.xulG.show_print_button)) {
80                                         document.getElementById('browser_print').hidden = false;
81                                 }
82
83                                 if (g.cgi.param('title')) {
84                                         try { document.title = g.cgi.param('title'); } catch(E) {}
85                                         try { window.title = g.cgi.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                         <button id="browser_print" label="Print Page" command="cmd_print" hidden="true"/>
112                 </hbox>
113                 <browser id="browser_browser" flex="1" type="content"/>
114         </vbox>
115
116 </window>
117