From bcfe40292d3425701ac092870f7bb417b9bb08ac Mon Sep 17 00:00:00 2001 From: iou1name Date: Thu, 18 Aug 2022 20:27:39 -0400 Subject: [PATCH] add option to hide post tags and header --- static/voyage.js | 16 ++++++++++++++++ templates/thread.html | 6 ++++++ 2 files changed, 22 insertions(+) diff --git a/static/voyage.js b/static/voyage.js index 95289fe..6c2a204 100644 --- a/static/voyage.js +++ b/static/voyage.js @@ -68,6 +68,22 @@ function toggle_visibility(event) { post.classList.remove(vis_class[event.target.parentElement.cellIndex - 1]); } } + } else if (tag == 'post tags') { + for (let post of document.querySelectorAll('.post_container > .tags')) { + if (event.target.checked) { + post.classList.add(vis_class[event.target.parentElement.cellIndex - 1]); + } else { + post.classList.remove(vis_class[event.target.parentElement.cellIndex - 1]); + } + } + } else if (tag == 'post header') { + for (let post of document.querySelectorAll('.post_container > .header')) { + if (event.target.checked) { + post.classList.add(vis_class[event.target.parentElement.cellIndex - 1]); + } else { + post.classList.remove(vis_class[event.target.parentElement.cellIndex - 1]); + } + } } else { for (let post of document.querySelectorAll('.' + tag)) { if (event.target.checked) { diff --git a/templates/thread.html b/templates/thread.html index 528c0a8..8b90846 100644 --- a/templates/thread.html +++ b/templates/thread.html @@ -30,6 +30,12 @@ {{ tag }} {% endfor %} + + post tags + + + post header +