From: Andrew Dolgov Date: Sat, 30 Mar 2013 10:28:13 +0000 (+0400) Subject: add hotkey toggle_cdm_expanded (f c) X-Git-Tag: 1.7.6~135 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=60b88b254c16a25c56e7016c1ef889b1d3e15c8b;p=tt-rss.git add hotkey toggle_cdm_expanded (f c) --- 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) {