forked from rDrama/rDrama
1
0
Fork 0
master
Aevann1 2021-12-01 14:42:29 +02:00
parent 0d8b21ff5f
commit d8da5dc4c6
1 changed files with 17 additions and 20 deletions

View File

@ -1,30 +1,27 @@
<script>
window.addEventListener("load",function(event) {
const banModal = function(link, id, name) {
document.getElementById("banModalTitle").innerHTML = `Ban @${name}`;
document.getElementById("ban-modal-link").value = link;
document.getElementById("banUserButton").innerHTML = `Ban @${name}`;
const banModal = function(link, id, name) {
document.getElementById("banModalTitle").innerHTML = `Ban @${name}`;
document.getElementById("ban-modal-link").value = link;
document.getElementById("banUserButton").innerHTML = `Ban @${name}`;
document.getElementById("banUserButton").onclick = function() {
let fd = new FormData(document.getElementById("banModalForm"));
fd.append("formkey", formkey());
document.getElementById("banUserButton").onclick = function() {
let fd = new FormData(document.getElementById("banModalForm"));
fd.append("formkey", formkey());
let xhr = new XMLHttpRequest();
xhr.open("POST", `/ban_user/${id}?form`, true);
xhr.withCredentials = true;
let xhr = new XMLHttpRequest();
xhr.open("POST", `/ban_user/${id}?form`, true);
xhr.withCredentials = true;
xhr.onload = function(){
var myToast = new bootstrap.Toast(document.getElementById('toast-post-success'));
myToast.show();
document.getElementById('toast-post-success-text').innerHTML = `@${name} banned`;
}
xhr.send(fd);
xhr.onload = function(){
var myToast = new bootstrap.Toast(document.getElementById('toast-post-success'));
myToast.show();
document.getElementById('toast-post-success-text').innerHTML = `@${name} banned`;
}
};
});
xhr.send(fd);
}
};
</script>
<div class="modal fade" id="banModal" tabindex="-1" role="dialog" aria-labelledby="banModalTitle" aria-hidden="true">