This commit is contained in:
Aevann1 2022-02-01 08:23:36 +02:00
parent a3ad147297
commit aeeac05f2a
4 changed files with 22 additions and 18 deletions

View file

@ -52,7 +52,6 @@ function report_commentModal(id, author) {
document.getElementById("reportCommentFormAfter").classList.add('d-none'); document.getElementById("reportCommentFormAfter").classList.add('d-none');
document.getElementById("reportCommentButton").onclick = function() { document.getElementById("reportCommentButton").onclick = function() {
this.innerHTML='Reporting comment'; this.innerHTML='Reporting comment';
this.disabled = true; this.disabled = true;
const xhr = new XMLHttpRequest(); const xhr = new XMLHttpRequest();
@ -65,11 +64,13 @@ function report_commentModal(id, author) {
xhr.onload=function() { xhr.onload=function() {
document.getElementById("reportCommentFormBefore").classList.add('d-none'); document.getElementById("reportCommentFormBefore").classList.add('d-none');
document.getElementById("reportCommentFormAfter").classList.remove('d-none'); document.getElementById("reportCommentFormAfter").classList.remove('d-none');
this.innerHTML='Report comment';
this.disabled = false;
}; };
xhr.onerror=function(){alert(errortext)}; xhr.onerror=function(){alert(errortext)};
xhr.send(form); xhr.send(form);
} }
}; };

View file

@ -1,6 +1,8 @@
function report_postModal(id) { function report_postModal(id) {
submitbutton=document.getElementById("reportPostButton"); submitbutton=document.getElementById("reportPostButton");
document.getElementById("reportPostFormBefore").classList.remove('d-none');
document.getElementById("reportPostFormAfter").classList.add('d-none');
submitbutton.onclick = function() { submitbutton.onclick = function() {
@ -18,6 +20,7 @@ function report_postModal(id) {
document.getElementById("reportPostFormBefore").classList.add('d-none'); document.getElementById("reportPostFormBefore").classList.add('d-none');
document.getElementById("reportPostFormAfter").classList.remove('d-none'); document.getElementById("reportPostFormAfter").classList.remove('d-none');
this.disabled = false; this.disabled = false;
this.innerHTML='Report post';
}; };
xhr.onerror=function(){alert(errortext)}; xhr.onerror=function(){alert(errortext)};

View file

@ -904,7 +904,7 @@
{% if v %} {% if v %}
<script src="/static/assets/js/marked.js?a=220"></script> <script src="/static/assets/js/marked.js?a=220"></script>
<script src="/static/assets/js/comments_v.js?a=236"></script> <script src="/static/assets/js/comments_v.js?a=237"></script>
{% endif %} {% endif %}
<script src="/static/assets/js/clipboard.js?a=220"></script> <script src="/static/assets/js/clipboard.js?a=220"></script>

View file

@ -32,4 +32,4 @@
</div> </div>
</div> </div>
<script src="/static/assets/js/report_post_modal.js?a=221"></script> <script src="/static/assets/js/report_post_modal.js?a=222"></script>