View Source option for embedded browser (click on the Debug link)
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 27 Oct 2010 05:10:39 +0000 (05:10 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 27 Oct 2010 05:10:39 +0000 (05:10 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@18485 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 3855672..a1d3dc3 100644 (file)
@@ -68,6 +68,8 @@
 <!ENTITY common.browser.find.accesskey "i">
 <!ENTITY common.browser.set_url.label "Modify URL">
 <!ENTITY common.browser.set_url.accesskey "U">
+<!ENTITY common.browser.view_source.label "View Source">
+<!ENTITY common.browser.view_source.accesskey "V">
 
 <!ENTITY common.textbox.cut "Cut">
 <!ENTITY common.textbox.copy "Copy">
index b91106d..22652d6 100644 (file)
@@ -44,6 +44,14 @@ util.browser.prototype = {
                                 if (url) { obj.get_content().location.href = url; }
                             }
                         ],
+                        'cmd_view_source' : [
+                            ['command'],
+                            function() {
+                                var curr_url = obj.get_content().location.href;
+                                //obj.get_content().location.href = 'view-source:' + curr_url; // This works too, but the openDialog below is more feature-rich
+                                window.openDialog("chrome://global/content/viewSource.xul", "", "all,dialog=no", curr_url);
+                            }
+                        ],
                         'cmd_print' : [
                             ['command'],
                             function() {
index 01a10e6..d5df55d 100644 (file)
         <command id="cmd_broken" />
         <command id="cmd_print" label="&common.browser.print.label;" accesskey="&common.browser.print.accesskey;" />
         <command id="cmd_debug" />
+        <command id="cmd_view_source" />
         <command id="cmd_find" />
         <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;" />
 
     <popupset>
         <popup id="debug_popup">
+            <menuitem label="&common.browser.view_source.label;" accesskey="&common.browser.view_source.accesskey;" command="cmd_view_source" />
             <menuitem label="&common.browser.set_url.label;" accesskey="&common.browser.set_url.accesskey;" command="cmd_debug" />
             <menuitem label="&common.browser.find.label;" accesskey="&common.browser.find.accesskey;" command="cmd_find" />
         </popup>
index 822aa1f..1f0983c 100644 (file)
         <command id="cmd_broken" />
         <command id="cmd_print" label="&common.browser.print.label;" accesskey="&common.browser.print.accesskey;" />
         <command id="cmd_debug" />
+        <command id="cmd_view_source" />
         <command id="cmd_find" />
         <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;" />
 
     <popupset>
         <popup id="debug_popup">
+            <menuitem label="&common.browser.view_source.label;" accesskey="&common.browser.view_source.accesskey;" command="cmd_view_source" />
             <menuitem label="&common.browser.set_url.label;" accesskey="&common.browser.set_url.accesskey;" command="cmd_debug" />
             <menuitem label="&common.browser.find.label;" accesskey="&common.browser.find.accesskey;" command="cmd_find" />
         </popup>