Hallo zusammen,
es geschehen noch Zeichen und Wunder. Im neuen Login kann man jetzt suchen !!!
Gruß
Heinke
tampermonkey script
// ==UserScript==
// @name Better plentysystems login
// @namespace https://app.plentyone.com/
// @version 0.1
// @description Make it yours.
// @author You
// @match http*://app.plentyone.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=plentysystems.com
// @grant none
// ==/UserScript==
function EnablePasswordManagerIntegration(mutation){
if (!mutation.addedNodes)
return
for (let node of mutation.addedNodes) {
if (!node.querySelectorAll)
continue;
for (let input of node.querySelectorAll('input')) {
const attribute = input.attributes['formcontrolname'];
if (!attribute)
continue;
input.setAttribute('name', attribute.value);
}
}
}
async function EnableLargerSystemList(mutation) {
const node = mutation.target;
if (node.nodeName !== 'MAT-CARD-CONTENT' || !mutation.addedNodes || mutation.addedNodes.length === 0)
return;
const systemList = mutation.addedNodes[0];
if (!systemList.classList.contains("system-list-wrapper"))
return;
systemList.setAttribute('style', 'max-height: calc(100vh - 25rem); height: unset;');
}
async function EnableWitzApi(mutation) {
const node = mutation.target;
if (node.nodeName !== 'AUTH-BANNER')
return;
const banner = node.parentNode;
banner.style.width = '35rem';
banner.style.opacity = 0;
const response = await fetch('https://witzapi.de/api/joke/?limit=1&language=de');
const json = await response.json();
banner.innerHTML = `<h1 style="padding: 2.5rem; background-color: var(--plentyone-blue-opacity-75); border-radius: calc(var(--border-radius-xl) - var(--border-sm));">${json[0].text}</h1>`;
banner.style.opacity = 1;
}
const mutationCallback = async (mutationList, observer) => {
for (const mutation of mutationList) {
if (mutation.type === 'childList') {
EnablePasswordManagerIntegration(mutation);
EnableLargerSystemList(mutation);
EnableWitzApi(mutation);
}
}
};
const targetNode = document.querySelector("body");
targetNode.style.colorScheme = 'dark';
const observer = new MutationObserver(mutationCallback);
observer.observe(targetNode, { childList: true, subtree: true });