remotes/1693045480750635534/spooky-22
Aevann1 2021-07-24 20:42:39 +02:00
parent e29cfe2544
commit ac7bea37f3
1 changed files with 7 additions and 14 deletions

View File

@ -219,26 +219,19 @@
document.getElementById("comment-author").textContent = author;
//offtopic.disabled=true;
document.getElementById("reportCommentButton").onclick = function() {
this.innerHTML='<span class="spinner-border spinner-border-sm mr-2" role="status" aria-hidden="true"></span>Reporting comment';
this.disabled = true;
var xhr = new XMLHttpRequest();
xhr.open("POST", '/api/flag/comment/'+id, true);
var form = new FormData()
form.append("formkey", formkey());
form.append("reason", document.getElementById("reason").value);
post('/api/flag/comment/' + id,
callback = function() {
xhr.withCredentials=true;
xhr.onload=function() {
document.getElementById("reportCommentFormBefore").classList.add('d-none');
document.getElementById("reportCommentFormAfter").classList.remove('d-none');
};
xhr.onerror=function(){alert(errortext)};
xhr.send(form);
document.getElementById("reportCommentFormBefore").classList.add('d-none');
document.getElementById("reportCommentFormAfter").classList.remove('d-none');
}
)
}
};