CKUIToolkit

A simple settings modal framework.

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/441653/1625560/CKUIToolkit.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ć!)

Autor
CKylinMC
Wersja
1.2.4
Utworzono
17-03-2022
Zaktualizowano
17-07-2025
Rozmiar
31,2 KB
Licencja
GPL-3.0-only

通过JSON/对象创建设置对话框

        const sampleCfg = {
            title: '设置',
            theme: 'dark',//可选, dark
            settings: [
                {
                    name: 'simple-text',
                    type: 'text',
                    label: '简单文本',
                }, {
                    name: 'simple-toggle',
                    type: 'toggle',
                    label: '简单开关',
                    description: '这是一个简单的开关',
                    value: false,
                }, {
                    name: 'simple-input',
                    type: 'input',
                    label: '简单输入框',
                    description: '这是一个简单的输入框',
                    value: '',
                }, {
                    name: 'simple-num-input',
                    type: 'inputnumber',
                    label: '简单数字输入框',
                    description: '这是一个简单的输入框',
                    value: 0,
                    min: 0,
                    max: 100,
                    step: 1,
                }, {
                    name: 'simple-long-input',
                    type: 'inputarea',
                    label: '简单长文本输入框',
                    description: '这是一个简单的输入框',
                    value: '',
                    checker: ()=>true,
                }, {
                    name: 'simple-select',
                    type: 'select',
                    label: '简单选择框',
                    description: '这是一个简单的选择框',
                    value: '',
                    options: [
                        { opt: '选项1', value: '1' },
                        { opt: '选项2', value: '2' },
                    ]
                }, {
                    name: 'text-toggle',
                    type: 'texttoggle',
                    description: '这是一个简单的选择框',
                    before: '开关当前处于',
                    on: '开',
                    off: '关',
                    after: '状态',
                    value: false,
                },{
                    name: 'simple-raw',
                    type: 'raw',
                    contents: {
                        text:'RAW!!!!'
                    },
                }, {
                    name: 'header',
                    type: 'header',
                    label: '分区A',
                }, {
                    name: 'btns',
                    type: 'btns',
                    btns: [
                        {
                            label: "1111111111111111111111111111",
                            onclick: async () => console.log(123)
                        },
                        {
                            label: "2222"
                        },
                        {
                            label: "3333"
                        },
                        {
                            label: "4444"
                        },
                    ],
                }, {
                    name: 'window-a',
                    type: 'window',
                    label: '窗口A',
                    config: {
                        title: '窗口A',
                        settings: [
                            {
                                name: 'window-a-sub-a',
                                type: 'text',
                                label: '窗口A子项A',
                            }
                        ]
                    }
                }
            ]
        };
        CKUIToolkit.showSettings(sampleCfg).then(it=>console.log('result:',it,'\nOrigin:',sampleCfg));