Aevann1 2022-08-11 19:18:53 +02:00
parent 61858337d9
commit f6729aab33
3 changed files with 13 additions and 13 deletions

View File

@ -1,17 +1,17 @@
document.getElementById('post-title').value = localStorage.getItem("post_title") const title = document.getElementById("post-title");
document.getElementById('post-text').value = localStorage.getItem("post_text") const text = document.getElementById("post-text");
document.getElementById('post-url').value = localStorage.getItem("post_url") 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() { 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) { if (url.value.length > 0 || image.files.length > 0 || image2.files.length > 0) {
text.required = false; text.required = false;
url.required=false; url.required=false;

View File

@ -131,7 +131,7 @@
<label for="body" class="mt-3">Text<i class="fas fa-info-circle text-gray-400 ml-1" data-bs-toggle="tooltip" data-bs-placement="top" title="Uses markdown. Limited to 20000 characters."></i></label> <label for="body" class="mt-3">Text<i class="fas fa-info-circle text-gray-400 ml-1" data-bs-toggle="tooltip" data-bs-placement="top" title="Uses markdown. Limited to 20000 characters."></i></label>
<textarea form="submitform" id="post-text" class="form-control rounded" aria-label="With textarea" placeholder="Optional if you have a link or an image." rows="7" name="body" oninput="markdown('post-text','preview');charLimit('post-text','character-count-submit-text-form');checkForRequired();savetext()" {% if v.longpost %}minlength="280"{% endif %} maxlength="{% if v.bird %}140{% else %}20000{% endif %}" required></textarea> <textarea form="submitform" id="post-text" class="form-control rounded" aria-label="With textarea" placeholder="Optional if you have a link or an image." rows="7" name="body" data-preview="preview" oninput="markdown(this);charLimit('post-text','character-count-submit-text-form');checkForRequired();savetext()" {% if v.longpost %}minlength="280"{% endif %} maxlength="{% if v.bird %}140{% else %}20000{% endif %}" required></textarea>
<div class="ghostdiv" style="display:none;"></div> <div class="ghostdiv" style="display:none;"></div>
<div class="text-small font-weight-bold mt-1" id="character-count-submit-text-form" style="right: 1rem; bottom: 0.5rem; z-index: 3;"></div> <div class="text-small font-weight-bold mt-1" id="character-count-submit-text-form" style="right: 1rem; bottom: 0.5rem; z-index: 3;"></div>

View File

@ -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': 266, 'js/submit.js': 267,
'js/userpage.js': 242, 'js/userpage.js': 242,
'js/userpage_v.js': 245, 'js/userpage_v.js': 245,
'js/lozad.js': 260, 'js/lozad.js': 260,