model/alert Cotonic
Displays a Zotonic alert dialog through the wires script and z_dialog_alert.
The page must have the normal Zotonic dialog support loaded.
post
Topic: model/alert/post.
The payload is an options object:
| Field | Meaning |
|---|---|
text | Dialog body, inserted as HTML. |
title | Dialog title, inserted as HTML; defaults to the translated “Alert”. |
ok | Confirmation button label, inserted as HTML; defaults to the translated “OK”. |
width | Optional dialog width. |
All three fields, text, title, and ok, are rendered as HTML without
escaping or sanitization by this handler. HTML-escape untrusted plain text before
supplying it. If markup is intended, sanitize it before sending the command.
cotonic.broker.publish("model/alert/post", {
title: "Upload complete",
text: "The document is ready.",
ok: "Close"
});
The command does not reply and does not publish a model event. Use publish,
not call. JavaScript function callbacks cannot be sent through worker messages.