summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-03-31 11:21:35 +0300
committerAndrew Dolgov <[email protected]>2017-03-31 11:21:35 +0300
commit337535416f3d75f94a34c64e785f1c2200844013 (patch)
tree4b58123da211193adda174a2c78b7e9979fa09a4 /js
parent86e534290e2c9ce772481e70aeb4148dde7539b4 (diff)
filter by search results while marking feed as read
Diffstat (limited to 'js')
-rw-r--r--js/feedlist.js17
-rwxr-xr-xjs/viewfeed.js2
2 files changed, 12 insertions, 7 deletions
diff --git a/js/feedlist.js b/js/feedlist.js
index 941fe9e8b..879b52d03 100644
--- a/js/feedlist.js
+++ b/js/feedlist.js
@@ -484,28 +484,31 @@ function catchupFeed(feed, is_cat, mode) {
switch (mode) {
case "1day":
- str = __("Mark all articles in %s older than 1 day as read?");
+ str = __("Mark %w in %s older than 1 day as read?");
break;
case "1week":
- str = __("Mark all articles in %s older than 1 week as read?");
+ str = __("Mark %w in %s older than 1 week as read?");
break;
case "2week":
- str = __("Mark all articles in %s older than 2 weeks as read?");
+ str = __("Mark %w in %s older than 2 weeks as read?");
break;
default:
- str = __("Mark all articles in %s as read?");
+ str = __("Mark %w in %s as read?");
}
+ var mark_what = last_search_query && last_search_query[0] ? __("search results") : __("all articles");
var fn = getFeedName(feed, is_cat);
- str = str.replace("%s", fn);
+ str = str.replace("%s", fn)
+ .replace("%w", mark_what);
if (getInitParam("confirm_feed_catchup") == 1 && !confirm(str)) {
return;
}
- var catchup_query = "?op=rpc&method=catchupFeed&feed_id=" +
- feed + "&is_cat=" + is_cat + "&mode=" + mode;
+ var catchup_query = {op: 'rpc', method: 'catchupFeed', feed_id: feed,
+ is_cat: is_cat, mode: mode, search_query: last_search_query[0],
+ search_lang: last_search_query[1]};
console.log(catchup_query);
diff --git a/js/viewfeed.js b/js/viewfeed.js
index 7cbcc08b6..3e2f97751 100755
--- a/js/viewfeed.js
+++ b/js/viewfeed.js
@@ -13,6 +13,7 @@ var loaded_article_ids = [];
var _last_headlines_update = 0;
var _headlines_scroll_offset = 0;
var current_first_id = 0;
+var last_search_query;
var _catchup_request_sent = false;
@@ -38,6 +39,7 @@ function headlines_callback2(transport, offset, background, infscroll_req) {
is_cat = reply['headlines']['is_cat'];
feed_id = reply['headlines']['id'];
+ last_search_query = reply['headlines']['search_query'];
if (background) {
var content = reply['headlines']['content'];