Reload button for staff client's browser, and some missing DTD entities
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 25 Feb 2010 20:58:10 +0000 (20:58 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 25 Feb 2010 20:58:10 +0000 (20:58 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15643 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/xul/staff_client/chrome/content/util/browser.js
Open-ILS/xul/staff_client/chrome/content/util/browser.xul
Open-ILS/xul/staff_client/chrome/content/util/rbrowser.xul

index 0761614..023bdfd 100644 (file)
 <!ENTITY common.true "True">
 <!ENTITY common.false "False">
 
+<!ENTITY common.browser.forward.label "Go Forward">
+<!ENTITY common.browser.forward.accesskey "d">
+<!ENTITY common.browser.backward.label "Go Back">
+<!ENTITY common.browser.backward.accesskey "B">
+<!ENTITY common.browser.reload.label "Reload">
+<!ENTITY common.browser.reload.accesskey "l">
+
 <!ENTITY common.textbox.cut "Cut">
 <!ENTITY common.textbox.copy "Copy">
 <!ENTITY common.textbox.paste "Paste">
index 707cc84..cba980b 100644 (file)
@@ -72,6 +72,19 @@ util.browser.prototype = {
                                     obj.error.sdump('D_ERROR',err);
                                 }
                             }
+                        ],
+                        'cmd_reload' : [
+                            ['command'],
+                            function() {
+                                try {
+                                    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+                                    var n = obj.getWebNavigation();
+                                    n.reload( Components.interfaces.nsIWebNavigation.LOAD_FLAGS_NONE );
+                                } catch(E) {
+                                    var err = 'cmd_reload: ' + E;
+                                    obj.error.sdump('D_ERROR',err);
+                                }
+                            }
                         ]
                     }
                 }
@@ -99,6 +112,7 @@ util.browser.prototype = {
 
     'get_content' : function() {
         try {
+            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
             if (this.controller.view.browser_browser.contentWindow.wrappedJSObject) {
                 return this.controller.view.browser_browser.contentWindow.wrappedJSObject;
             } else {
@@ -133,6 +147,7 @@ util.browser.prototype = {
 
     'getWebNavigation' : function() {
         try {
+            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
             var wn = this.controller.view.browser_browser.webNavigation;
             var s = this.url + '\n' + this.get_content().location.href + '\n';
             s += ('getWebNavigation() = ' + wn + '\n');
@@ -144,6 +159,7 @@ util.browser.prototype = {
     },
 
     'updateNavButtons' : function() {
+        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
         var obj = this; 
         var s = obj.url + '\n' + obj.get_content().location.href + '\n';
         try {
index c047929..d0a8428 100644 (file)
     <commandset id="util_browser_cmds">
         <command id="cmd_broken" />
         <command id="cmd_print" />
-        <command id="cmd_back" />
-        <command id="cmd_forward" />
+        <command id="cmd_back" label="&common.browser.backward.label;" accesskey="&common.browser.backward.accesskey;" />
+        <command id="cmd_reload" label="&common.browser.reload.label;" accesskey="&common.browser.reload.accesskey;" />
+        <command id="cmd_forward" label="&common.browser.forward.label;" accesskey="&common.browser.forward.accesskey;" />
     </commandset>
 
     <vbox flex="1">
         <hbox>
-            <button id="back" label="Go Back" command="cmd_back" accesskey="b" disabled="true" hidden="true"/>
-            <button id="forward" label="Go Forward" command="cmd_forward" accesskey="d" disabled="true" hidden="true"/>
+            <button id="back" command="cmd_back" disabled="true" hidden="true"/>
+            <button id="reload" command="cmd_reload" disabled="false" hidden="false"/>
+            <button id="forward" command="cmd_forward" disabled="true" hidden="true"/>
             <spacer flex="1"/>
             <label id="debug" value="Debug" disabled="true" onclick="var m = (this.getAttribute('tooltiptext')+'\n'); dump(m); alert(m);"/>
             <button id="browser_print" label="Print Page" command="cmd_print" hidden="true"/>
index 1333362..9bb38a9 100644 (file)
     <commandset id="util_browser_cmds">
         <command id="cmd_broken" />
         <command id="cmd_print" />
-        <command id="cmd_back" />
-        <command id="cmd_forward" />
+        <command id="cmd_back" label="&common.browser.backward.label;" accesskey="&common.browser.backward.accesskey;" />
+        <command id="cmd_reload" label="&common.browser.reload.label;" accesskey="&common.browser.reload.accesskey;" />
+        <command id="cmd_forward" label="&common.browser.forward.label;" accesskey="&common.browser.forward.accesskey;" />
     </commandset>
 
     <vbox flex="1">
         <hbox>
-            <button id="back" label="Go Back" command="cmd_back" accesskey="b" disabled="true" hidden="true"/>
-            <button id="forward" label="Go Forward" command="cmd_forward" accesskey="d" disabled="true" hidden="true"/>
+            <button id="back" command="cmd_back" disabled="true" hidden="true"/>
+            <button id="reload" command="cmd_reload" disabled="false" hidden="false"/>
+            <button id="forward" command="cmd_forward" disabled="true" hidden="true"/>
             <spacer flex="1"/>
             <button id="browser_print" label="Print Page" oldcommand="cmd_print" hidden="true"
                 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(); }"