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