z_render (zotonic_core v1.0.0-rc.10)
Link to this section Summary
Functions
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
Link to this section Types
Link to this type
ctx_rs/0
-type ctx_rs() :: render_state() | z:context().
Link to this type
html_element_id/0
-type html_element_id() :: binary() | string() | undefined.
Link to this type
render_state/0
-type render_state() :: #render_state{}.
Link to this section Functions
Link to this function
add_script(Script, Context)
Link to this function
appear(TargetId, Html, Context)
Link to this function
appear_after(TargetId, Html, Context)
Link to this function
appear_after_selector(CssSelector, Html, Context)
Link to this function
appear_after_selector_js(CssSelector, Html)
Link to this function
appear_before(TargetId, Html, Context)
Link to this function
appear_before_selector(CssSelector, Html, Context)
Link to this function
appear_before_selector_js(CssSelector, Html)
Link to this function
appear_bottom(TargetId, Html, Context)
Link to this function
appear_bottom_selector(CssSelector, Html, Context)
Link to this function
appear_bottom_selector_js(CssSelector, Html)
Link to this function
appear_replace(TargetId, Html, Context)
Link to this function
appear_replace_selector(CssSelector, Html, Context)
Link to this function
appear_replace_selector_js(CssSelector, Html)
Link to this function
appear_selector(CssSelector, Html, Context)
Link to this function
appear_selector_js(CssSelector, Html)
Link to this function
appear_top(TargetId, Html, Context)
Link to this function
appear_top_selector(CssSelector, Html, Context)
Link to this function
appear_top_selector_js(CssSelector, Html)
Link to this function
clean(Context)
Link to this function
css_selector(TargetId)
Link to this function
css_selector(TargetId, Args)
Link to this function
dialog(Title, Template, Vars, Context)
Link to this function
dialog_close(Context)
Link to this function
get_script(Context)
-spec get_script(z:context()) -> iolist().
Link to this function
growl(Text, Context)
Link to this function
growl(Text, Type, Stay, Context)
Link to this function
growl_error(Text, Context)
Link to this function
insert_after(TargetId, Html, Context)
Link to this function
insert_after_selector(CssSelector, Html, Context)
Link to this function
insert_after_selector_js(CssSelector, Html)
Link to this function
insert_before(TargetId, Html, Context)
Link to this function
insert_before_selector(CssSelector, Html, Context)
Link to this function
insert_before_selector_js(CssSelector, Html)
Link to this function
insert_bottom(TargetId, Html, Context)
Link to this function
insert_bottom_selector(CssSelector, Html, Context)
Link to this function
insert_bottom_selector_js(CssSelector, Html)
Link to this function
insert_top(TargetId, Html, Context)
Link to this function
insert_top_selector(CssSelector, Html, Context)
Link to this function
insert_top_selector_js(CssSelector, Html)
Link to this function
make_postback(PostbackTag, EventType, TriggerId, TargetId, Delegate, Context)
Link to this function
make_postback(PostbackTag, EventType, TriggerId, TargetId, Delegate, QArgs, Context)
Link to this function
make_postback_info(Tag, EventType, TriggerId, TargetId, Delegate, Context)
Link to this function
make_validation_postback(Validator, Context)
Link to this function
make_validation_postback(Validator, Args, Context)
Link to this function
output(MixedHtml, Context)
Link to this function
overlay(Template, Vars, Context)
Link to this function
overlay_close(Context)
Link to this function
quote_css_selector(S)
Link to this function
render(Mixed, Context)
Link to this function
render_actions(TriggerId, TargetId, T, Context)
-spec render_actions(html_element_id(), html_element_id(), list(), z:context()) -> {iolist(), z:context()}.
Link to this function
render_css_selector(Selector)
Link to this function
render_html(Render, Context)
Link to this function
render_to_iolist(MixedHtml, Context)
Link to this function
render_to_iolist(Template, Vars, Context)
Link to this function
render_validator(TriggerId, TargetId, Args, Context)
-spec render_validator(undefined | binary(), undefined | binary(), list(), z:context()) -> iolist().
Link to this function
replace(TargetId, Html, Context)
Link to this function
replace_selector(CssSelector, Html, Context)
Link to this function
replace_selector_js(CssSelector, Html)
Link to this function
set_value(TargetId, Value, Context)
Link to this function
set_value_selector(CssSelector, Value, Context)
Link to this function
update(TargetId, Html, Context)
Link to this function
update_iframe(IFrameId, Html, Context)
Link to this function
update_selector(CssSelector, Html, Context)
Link to this function
update_selector_js(CssSelector, Html)
Link to this function
validator(TriggerId, TargetId, Validator, Context)
Link to this function
wire(Actions, Context)
Link to this function
wire(TriggerId, Actions, Context)
Link to this function