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.
Automatic widget loading
The widget manager initializes elements with a do_<name> class using the
corresponding jQuery widget. If that widget is not registered yet, it tries to
load js/modules/z.<name>.js from the enabled modules and site. For example,
do_autofocus loads js/modules/z.autofocus.js. The do_dialog alias loads
z.dialog.js and calls show_dialog.
Libraries use the normal timestamped lib URLs and share the browser asset
registry with lib tags. Concurrent discoveries share a load. Initialization is
asynchronous for missing widgets; existing widgets initialize as before. Widget
defaults and data-<name> options are read after loading. Removed elements are
not initialized. Missing files or libraries that do not register the expected
jQuery function produce a browser console warning.
Set configuration module mod_wires, key widget_autoload, to false to disable
this automatic loading (default: true). Already included widgets still work.
Widgets with a different file layout, or additional dependencies, should be
included explicitly with the lib tag. Configuration is checked by the server
when resolving a missing widget; reload open pages after changing it.
The model path model/wires/get/widget/<name> returns the asset descriptors
used by the loader. Names may contain letters, digits, underscores and hyphens.
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 usingz_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 usingz_render:make_postback_info.
Delegate callbacks:
event/2withpostbackmessages:mediaoverlay_update.