]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul
progressmeter as a "throbber" for page loads, etc. in staff client browser
[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="try { my_init(); font_helper(); } catch(E) { alert(E); }"
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
35         function my_init() {
36             try {
37                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
38                         if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
39                 JSAN.errorLevel = "die"; // none, warn, or die
40                 JSAN.addRepository('/xul/server/');
41                 JSAN.use('util.error'); g.error = new util.error();
42                 g.error.sdump('D_TRACE','my_init() for util_browser.xul');
43
44                 var name = xul_param('tab_name') || xul_param('name') || null;
45                 var url; try { url = xul_param('url'); } catch(E) { dump(E + '\n'); };
46                 if (!url) url = urls.browser;
47
48                 if (!g.browser) {
49                     JSAN.use('util.browser'); g.browser = new util.browser();
50                 }
51
52                 var push_xulG = true;
53                 if (xul_param('no_xulG')) push_xulG = false;
54
55                 var alt_print = false;
56                 if (xul_param('alternate_print')) alt_print = true;
57
58                 var p = { 
59                     'url' : url,
60                     'push_xulG' : push_xulG,
61                     'alt_print' : alt_print,
62                     'debug_label' : 'debug'
63                 } 
64                 if (typeof window.xulG == 'object' && typeof window.xulG.passthru_content_params == 'object') {
65                     p.passthru_content_params = window.xulG.passthru_content_params;
66                 }
67                 if (typeof window.xulG == 'object' && typeof window.xulG.on_url_load == 'function') {
68                     p.on_url_load = window.xulG.on_url_load;
69                 }
70
71                 g.browser.init( p );
72
73                 if (typeof window.xulG == 'object' && typeof window.xulG.set_tab_name == 'function') {
74                     if (name) try { window.xulG.set_tab_name(name); } catch(E) { alert(E); }
75                 }
76                 if (xul_param('show_nav_buttons')) {
77                     document.getElementById('back').hidden = false;
78                     document.getElementById('forward').hidden = false;
79                 }
80                 if (xul_param('show_print_button')) {
81                     document.getElementById('browser_print').hidden = false;
82                 }
83
84                 if (xul_param('title')) {
85                     try { document.title = xul_param('title'); } catch(E) {}
86                     try { window.title = xul_param('title'); } catch(E) {}
87                 }
88
89             } catch(E) {
90                 var err_msg = "!! This software has encountered an error.  Please tell your friendly " +
91                     "system administrator or software developer the following:\n" + E + '\n';
92                 try { g.error.sdump('D_ERROR',err_msg); } catch(E) { dump(err_msg); }
93                 alert(err_msg);
94             }
95         }
96
97     ]]>
98     </script>
99
100     <commandset id="util_browser_cmds">
101         <command id="cmd_broken" />
102         <command id="cmd_print" />
103         <command id="cmd_debug" />
104         <command id="cmd_back" label="&common.browser.backward.label;" accesskey="&common.browser.backward.accesskey;" />
105         <command id="cmd_reload" label="&common.browser.reload.label;" accesskey="&common.browser.reload.accesskey;" />
106         <command id="cmd_forward" label="&common.browser.forward.label;" accesskey="&common.browser.forward.accesskey;" />
107     </commandset>
108
109     <vbox flex="1">
110         <hbox>
111             <button id="back" command="cmd_back" disabled="true" hidden="true"/>
112             <button id="reload" command="cmd_reload" disabled="false" hidden="false"/>
113             <button id="forward" command="cmd_forward" disabled="true" hidden="true"/>
114             <spacer flex="1"/>
115             <progressmeter id="throbber" mode="determined" flex="1"/>
116             <label id="debug" value="Debug" disabled="true" command="cmd_debug" onclick="this.doCommand();" />
117             <button id="browser_print" label="Print Page" oldcommand="cmd_print" hidden="true"
118                 oncommand="netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); if (g.browser.alt_print) { JSAN.use('util.print'); var p = new util.print(); p.NSPrint(g.browser.get_content(),false,{}); } else { g.browser.get_content().print(); }"
119             />
120         </hbox>
121         <browser id="browser_browser" flex="1" type="content"/>
122     </vbox>
123
124 </window>
125