about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xsfeed_html.sh31
1 files changed, 30 insertions, 1 deletions
diff --git a/sfeed_html.sh b/sfeed_html.sh index a2f7cc4..3965a87 100755 --- a/sfeed_html.sh +++ b/sfeed_html.sh
@@ -20,6 +20,8 @@ Planet ACDW</h1>
20<p class="last-updated">last updated at <time>$(date -R)</time></p> 20<p class="last-updated">last updated at <time>$(date -R)</time></p>
21</header> 21</header>
22<nav> 22<nav>
23<a href="#" id="stalebutton">hide stale</a>
24//
23<a href="feeds-short.xml">rss</a> 25<a href="feeds-short.xml">rss</a>
24// 26//
25<a href="feeds.html">all</a> 27<a href="feeds.html">all</a>
@@ -31,13 +33,40 @@ Planet ACDW</h1>
31</nav> 33</nav>
32<main> 34<main>
33$(html_main "$@") 35$(html_main "$@")
34<aside><ul>$(cat "$aside")</ul></aside> 36<aside><ul id="feedlist">$(cat "$aside")</ul></aside>
35</main> 37</main>
36<footer> 38<footer>
37Generated by <a href="https://codemadness.org/sfeed-simple-feed-parser.html">sfeed</a> 39Generated by <a href="https://codemadness.org/sfeed-simple-feed-parser.html">sfeed</a>
38using <a href="https://git.acdw.net/sfeed/">this configuration</a>. 40using <a href="https://git.acdw.net/sfeed/">this configuration</a>.
39<a href="mailto:planet@me.acdw.net">suggest a feed!</a> 41<a href="mailto:planet@me.acdw.net">suggest a feed!</a>
40</footer> 42</footer>
43<script>
44var staleHidden = false;
45var staleItems = new Set(document.getElementsByClassName("stale"));
46var staleFeeds = new Set(document.getElementsByClassName("stale_feed"));
47var feedlistFeeds = new Set(document.getElementById("feedlist").children);
48function hideShowStale(){
49 var display;
50 if (staleHidden) {
51 display = null; staleHidden = false;
52 flBG = null; flBB = null;
53 } else {
54 display = 'none'; staleHidden = true;
55 flBG = 'inherit'; flBB = '1px solid';
56 }
57 staleItems.forEach(e => { e.style.display = display; });
58 staleFeeds.forEach(e => { e.style.display = display; });
59 if (window.innerWidth > 720) {
60 feedlistFeeds.forEach(e => { e.style.background = flBG; e.style.borderBottom = flBB; });
61 }
62}
63var button = document.getElementById("stalebutton");
64button.addEventListener("click", function() {
65 hideShowStale();
66 if (staleHidden) { button.textContent = "show stale"; }
67 else { button.textContent = "hide stale"; }
68});
69</script>
41</body> 70</body>
42</html> 71</html>
43EOF 72EOF