From 26bbc8b69a35415344d8c0fc96acc3b680f313b5 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 15 Aug 2022 08:42:59 +0200 Subject: [PATCH] perserve the first 4 checkboxes in /submit too --- files/assets/js/submit.js | 25 ++++++++++++++++++------- files/templates/submission.html | 11 ++++++++--- files/templates/submit.html | 20 ++++++++++---------- files/templates/util/assetcache.html | 2 +- 4 files changed, 37 insertions(+), 21 deletions(-) diff --git a/files/assets/js/submit.js b/files/assets/js/submit.js index e689d8333..7047b25b8 100644 --- a/files/assets/js/submit.js +++ b/files/assets/js/submit.js @@ -1,6 +1,11 @@ -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-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-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' markdown(document.getElementById("post-text")); @@ -77,7 +82,7 @@ document.onpaste = function(event) { document.getElementById('file-upload').setAttribute('required', 'false'); } document.getElementById('post-url').value = null; - localStorage.setItem("post_url", "") + localStorage.setItem("post-url", "") checkForRequired(); } } @@ -97,11 +102,17 @@ document.getElementById('file-upload').addEventListener('change', function(){ }) function savetext() { - localStorage.setItem("post_title", document.getElementById('post-title').value) - localStorage.setItem("post_text", document.getElementById('post-text').value) - localStorage.setItem("post_url", document.getElementById('post-url').value) + localStorage.setItem("post-title", document.getElementById('post-title').value) + localStorage.setItem("post-text", document.getElementById('post-text').value) + localStorage.setItem("post-url", document.getElementById('post-url').value) + let sub = document.getElementById('sub') if (sub) localStorage.setItem("sub", sub.value) + + 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) } diff --git a/files/templates/submission.html b/files/templates/submission.html index 812eae945..828ce2d92 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -1137,10 +1137,15 @@ {% if success %} {% endif %} diff --git a/files/templates/submit.html b/files/templates/submit.html index b1dfb0e56..a820a72e7 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -170,29 +170,29 @@

 
 												
- - + +
- - + +
- - + +
{% if FEATURES['COUNTRY_CLUB'] -%}
- - + +
{%- endif %}
- - + +
diff --git a/files/templates/util/assetcache.html b/files/templates/util/assetcache.html
index 0d066465c..63731e0ef 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': 269,
+	'js/submit.js': 270,
 	'js/userpage.js': 244,
 	'js/userpage_v.js': 245,
 	'js/lozad.js': 260,