This commit is contained in:
Aevann1 2021-12-22 06:27:09 +02:00
parent 3f9dd5219f
commit 65ec25a89d
5 changed files with 4 additions and 80 deletions

View file

@ -9,34 +9,6 @@ function hide_image() {
}
}
function autoSuggestTitle() {
var urlField = document.getElementById("post-URL");
var titleField = document.getElementById("post-title");
var isValidURL = urlField.checkValidity();
if (isValidURL && urlField.value.length > 0 && titleField.value === "") {
var x = new XMLHttpRequest();
x.withCredentials=true;
x.onreadystatechange = function() {
if (x.readyState == 4 && x.status == 200) {
title=JSON.parse(x.responseText)["title"];
titleField.value=title;
checkForRequired()
}
}
x.open('get','/submit/title?url=' + urlField.value);
x.send(null);
};
};
function checkForRequired() {
var title = document.getElementById("post-title");