U2 Magic Form

Automatically set minimum-cost values in the magic form.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         U2 Magic Form
// @namespace    https://u2.dmhy.org/
// @version      1.0
// @description  Automatically set minimum-cost values in the magic form.
// @author       LightArrowsEXE
// @grant        GM_xmlhttpRequest
// @match        *://u2.dmhy.org/*
// @exclude      *://u2.dmhy.org/shoutbox.php*
// @icon         https://u2.dmhy.org/favicon.ico
// @require      https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    const hoursInput = document.querySelector('input[name="hours"]');

    if (hoursInput) {
        hoursInput.value = "24";
    }

    const radioLabel = document.querySelector('label[for="s_user_self"]');

    if (radioLabel) {
        const radioInput = document.getElementById(radioLabel.getAttribute("for"));

        if (radioInput) {
            radioInput.checked = true;
        }
    }

    const queryButton = document.querySelector("input#btn_query");

    if (queryButton) {
        queryButton.click();
    }
})();