z_render (zotonic_core v1.0.0-rc.17)
Render routines using wires and actions. Based on Nitrogen, which is copyright (c) 2008-2009 Rusty Klophaus
Summary
Functions
Prepend extra arguments to an action. The arguments are prepended to the list of action arguments, overruling or adding existing arguments.
Set the contents of an element to the the html fragment
Add a html after the target element
Append a html fragment at the bottom of the contents of an element
Append a html fragment at the bottom of the contents of an element
Insert a html fragment at the top of the contents of an element
Remove all scripts from the context, resetting it back to a clean sheet.
Map a target id to a css selector
Map a target id to a css selector, check the Args proplist for additional selectors
Collect all scripts in the context, returns an iolist with javascript.
Add a html after the target element
Add a html before the target element
Append a html fragment at the bottom of the contents of an element
Insert a html fragment at the top of the contents of an element
Make a javascript to call the postback, posting an encoded string containing callback information. The PostbackTag is send to the server, EventType is normally the atom 'postback'.
Make an encoded string containing information which module and function to call.
Replace the placeholders with their rendered content and collect all scripts from the mixed html and context. The result is a clean HTML tree and can be used for return by controllers.
Quote a css selector (assume no escaping needed...)
Render adds output to the render-state of the context. Makes sure that the added output is an iolist The stored render state is later used in output/2
Render a css selector, allow direct expressions like
Render adds output to the render field of the context state. Do update the context for possible changes in scripts etc.
Render a validator to the correct javascript. Args are all arguments of the validator scomp. This renders an allocation of the initial validator and then appends all validations. 'type' holds multiple validations. Validations are of the form: {validator, [Args]}
Replace an element to the the html fragment
Set the value of an input element.
Set the contents of an element to the the html fragment
Set the contents of an iframe to the generated html.
Set the contents of all elements matching the css selector to the the html fragment
Set the contents of all elements matching the css selector to the the html fragment
Add an input validator to the list of known validators, used when rendering custom validators
Types
Functions
-spec action_with_args(Action, Args) -> Action1 when Action :: MaybeAction | [MaybeAction], MaybeAction :: action() | [Action] | undefined, Args :: proplists:proplist(), Action1 :: action() | [action()].
Prepend extra arguments to an action. The arguments are prepended to the list of action arguments, overruling or adding existing arguments.
Set the contents of an element to the the html fragment
Add a html after the target element
Append a html fragment at the bottom of the contents of an element
Append a html fragment at the bottom of the contents of an element
Insert a html fragment at the top of the contents of an element
Remove all scripts from the context, resetting it back to a clean sheet.
Map a target id to a css selector
Map a target id to a css selector, check the Args proplist for additional selectors
-spec dialog(Title, Template, Vars, Context) -> Context1 when Title :: string() | binary() | z:trans() | undefined, Template :: template_compiler:template() | #module_index{key :: #module_index_key{site :: atom(), type :: z_module_indexer:key_type() | undefined, name :: atom() | binary() | {binary(), binary()}}, filepath :: file:filename_all() | undefined, module :: atom() | undefined, erlang_module :: atom() | undefined, tag :: integer() | undefined}, Vars :: list() | map(), Context :: z:context(), Context1 :: z:context().
-spec dialog_close(Level, z:context()) -> z:context() when Level :: non_neg_integer().
Collect all scripts in the context, returns an iolist with javascript.
-spec growl(unicode:chardata(), z:context()) -> z:context().
-spec growl_error(unicode:chardata(), z:context()) -> z:context().
Add a html after the target element
Add a html before the target element
Append a html fragment at the bottom of the contents of an element
Insert a html fragment at the top of the contents of an element
Make a javascript to call the postback, posting an encoded string containing callback information. The PostbackTag is send to the server, EventType is normally the atom 'postback'.
Make an encoded string containing information which module and function to call.
Replace the placeholders with their rendered content and collect all scripts from the mixed html and context. The result is a clean HTML tree and can be used for return by controllers.
-spec overlay(Template, Vars, Context) -> Context1 when Template :: template_compiler:template() | #module_index{key :: #module_index_key{site :: atom(), type :: z_module_indexer:key_type() | undefined, name :: atom() | binary() | {binary(), binary()}}, filepath :: file:filename_all() | undefined, module :: atom() | undefined, erlang_module :: atom() | undefined, tag :: integer() | undefined}, Vars :: list() | map(), Context :: z:context(), Context1 :: z:context().
Quote a css selector (assume no escaping needed...)
Render adds output to the render-state of the context. Makes sure that the added output is an iolist The stored render state is later used in output/2
-spec render_actions(html_element_id(), html_element_id(), list(), z:context()) -> {iolist(), z:context()}.
Render a css selector, allow direct expressions like
Render adds output to the render field of the context state. Do update the context for possible changes in scripts etc.
-spec render_validator(undefined | binary(), undefined | binary(), list(), z:context()) -> iolist().
Render a validator to the correct javascript. Args are all arguments of the validator scomp. This renders an allocation of the initial validator and then appends all validations. 'type' holds multiple validations. Validations are of the form: {validator, [Args]}
Replace an element to the the html fragment
Set the value of an input element.
-spec update(string() | binary(), #render{template :: template_compiler:template(), is_all :: boolean(), vars :: proplists:proplist()} | iodata(), z:context()) -> z:context().
Set the contents of an element to the the html fragment
Set the contents of an iframe to the generated html.
Set the contents of all elements matching the css selector to the the html fragment
Set the contents of all elements matching the css selector to the the html fragment
Add an input validator to the list of known validators, used when rendering custom validators