From 240efcfac1fcfa33dd5058f5fcda6a649c023a70 Mon Sep 17 00:00:00 2001 From: nate smith Date: Mon, 19 Feb 2024 00:15:47 -0800 Subject: [PATCH] tweak source showing --- assets/main.js | 10 ++++++---- templates/index.tmpl | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/assets/main.js b/assets/main.js index 19d98f8..85fcc42 100644 --- a/assets/main.js +++ b/assets/main.js @@ -20,17 +20,19 @@ class Button extends HTMLButtonElement { } class SourceShower extends Button { + connectedCallback() { + this.innerText = "?" + } click() { this.closest("div.line").querySelector("p[is=source-text]").toggle() - if (this.innerText == "show source") { - this.innerText = "hide source"; + if (this.innerHTML.includes("strong")) { + this.innerHTML = "?"; } else { - this.innerText = "show source"; + this.innerHTML = "?"; } } } - class LineRemover extends Button { click() { const container = this.closest("div.line"); diff --git a/templates/index.tmpl b/templates/index.tmpl index 9f7ab80..38b78bc 100644 --- a/templates/index.tmpl +++ b/templates/index.tmpl @@ -3,7 +3,7 @@ Trunkless @@ -22,7 +22,7 @@ - +