remotes/1693045480750635534/spooky-22
Aevann1 2021-07-21 12:44:59 +02:00
parent 4c3f312b95
commit 2321556a4d
1 changed files with 35 additions and 0 deletions

View File

@ -4,6 +4,41 @@
{% block scripts %}
<script>
// Invite user to mod
function invite_mod_to_guild(boardid) {
var inviteForm = document.getElementById("invite-form");
var inviteError = document.getElementById("toast-error-message");
var usernameField = document.getElementById("invite-username");
var isValidUsername = usernameField.checkValidity();
username = usernameField.value;
if (isValidUsername) {
var xhr = new XMLHttpRequest();
xhr.open("post", "/mod/invite_mod/"+boardid);
xhr.withCredentials=true;
f=new FormData();
f.append("username", username);
f.append("formkey", formkey());
xhr.onload=function(){
if (xhr.status==204) {
window.location.reload(true);
}
else {
$('#toast-invite-error').toast('dispose');
$('#toast-invite-error').toast('show');
inviteError.textContent = JSON.parse(xhr.response)["error"];
}
}
xhr.send(f)
}
}
// Badmin Step Down Function
step_downModal = function(mod) {
document.getElementById("stepDownButton").onclick = function() {