Greasy Fork is available in English.

Box.js

Box for modal / toast

Questo script non dovrebbe essere installato direttamente. È una libreria per altri script da includere con la chiave // @require https://update.greasyfork.org/scripts/447483/1071404/Boxjs.js

Autore
invobzvr
Versione
0.5
Creato il
06/07/2022
Aggiornato il
18/07/2022
Licenza
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: model => model.querySelector('input').value, // "Hello, Box!"
        Cancel: () => {}, // undefined
    },
});
const Toast = Box.mixin({
    title: 'Demo Toast',
    toast: true,
    time: 3e3,
});

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