1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-26 06:21:28 +00:00

dynamically show new label markers in headlines buffer w/o reload

This commit is contained in:
Andrew Dolgov
2009-01-18 16:07:31 +01:00
parent 1380f8eed4
commit f92471951b
4 changed files with 56 additions and 3 deletions

View File

@@ -907,7 +907,8 @@ function selectionAssignLabel(id) {
new Ajax.Request(query, {
onComplete: function(transport) {
viewCurrentFeed();
show_labels_in_headlines(transport);
all_counters_callback2(transport);
} });
}
@@ -2008,3 +2009,31 @@ function scrollArticle(offset) {
exception_error("scrollArticle", e);
}
}
function show_labels_in_headlines(transport) {
try {
if (transport.responseXML) {
var info = transport.responseXML.getElementsByTagName("info-for-headlines")[0];
var elems = info.getElementsByTagName("entry");
for (var l = 0; l < elems.length; l++) {
var e_id = elems[l].getAttribute("id");
if (e_id) {
var ctr = document.getElementById("HLLCTR-" + e_id);
if (ctr) {
ctr.innerHTML = elems[l].firstChild.nodeValue;
}
}
}
}
} catch (e) {
exception_error("show_labels_in_headlines", e);
}
}