mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-22 21:11:27 +00:00
js: add get_feed_unread()
This commit is contained in:
@@ -149,11 +149,10 @@ function viewfeed(feed, subop, is_cat, subop_param, skip_history, offset) {
|
|||||||
queue: { position:'end', scope: 'FEEDL-' + feed, limit: 1 } } );
|
queue: { position:'end', scope: 'FEEDL-' + feed, limit: 1 } } );
|
||||||
}
|
}
|
||||||
|
|
||||||
var unread_ctr = document.getElementById("FEEDU-" + feed);
|
var unread_ctr = get_feed_unread(feed);
|
||||||
var cache_check = false;
|
var cache_check = false;
|
||||||
|
|
||||||
if (unread_ctr && !page_offset && !force_nocache && !subop) {
|
if (unread_ctr != -1 && !page_offset && !force_nocache && !subop) {
|
||||||
unread_ctr = unread_ctr.innerHTML;
|
|
||||||
|
|
||||||
var cache_prefix = "";
|
var cache_prefix = "";
|
||||||
|
|
||||||
|
|||||||
@@ -778,6 +778,15 @@ function all_counters_callback2(transport) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_feed_unread(id) {
|
||||||
|
try {
|
||||||
|
return parseInt(document.getElementById("FEEDU-" + id).innerHTML);
|
||||||
|
} catch (e) {
|
||||||
|
exception_error("get_feed_unread", e, true);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function get_feed_entry_unread(doc, elem) {
|
function get_feed_entry_unread(doc, elem) {
|
||||||
|
|
||||||
var id = elem.id.replace("FEEDR-", "");
|
var id = elem.id.replace("FEEDR-", "");
|
||||||
|
|||||||
Reference in New Issue
Block a user