Greasy Fork is available in English.

bleutools

界面

Stan na 10-03-2022. Zobacz najnowsza wersja.

Ten skrypt nie powinien być instalowany bezpośrednio. Jest to biblioteka dla innych skyptów do włączenia dyrektywą meta // @require https://update.greasyfork.org/scripts/441249/1026339/bleutools.js

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         bleutools
// @namespace    https://greasyfork.org/zh-CN/users/798733-bleu
// @author       bleu
// @version      v1.0.0
// @description  界面
// @grant        GM_xmlhttpRequest
// @require      https://cdn.jsdelivr.net/npm/[email protected]/dist/sweetalert2.all.min.js
// ==/UserScript==
    'use strict';

    function swalForInfo(satitle, satime, saposition) {
        return Swal.fire({
            title: satitle,
            position: saposition,
            showConfirmButton: false,
            timer: satime,
            customClass: {
                title: 'bleu_sa_title_min',
                popup: 'bleu_sa_popup_min'
            }
        })
    }

    function swalForUI(title, html, width) {
        return swal.fire({
            title: title,
            html: html,
            width: width,
            showConfirmButton: false,
            showCloseButton: true,
            allowOutsideClick: false,
            footer: ' ',
            customClass: {
                title: 'bleu_sa_title',
                popup: 'bleu_sa_popup',
                closeButton: 'bleu_sa_close',
                htmlContainer: 'bleu_sa_container',
                footer: 'bleu_sa_footer'
            },
        })
    }

    function bleuXHR(TYPE, URL, DATA, HEADER, rtype) {
        return new Promise((resolve, reject) => {
            GM_xmlhttpRequest({
                method: TYPE,
                timeout: 2000,
                headers: HEADER || reqHeaders,
                url: URL,
                data: DATA,
                responseType: rtype || "json",
                onload: function (res) {
                    resolve(res.response || res.responseText || res);
                },
                onerror: function (err) {
                    reject(err);
                }
            });
        })
    }

    function addCssStyle(cssStyle) {
        if (cssStyle === undefined || cssStyle === null) cssStyle = '';
        let initStyle = `
            .bleu_sa_close {width: 30px;height: 30px;font-size: 30px;}
            .bleu_sa_title {font-size: 25px;}
            .bleu_sa_container{margin: 0;font-size: 20px;}
            .bleu_sa_popup {padding: 0 0 0;}
            .bleu_sa_footer{margin: 0;padding-top: 20px;}
            .bleu_sa_title_min{font-size: 20px;padding: 0;}
            .bleu_sa_popup_min{padding: 0 0 0;width: auto;}
            `
        let style = document.createElement('style');
        style.innerHTML = initStyle + cssStyle;
        document.querySelector('head').appendChild(style);
    }