summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2019-12-05 17:00:02 +0300
committerAndrew Dolgov <[email protected]>2019-12-05 17:00:17 +0300
commit1902a7dcb0d4b0fc00a1c2ed86f4b8ab757f4508 (patch)
treefeded37649207e0867079a94b946fdb6ca9729b0
parentf30287be652295d18e632316a66866697c26638c (diff)
pgup/pgdown hotkey normalization:
- pgup/pgdown without modifier scroll headline buffer - shift+pgup/pgdown work similarly to shift+up/down but operating on pages
-rw-r--r--include/functions.php6
-rw-r--r--js/Article.js2
-rwxr-xr-xjs/Headlines.js6
-rw-r--r--js/tt-rss.js10
4 files changed, 19 insertions, 5 deletions
diff --git a/include/functions.php b/include/functions.php
index 18885b1ea..b4e91fe9c 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -1114,14 +1114,16 @@
"j" => "prev_feed",
"n" => "next_article",
"p" => "prev_article",
+ "(33)|PageUp" => "prev_article_page",
+ "(34)|PageDown" => "next_article_page",
"(38)|Up" => "prev_article",
"(40)|Down" => "next_article",
"*(38)|Shift+Up" => "article_scroll_up",
"*(40)|Shift+Down" => "article_scroll_down",
"^(38)|Ctrl+Up" => "prev_article_noscroll",
"^(40)|Ctrl+Down" => "next_article_noscroll",
- "(33)|Page Up" => "article_page_up",
- "(34)|Page Down" => "article_page_down",
+ "^(33)|Shift+PageUp" => "article_page_up",
+ "^(34)|Shift+PageDown" => "article_page_down",
"/" => "search_dialog",
"s" => "toggle_mark",
"S" => "toggle_publ",
diff --git a/js/Article.js b/js/Article.js
index e40e1fca0..1135fde02 100644
--- a/js/Article.js
+++ b/js/Article.js
@@ -314,7 +314,7 @@ define(["dojo/_base/declare"], function (declare) {
else
return 0;
},
- scrollPages: function (offset) {
+ scrollByPages: function (offset) {
if (!App.isCombinedMode()) {
const ci = $("content-insert");
if (ci) {
diff --git a/js/Headlines.js b/js/Headlines.js
index 3c98bef6c..4382e04f7 100755
--- a/js/Headlines.js
+++ b/js/Headlines.js
@@ -1381,6 +1381,12 @@ define(["dojo/_base/declare"], function (declare) {
}
},
+ scrollByPages: function (offset) {
+ const hi = $("headlines-frame");
+ if (hi) {
+ hi.scrollTop += hi.offsetHeight * offset * 0.9;
+ }
+ },
initHeadlinesMenu: function () {
if (!dijit.byId("headlinesMenu")) {
diff --git a/js/tt-rss.js b/js/tt-rss.js
index 43d057199..f5444207d 100644
--- a/js/tt-rss.js
+++ b/js/tt-rss.js
@@ -330,11 +330,17 @@ require(["dojo/_base/kernel",
this.hotkey_actions["article_scroll_up"] = function () {
Article.scroll(-40);
};
+ this.hotkey_actions["next_article_page"] = function () {
+ Headlines.scrollByPages(1);
+ };
+ this.hotkey_actions["prev_article_page"] = function () {
+ Headlines.scrollByPages(-1);
+ };
this.hotkey_actions["article_page_down"] = function () {
- Article.scrollPages(1);
+ Article.scrollByPages(1);
};
this.hotkey_actions["article_page_up"] = function () {
- Article.scrollPages(-1);
+ Article.scrollByPages(-1);
};
this.hotkey_actions["close_article"] = function () {
if (App.isCombinedMode()) {