summaryrefslogtreecommitdiff
path: root/js/tt-rss.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/tt-rss.js')
-rw-r--r--js/tt-rss.js67
1 files changed, 40 insertions, 27 deletions
diff --git a/js/tt-rss.js b/js/tt-rss.js
index d45dd5748..7c325cedf 100644
--- a/js/tt-rss.js
+++ b/js/tt-rss.js
@@ -56,6 +56,7 @@ require(["dojo/_base/kernel",
"fox/FeedStoreModel",
"fox/FeedTree",
"fox/Toolbar",
+ "fox/form/ValidationTextArea",
"fox/form/Select",
"fox/form/ComboButton",
"fox/form/DropDownButton"], function (dojo, declare, ready, parser, AppBase) {
@@ -203,15 +204,12 @@ require(["dojo/_base/kernel",
return Feeds.reloadCurrent('');
},
- isCombinedMode: function() {
- return App.getInitParam("combined_display_mode");
- },
hotkeyHandler: function(event) {
if (event.target.nodeName == "INPUT" || event.target.nodeName == "TEXTAREA") return;
// Arrow buttons and escape are not reported via keypress, handle them via keydown.
- // escape = 27, left = 37, up = 38, right = 39, down = 40, pgup = 33, pgdn = 34
- if (event.type == "keydown" && event.which != 27 && (event.which < 33 || event.which > 40)) return;
+ // escape = 27, left = 37, up = 38, right = 39, down = 40, pgup = 33, pgdn = 34, insert = 45, delete = 46
+ if (event.type == "keydown" && event.which != 27 && (event.which < 33 || event.which > 46)) return;
const action_name = App.keyeventToAction(event);
@@ -284,26 +282,35 @@ require(["dojo/_base/kernel",
if (rv) Feeds.open({feed: rv[0], is_cat: rv[1], delayed: true})
};
this.hotkey_actions["next_article_or_scroll"] = function (event) {
- Headlines.move('next', {event: event});
+ if (App.isCombinedMode())
+ Headlines.scroll(Headlines.line_scroll_offset, event);
+ else
+ Headlines.move('next');
};
this.hotkey_actions["prev_article_or_scroll"] = function (event) {
- Headlines.move('prev', {event: event});
+ if (App.isCombinedMode())
+ Headlines.scroll(-Headlines.line_scroll_offset, event);
+ else
+ Headlines.move('prev');
};
- this.hotkey_actions["next_article_noscroll"] = function (event) {
- Headlines.move('next', {noscroll: true, event: event});
+ this.hotkey_actions["next_article_noscroll"] = function () {
+ Headlines.move('next');
};
- this.hotkey_actions["prev_article_noscroll"] = function (event) {
- Headlines.move('prev', {noscroll: true, event: event});
+ this.hotkey_actions["prev_article_noscroll"] = function () {
+ Headlines.move('prev');
};
- this.hotkey_actions["next_article_noexpand"] = function (event) {
- Headlines.move('next', {noscroll: true, noexpand: true, event: event});
+ this.hotkey_actions["next_article_noexpand"] = function () {
+ Headlines.move('next', {no_expand: true});
};
- this.hotkey_actions["prev_article_noexpand"] = function (event) {
- Headlines.move('prev', {noscroll: true, noexpand: true, event: event});
+ this.hotkey_actions["prev_article_noexpand"] = function () {
+ Headlines.move('prev', {no_expand: true});
};
this.hotkey_actions["search_dialog"] = function () {
Feeds.search();
};
+ this.hotkey_actions["cancel_search"] = function () {
+ Feeds.cancelSearch();
+ };
this.hotkey_actions["toggle_mark"] = function () {
Headlines.selectionToggleMarked();
};
@@ -331,28 +338,34 @@ require(["dojo/_base/kernel",
Headlines.catchupRelativeTo(0);
};
this.hotkey_actions["article_scroll_down"] = function (event) {
- const ctr = App.isCombinedMode() ? $("headlines-frame") : $("content-insert");
-
- if (ctr)
- Article.scroll(ctr.offsetHeight / 2, event);
+ if (App.isCombinedMode())
+ Headlines.scroll(Headlines.line_scroll_offset, event);
+ else
+ Article.scroll(Headlines.line_scroll_offset, event);
};
this.hotkey_actions["article_scroll_up"] = function (event) {
- const ctr = App.isCombinedMode() ? $("headlines-frame") : $("content-insert");
-
- if (ctr)
- Article.scroll(-ctr.offsetHeight / 2, event);
+ if (App.isCombinedMode())
+ Headlines.scroll(-Headlines.line_scroll_offset, event);
+ else
+ Article.scroll(-Headlines.line_scroll_offset, event);
};
- this.hotkey_actions["next_article_page"] = function (event) {
+ this.hotkey_actions["next_headlines_page"] = function (event) {
Headlines.scrollByPages(1, event);
};
- this.hotkey_actions["prev_article_page"] = function (event) {
+ this.hotkey_actions["prev_headlines_page"] = function (event) {
Headlines.scrollByPages(-1, event);
};
this.hotkey_actions["article_page_down"] = function (event) {
- Article.scrollByPages(1, event);
+ if (App.isCombinedMode())
+ Headlines.scrollByPages(1, event);
+ else
+ Article.scrollByPages(1, event);
};
this.hotkey_actions["article_page_up"] = function (event) {
- Article.scrollByPages(-1, event);
+ if (App.isCombinedMode())
+ Headlines.scrollByPages(-1, event);
+ else
+ Article.scrollByPages(-1, event);
};
this.hotkey_actions["close_article"] = function () {
if (App.isCombinedMode()) {