fix submit.js

master
Aevann1 2022-08-14 05:20:43 +02:00
parent 47b6139f7c
commit e73fa11696
2 changed files with 14 additions and 14 deletions

View File

@ -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")
markdown(document.getElementById("post-text"));
function checkForRequired() {
const title = document.getElementById("post-title");
const text = document.getElementById("post-text");
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");
title.value = localStorage.getItem("post_title")
text.value = localStorage.getItem("post_text")
url.value = localStorage.getItem("post_url")
markdown(text);
function checkForRequired() {
if (url.value.length > 0 || image.files.length > 0 || image2.files.length > 0) {
text.required = false;
url.required=false;
@ -37,8 +37,8 @@ function checkForRequired() {
checkForRequired();
function hide_image() {
const x=document.getElementById('image-upload-block');
let url=document.getElementById('post-url').value;
x=document.getElementById('image-upload-block');
url=document.getElementById('post-url').value;
if (url.length>=1){
x.classList.add('d-none');
}

View File

@ -25,7 +25,7 @@ set CACHE_VER = {
'js/formatting.js': 240,
'js/lottery.js': 256,
'js/marked.js': 283,
'js/submit.js': 268,
'js/submit.js': 269,
'js/userpage.js': 243,
'js/userpage_v.js': 245,
'js/lozad.js': 260,