]> git.wh0rd.org Git - tt-rss.git/commitdiff
add hotkey toggle_cdm_expanded (f c)
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 30 Mar 2013 10:28:13 +0000 (14:28 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 30 Mar 2013 10:28:13 +0000 (14:28 +0400)
include/functions.php
js/tt-rss.js

index 030d8d50efa33e6763163c254b51810bd5ea752c..36d349b54342b0261f1c1a4993d0b745118815f3 100644 (file)
                                "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"),
                                "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(
index d38b203c1b6fefb40e10e9825dbfcf6a0b64e44e..cb7c0ab2db698c4bfb934eb8024d5d151a2d4a15 100644 (file)
@@ -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) {