fix connect button

This commit is contained in:
Holly Stubbs 2024-10-03 09:07:44 +01:00
parent 9dfc7e4100
commit 23311e6c10
Signed by: tgpholly
GPG key ID: B8583C4B7D18119E

View file

@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name MultiProbe // @name MultiProbe
// @namespace https://*.angusnicneven.com/* // @namespace https://*.angusnicneven.com/*
// @version 20241003.0 // @version 20241003.1
// @description Probe with friends! // @description Probe with friends!
// @author tgpholly // @author tgpholly
// @match https://*.angusnicneven.com/* // @match https://*.angusnicneven.com/*
@ -55,7 +55,7 @@ console.log("[MP] MultiProbe init");
'use strict'; 'use strict';
// Make sure to change the userscript version too!!!!!!!!!! // Make sure to change the userscript version too!!!!!!!!!!
const USERSCRIPT_VERSION_RAW = "20241003.0"; const USERSCRIPT_VERSION_RAW = "20241003.1";
const USERSCRIPT_VERSION = parseInt(USERSCRIPT_VERSION_RAW.replace(".", "")); const USERSCRIPT_VERSION = parseInt(USERSCRIPT_VERSION_RAW.replace(".", ""));
if (!continueRunningScript) { if (!continueRunningScript) {
@ -1154,7 +1154,6 @@ mp_button {
loginForm.appendChild(buttons); loginForm.appendChild(buttons);
const submitButton = document.createElement("mp_button"); const submitButton = document.createElement("mp_button");
submitButton.innerText = "Connect"; submitButton.innerText = "Connect";
submitButton.type = "submit";
buttons.appendChild(submitButton); buttons.appendChild(submitButton);
const doNotButton = document.createElement("mp_button"); const doNotButton = document.createElement("mp_button");
doNotButton.innerText = "Close"; doNotButton.innerText = "Close";
@ -1162,9 +1161,7 @@ mp_button {
doNotButton.style.marginLeft = "1rem"; doNotButton.style.marginLeft = "1rem";
buttons.appendChild(doNotButton); buttons.appendChild(doNotButton);
loginForm.onsubmit = (e) => { function performLogin() {
e.preventDefault();
username.disabled = true; username.disabled = true;
password.disabled = true; password.disabled = true;
submitButton.disabled = true; submitButton.disabled = true;
@ -1201,6 +1198,13 @@ mp_button {
}); });
} }
submitButton.onclick = () => performLogin();
loginForm.onsubmit = (e) => {
e.preventDefault();
performLogin();
}
document.documentElement.appendChild(bg); document.documentElement.appendChild(bg);
} }