1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 20:25:57 +00:00

online search in headline buffer (hotkey shift-I)

This commit is contained in:
Andrew Dolgov
2008-05-04 07:46:32 +01:00
parent 69811a7d4e
commit 7a822893ce
5 changed files with 93 additions and 27 deletions

View File

@@ -152,6 +152,8 @@ function headlines_callback2(transport, active_feed_id, is_cat, feed_cur_page) {
markHeadline(ids[i]);
}
subtoolbarSearch();
} else {
debug("no new headlines received");
}
@@ -1677,4 +1679,38 @@ function cdmExpandArticle(a_id) {
}
function subtoolbarSearch() {
try {
var q = document.getElementById("subtoolbar_search_box");
if (!q) return;
q = q.value.toUpperCase();
var ids = false;
if (document.getElementById("headlinesList")) {
ids = getVisibleHeadlineIds();
} else {
ids = cdmGetVisibleArticles();
}
for (var i = 0; i < ids.length; i++) {
var title = document.getElementById("RTITLE-" + ids[i]);
if (title) {
if (!title.innerHTML.toUpperCase().match(q)) {
Element.hide(document.getElementById("RROW-" + ids[i]));
} else {
Element.show(document.getElementById("RROW-" + ids[i]));
}
}
}
} catch (e) {
exception_error("subtoolbarSearch", e);
}
}