add f C hotkey to toggle combined mode (closes #549)

This commit is contained in:
Andrew Dolgov 2013-03-12 09:52:45 +04:00
parent 5f9d021336
commit 4b27f0c06d
2 changed files with 16 additions and 1 deletions

View file

@ -1895,7 +1895,8 @@
"feed_reverse" => __("Reverse headlines"), "feed_reverse" => __("Reverse headlines"),
"feed_debug_update" => __("Debug feed update"), "feed_debug_update" => __("Debug feed update"),
"catchup_all" => __("Mark all feeds as read"), "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( __("Go to") => array(
"goto_all" => __("All articles"), "goto_all" => __("All articles"),
"goto_fresh" => __("Fresh"), "goto_fresh" => __("Fresh"),
@ -1955,6 +1956,7 @@
"f q" => "feed_catchup", "f q" => "feed_catchup",
"f x" => "feed_reverse", "f x" => "feed_reverse",
"f D" => "feed_debug_update", "f D" => "feed_debug_update",
"f C" => "toggle_combined_mode",
"Q" => "catchup_all", "Q" => "catchup_all",
"x" => "cat_toggle_collapse", "x" => "cat_toggle_collapse",
// "goto" => array( // "goto" => array(

View file

@ -775,6 +775,19 @@ function hotkey_handler(e) {
return false; return false;
case "help_dialog": case "help_dialog":
helpDialog("main"); 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; return false;
default: default:
console.log("unhandled action: " + hotkey_action + "; hotkey: " + hotkey); console.log("unhandled action: " + hotkey_action + "; hotkey: " + hotkey);