Box.js

Box for modal / toast

Dette scriptet burde ikke installeres direkte. Det er et bibliotek for andre script å inkludere med det nye metadirektivet // @require https://update.greasyfork.org/scripts/447483/1675467/Boxjs.js

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

Forfatter
invobzvr
Versjon
0.5
Lagd
06.07.2022
Oppdatert
18.07.2022
Size
6,9 kB
Lisens
GPL-3.0

Box.js

Description

Box for modal/toast

Example

await new Box({
    title: 'Demo Box',
    html: `<input class="box-input" value="Hello, Box!">`,
    actions: {
        OK: modal => modal.querySelector('input').value, // "Hello, Box!"
        Cancel: () => {}, // undefined
    },
});
const Toast = Box.mixin({
    title: 'Demo Toast',
    toast: true,
    time: 3e3,
});

new Toast({ text: 'Hello, Toast!' });