From ac7bea37f33c217d4a16784dde97417e55125354 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 24 Jul 2021 20:42:39 +0200 Subject: [PATCH] dffd --- drama/templates/default.html | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/drama/templates/default.html b/drama/templates/default.html index 29342b45b..78cfba175 100644 --- a/drama/templates/default.html +++ b/drama/templates/default.html @@ -219,26 +219,19 @@ document.getElementById("comment-author").textContent = author; + //offtopic.disabled=true; document.getElementById("reportCommentButton").onclick = function() { this.innerHTML='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'); + } + ) } };