blob: bc68665fe24be849c6058b547e8f8136b42f57d7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
/* Make a "Hide/Show Stale Items" button */
var staleHidden = false;
var staleItems = new Set(document.getElementsByClassName("stale"));
var staleFeeds = new Set(document.getElementsByClassName("stale_feed"));
var feedlistFeeds = new Set(document.getElementById("feedlist").children);
function hideShowStale(){
var display;
if (staleHidden) {
display = null; staleHidden = false;
flBG = null; flBB = null;
} else {
display = 'none'; staleHidden = true;
flBG = 'inherit'; flBB = '1px solid';
}
staleItems.forEach(e => { e.style.display = display; });
staleFeeds.forEach(e => { e.style.display = display; });
if (window.innerWidth > 720) {
feedlistFeeds.forEach(e => { e.style.background = flBG; e.style.borderBottom = flBB; });
}
}
var button = document.getElementById("stalebutton");
button.addEventListener("click", function() {
hideShowStale();
if (staleHidden) { button.textContent = "show stale"; }
else { button.textContent = "hide stale"; }
});
|