From a2ce6c351572fc12d70ee31d52d1734977e0ae17 Mon Sep 17 00:00:00 2001 From: Holly Date: Wed, 2 Oct 2024 19:11:33 +0100 Subject: [PATCH] replace usage of button with custom button to circumvent issues on some pages --- client/Terminal-00-Multiuser.user.js | 73 ++++++++++++++++++++-------- 1 file changed, 53 insertions(+), 20 deletions(-) diff --git a/client/Terminal-00-Multiuser.user.js b/client/Terminal-00-Multiuser.user.js index 765fc63..9b2ac8c 100644 --- a/client/Terminal-00-Multiuser.user.js +++ b/client/Terminal-00-Multiuser.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name MultiProbe // @namespace https://*.angusnicneven.com/* -// @version 20241002.1 +// @version 20241002.2 // @description Probe with friends! // @author tgpholly // @match https://*.angusnicneven.com/* @@ -48,7 +48,7 @@ console.log("[MP] MultiProbe init"); 'use strict'; // Make sure to change the userscript version too!!!!!!!!!! - const USERSCRIPT_VERSION_RAW = "20241002.1"; + const USERSCRIPT_VERSION_RAW = "20241002.2"; const USERSCRIPT_VERSION = parseInt(USERSCRIPT_VERSION_RAW.replace(".", "")); if (!continueRunningScript) { @@ -142,7 +142,7 @@ html { .groupui { position: fixed; - top: 2rem; + top: calc(2rem + 6px); right: 0px; height: 25rem; width: 12rem; @@ -152,18 +152,26 @@ html { text-shadow: none!important; font-family: Arial,sans-serif; font-size: unset !important; + transition: right .16s ease-in-out; } .groupui-popper { position: absolute; - top: 0px; - left: -1rem; + top: -2px; + left: -1.5rem; width: 1rem; - height: 100%; + height: calc(100% - 6px); opacity: 0.25; + transition: opacity .16s ease-in-out; background-color: black; border: 1px solid white; color: white; + padding: .125rem; + line-height: 380px; +} + +.groupui:not(.grouphidden) .groupui-popper, .groupui-popper:hover { + opacity: 1; } .groupui-title { @@ -340,6 +348,28 @@ mp_container ul li { mp_group_user { display: block; } + +mp_button { + display: inline-block; + background-color: black; + color: white; + border: 1px solid white; + text-shadow: none!important; + font-family: Arial,sans-serif; + font-size: unset !important; + padding: 4px 8px; + margin: 2px; + text-align: center; +} + +.out-of-the-way { + opacity: 0.25; + transition: opacity .16s ease-in-out; +} + +.out-of-the-way:hover { + opacity: 1; +} `.split("\n").join("").split("\r").join("").split("\t").join(""); document.head.appendChild(styles); @@ -362,7 +392,7 @@ mp_group_user { groupUIBase.style = "display:none"; groupUIBase.classList.add("groupui"); groupUIBase.classList.add("grouphidden"); - const groupPopper = document.createElement("button"); + const groupPopper = document.createElement("mp_button"); groupPopper.classList.add("groupui-popper"); groupPopper.onclick = () => { groupUIBase.classList.toggle("grouphidden"); @@ -393,11 +423,11 @@ mp_group_user { buttonBox.classList.add("buttons"); user.appendChild(buttonBox); - /*const followButton = document.createElement("button"); + /*const followButton = document.createElement("mp_button"); followButton.innerText = "F"; buttonBox.appendChild(followButton);*/ - const gotoButton = document.createElement("button"); + const gotoButton = document.createElement("mp_button"); gotoButton.innerText = "Go To"; const gotoLoc = location; gotoButton.onclick = () => { @@ -833,7 +863,7 @@ mp_group_user { const buttons = document.createElement("mp_container"); buttons.style.marginTop = "1rem"; - const disconnectButton = document.createElement("button"); + const disconnectButton = document.createElement("mp_button"); disconnectButton.innerText = localStorage["mpconnectonload"] === "true" ? "Disconnect" : "Connect"; disconnectButton.onclick = () => { if (localStorage["mpconnectonload"] === "true") { @@ -843,9 +873,11 @@ mp_group_user { } } else { localStorage["mpconnectonload"] = true; - doConnect(localStorage["mpapikey"]); + //doConnect(localStorage["mpapikey"]); } disconnectButton.innerText = localStorage["mpconnectonload"] === "true" ? "Disconnect" : "Connect"; + + window.location.reload(); }; buttons.appendChild(disconnectButton); @@ -854,7 +886,7 @@ mp_group_user { manageAccountLink.href = "https://multiprobe.eusv.net/"; manageAccountLink.target = "_blank"; buttons.appendChild(manageAccountLink); - const manageAccount = document.createElement("button"); + const manageAccount = document.createElement("mp_button"); manageAccount.style.marginLeft = "1rem"; manageAccount.innerText = "Manage Account"; manageAccount.onclick = () => { @@ -862,7 +894,7 @@ mp_group_user { } buttons.appendChild(manageAccount); - const closeButton = document.createElement("button"); + const closeButton = document.createElement("mp_button"); closeButton.innerText = "Close"; closeButton.onclick = () => { bg.remove(); @@ -894,7 +926,7 @@ mp_group_user { const buttons = document.createElement("mp_container"); buttons.style.marginTop = "1rem"; - const gotIt = document.createElement("button"); + const gotIt = document.createElement("mp_button"); gotIt.onclick = () => { bg.remove(); } @@ -945,7 +977,7 @@ mp_group_user { const buttons = document.createElement("mp_container"); buttons.style.marginTop = "1rem"; - const gotIt = document.createElement("button"); + const gotIt = document.createElement("mp_button"); gotIt.onclick = () => { localStorage["mpshowfirsttime"] = "false"; bg.remove(); @@ -1031,11 +1063,11 @@ mp_group_user { const buttons = document.createElement("mp_container"); buttons.style.marginTop = "1rem"; loginForm.appendChild(buttons); - const submitButton = document.createElement("button"); + const submitButton = document.createElement("mp_button"); submitButton.innerText = "Connect"; submitButton.type = "submit"; buttons.appendChild(submitButton); - const doNotButton = document.createElement("button"); + const doNotButton = document.createElement("mp_button"); doNotButton.innerText = "Close"; doNotButton.onclick = () => bg.remove(); doNotButton.style.marginLeft = "1rem"; @@ -1083,9 +1115,10 @@ mp_group_user { document.documentElement.appendChild(bg); } - const openMenuButton = document.createElement("button"); - openMenuButton.style = "opacity:0.25;position:fixed;top:0px;right:0px;z-index:9999999;margin:4px;background-color:black;color:white;border:1px solid white;text-shadow: none!important;font-family: Arial,sans-serif;font-size: unset !important;"; - openMenuButton.innerText = "MultiProbe Menu"; + const openMenuButton = document.createElement("mp_button"); + openMenuButton.style = "position:fixed;top:0px;right:0px;z-index:9999999;margin:4px"; + openMenuButton.classList.add("out-of-the-way"); + openMenuButton.innerText = "MultiProbe"; openMenuButton.onclick = () => { if (ws || localStorage["mpapikey"]) { createOnlineDialog();