From 60b88b254c16a25c56e7016c1ef889b1d3e15c8b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 30 Mar 2013 14:28:13 +0400 Subject: [PATCH] add hotkey toggle_cdm_expanded (f c) --- include/functions.php | 4 +++- js/tt-rss.js | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/include/functions.php b/include/functions.php index 030d8d50..36d349b5 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1938,7 +1938,8 @@ "feed_debug_update" => __("Debug feed update"), "catchup_all" => __("Mark all feeds as read"), "cat_toggle_collapse" => __("Un/collapse current category"), - "toggle_combined_mode" => __("Toggle combined mode")), + "toggle_combined_mode" => __("Toggle combined mode"), + "toggle_cdm_expanded" => __("Toggle auto expand in combined mode")), __("Go to") => array( "goto_all" => __("All articles"), "goto_fresh" => __("Fresh"), @@ -2002,6 +2003,7 @@ "f x" => "feed_reverse", "f *d" => "feed_debug_update", "f *c" => "toggle_combined_mode", + "f c" => "toggle_cdm_expanded", "*q" => "catchup_all", "x" => "cat_toggle_collapse", // "goto" => array( diff --git a/js/tt-rss.js b/js/tt-rss.js index d38b203c..cb7c0ab2 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -483,6 +483,19 @@ function init() { window.location.reload(); } }); }; + hotkey_actions["toggle_cdm_expanded"] = function() { + notify_progress("Loading, please wait..."); + + var value = getInitParam("cdm_expanded") ? "false" : "true"; + var query = "?op=rpc&method=setpref&key=CDM_EXPANDED&value=" + value; + + new Ajax.Request("backend.php", { + parameters: query, + onComplete: function(transport) { + setInitParam("cdm_expanded", !getInitParam("cdm_expanded")); + viewCurrentFeed(); + } }); + }; } catch (e) { -- 2.39.5