Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Views Bootstrap 5.5.4 — Minor update available for module views_bootstrap (5.5.4). Release: Rightup theme 1.0.3 — Minor update available for theme vartheme_bs5_rightup (1.0.3). Release: CommentOn 1.0.6 — Minor update available for module commenton (1.0.6). Release: ChatGPT Ads 1.0.3 — Minor update available for module chatgpt_ads (1.0.3). Release: Opensolr Search 5.1.3 — Minor update available for module opensolr_search (5.1.3). Release: ServiceM8 Webform Integration 1.2.1 — Minor update available for module servicem8_webform (1.2.1). Release: PostfixAdmin 1.0.0 — Initial release available for module postfix_admin (1.0.0)! Release: ip_analyser 1.0.3 — Minor update available for module ip_analyser (1.0.3). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.

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

Tracked releases
6
Tracked since
Feb 2023
Latest release
3 years ago
Releases (12 mo)
0
Maintenance
Dormant

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