Box for modal / toast
As of
This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greasyfork.org/scripts/447483/1071404/Boxjs.js
Box for modal / toast
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!' });