perserve status of ALL checkboxes in /submit

master
Aevann1 2022-11-09 21:25:52 +02:00
parent 6694585434
commit a95d378cf6
2 changed files with 6 additions and 0 deletions

View File

@ -2,10 +2,12 @@ document.getElementById('post-title').value = localStorage.getItem("post-title")
document.getElementById('post-text').value = localStorage.getItem("post-text")
document.getElementById('post-url').value = localStorage.getItem("post-url")
document.getElementById('post-notify').checked = localStorage.getItem("post-notify") == 'true'
document.getElementById('post-new').checked = localStorage.getItem("post-new") == 'true'
document.getElementById('post-nsfw').checked = localStorage.getItem("post-nsfw") == 'true'
document.getElementById('post-private').checked = localStorage.getItem("post-private") == 'true'
document.getElementById('post-club').checked = localStorage.getItem("post-club") == 'true'
document.getElementById('post-ghost').checked = localStorage.getItem("post-ghost") == 'true'
markdown(document.getElementById("post-text"));
@ -115,10 +117,12 @@ function savetext() {
let sub = document.getElementById('sub')
if (sub) localStorage.setItem("sub", sub.value)
localStorage.setItem("post-notify", document.getElementById('post-notify').checked)
localStorage.setItem("post-new", document.getElementById('post-new').checked)
localStorage.setItem("post-nsfw", document.getElementById('post-nsfw').checked)
localStorage.setItem("post-private", document.getElementById('post-private').checked)
localStorage.setItem("post-club", document.getElementById('post-club').checked)
localStorage.setItem("post-ghost", document.getElementById('post-ghost').checked)
}

View File

@ -650,10 +650,12 @@
localStorage.setItem("post-url", "")
localStorage.setItem("sub", "")
localStorage.setItem("post-notify", true)
localStorage.setItem("post-new", false)
localStorage.setItem("post-nsfw", false)
localStorage.setItem("post-private", false)
localStorage.setItem("post-club", false)
localStorage.setItem("post-ghost", false)
</script>
{% endif %}