From 6e625555c980f82bec546bcb4d21db8d22d8eb76 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 2 Dec 2018 08:34:08 +0300 Subject: [PATCH] Headlines: shorten selectArticles --- classes/feeds.php | 8 ++++---- js/tt-rss.js | 12 ++++++------ js/viewfeed.js | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/classes/feeds.php b/classes/feeds.php index d6271a03a..647414609 100755 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -20,10 +20,10 @@ class Feeds extends Handler_Protected { $archive_sel_link = "Headlines.archiveSelection()"; $delete_sel_link = "Headlines.deleteSelection()"; - $sel_all_link = "Headlines.selectArticles('all')"; - $sel_unread_link = "Headlines.selectArticles('unread')"; - $sel_none_link = "Headlines.selectArticles('none')"; - $sel_inv_link = "Headlines.selectArticles('invert')"; + $sel_all_link = "Headlines.select('all')"; + $sel_unread_link = "Headlines.select('unread')"; + $sel_none_link = "Headlines.select('none')"; + $sel_inv_link = "Headlines.select('invert')"; $tog_unread_link = "Headlines.selectionToggleUnread()"; $tog_marked_link = "Headlines.selectionToggleMarked()"; diff --git a/js/tt-rss.js b/js/tt-rss.js index 8750dcdd2..b787ae17d 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -315,22 +315,22 @@ const App = { } }; this.hotkey_actions["select_all"] = function () { - Headlines.selectArticles('all'); + Headlines.select('all'); }; this.hotkey_actions["select_unread"] = function () { - Headlines.selectArticles('unread'); + Headlines.select('unread'); }; this.hotkey_actions["select_marked"] = function () { - Headlines.selectArticles('marked'); + Headlines.select('marked'); }; this.hotkey_actions["select_published"] = function () { - Headlines.selectArticles('published'); + Headlines.select('published'); }; this.hotkey_actions["select_invert"] = function () { - Headlines.selectArticles('invert'); + Headlines.select('invert'); }; this.hotkey_actions["select_none"] = function () { - Headlines.selectArticles('none'); + Headlines.select('none'); }; this.hotkey_actions["feed_refresh"] = function () { if (Feeds.getActiveFeedId() != undefined) { diff --git a/js/viewfeed.js b/js/viewfeed.js index 83e943696..0b82c3476 100755 --- a/js/viewfeed.js +++ b/js/viewfeed.js @@ -1109,7 +1109,7 @@ const Headlines = { return rv; }, - selectArticles: function(mode) { + select: function(mode) { // mode = all,none,unread,invert,marked,published let query = "#headlines-frame > div[id*=RROW]"; @@ -1128,7 +1128,7 @@ const Headlines = { query += "[class*=Unread]"; break; default: - console.warn("selectArticles: unknown mode", mode); + console.warn("select: unknown mode", mode); } const rows = $$(query); @@ -1522,7 +1522,7 @@ const Headlines = { menu.addChild(new dijit.MenuItem({ label: __("Select articles in group"), onClick: function (event) { - Headlines.selectArticles("all", + Headlines.select("all", "#headlines-frame > div[id*=RROW]" + "[data-orig-feed-id='" + this.getParent().currentTarget.getAttribute("data-feed-id") + "']"); @@ -1532,8 +1532,8 @@ const Headlines = { menu.addChild(new dijit.MenuItem({ label: __("Mark group as read"), onClick: function () { - Headlines.selectArticles("none"); - Headlines.selectArticles("all", + Headlines.select("none"); + Headlines.select("all", "#headlines-frame > div[id*=RROW]" + "[data-orig-feed-id='" + this.getParent().currentTarget.getAttribute("data-feed-id") + "']");