forked from rDrama/rDrama
fix submit.js
parent
47b6139f7c
commit
e73fa11696
|
@ -1,17 +1,17 @@
|
||||||
const title = document.getElementById("post-title");
|
document.getElementById('post-title').value = localStorage.getItem("post_title")
|
||||||
const text = document.getElementById("post-text");
|
document.getElementById('post-text').value = localStorage.getItem("post_text")
|
||||||
const url = document.getElementById("post-url");
|
document.getElementById('post-url').value = localStorage.getItem("post_url")
|
||||||
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")
|
markdown(document.getElementById("post-text"));
|
||||||
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;
|
||||||
|
@ -37,8 +37,8 @@ function checkForRequired() {
|
||||||
checkForRequired();
|
checkForRequired();
|
||||||
|
|
||||||
function hide_image() {
|
function hide_image() {
|
||||||
const x=document.getElementById('image-upload-block');
|
x=document.getElementById('image-upload-block');
|
||||||
let url=document.getElementById('post-url').value;
|
url=document.getElementById('post-url').value;
|
||||||
if (url.length>=1){
|
if (url.length>=1){
|
||||||
x.classList.add('d-none');
|
x.classList.add('d-none');
|
||||||
}
|
}
|
||||||
|
|
|
@ -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': 268,
|
'js/submit.js': 269,
|
||||||
'js/userpage.js': 243,
|
'js/userpage.js': 243,
|
||||||
'js/userpage_v.js': 245,
|
'js/userpage_v.js': 245,
|
||||||
'js/lozad.js': 260,
|
'js/lozad.js': 260,
|
||||||
|
|
Loading…
Reference in New Issue