]> git.wh0rd.org Git - tt-rss.git/commitdiff
add f C hotkey to toggle combined mode (closes #549)
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 12 Mar 2013 05:52:45 +0000 (09:52 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 12 Mar 2013 05:52:45 +0000 (09:52 +0400)
include/functions.php
js/tt-rss.js

index ccf79809520b38f5c6882164fbfd10aa17e46996..68e744c49f3130f46a04e8e1d90064f96e707b02 100644 (file)
                                "feed_reverse" => __("Reverse headlines"),
                                "feed_debug_update" => __("Debug feed update"),
                                "catchup_all" => __("Mark all feeds as read"),
-                               "cat_toggle_collapse" => __("Un/collapse current category")),
+                               "cat_toggle_collapse" => __("Un/collapse current category"),
+                               "toggle_combined_mode" => __("Toggle combined mode")),
                        __("Go to") => array(
                                "goto_all" => __("All articles"),
                                "goto_fresh" => __("Fresh"),
                                "f q" => "feed_catchup",
                                "f x" => "feed_reverse",
                                "f D" => "feed_debug_update",
+                               "f C" => "toggle_combined_mode",
                                "Q" => "catchup_all",
                                "x" => "cat_toggle_collapse",
 //                     "goto" => array(
index 054ccf3df992c481a36f2cd56a34e93ebaebbd95..badfe8707440a1d423017f1bb1d230cede90ed38 100644 (file)
@@ -775,6 +775,19 @@ function hotkey_handler(e) {
                        return false;
                case "help_dialog":
                        helpDialog("main");
+                       return false;
+               case "toggle_combined_mode":
+                       notify_progress("Loading, please wait...");
+
+                       var value = isCdmMode() ? "false" : "true";
+                       var query = "?op=rpc&method=setpref&key=COMBINED_DISPLAY_MODE&value=" + value;
+
+                       new Ajax.Request("backend.php", {
+                               parameters: query,
+                               onComplete: function(transport) {
+                                       window.location.reload();
+                               } });
+
                        return false;
                default:
                        console.log("unhandled action: " + hotkey_action + "; hotkey: " + hotkey);