This commit is contained in:
Aevann1 2022-02-16 04:15:17 +02:00
parent a69c5351fe
commit f3bb52e379
34 changed files with 3208 additions and 3185 deletions

View file

@ -1,22 +1,22 @@
function banModal(link, id, name) {
document.getElementById("banModalTitle").innerHTML = `Ban @${name}`;
document.getElementById("ban-modal-link").value = link;
document.getElementById("banUserButton").innerHTML = `Ban @${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());
const xhr = new XMLHttpRequest();
xhr.open("POST", `/ban_user/${id}?form`);
xhr.setRequestHeader('xhr', 'xhr');
const xhr = new XMLHttpRequest();
xhr.open("POST", `/ban_user/${id}?form`);
xhr.setRequestHeader('xhr', 'xhr');
xhr.onload = function(){
var myToast = bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-success'));
myToast.show();
document.getElementById('toast-post-success-text').innerHTML = `@${name} banned`;
}
xhr.onload = function(){
var myToast = bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-success'));
myToast.show();
document.getElementById('toast-post-success-text').innerHTML = `@${name} banned`;
}
xhr.send(fd);
}
xhr.send(fd);
}
};