forked from rDrama/rDrama
spacing consistency
parent
d64a72cdc5
commit
40e0dfbdce
|
@ -78,30 +78,23 @@ function remove_attachment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function autoSuggestTitle() {
|
function autoSuggestTitle() {
|
||||||
|
|
||||||
const urlField = document.getElementById("post-url");
|
const urlField = document.getElementById("post-url");
|
||||||
|
|
||||||
const titleField = document.getElementById("post-title");
|
const titleField = document.getElementById("post-title");
|
||||||
|
|
||||||
const isValidURL = urlField.checkValidity();
|
const isValidURL = urlField.checkValidity();
|
||||||
|
|
||||||
if (isValidURL && urlField.value.length > 0 && titleField.value === "") {
|
if (isValidURL && urlField.value.length > 0 && titleField.value === "") {
|
||||||
|
|
||||||
const x = new XMLHttpRequest();
|
const x = new XMLHttpRequest();
|
||||||
x.onreadystatechange = function() {
|
x.onreadystatechange = function() {
|
||||||
if (x.readyState == 4 && x.status == 200 && !titleField.value) {
|
if (x.readyState == 4 && x.status == 200 && !titleField.value) {
|
||||||
|
title = JSON.parse(x.responseText)["title"];
|
||||||
title=JSON.parse(x.responseText)["title"];
|
titleField.value = title;
|
||||||
titleField.value=title;
|
|
||||||
checkForRequired()
|
checkForRequired()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
x.open('get','/submit/title?url=' + urlField.value);
|
x.open('get','/submit/title?url=' + urlField.value);
|
||||||
x.setRequestHeader('xhr', 'xhr');
|
x.setRequestHeader('xhr', 'xhr');
|
||||||
x.send(null);
|
x.send(null);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function ghost_toggle(t) {
|
function ghost_toggle(t) {
|
||||||
|
|
Loading…
Reference in New Issue