Repository navigation
New module: toast.js, plus serializeForm
- New
toast.js: notifications with no external dependency, as an alternative to loading SweetAlert2 just to show a message. Providestoast(message, type, duration)and the shortcutstoastSuccess,toastError,toastWarning,toastInfo. Each returns adismiss()function, andduration: 0keeps the toast until you dismiss it, which suits a loading state. The CSS is injected by the module itself, so there is no separate stylesheet to import. - New
serializeForm(id)inelement.js: returns every named form field as one{name: value}object, sogetValue()no longer has to be called field by field beforepostJSON(). Disabled fields and file inputs are skipped; file uploads needpostFile/postFileJSON.
Docs: https://croot.js.org/docs/toast and https://croot.js.org/docs/element/