]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul
playing around with Find in Page functionality; the recent dojo highlighter commit...
[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 PUBLIC "" ""[
14     <!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
15 ]>
16
17 <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
18 <!-- OVERLAYS -->
19 <?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
20
21 <window id="util_browser_win" 
22     onload="try { my_init(); font_helper(); } catch(E) { alert(E); }"
23     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
24
25     <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
26     <!-- BEHAVIOR -->
27         <script type="text/javascript">
28         var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true; var g = {};
29         netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
30     </script>
31         <scripts id="openils_util_scripts"/>
32
33     <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
34     <script>
35     <![CDATA[
36
37         function my_init() {
38             try {
39                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
40                         if (typeof JSAN == 'undefined') { throw( "The JSAN library object is missing."); }
41                 JSAN.errorLevel = "die"; // none, warn, or die
42                 JSAN.addRepository('/xul/server/');
43                 JSAN.use('util.error'); g.error = new util.error();
44                 g.error.sdump('D_TRACE','my_init() for util_browser.xul');
45
46                 var name = xul_param('tab_name') || xul_param('name') || null;
47                 var url; try { url = xul_param('url'); } catch(E) { dump(E + '\n'); };
48                 if (!url) url = urls.browser;
49
50                 if (!g.browser) {
51                     JSAN.use('util.browser'); g.browser = new util.browser();
52                 }
53
54                 var push_xulG = true;
55                 if (xul_param('no_xulG')) push_xulG = false;
56
57                 var p = { 
58                     'url' : url,
59                     'push_xulG' : push_xulG,
60                     'html_source' : xul_param('html_source'),
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         function default_focus() {
97             try {
98                 dump('entering rbrowser.xul, default_focus()\n');
99                 g.browser.updateNavButtons();
100             } catch(E) {
101                 dump('Error in rbrowser.xul, default_focus(): ' + E + '\n');
102             }
103         }
104
105     ]]>
106     </script>
107
108     <commandset id="util_browser_cmds">
109         <command id="cmd_broken" />
110         <command id="cmd_print" label="&common.browser.print.label;" accesskey="&common.browser.print.accesskey;" />
111         <command id="cmd_debug" />
112         <command id="cmd_find" />
113         <command id="cmd_back" label="&common.browser.backward.label;" accesskey="&common.browser.backward.accesskey;" />
114         <command id="cmd_reload" label="&common.browser.reload.label;" accesskey="&common.browser.reload.accesskey;" />
115         <command id="cmd_forward" label="&common.browser.forward.label;" accesskey="&common.browser.forward.accesskey;" />
116     </commandset>
117
118     <vbox flex="1">
119         <hbox>
120             <button id="back" command="cmd_back" disabled="true" hidden="true"/>
121             <button id="reload" command="cmd_reload" disabled="false" hidden="false"/>
122             <button id="forward" command="cmd_forward" disabled="true" hidden="true"/>
123             <spacer flex="1"/>
124             <label id="debug" value="Debug" disabled="true" command="cmd_debug" onclick="this.doCommand();" />
125             <button id="browser_print" command="cmd_print" hidden="true"/>
126             <button id="browser_find" label="Find in Page" command="cmd_find" hidden="false"/>
127         </hbox>
128         <browser id="browser_browser" flex="1" autoscroll="false" type="content"/>
129     </vbox>
130
131 </window>
132