diff options
Diffstat (limited to 'web/template/thread.tmpl')
-rw-r--r-- | web/template/thread.tmpl | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/web/template/thread.tmpl b/web/template/thread.tmpl new file mode 100644 index 000000000..b6b91fd31 --- /dev/null +++ b/web/template/thread.tmpl @@ -0,0 +1,34 @@ +{{ template "header.tmpl" .}} +<main> + <div class="thread"> + {{range .context.Ancestors}} + <div class="toot"> + {{ template "status.tmpl" .}} + </div> + {{end}} + <div class="toot expanded"> + {{ template "status.tmpl" .status}} + </div> + {{range .context.Descendants}} + <div class="toot"> + {{ template "status.tmpl" .}} + </div> + {{end}} + </div> +</main> +<script> + Array.from(document.getElementsByClassName("spoiler-label")).forEach((label) => { + let checkbox = document.getElementById(label.htmlFor); + function update() { + if(checkbox.checked) { + label.innerHTML = "Show more"; + } else { + label.innerHTML = "Show less"; + } + } + update(); + + label.addEventListener("click", () => {setTimeout(update, 1)}); + }); +</script> +{{ template "footer.tmpl" .}}
\ No newline at end of file |