dsffds
This commit is contained in:
parent
fef7aad2cd
commit
a222de7d4f
1 changed files with 17 additions and 20 deletions
|
@ -1,30 +1,27 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
window.addEventListener("load",function(event) {
|
const banModal = function(link, id, name) {
|
||||||
const banModal = function(link, id, name) {
|
document.getElementById("banModalTitle").innerHTML = `Ban @${name}`;
|
||||||
document.getElementById("banModalTitle").innerHTML = `Ban @${name}`;
|
document.getElementById("ban-modal-link").value = link;
|
||||||
document.getElementById("ban-modal-link").value = link;
|
document.getElementById("banUserButton").innerHTML = `Ban @${name}`;
|
||||||
document.getElementById("banUserButton").innerHTML = `Ban @${name}`;
|
|
||||||
|
|
||||||
document.getElementById("banUserButton").onclick = function() {
|
document.getElementById("banUserButton").onclick = function() {
|
||||||
let fd = new FormData(document.getElementById("banModalForm"));
|
let fd = new FormData(document.getElementById("banModalForm"));
|
||||||
fd.append("formkey", formkey());
|
fd.append("formkey", formkey());
|
||||||
|
|
||||||
let xhr = new XMLHttpRequest();
|
let xhr = new XMLHttpRequest();
|
||||||
xhr.open("POST", `/ban_user/${id}?form`, true);
|
xhr.open("POST", `/ban_user/${id}?form`, true);
|
||||||
xhr.withCredentials = true;
|
xhr.withCredentials = true;
|
||||||
|
|
||||||
xhr.onload = function(){
|
xhr.onload = function(){
|
||||||
var myToast = new bootstrap.Toast(document.getElementById('toast-post-success'));
|
var myToast = new bootstrap.Toast(document.getElementById('toast-post-success'));
|
||||||
myToast.show();
|
myToast.show();
|
||||||
document.getElementById('toast-post-success-text').innerHTML = `@${name} banned`;
|
document.getElementById('toast-post-success-text').innerHTML = `@${name} banned`;
|
||||||
}
|
|
||||||
|
|
||||||
xhr.send(fd);
|
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
});
|
xhr.send(fd);
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="modal fade" id="banModal" tabindex="-1" role="dialog" aria-labelledby="banModalTitle" aria-hidden="true">
|
<div class="modal fade" id="banModal" tabindex="-1" role="dialog" aria-labelledby="banModalTitle" aria-hidden="true">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue