summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-01-22 12:52:52 +0400
committerAndrew Dolgov <[email protected]>2013-01-22 12:52:52 +0400
commite5e2cf3b88a33594777a5487f400e9c93d6b82cd (patch)
tree5aa22169c7defd222f2930925666b523f47cfe8e
parent1b03e1deb6b3947f95e42c68cf95fa76ecf66162 (diff)
add hack to support arbitrary key descriptions for hotkeys
-rw-r--r--classes/backend.php6
-rw-r--r--include/functions.php8
-rw-r--r--js/tt-rss.js11
3 files changed, 21 insertions, 4 deletions
diff --git a/classes/backend.php b/classes/backend.php
index 6fa31864d..0b6e6bd30 100644
--- a/classes/backend.php
+++ b/classes/backend.php
@@ -44,6 +44,12 @@ class Backend extends Handler {
print "<li><h3>" . $section . "</h3></li>";
foreach ($hotkeys as $action => $description) {
+ if (strpos($omap[$action], "|") !== FALSE) {
+ $omap[$action] = substr($omap[$action],
+ strpos($omap[$action], "|")+1,
+ strlen($omap[$action]));
+ }
+
print "<li>";
print "<span class='hksequence'>" . $omap[$action] . "</span>";
print $description;
diff --git a/include/functions.php b/include/functions.php
index b564caf1e..ac3a8861e 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -2035,9 +2035,9 @@
"j" => "prev_feed",
"n" => "next_article",
"p" => "prev_article",
- "(38)" => "prev_article",
- "(40)" => "next_article",
- "(191)" => "search_dialog",
+ "(38)|up" => "prev_article",
+ "(40)|down" => "next_article",
+ "(191)|/" => "search_dialog",
// "article" => array(
"s" => "toggle_mark",
"S" => "toggle_publ",
@@ -2077,7 +2077,7 @@
"g t" => "goto_tagcloud",
"g P" => "goto_prefs",
// "other" => array(
- "(9)" => "select_article_cursor", // tab
+ "(9)|tab" => "select_article_cursor", // tab
"c l" => "create_label",
"c f" => "create_filter",
"c s" => "collapse_sidebar",
diff --git a/js/tt-rss.js b/js/tt-rss.js
index 78f7a867d..13181c421 100644
--- a/js/tt-rss.js
+++ b/js/tt-rss.js
@@ -366,6 +366,17 @@ function init_second_stage() {
if ('sessionStorage' in window && window['sessionStorage'] !== null)
sessionStorage.clear();
+ var hotkeys = getInitParam("hotkeys");
+ var tmp = [];
+
+ for (sequence in hotkeys[1]) {
+ filtered = sequence.replace(/\|.*$/, "");
+ tmp[filtered] = hotkeys[1][sequence];
+ }
+
+ hotkeys[1] = tmp;
+ setInitParam("hotkeys", hotkeys);
+
console.log("second stage ok");
} catch (e) {