From f6729aab330b88b26a86cfec3b91e69199cae9fe Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 11 Aug 2022 19:18:53 +0200 Subject: [PATCH] fix https://rdrama.org/post/18459/marseycapywalking-megathread-for-bugs-and-suggestions/2487028?context=8#context --- files/assets/js/submit.js | 22 +++++++++++----------- files/templates/submit.html | 2 +- files/templates/util/assetcache.html | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/files/assets/js/submit.js b/files/assets/js/submit.js index 63982e9ba..278822d6e 100644 --- a/files/assets/js/submit.js +++ b/files/assets/js/submit.js @@ -1,17 +1,17 @@ -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") +const title = document.getElementById("post-title"); +const text = document.getElementById("post-text"); +const url = document.getElementById("post-url"); +const button = document.getElementById("create_button"); +const image = document.getElementById("file-upload"); +const image2 = document.getElementById("file-upload-submit"); -markdown('post-text','preview'); +title.value = localStorage.getItem("post_title") +text.value = localStorage.getItem("post_text") +url.value = localStorage.getItem("post_url") + +markdown(text); function checkForRequired() { - const title = document.getElementById("post-title"); - const url = document.getElementById("post-url"); - const text = document.getElementById("post-text"); - const button = document.getElementById("create_button"); - const image = document.getElementById("file-upload"); - const image2 = document.getElementById("file-upload-submit"); - if (url.value.length > 0 || image.files.length > 0 || image2.files.length > 0) { text.required = false; url.required=false; diff --git a/files/templates/submit.html b/files/templates/submit.html index db75d89cb..d732b6013 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -131,7 +131,7 @@ - +
diff --git a/files/templates/util/assetcache.html b/files/templates/util/assetcache.html index 6dd08ab8b..09a43da09 100644 --- a/files/templates/util/assetcache.html +++ b/files/templates/util/assetcache.html @@ -25,7 +25,7 @@ set CACHE_VER = { 'js/formatting.js': 240, 'js/lottery.js': 256, 'js/marked.js': 283, - 'js/submit.js': 266, + 'js/submit.js': 267, 'js/userpage.js': 242, 'js/userpage_v.js': 245, 'js/lozad.js': 260,