- hotkey_actions["dismiss_selected"] = function() {
- dismissSelectedArticles();
- };
- 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(getActiveFeedId(), '', activeFeedIsCat());
- return;
- }
- };
- hotkey_actions["feed_unhide_read"] = function() {
- toggleDispRead();
- };
- hotkey_actions["feed_subscribe"] = function() {
- quickAddFeed();
- };
- hotkey_actions["feed_debug_update"] = function() {
- window.open("backend.php?op=feeds&method=view&feed=" + getActiveFeedId() +
- "&view_mode=adaptive&order_by=default&update=&m=ForceUpdate&cat=" +
- activeFeedIsCat() + "&DevForceUpdate=1&debug=1&xdebug=1&csrf_token=" +
- getInitParam("csrf_token"));
- };
- hotkey_actions["feed_edit"] = function() {
- if (activeFeedIsCat())
- alert(__("You can't edit this kind of feed."));
- else
- editFeed(getActiveFeedId());
- };
- hotkey_actions["feed_catchup"] = function() {
- if (getActiveFeedId() != undefined) {
- catchupCurrentFeed();
- return;
- }
- };
- hotkey_actions["feed_reverse"] = function() {
- reverseHeadlineOrder();
- };
- hotkey_actions["catchup_all"] = function() {
- catchupAllFeeds();
- };
- hotkey_actions["cat_toggle_collapse"] = function() {
- if (activeFeedIsCat()) {
- dijit.byId("feedTree").collapseCat(getActiveFeedId());
- return;
- }
- };
- hotkey_actions["goto_all"] = function() {
- viewfeed(-4);
- };
- hotkey_actions["goto_fresh"] = function() {
- viewfeed(-3);
- };
- hotkey_actions["goto_marked"] = function() {
- viewfeed(-1);
- };
- hotkey_actions["goto_published"] = function() {
- viewfeed(-2);
- };
- hotkey_actions["goto_tagcloud"] = function() {
- displayDlg(__("Tag cloud"), "printTagCloud");
- };
- hotkey_actions["goto_prefs"] = function() {
- gotoPreferences();
- };
- hotkey_actions["select_article_cursor"] = function() {
- var id = getArticleUnderPointer();
- if (id) {
- var row = $("RROW-" + id);
-
- if (row) {
- var cb = dijit.getEnclosingWidget(
- row.getElementsByClassName("rchk")[0]);
-
- if (cb) {
- cb.attr("checked", !cb.attr("checked"));
- toggleSelectRowById(cb, "RROW-" + id);
- return false;
- }
- }
- }
- };
- hotkey_actions["create_label"] = function() {
- addLabel();
- };
- hotkey_actions["create_filter"] = function() {
- quickAddFilter();
- };
- hotkey_actions["collapse_sidebar"] = function() {
- collapse_feedlist();
- };
- hotkey_actions["toggle_embed_original"] = function() {
- if (typeof embedOriginalArticle != "undefined") {
- if (getActiveArticleId())
- embedOriginalArticle(getActiveArticleId());
- } else {
- alert(__("Please enable embed_original plugin first."));
- }
- };
- hotkey_actions["toggle_widescreen"] = function() {
- if (!isCdmMode()) {
- _widescreen_mode = !_widescreen_mode;
+ else {
+ cdmExpandArticle(id);
+ }
+ }
+ };
+ hotkey_actions["toggle_expand"] = function() {
+ const id = getActiveArticleId();
+ const 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() {
+ 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()) {
+ if (!getInitParam("cdm_expanded")) {
+ cdmCollapseArticle(false, 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() +
+ "&csrf_token=" + getInitParam("csrf_token"));
+ } else {
+ alert("You can't debug this kind of feed.");
+ }
+ };
+
+ hotkey_actions["feed_debug_viewfeed"] = function() {
+ viewfeed({feed: getActiveFeedId(), is_cat: activeFeedIsCat(), viewfeed_debug: true});
+ };