remotes/1693045480750635534/spooky-22
Aevann1 2021-07-21 12:52:40 +02:00
parent 032754f65e
commit 917c67b7d0
1 changed files with 194 additions and 160 deletions

View File

@ -2,6 +2,40 @@
<html lang="en">
<head>
<script>
block_user=function() {
var exileForm = document.getElementById("exile-form");
var exileError = document.getElementById("toast-error-message");
var usernameField = document.getElementById("exile-username");
var isValidUsername = usernameField.checkValidity();
username = usernameField.value;
if (isValidUsername) {
var xhr = new XMLHttpRequest();
xhr.open("post", "/settings/block");
xhr.withCredentials=true;
f=new FormData();
f.append("username", username);
f.append("formkey", formkey());
xhr.onload=function(){
if (xhr.status<300) {
window.location.reload(true);
}
else {
$('#toast-exile-error').toast('dispose');
$('#toast-exile-error').toast('show');
exileError.textContent = JSON.parse(xhr.response)["error"];
}
}
xhr.send(f)
}
}
//mobile prompt
if (("standalone" in window.navigator) && // Check if "standalone" property exists