]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/xul/staff_client/chrome/content/util/browser.xul
browser wrapper without xulG
[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="my_init()"
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                                 g.cgi = new CGI();
43                                 var name = g.cgi.param('tab_name') || g.cgi.param('name') || null;
44                                 if (!name) {
45                                         if (typeof window.xulG == 'object') {
46                                                 name = window.xulG.name || window.xulG.tab_name || null;
47                                         }
48                                 }
49                                 var session = g.cgi.param('session');
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') || xulG.no_xulG) push_xulG = false;
57
58                                 g.browser.init( 
59                                         { 
60                                                 'url' : xulG.url_prefix(url),
61                                                 'session' : session,
62                                                 'push_xulG' : push_xulG,
63                                         } 
64                                 );
65
66                                 if (typeof window.xulG == 'object' && typeof window.xulG.set_tab_name == 'function') {
67                                         if (name) try { window.xulG.set_tab_name(name); } catch(E) { alert(E); }
68                                 }
69                                 if (typeof window.xulG && window.xulG.show_nav_buttons) {
70                                         document.getElementById('back').hidden = false;
71                                         document.getElementById('forward').hidden = false;
72                                 }
73                                 if (typeof window.xulG && window.xulG.show_print_button) {
74                                         document.getElementById('browser_print').hidden = false;
75                                 }
76
77                         } catch(E) {
78                                 var err_msg = "!! This software has encountered an error.  Please tell your friendly " +
79                                         "system administrator or software developer the following:\n" + E + '\n';
80                                 try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
81                                 alert(err_msg);
82                         }
83                 }
84
85         ]]>
86         </script>
87
88         <commandset id="util_browser_cmds">
89                 <command id="cmd_broken" />
90                 <command id="cmd_print" />
91                 <command id="cmd_back" />
92                 <command id="cmd_forward" />
93         </commandset>
94
95         <vbox flex="1">
96                 <hbox>
97                         <button id="back" label="Go Back" command="cmd_back" accesskey="b" disabled="true" hidden="true"/>
98                         <button id="forward" label="Go Forward" command="cmd_forward" accesskey="d" disabled="true" hidden="true"/>
99                         <spacer flex="1"/>
100                         <button id="browser_print" label="Print Page" command="cmd_print" hidden="true"/>
101                 </hbox>
102                 <browser id="browser_browser" flex="1" type="content"/>
103         </vbox>
104
105 </window>
106