From 0dea62b686ee7609ad7c07ab6200872365083f2c Mon Sep 17 00:00:00 2001 From: Joshua Laymon Date: Tue, 2 Sep 2025 03:04:27 +0000 Subject: [PATCH] Update web/templates/entry_view.html --- web/templates/entry_view.html | 76 +++++++++++++---------------------- 1 file changed, 28 insertions(+), 48 deletions(-) diff --git a/web/templates/entry_view.html b/web/templates/entry_view.html index 830077a..168145e 100644 --- a/web/templates/entry_view.html +++ b/web/templates/entry_view.html @@ -102,19 +102,10 @@
Source
{% if entry.source %} - {% with s=entry.source %} - {% with sl=s|lower %} - {% if sl|slice:":2" == "wp" or sl|slice:":2" == "ws" or sl|slice:":2" == "yb" or sl|slice:":3" == "mwb" or sl|slice:":1" == "w" or sl|slice:":1" == "g" or sl|slice:":2" == "ap" or sl|slice:":3" == "apf" or sl|slice:":2" == "be" or sl|slice:":2" == "bh" or sl|slice:":2" == "br" or sl|slice:":2" == "bt" or sl|slice:":3" == "btg" or sl|slice:":2" == "cf" or sl|slice:":2" == "cl" or sl|slice:":2" == "ct" or sl|slice:":2" == "dp" or sl|slice:":2" == "fg" or sl|slice:":2" == "fy" or sl|slice:":2" == "gt" or sl|slice:":2" == "hb" or sl|slice:":2" == "im" or sl|slice:":2" == "ip" or sl|slice:":2" == "it" or sl|slice:":2" == "jv" or sl|slice:":2" == "ka" or sl|slice:":2" == "kj" or sl|slice:":2" == "kl" or sl|slice:":2" == "lf" or sl|slice:":3" == "lff" or sl|slice:":2" == "ll" or sl|slice:":2" == "ly" or sl|slice:":2" == "my" or sl|slice:":2" == "od" or sl|slice:":2" == "pe" or sl|slice:":2" == "po" or sl|slice:":2" == "pt" or sl|slice:":2" == "rr" or sl|slice:":2" == "rs" or sl|slice:":2" == "sg" or sl|slice:":2" == "sh" or sl|slice:":2" == "si" or sl|slice:":2" == "td" or sl|slice:":2" == "tp" or sl|slice:":2" == "tr" or sl|slice:":2" == "ts" or sl|slice:":2" == "un" or sl|slice:":2" == "jy"%} - {{ s }} - {% else %} - {{ s }} - {% endif %} - {% endwith %} - {% endwith %} + {{ entry.source }} {% else %}—{% endif %}
@@ -216,7 +207,7 @@ border-color:#c9def5; } - /* Subject chip gets a hit → color the whole pill */ + /* Subject chip gets a hit → color the whole chip */ .chip-subject.chip-hit{ background:#f8e3c5; /* your chosen highlight color */ border-color:#e0b98e; @@ -394,10 +385,9 @@ a.muted = false; try { - await a.play(); // <- may throw NotAllowedError on some iOS/Safari cases + await a.play(); playing = true; } catch (err) { - // Autoplay/permission style block (Safari/iOS or Chrome heuristics) if (err && (err.name === 'NotAllowedError' || /not allowed|denied permission/i.test(err.message))) { showToast("Audio was blocked. Make sure the phone isn't on Silent and tap the speaker again."); @@ -407,9 +397,7 @@ } } - // -------- button: toggle behavior -------- ttsBtn.addEventListener('click', async () => { - // Toggle OFF if something is already playing (either engine) if (playing) { try { stopAll(); @@ -438,7 +426,6 @@ } }); - // Safety: stop audio when navigating away window.addEventListener('pagehide', stopAll); })(); @@ -469,10 +456,7 @@ function showToast(message, duration = 3000) { toast.textContent = message; document.body.appendChild(toast); - // Trigger fade in setTimeout(() => toast.classList.add("show"), 50); - - // Fade out & remove setTimeout(() => { toast.classList.remove("show"); setTimeout(() => document.body.removeChild(toast), 500); @@ -483,7 +467,6 @@ function showToast(message, duration = 3000) { - + + + + + + +