Aevann 2023-02-10 19:02:45 +02:00
parent e5343fb7a8
commit 47a4bdfa95
3 changed files with 11 additions and 15 deletions

View File

@ -1,11 +0,0 @@
history.pushState(null, null, `/post/${pid}`);
localStorage.setItem("post-title", "")
localStorage.setItem("post-text", "")
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-ghost", false)

View File

@ -241,6 +241,17 @@ function submit(form) {
uploadfilelist.classList.add("d-none")
if (xhr.status >= 200 && xhr.status < 300) {
const post_id = JSON.parse(xhr.response)['post_id'];
localStorage.setItem("post-title", "")
localStorage.setItem("post-text", "")
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-ghost", false)
location.href = "/post/" + post_id
} else {
submitButton.disabled = false;

View File

@ -371,10 +371,6 @@
<script defer src="{{'js/new_comments.js' | asset}}"></script>
<script defer src="{{'js/submission.js' | asset}}"></script>
{% if success %}
<script defer src="{{'js/submission_success.js' | asset}}"></script>
{% endif %}
{% if fart and not (v and v.has_badge(128)) %}
<script defer src="{{'js/fart.js' | asset}}"></script>
{% endif %}