vxc
This commit is contained in:
parent
a3ad147297
commit
aeeac05f2a
4 changed files with 22 additions and 18 deletions
|
@ -52,24 +52,25 @@ function report_commentModal(id, author) {
|
|||
document.getElementById("reportCommentFormAfter").classList.add('d-none');
|
||||
|
||||
document.getElementById("reportCommentButton").onclick = function() {
|
||||
this.innerHTML='Reporting comment';
|
||||
this.disabled = true;
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", '/report/comment/'+id);
|
||||
xhr.setRequestHeader('xhr', 'xhr');
|
||||
var form = new FormData()
|
||||
form.append("formkey", formkey());
|
||||
form.append("reason", document.getElementById("reason-comment").value);
|
||||
|
||||
this.innerHTML='Reporting comment';
|
||||
this.disabled = true;
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", '/report/comment/'+id);
|
||||
xhr.setRequestHeader('xhr', 'xhr');
|
||||
var form = new FormData()
|
||||
form.append("formkey", formkey());
|
||||
form.append("reason", document.getElementById("reason-comment").value);
|
||||
xhr.onload=function() {
|
||||
document.getElementById("reportCommentFormBefore").classList.add('d-none');
|
||||
document.getElementById("reportCommentFormAfter").classList.remove('d-none');
|
||||
this.innerHTML='Report comment';
|
||||
this.disabled = false;
|
||||
};
|
||||
|
||||
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);
|
||||
}
|
||||
xhr.onerror=function(){alert(errortext)};
|
||||
xhr.send(form);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
function report_postModal(id) {
|
||||
|
||||
submitbutton=document.getElementById("reportPostButton");
|
||||
document.getElementById("reportPostFormBefore").classList.remove('d-none');
|
||||
document.getElementById("reportPostFormAfter").classList.add('d-none');
|
||||
|
||||
submitbutton.onclick = function() {
|
||||
|
||||
|
@ -18,6 +20,7 @@ function report_postModal(id) {
|
|||
document.getElementById("reportPostFormBefore").classList.add('d-none');
|
||||
document.getElementById("reportPostFormAfter").classList.remove('d-none');
|
||||
this.disabled = false;
|
||||
this.innerHTML='Report post';
|
||||
};
|
||||
|
||||
xhr.onerror=function(){alert(errortext)};
|
||||
|
|
|
@ -904,7 +904,7 @@
|
|||
|
||||
{% if v %}
|
||||
<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 %}
|
||||
|
||||
<script src="/static/assets/js/clipboard.js?a=220"></script>
|
||||
|
|
|
@ -32,4 +32,4 @@
|
|||
</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>
|
Loading…
Add table
Add a link
Reference in a new issue