diff --git a/web/making_a_web_site.anubis b/web/making_a_web_site.anubis index e30b65e..c125c45 100644 --- a/web/making_a_web_site.anubis +++ b/web/making_a_web_site.anubis @@ -1354,7 +1354,7 @@ public define CoreAttrs formmethod(FormMethod method) = attr("formmethod", if me 'HTML_Off_Form' defines all the elements you may put outside any form. -public define CoreAttrs method(String value) = attr("method", value). +public define CoreAttrs method(String value) = attr("method", value). public define CoreAttrs action(WEB_Action_Name action)= attr("action", "/"+format_web_action_name(action)). public define CoreAttrs action(WEB_Action_Name action, List((String,String)) extra_ops)= attr("formaction", "/"+format_web_action_name(action, extra_ops)). public define CoreAttrs formmethod(String value) = attr("formmethod", value). @@ -1562,6 +1562,12 @@ public define CoreAttrs name(String value)= attr("name", value). public define CoreAttrs value(String value)= attr("value", value). public define CoreAttrs init(String value)= attr("value", encode_HTML_entities(value)). //-- BEGIN of preset type + + /// Checkbox +public define HTML_Off_Form checkbox(List(CoreAttrs) attrs, String name, String form, Bool checked) = input([type("checkbox"), attr("name",name), attr("form", form), bool_attr(checked, "checked") . attrs]). +public define HTML_Off_Form checkbox(List(CoreAttrs) attrs, String name, Bool checked) = input([type("checkbox"), attr("name",name), bool_attr(checked, "checked") . attrs]). +public define HTML_Off_Form checkbox(String name, String form, Bool checked) = checkbox([], name, form, checked). +public define HTML_Off_Form checkbox(String name, Bool checked) = checkbox([], name, checked). /// Radio button public define HTML_Off_Form radio(List(CoreAttrs) attrs, String name, String value, String form, Bool checked) = input([type("radio"), attr("name",name), attr("value",value), attr("form", form), bool_attr(checked, "checked") . attrs]). @@ -1635,11 +1641,12 @@ public define HTML_Off_Form ol(List(HTML_Off_Form) content) public define HTML_Off_Form ol(HTML_Off_Form content) = html_tag("ol", [], [content]). // -public define HTML_Off_Form option(List(CoreAttrs) attrs, List(HTML_Off_Form) content) = html_tag("option", attrs, content). -public define HTML_Off_Form option(List(CoreAttrs) attrs, HTML_Off_Form content) = html_tag("option", attrs, [content]). -public define HTML_Off_Form option(List(HTML_Off_Form) content) = html_tag("option", [], content). -public define HTML_Off_Form option(HTML_Off_Form content) = html_tag("option", [], [content]). - +public define HTML_Off_Form option(List(CoreAttrs) attrs, List(HTML_Off_Form) content) = html_tag("option", attrs, content). +public define HTML_Off_Form option(List(CoreAttrs) attrs, HTML_Off_Form content) = html_tag("option", attrs, [content]). +public define HTML_Off_Form option(List(HTML_Off_Form) content) = html_tag("option", [], content). +public define HTML_Off_Form option(CoreAttrs attr, HTML_Off_Form content) = html_tag("option", [attr], [content]). +public define HTML_Off_Form option(HTML_Off_Form content) = html_tag("option", [], [content]). +public define HTML_Off_Form option(String _value, String _text) = html_tag("option", [value(_value)], [text(_text)]). // public define HTML_Off_Form p(List(CoreAttrs) attrs, List(HTML_Off_Form) content) = html_tag("p", attrs, content). public define HTML_Off_Form p(List(CoreAttrs) attrs, HTML_Off_Form content) = html_tag("p", attrs, [content]). -- libgit2 0.21.4
public define HTML_Off_Form p(List(CoreAttrs) attrs, List(HTML_Off_Form) content) = html_tag("p", attrs, content). public define HTML_Off_Form p(List(CoreAttrs) attrs, HTML_Off_Form content) = html_tag("p", attrs, [content]). -- libgit2 0.21.4