forked from MarseyWorld/MarseyWorld
perserve the first 4 checkboxes in /submit too
parent
b033b518b8
commit
26bbc8b69a
|
@ -1,6 +1,11 @@
|
||||||
document.getElementById('post-title').value = localStorage.getItem("post_title")
|
document.getElementById('post-title').value = localStorage.getItem("post-title")
|
||||||
document.getElementById('post-text').value = localStorage.getItem("post_text")
|
document.getElementById('post-text').value = localStorage.getItem("post-text")
|
||||||
document.getElementById('post-url').value = localStorage.getItem("post_url")
|
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"));
|
markdown(document.getElementById("post-text"));
|
||||||
|
|
||||||
|
@ -77,7 +82,7 @@ document.onpaste = function(event) {
|
||||||
document.getElementById('file-upload').setAttribute('required', 'false');
|
document.getElementById('file-upload').setAttribute('required', 'false');
|
||||||
}
|
}
|
||||||
document.getElementById('post-url').value = null;
|
document.getElementById('post-url').value = null;
|
||||||
localStorage.setItem("post_url", "")
|
localStorage.setItem("post-url", "")
|
||||||
checkForRequired();
|
checkForRequired();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -97,11 +102,17 @@ document.getElementById('file-upload').addEventListener('change', function(){
|
||||||
})
|
})
|
||||||
|
|
||||||
function savetext() {
|
function savetext() {
|
||||||
localStorage.setItem("post_title", document.getElementById('post-title').value)
|
localStorage.setItem("post-title", document.getElementById('post-title').value)
|
||||||
localStorage.setItem("post_text", document.getElementById('post-text').value)
|
localStorage.setItem("post-text", document.getElementById('post-text').value)
|
||||||
localStorage.setItem("post_url", document.getElementById('post-url').value)
|
localStorage.setItem("post-url", document.getElementById('post-url').value)
|
||||||
|
|
||||||
let sub = document.getElementById('sub')
|
let sub = document.getElementById('sub')
|
||||||
if (sub) localStorage.setItem("sub", sub.value)
|
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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1137,10 +1137,15 @@
|
||||||
{% if success %}
|
{% if success %}
|
||||||
<script>
|
<script>
|
||||||
history.pushState(null, null, '{{p.permalink}}');
|
history.pushState(null, null, '{{p.permalink}}');
|
||||||
localStorage.setItem("post_title", "")
|
localStorage.setItem("post-title", "")
|
||||||
localStorage.setItem("post_text", "")
|
localStorage.setItem("post-text", "")
|
||||||
localStorage.setItem("post_url", "")
|
localStorage.setItem("post-url", "")
|
||||||
localStorage.setItem("sub", "")
|
localStorage.setItem("sub", "")
|
||||||
|
|
||||||
|
localStorage.setItem("post-new", false)
|
||||||
|
localStorage.setItem("post-nsfw", false)
|
||||||
|
localStorage.setItem("post-private", false)
|
||||||
|
localStorage.setItem("post-club", false)
|
||||||
</script>
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
|
@ -170,29 +170,29 @@
|
||||||
<pre></pre>
|
<pre></pre>
|
||||||
|
|
||||||
<div class="custom-control custom-checkbox">
|
<div class="custom-control custom-checkbox">
|
||||||
<input autocomplete="off" type="checkbox" class="custom-control-input" id="new" name="new">
|
<input autocomplete="off" type="checkbox" class="custom-control-input" id="post-new" name="new" onchange="savetext()">
|
||||||
<label class="custom-control-label" for="new">Make the default comment sorting "new"</label>
|
<label class="custom-control-label" for="post-new">Make the default comment sorting "new"</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="custom-control custom-checkbox">
|
<div class="custom-control custom-checkbox">
|
||||||
<input autocomplete="off" type="checkbox" class="custom-control-input" id="nsfw" name="over_18">
|
<input autocomplete="off" type="checkbox" class="custom-control-input" id="post-nsfw" name="over_18" onchange="savetext()">
|
||||||
<label class="custom-control-label" for="nsfw">+18</label>
|
<label class="custom-control-label" for="post-nsfw">+18</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="custom-control custom-checkbox">
|
<div class="custom-control custom-checkbox">
|
||||||
<input onchange='draft(this);' autocomplete="off" type="checkbox" class="custom-control-input" id="private" name="private">
|
<input onchange='draft(this);' autocomplete="off" type="checkbox" class="custom-control-input" id="post-private" name="private" onchange="savetext()">
|
||||||
<label class="custom-control-label" for="private">Draft</label>
|
<label class="custom-control-label" for="post-private">Draft</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if FEATURES['COUNTRY_CLUB'] -%}
|
{% if FEATURES['COUNTRY_CLUB'] -%}
|
||||||
<div class="custom-control custom-checkbox">
|
<div class="custom-control custom-checkbox">
|
||||||
<input autocomplete="off" type="checkbox" class="custom-control-input" id="club" name="club">
|
<input autocomplete="off" type="checkbox" class="custom-control-input" id="post-club" name="club" onchange="savetext()">
|
||||||
<label class="custom-control-label" for="club">{{CC_TITLE}} thread</label>
|
<label class="custom-control-label" for="post-club">{{CC_TITLE}} thread</label>
|
||||||
</div>
|
</div>
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
<div class="custom-control custom-checkbox">
|
<div class="custom-control custom-checkbox">
|
||||||
<input onchange='draft(this);' autocomplete="off" type="checkbox" class="custom-control-input" id="ghost" name="ghost" {% if v.coins < 100 %}disabled{% endif %}>
|
<input onchange='draft(this);' autocomplete="off" type="checkbox" class="custom-control-input" id="post-ghost" name="ghost" {% if v.coins < 100 %}disabled{% endif %}>
|
||||||
<label class="custom-control-label" for="ghost">Ghost Thread (cost: 100 coins)</label>
|
<label class="custom-control-label" for="post-ghost">Ghost Thread (cost: 100 coins)</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
|
|
|
@ -25,7 +25,7 @@ set CACHE_VER = {
|
||||||
'js/formatting.js': 240,
|
'js/formatting.js': 240,
|
||||||
'js/lottery.js': 256,
|
'js/lottery.js': 256,
|
||||||
'js/marked.js': 283,
|
'js/marked.js': 283,
|
||||||
'js/submit.js': 269,
|
'js/submit.js': 270,
|
||||||
'js/userpage.js': 244,
|
'js/userpage.js': 244,
|
||||||
'js/userpage_v.js': 245,
|
'js/userpage_v.js': 245,
|
||||||
'js/lozad.js': 260,
|
'js/lozad.js': 260,
|
||||||
|
|
Loading…
Reference in New Issue