Key binding for viewing page source

Alexander Voigt <[email protected]>
Newsgroups gmane.comp.web.dillo.devel
Message-ID <[email protected]>
Dear Dillo developers,

I use the "view page source" function from the right-click popup menu
very often and so I created a key binding for this (see attached
patch).  Since I find this very handy, please consider this patch for
the repository.

Kind regards,
Alex

_______________________________________________
Dillo-dev mailing list
[email protected]
http://lists.auriga.wearlab.de/cgi-bin/mailman/listinfo/dillo-dev
view_source_keybinding.patch (text/x-diff, 1.5 KB)
diff -r cfe557c0700b src/keys.cc
--- a/src/keys.cc	Tue Sep 18 02:27:31 2012 +0000
+++ b/src/keys.cc	Wed Sep 19 22:06:24 2012 +0200
@@ -134,6 +134,7 @@
    { "right"        , KEYS_RIGHT        , 0         , FL_Right        },
    { "top"          , KEYS_TOP          , 0         , FL_Home         },
    { "bottom"       , KEYS_BOTTOM       , 0         , FL_End          },
+   { "view-source"  , KEYS_VIEW_SOURCE  , FL_CTRL   , 'u'             },
 };
 
 static Dlist *bindings;
diff -r cfe557c0700b src/keys.hh
--- a/src/keys.hh	Tue Sep 18 02:27:31 2012 +0000
+++ b/src/keys.hh	Wed Sep 19 22:06:24 2012 +0200
@@ -46,7 +46,8 @@
    KEYS_LEFT,
    KEYS_RIGHT,
    KEYS_TOP,
-   KEYS_BOTTOM
+   KEYS_BOTTOM,
+   KEYS_VIEW_SOURCE
 } KeysCommand_t;
 
 class Keys {
diff -r cfe557c0700b src/keysrc
--- a/src/keysrc	Tue Sep 18 02:27:31 2012 +0000
+++ b/src/keysrc	Wed Sep 19 22:06:24 2012 +0200
@@ -72,6 +72,9 @@
 # "file-menu" pops up the file menu.
 #<alt>f = file-menu
 
+# view page source
+#<ctrl>u = view-source
+
 # "goto" goes to the location bar at the top of the window.
 #<ctrl>l = goto
 
diff -r cfe557c0700b src/uicmd.cc
--- a/src/uicmd.cc	Tue Sep 18 02:27:31 2012 +0000
+++ b/src/uicmd.cc	Wed Sep 19 22:06:24 2012 +0200
@@ -215,6 +215,10 @@
       } else if (cmd == KEYS_CLOSE_ALL) {
          a_Timeout_add(0.0, a_UIcmd_close_all_bw, NULL);
          ret = 1;
+      } else if (cmd == KEYS_VIEW_SOURCE) {
+         const DilloUrl *url = a_History_get_url(NAV_TOP_UIDX(bw));
+         a_UIcmd_view_page_source(bw, url);
+         ret = 1;
       }
    }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.