add custom server support

This commit is contained in:
biglyderv 2025-04-20 18:02:09 -04:00
parent ca385c3afe
commit 60b3e373a1
Signed by: biglyderv
GPG key ID: 0E2EB0B4CD7397B5

View file

@ -2,6 +2,7 @@
var messages = document.getElementById('messages');
var form = document.getElementById('form');
var input = document.getElementById('input');
const server = new URLSearchParams(document.location.search).get('server') || '/';
async function goPage(count) {
let counter = input.value.match(/[^\s]+$/g);
@ -42,7 +43,7 @@ async function main(e) {
if (!input.value) return false;
let msg = await fetch("/", {
let msg = await fetch(server, {
"method": "POST",
"headers": {
"content-type": "application/json",
@ -69,7 +70,7 @@ document.querySelector('.next').addEventListener('click', (e) => { e.preventDefa
input.value = '/help 1';
goPage(0);
setTimeout(function() {
setTimeout(function () {
input.value = '/inv 1';
goPage(0);
},500)
}, 500)