sneed
This commit is contained in:
parent
c36b586de9
commit
21aad1477a
2 changed files with 35 additions and 36 deletions
|
@ -1053,42 +1053,6 @@ if (window.location.pathname=='/submit') {
|
|||
window.onload = autoSuggestTitle();
|
||||
}
|
||||
|
||||
// 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)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
block_user=function() {
|
||||
|
||||
var exileForm = document.getElementById("exile-form");
|
||||
|
|
|
@ -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…
Add table
Add a link
Reference in a new issue