mod_wires

Actions, tags (also known as screen components), and javascript for user interfaces using wires.

Used by module#mod_admin and the other administrative modules.

Wires are actions that are directly coupled to user interface elements. These couplings are defined in the templates using the scomp#wire tag.

Accepted Events

This module handles the following notifier callbacks:

  • observe_acl_is_allowed: Allow publish from clients to the transport topic.
  • observe_output_html: Render nested actions and scomp results using z_render:output.
  • observe_page_actions: Sanitize and normalize page action payloads before they are sent to the browser.
  • observe_postback_notify: Handle postback notifications for showing a media overlay.
  • observe_scomp_script_render: Part of the {% script %} rendering in templates using z_render:make_postback_info.

Delegate callbacks:

  • event/2 with postback messages: mediaoverlay_update.

Edit on GitHub

Observes

Notifications

observe_acl_is_allowed/2

Check if a user is authorized to perform an operation on a an object (some resource or module). Observe this notification to do complex or more fine-grained…

Notifications

observe_postback_notify/2

Handle a javascript notification from the postback handler. The message is the the request, trigger the id of the element which triggered the postback, and…

Notifications

observe_scomp_script_render/2

Add extra javascript with the {% script %} tag. (map) Used to let modules inject extra javascript depending on the arguments of the {% script %} tag. Must…

Actions

Actions

add_class

Add a css class to an html element.

Actions

alert

Show an alert dialog.

Actions

animate

Add a $(..).animate jQuery call to the target element.

Actions

buttonize

Add button interaction classes to an element.

Actions

confirm

Show a JavaScript confirm message and on confirmation triggers one or more actions and/or sends a postback to the server.

Actions

dialog

Opens a dialog with a predefined HTML content and title.

Actions

dialog_close

Closes a dialog. When there is no dialog open then nothing happens.

Actions

dialog_open

Renders a template on the server and opens a dialog with the HTML output of the template.

Actions

disable

Sets the “disabled” attribute of a HTML tag and adds the CSS class “disabled”.

Actions

editor_add

Add WYSIWYG editor controls to the textareas selected by the target. The active editor integration, such as TinyMCE, implements the actual controls; the action…

Actions

editor_remove

Remove WYSIWYG editor controls from the textareas selected by the target. Use this before replacing or moving editor-managed markup so the editor can release…

Actions

effect

Run a jQuery UI effect on the target element.

Actions

enable

Resets the “disabled” attribute of a HTML tag and removes the CSS class “disabled”.

Actions

event

Bind actions to a jQuery event or submit a form.

Actions

fade_in

Show an element by animating the opacity.

Actions

fade_out

Hide an element by animating the opacity.

Actions

focus

Add a $(..).focus() jQuery call to the target element to give it input focus.

Actions

form_reset

Resets the target form to its initial state.

Actions

growl

Show a message in the upper right corner of the browser window. The message will automatically disappear after some time.

Actions

hide

Hide an element without any animation.

Scomp

Scomp

button

Makes a button with an action attached.

Scomp

draggable

Mark a html element as draggable.

Scomp

droppable

Mark an element as valid drag destination.

Scomp

script

This tag is the placeholder where all generated JavaScript scripts will be output on the page.

Scomp

sortable

Mark an element as sortable.

Scomp

sorter

A sorter is a container for sortables.

Scomp

validate

The validator tag accepts the following arguments:

Scomp

wire

Connect actions and events to a HTML element.

Scomp

wire_args

Add extra arguments to wired actions.

Referred by

Developer guide

Browser/server interaction

There are multiple ways to set up interaction between server-side Zotonic code and client-side JavaScript.