- new Ajax.Request("backend.php", {
- parameters: {op: "rpc", method: "sanityCheck", hasAudio: hasAudio,
- hasMp3: hasMp3,
- clientTzOffset: clientTzOffset,
- hasSandbox: hasSandbox},
- onComplete: function(transport) {
- backend_sanity_check_callback(transport);
- } });
-
- hotkey_actions["next_feed"] = function() {
- var rv = dijit.byId("feedTree").getNextFeed(
- getActiveFeedId(), activeFeedIsCat());
-
- if (rv) viewfeed({feed: rv[0], is_cat: rv[1], can_wait: true})
- };
- hotkey_actions["prev_feed"] = function() {
- var rv = dijit.byId("feedTree").getPreviousFeed(
- getActiveFeedId(), activeFeedIsCat());
-
- if (rv) viewfeed({feed: rv[0], is_cat: rv[1], can_wait: true})
- };
- hotkey_actions["next_article"] = function() {
- moveToPost('next');
- };
- hotkey_actions["prev_article"] = function() {
- moveToPost('prev');
- };
- hotkey_actions["next_article_noscroll"] = function() {
- moveToPost('next', true);
- };
- hotkey_actions["prev_article_noscroll"] = function() {
- moveToPost('prev', true);
- };
- hotkey_actions["next_article_noexpand"] = function() {
- moveToPost('next', true, true);
- };
- hotkey_actions["prev_article_noexpand"] = function() {
- moveToPost('prev', true, true);
- };
- hotkey_actions["collapse_article"] = function() {
- var id = getActiveArticleId();
- var elem = $("CICD-"+id);
-
- if (elem) {
- if (elem.visible()) {
- cdmCollapseArticle(null, id);
- }
- else {
- cdmExpandArticle(id);
- }
- }
- };
- hotkey_actions["toggle_expand"] = function() {
- var id = getActiveArticleId();
- var elem = $("CICD-"+id);
-
- if (elem) {
- if (elem.visible()) {
- cdmCollapseArticle(null, id, false);
- }
- else {
- cdmExpandArticle(id);
- }
- }
- };
- hotkey_actions["search_dialog"] = function() {
- search();
- };
- hotkey_actions["toggle_mark"] = function() {
- selectionToggleMarked(undefined, false, true);
- };
- hotkey_actions["toggle_publ"] = function() {
- selectionTogglePublished(undefined, false, true);
- };
- hotkey_actions["toggle_unread"] = function() {
- selectionToggleUnread(undefined, false, true);
- };
- hotkey_actions["edit_tags"] = function() {
- var id = getActiveArticleId();
- if (id) {
- editArticleTags(id);
- };
- }
- hotkey_actions["dismiss_selected"] = function() {
- dismissSelectedArticles();
- };
- hotkey_actions["dismiss_read"] = function() {
- dismissReadArticles();
- };
- hotkey_actions["open_in_new_window"] = function() {
- if (getActiveArticleId()) {
- openArticleInNewWindow(getActiveArticleId());
- return;
- }
- };
- hotkey_actions["catchup_below"] = function() {
- catchupRelativeToArticle(1);
- };
- hotkey_actions["catchup_above"] = function() {
- catchupRelativeToArticle(0);
- };
- hotkey_actions["article_scroll_down"] = function() {
- var ctr = $("content_insert") ? $("content_insert") : $("headlines-frame");
-
- scrollArticle(40);
- };
- hotkey_actions["article_scroll_up"] = function() {
- var ctr = $("content_insert") ? $("content_insert") : $("headlines-frame");
-
- scrollArticle(-40);
- };
- hotkey_actions["close_article"] = function() {
- if (isCdmMode()) {
- if (!getInitParam("cdm_expanded")) {
- cdmCollapseArticle(false, getActiveArticleId());
- } else {
- dismissArticle(getActiveArticleId());
- }
- } else {
- closeArticlePanel();
- }
- };
- hotkey_actions["email_article"] = function() {
- if (typeof emailArticle != "undefined") {
- emailArticle();
- } else if (typeof mailtoArticle != "undefined") {
- mailtoArticle();
- } else {
- alert(__("Please enable mail plugin first."));
- }
- };
- hotkey_actions["select_all"] = function() {
- selectArticles('all');
- };
- hotkey_actions["select_unread"] = function() {
- selectArticles('unread');
- };
- hotkey_actions["select_marked"] = function() {
- selectArticles('marked');
- };
- hotkey_actions["select_published"] = function() {
- selectArticles('published');
- };
- hotkey_actions["select_invert"] = function() {
- selectArticles('invert');
- };
- hotkey_actions["select_none"] = function() {
- selectArticles('none');
- };
- hotkey_actions["feed_refresh"] = function() {
- if (getActiveFeedId() != undefined) {
- viewfeed({feed: getActiveFeedId(), is_cat: activeFeedIsCat()});
- return;
- }
- };
- hotkey_actions["feed_unhide_read"] = function() {
- toggleDispRead();
- };
- hotkey_actions["feed_subscribe"] = function() {
- quickAddFeed();
- };
- hotkey_actions["feed_debug_update"] = function() {
- if (!activeFeedIsCat() && parseInt(getActiveFeedId()) > 0) {
- window.open("backend.php?op=feeds&method=update_debugger&feed_id=" + getActiveFeedId() +
+
+ });
+}
+
+function init_hotkey_actions() {
+ hotkey_actions["next_feed"] = function() {
+ const rv = dijit.byId("feedTree").getNextFeed(
+ getActiveFeedId(), activeFeedIsCat());
+
+ if (rv) viewfeed({feed: rv[0], is_cat: rv[1], can_wait: true})
+ };
+ hotkey_actions["prev_feed"] = function() {
+ const rv = dijit.byId("feedTree").getPreviousFeed(
+ getActiveFeedId(), activeFeedIsCat());
+
+ if (rv) viewfeed({feed: rv[0], is_cat: rv[1], can_wait: true})
+ };
+ hotkey_actions["next_article"] = function() {
+ moveToPost('next');
+ };
+ hotkey_actions["prev_article"] = function() {
+ moveToPost('prev');
+ };
+ hotkey_actions["next_article_noscroll"] = function() {
+ moveToPost('next', true);
+ };
+ hotkey_actions["prev_article_noscroll"] = function() {
+ moveToPost('prev', true);
+ };
+ hotkey_actions["next_article_noexpand"] = function() {
+ moveToPost('next', true, true);
+ };
+ hotkey_actions["prev_article_noexpand"] = function() {
+ moveToPost('prev', true, true);
+ };
+ hotkey_actions["search_dialog"] = function() {
+ search();
+ };
+ hotkey_actions["toggle_mark"] = function() {
+ selectionToggleMarked(undefined, false, true);
+ };
+ hotkey_actions["toggle_publ"] = function() {
+ selectionTogglePublished(undefined, false, true);
+ };
+ hotkey_actions["toggle_unread"] = function() {
+ selectionToggleUnread(undefined, false, true);
+ };
+ hotkey_actions["edit_tags"] = function() {
+ const id = getActiveArticleId();
+ if (id) {
+ editArticleTags(id);
+ }
+ }
+ hotkey_actions["open_in_new_window"] = function() {
+ if (getActiveArticleId()) {
+ openArticleInNewWindow(getActiveArticleId());
+ }
+ };
+ hotkey_actions["catchup_below"] = function() {
+ catchupRelativeToArticle(1);
+ };
+ hotkey_actions["catchup_above"] = function() {
+ catchupRelativeToArticle(0);
+ };
+ hotkey_actions["article_scroll_down"] = function() {
+ scrollArticle(40);
+ };
+ hotkey_actions["article_scroll_up"] = function() {
+ scrollArticle(-40);
+ };
+ hotkey_actions["close_article"] = function() {
+ if (isCdmMode()) {
+ cdmCollapseActive();
+ } else {
+ closeArticlePanel();
+ }
+ };
+ hotkey_actions["email_article"] = function() {
+ if (typeof emailArticle != "undefined") {
+ emailArticle();
+ } else if (typeof mailtoArticle != "undefined") {
+ mailtoArticle();
+ } else {
+ alert(__("Please enable mail plugin first."));
+ }
+ };
+ hotkey_actions["select_all"] = function() {
+ selectArticles('all');
+ };
+ hotkey_actions["select_unread"] = function() {
+ selectArticles('unread');
+ };
+ hotkey_actions["select_marked"] = function() {
+ selectArticles('marked');
+ };
+ hotkey_actions["select_published"] = function() {
+ selectArticles('published');
+ };
+ hotkey_actions["select_invert"] = function() {
+ selectArticles('invert');
+ };
+ hotkey_actions["select_none"] = function() {
+ selectArticles('none');
+ };
+ hotkey_actions["feed_refresh"] = function() {
+ if (getActiveFeedId() != undefined) {
+ viewfeed({feed: getActiveFeedId(), is_cat: activeFeedIsCat()});
+ return;
+ }
+ };
+ hotkey_actions["feed_unhide_read"] = function() {
+ toggleDispRead();
+ };
+ hotkey_actions["feed_subscribe"] = function() {
+ quickAddFeed();
+ };
+ hotkey_actions["feed_debug_update"] = function() {
+ if (!activeFeedIsCat() && parseInt(getActiveFeedId()) > 0) {
+ window.open("backend.php?op=feeds&method=update_debugger&feed_id=" + getActiveFeedId() +