Sweet Alert
Integrates the SweetAlert plugin to act as a modern replacement for JavaScript's alert. It is capable of not only a simple alert box, but confirmation dialogs and UI toast messages too.
Version 2.x
The 2.0.0 release uses the updated SweetAlert2.
Installation
This module requires the SweetAlert2 library. It can be downloaded at https://github.com/sweetalert2/sweetalert2/releases.
Download sweetalert2.all.min.js to (webroot)/libraries/sweetalert2.
Currently supported plugin version: 11.x.
Usage
The admin area for SweetAlert now has a simple demo area to try different configuration options and see what the alert will look like.
You can fire SweetAlert with an AjaxResponse in Drupal 9+ by returning a response like so:
$response = new AjaxResponse();
$response->addCommand(new SweetAlertCommand(
[
'title' => $title,
'text' => $message,
]
)
);
return $response;
Upgrade path
Many of the options may have changed from version 1 to 2 of the JS plugin. Please refer to the plugins update path docs to understand what code you have implemented, if any, that needs to be changed. https://sweetalert2.github.io/#download
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Release Timeline
Releases
| Version | Type | Core | Release date | |
|---|---|---|---|---|
| 2.0.1 | Stable | Feb 27, 2023 | ||
| 2.0.0 | Stable | Feb 27, 2023 | ||
| 2.0.0-alpha3 | Pre-release | Feb 27, 2023 | ||
| 2.0.0-alpha2 | Pre-release | Feb 27, 2023 | ||
| 2.0.0-alpha1 | Pre-release | Feb 26, 2023 | ||
| 2.0.x-dev | Dev | Feb 24, 2023 |