diff --git a/frontends/bringrss_flask/templates/root.html b/frontends/bringrss_flask/templates/root.html
index 244023b..b3659bd 100644
--- a/frontends/bringrss_flask/templates/root.html
+++ b/frontends/bringrss_flask/templates/root.html
@@ -298,7 +298,7 @@ body
{
text-decoration: line-through;
}
-#news .news:nth-of-type(even)
+#news .news:not(.hidden):nth-of-type(even)
{
background-color: var(--color_transparency);
}
@@ -426,9 +426,10 @@ body
-
+
⌛
+
@@ -459,6 +460,8 @@ const newsreader_feedname = document.getElementById("newsreader_feedname");
const newsreader_enclosure = document.getElementById("newsreader_enclosure");
const newsreader_news_text = document.getElementById("newsreader_news_text");
+const dynamic_filter_input = document.getElementById("dynamic_filter_input");
+
const feed_rearrange_guideline = document.getElementById("feed_rearrange_guideline");
let active_feed = null;
@@ -1382,7 +1385,7 @@ function set_show_recycled_form(event)
document.getElementById("set_show_recycled_button").classList.add("bold");
}
-function set_show_unread_form(event)
+function set_show_unread_onclick(event)
{
let params = new URLSearchParams(window.location.search);
params.delete("read");
@@ -1400,6 +1403,33 @@ function set_show_unread_form(event)
document.getElementById("set_show_recycled_button").classList.remove("bold");
}
+let dynamic_filter_timeout = null;
+function dynamic_filter_oninput(event)
+{
+ clearTimeout(dynamic_filter_timeout);
+ dynamic_filter_timeout = setTimeout(dynamic_filter_news, 666);
+}
+
+function dynamic_filter_news()
+{
+ const searchterm = dynamic_filter_input.value.trim().toLocaleLowerCase();
+ // console.log(searchterm);
+ const newss = document.getElementById("news").querySelectorAll(".news");
+ for (const news of newss)
+ {
+ const title = news.querySelector(".title").innerText.toLocaleLowerCase();
+ // console.log(title);
+ if (title.indexOf(searchterm) >= 0)
+ {
+ news.classList.remove("hidden");
+ }
+ else
+ {
+ news.classList.add("hidden");
+ }
+ }
+}
+
let show_news_batch_timeout;
function show_newss(newss)
{
@@ -1449,6 +1479,7 @@ function show_newss(newss)
}
}
show_batch();
+ dynamic_filter_news();
}
// NEWS SELECTION //////////////////////////////////////////////////////////////////////////////////