sneed
parent
4c3f312b95
commit
2321556a4d
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue