debug link in staff client browser framework now lets you change the URL
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 11 Mar 2010 21:02:18 +0000 (21:02 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 11 Mar 2010 21:02:18 +0000 (21:02 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15806 dcc99617-32d9-48b4-a31d-7c20da2025e4

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 14c1c42..5ffe5ac 100644 (file)
@@ -35,6 +35,14 @@ util.browser.prototype = {
                             ['command'],
                             function() { alert('Not Yet Implemented'); }
                         ],
+                        'cmd_debug' : [
+                            ['command'],
+                            function() {
+                                var curr_url = obj.get_content().location.href;
+                                var url = window.prompt('Original URL: ' + obj.url + '\nCurrent URL: ' + curr_url + '\nEnter new URL:',curr_url);
+                                if (url) { obj.get_content().location.href = url; }
+                            }
+                        ],
                         'cmd_print' : [
                             ['command'],
                             function() {
index d0a8428..d927992 100644 (file)
@@ -58,7 +58,7 @@
                     'url' : url,
                     'push_xulG' : push_xulG,
                     'alt_print' : alt_print,
-                    'debug_label' : 'debug',
+                    'debug_label' : 'debug'
                 };
                 if (typeof window.xulG == 'object' && typeof window.xulG.passthru_content_params == 'object') {
                     p.passthru_content_params = window.xulG.passthru_content_params;
@@ -99,6 +99,7 @@
     <commandset id="util_browser_cmds">
         <command id="cmd_broken" />
         <command id="cmd_print" />
+        <command id="cmd_debug" />
         <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;" />
             <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);"/>
+            <label id="debug" value="Debug" disabled="true" command="cmd_debug" onclick="this.doCommand();" />
             <button id="browser_print" label="Print Page" command="cmd_print" hidden="true"/>
         </hbox>
         <browser id="browser_browser" flex="1" type="content"/>
index 9bb38a9..8ba1a70 100644 (file)
@@ -59,6 +59,7 @@
                     'url' : url,
                     'push_xulG' : push_xulG,
                     'alt_print' : alt_print,
+                    'debug_label' : 'debug'
                 } 
                 if (typeof window.xulG == 'object' && typeof window.xulG.passthru_content_params == 'object') {
                     p.passthru_content_params = window.xulG.passthru_content_params;
     <commandset id="util_browser_cmds">
         <command id="cmd_broken" />
         <command id="cmd_print" />
+        <command id="cmd_debug" />
         <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;" />
             <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" command="cmd_debug" onclick="this.doCommand();" />
             <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(); }"
             />
-
         </hbox>
         <browser id="browser_browser" flex="1" type="content"/>
     </vbox>