Commit 0c55d6c864dfd45db6dc432ec3d31136221e784e
1 parent
bf445a58
merge
Showing
1 changed file
with
24 additions
and
3 deletions
Show diff stats
web/making_a_web_site.anubis
| ... | ... | @@ -1309,6 +1309,18 @@ public define CoreAttrs formmethod(FormMethod method) = attr("formmethod", if me |
| 1309 | 1309 | |
| 1310 | 1310 | 'HTML_Off_Form' defines all the elements you may put outside any form. |
| 1311 | 1311 | |
| 1312 | +public define CoreAttrs method(String value) = attr("method", value). | |
| 1313 | +public define CoreAttrs for(String value) = attr("for", value). | |
| 1314 | +public define CoreAttrs placeholder(String value) = attr("placeholder", value). | |
| 1315 | +public define CoreAttrs action(WEB_Action_Name action)= attr("action", "/"+format_web_action_name(action)). | |
| 1316 | +public define CoreAttrs action(WEB_Action_Name action, List((String,String)) extra_ops)= attr("formaction", "/"+format_web_action_name(action, extra_ops)). | |
| 1317 | +public define CoreAttrs formaction(WEB_Action_Name action)= attr("action", "/"+format_web_action_name(action)). | |
| 1318 | +public define CoreAttrs formaction(WEB_Action_Name action, List((String,String)) extra_ops)= attr("formaction", "/"+format_web_action_name(action, extra_ops)). | |
| 1319 | +public define CoreAttrs formmethod(String value) = attr("formmethod", value). | |
| 1320 | +public define CoreAttrs form(String value) = attr("form", value). | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1312 | 1324 | public define HTML_Off_Form text(List(CoreAttrs) attrs, Int i) = text(attrs, to_decimal(i)). |
| 1313 | 1325 | public define HTML_Off_Form text(CoreAttrs attr, Int i) = text([attr], i). |
| 1314 | 1326 | public define HTML_Off_Form text(Int i) = text([], i). |
| ... | ... | @@ -1502,19 +1514,23 @@ public define HTML_Off_Form iframe(String src) |
| 1502 | 1514 | public define HTML_Off_Form input(List(CoreAttrs) attrs) = html_void_tag("input", attrs). |
| 1503 | 1515 | public define HTML_Off_Form input(CoreAttrs attr) = html_void_tag("input", [attr]). |
| 1504 | 1516 | |
| 1517 | +public define CoreAttrs type(String value)= attr("type", value). | |
| 1518 | +public define CoreAttrs name(String value)= attr("name", value). | |
| 1519 | +public define CoreAttrs value(String value)= attr("value", value). | |
| 1520 | + | |
| 1505 | 1521 | //-- BEGIN of <input> preset type |
| 1506 | 1522 | |
| 1507 | 1523 | /// Radio button |
| 1508 | -public define HTML_Off_Form radio(List(CoreAttrs) attrs, String name, String value, String form, Bool checked) = input([attr("type","radio"), attr("name",name), attr("value",value), attr("form", form), bool_attr(checked, "checked") . attrs]). | |
| 1524 | +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]). | |
| 1509 | 1525 | public define HTML_Off_Form radio(List(CoreAttrs) attrs, String name, String value, String form) = radio(attrs, name, value, form, false). |
| 1510 | 1526 | public define HTML_Off_Form radio(String name, String value, String form, Bool checked) = radio([], name, value, form, checked). |
| 1511 | 1527 | public define HTML_Off_Form radio(String name, String value, String form) = radio([], name, value, form, false). |
| 1512 | 1528 | |
| 1513 | 1529 | /// hidden value |
| 1514 | -public define HTML_Off_Form hidden(List(CoreAttrs) attrs, String name, String value, String form) = input([attr("type","hidden"), attr("name",name), attr("value",value), attr("form", form) . attrs]). | |
| 1530 | +public define HTML_Off_Form hidden(List(CoreAttrs) attrs, String name, String value, String form) = input([type("hidden"), attr("name",name), attr("value",value), attr("form", form) . attrs]). | |
| 1515 | 1531 | public define HTML_Off_Form hidden(CoreAttrs attr, String name, String value, String form) = hidden([attr], name, value, form). |
| 1516 | 1532 | public define HTML_Off_Form hidden(String name, String value, String form) = hidden([], name, value, form). |
| 1517 | -public define HTML_Off_Form hidden(String name, String value) = input([attr("type","hidden"), attr("name",name), attr("value",value)]). | |
| 1533 | +public define HTML_Off_Form hidden(String _name, String _value) = input([type("hidden"), name(_name), value(_value)]). | |
| 1518 | 1534 | |
| 1519 | 1535 | //-- END of <input> preset type |
| 1520 | 1536 | |
| ... | ... | @@ -1606,7 +1622,10 @@ public define HTML_Off_Form progress(CoreAttrs _attr, Int value, Int max, HTML_O |
| 1606 | 1622 | public define HTML_Off_Form progress(Int value, Int max, HTML_Off_Form content) = html_tag("progress", [attr("value", value), attr("max", max)], [content]). |
| 1607 | 1623 | public define HTML_Off_Form progress(List(CoreAttrs) attrs, Int value, Int max, String content) = html_tag("progress", [attr("value", value), attr("max", max) . attrs], [text(content)]). |
| 1608 | 1624 | public define HTML_Off_Form progress(CoreAttrs _attr, Int value, Int max, String content) = html_tag("progress", [attr("value", value), attr("max", max), _attr], [text(content)]). |
| 1625 | +public define HTML_Off_Form progress(List(CoreAttrs) attrs, Int value, Int max) = html_tag("progress", [attr("value", value), attr("max", max) . attrs], []). | |
| 1626 | +public define HTML_Off_Form progress(CoreAttrs _attr, Int value, Int max) = html_tag("progress", [attr("value", value), attr("max", max), _attr], []). | |
| 1609 | 1627 | public define HTML_Off_Form progress(Int value, Int max, String content) = html_tag("progress", [attr("value", value), attr("max", max)], [text(content)]). |
| 1628 | +public define HTML_Off_Form progress(Int value, Int max) = html_tag("progress", [attr("value", value), attr("max", max)], []). | |
| 1610 | 1629 | |
| 1611 | 1630 | |
| 1612 | 1631 | // <section> |
| ... | ... | @@ -1634,6 +1653,8 @@ public define HTML_Off_Form span(Int i) |
| 1634 | 1653 | public define HTML_Off_Form span(List(CoreAttrs) attrs, String s) = html_tag("span", attrs, [text(s)]). |
| 1635 | 1654 | public define HTML_Off_Form span(CoreAttrs attr, String s) = html_tag("span", [attr],[text(s)]). |
| 1636 | 1655 | public define HTML_Off_Form span(String s) = html_tag("span", [], [text(s)]). |
| 1656 | +public define HTML_Off_Form span(List(CoreAttrs) attrs) = html_tag("span", attrs, []). | |
| 1657 | +public define HTML_Off_Form span(CoreAttrs attr) = html_tag("span", [attr],[]). | |
| 1637 | 1658 | |
| 1638 | 1659 | // <strong> |
| 1639 | 1660 | public define HTML_Off_Form strong(List(CoreAttrs) attrs, List(HTML_Off_Form) content) = html_tag("strong", attrs, content). | ... | ... |