Commit 272e47b262435cb4b6080c7cdf924e56ea62aa67

Authored by David RENÉ
1 parent 0a3b5fb1

remove some alternative from HTML_Off_Form to move it as html_tag or some are co…

…mpletely removed due to their useless
preformated move to html_tag pre
progress move to html_tag progress
center removed
mail_to removed
scroller removed
fixed_size removed
fixed_size_2 removed
web/controllers_web_site.anubis
@@ -151,9 +151,9 @@ define HTTP_Answer @@ -151,9 +151,9 @@ define HTTP_Answer
151 151
152 // content of page 152 // content of page
153 sequence([ 153 sequence([
154 - preformated([size(14)],"Anubis Web Server - Standard Lib v1.19.0.0 - Anubis language v1.19"),  
155 - preformated([size(12)],"Error "+to_String(http_status)),  
156 - preformated([size(12)],"Internal message :"+message), 154 + pre("Anubis Web Server - Standard Lib v1.19.0.0 - Anubis language v1.19"),
  155 + pre("Error "+to_String(http_status)),
  156 + pre("Internal message :"+message),
157 br, 157 br,
158 in_form(html_Id(""),text_area(wan(""), init(dump(_session)), 120, 60)) 158 in_form(html_Id(""),text_area(wan(""), init(dump(_session)), 120, 60))
159 ]) 159 ])
web/making_a_web_site.anubis
@@ -680,6 +680,7 @@ public define Printable_tree [WebArgValue x . Printable_tree y] = str_pt(x.valu @@ -680,6 +680,7 @@ public define Printable_tree [WebArgValue x . Printable_tree y] = str_pt(x.valu
680 public define Printable_tree [InitialValue x . Printable_tree y] = str_pt(x.value, y). 680 public define Printable_tree [InitialValue x . Printable_tree y] = str_pt(x.value, y).
681 681
682 public define CoreAttrs attr(String name, Bool value) = attr(name, if value then "true" else "false"). 682 public define CoreAttrs attr(String name, Bool value) = attr(name, if value then "true" else "false").
  683 +public define CoreAttrs attr(String name, Int value) = attr(name, to_String(value)).
683 684
684 685
685 public define InputAttrs attr(String name, Bool value) = attr(name, if value then "true" else "false"). 686 public define InputAttrs attr(String name, Bool value) = attr(name, if value then "true" else "false").
@@ -1566,6 +1567,27 @@ public define HTML_Off_Form p(CoreAttrs attr, HTML_Off_Form content) @@ -1566,6 +1567,27 @@ public define HTML_Off_Form p(CoreAttrs attr, HTML_Off_Form content)
1566 public define HTML_Off_Form p(List(HTML_Off_Form) content) = html_tag("p", [], content). 1567 public define HTML_Off_Form p(List(HTML_Off_Form) content) = html_tag("p", [], content).
1567 public define HTML_Off_Form p(HTML_Off_Form content) = html_tag("p", [], [content]). 1568 public define HTML_Off_Form p(HTML_Off_Form content) = html_tag("p", [], [content]).
1568 1569
  1570 + // <pre> preformatted
  1571 +public define HTML_Off_Form pre(List(CoreAttrs) attrs, List(HTML_Off_Form) content) = html_tag("pre", attrs, content).
  1572 +public define HTML_Off_Form pre(List(CoreAttrs) attrs, HTML_Off_Form content) = html_tag("pre", attrs, [content]).
  1573 +public define HTML_Off_Form pre(CoreAttrs attr, List(HTML_Off_Form) content) = html_tag("pre", [attr], content).
  1574 +public define HTML_Off_Form pre(CoreAttrs attr, HTML_Off_Form content) = html_tag("pre", [attr], [content]).
  1575 +public define HTML_Off_Form pre(List(HTML_Off_Form) content) = html_tag("pre", [], content).
  1576 +public define HTML_Off_Form pre(HTML_Off_Form content) = html_tag("pre", [], [content]).
  1577 +public define HTML_Off_Form pre(String string) = html_tag("pre", [], [text(string)]).
  1578 +public define HTML_Off_Form pre(CoreAttrs attr, String string) = html_tag("pre", [attr], [text(string)]).
  1579 +public define HTML_Off_Form pre(List(CoreAttrs) attrs, String string) = html_tag("pre", attrs, [text(string)]).
  1580 +
  1581 + // <progress>
  1582 +public define HTML_Off_Form progress(List(CoreAttrs) attrs, Int value, Int max, List(HTML_Off_Form) content) = html_tag("progress", [attr("value", value), attr("max", max) . attrs], content).
  1583 +public define HTML_Off_Form progress(List(CoreAttrs) attrs, Int value, Int max, HTML_Off_Form content) = html_tag("progress", [attr("value", value), attr("max", max) . attrs], [content]).
  1584 +public define HTML_Off_Form progress(CoreAttrs _attr, Int value, Int max, HTML_Off_Form content) = html_tag("progress", [attr("value", value), attr("max", max) , _attr], [content]).
  1585 +public define HTML_Off_Form progress(Int value, Int max, HTML_Off_Form content) = html_tag("progress", [attr("value", value), attr("max", max)], [content]).
  1586 +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)]).
  1587 +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)]).
  1588 +public define HTML_Off_Form progress(Int value, Int max, String content) = html_tag("progress", [attr("value", value), attr("max", max)], [text(content)]).
  1589 +
  1590 +
1569 // <section> 1591 // <section>
1570 public define HTML_Off_Form section(List(CoreAttrs) attrs, List(HTML_Off_Form) content) = html_tag("section", attrs, content). 1592 public define HTML_Off_Form section(List(CoreAttrs) attrs, List(HTML_Off_Form) content) = html_tag("section", attrs, content).
1571 public define HTML_Off_Form section(List(CoreAttrs) attrs, HTML_Off_Form content) = html_tag("section", attrs, [content]). 1593 public define HTML_Off_Form section(List(CoreAttrs) attrs, HTML_Off_Form content) = html_tag("section", attrs, [content]).
@@ -1643,23 +1665,26 @@ public define HTML_Off_Form th(CoreAttrs attr, String string) @@ -1643,23 +1665,26 @@ public define HTML_Off_Form th(CoreAttrs attr, String string)
1643 public define HTML_Off_Form th(List(CoreAttrs) attrs, String string) = html_tag("th", attrs, [text(string)]). 1665 public define HTML_Off_Form th(List(CoreAttrs) attrs, String string) = html_tag("th", attrs, [text(string)]).
1644 1666
1645 // <td> 1667 // <td>
1646 -public define HTML_Off_Form td(List(CoreAttrs) attrs, List(HTML_Off_Form) content) = html_tag("td", attrs, content).  
1647 -public define HTML_Off_Form td(List(CoreAttrs) attrs, HTML_Off_Form content) = html_tag("td", attrs, [content]).  
1648 -public define HTML_Off_Form td(CoreAttrs attr, List(HTML_Off_Form) content) = html_tag("td", [attr], content).  
1649 -public define HTML_Off_Form td(CoreAttrs attr, HTML_Off_Form content) = html_tag("td", [attr], [content]).  
1650 -public define HTML_Off_Form td(List(HTML_Off_Form) content) = html_tag("td", [], content).  
1651 -public define HTML_Off_Form td(HTML_Off_Form content) = html_tag("td", [], [content]).  
1652 -public define HTML_Off_Form td(String string) = html_tag("td", [], [text(string)]).  
1653 -public define HTML_Off_Form td(CoreAttrs attr, String string) = html_tag("td", [attr], [text(string)]).  
1654 -public define HTML_Off_Form td(List(CoreAttrs) attrs, String string) = html_tag("td", attrs, [text(string)]). 1668 +public define HTML_Off_Form td(List(CoreAttrs) attrs, List(HTML_Off_Form) content) = html_tag("td", attrs, content).
  1669 +public define HTML_Off_Form td(List(CoreAttrs) attrs, HTML_Off_Form content) = html_tag("td", attrs, [content]).
  1670 +public define HTML_Off_Form td(CoreAttrs attr, List(HTML_Off_Form) content) = html_tag("td", [attr], content).
  1671 +public define HTML_Off_Form td(CoreAttrs attr, HTML_Off_Form content) = html_tag("td", [attr], [content]).
  1672 +public define HTML_Off_Form td(List(HTML_Off_Form) content) = html_tag("td", [], content).
  1673 +public define HTML_Off_Form td(HTML_Off_Form content) = html_tag("td", [], [content]).
  1674 +public define HTML_Off_Form td(List(CoreAttrs) attrs, String string) = html_tag("td", attrs, [text(string)]).
  1675 +public define HTML_Off_Form td(CoreAttrs attr, String string) = html_tag("td", [attr], [text(string)]).
  1676 +public define HTML_Off_Form td(String string) = html_tag("td", [], [text(string)]).
  1677 +public define HTML_Off_Form td(List(CoreAttrs) attrs, Int i) = html_tag("td", attrs, [text(to_decimal(i))]).
  1678 +public define HTML_Off_Form td(CoreAttrs attr, Int i) = html_tag("td", [attr], [text(to_decimal(i))]).
  1679 +public define HTML_Off_Form td(Int i) = html_tag("td", [], [text(to_decimal(i))]).
1655 1680
1656 // <tr> 1681 // <tr>
1657 -public define HTML_Off_Form tr(List(CoreAttrs) attrs, List(HTML_Off_Form) content) = html_tag("tr", attrs, content).  
1658 -public define HTML_Off_Form tr(List(CoreAttrs) attrs, HTML_Off_Form content) = html_tag("tr", attrs, [content]).  
1659 -public define HTML_Off_Form tr(CoreAttrs attr, List(HTML_Off_Form) content) = html_tag("tr", [attr], content).  
1660 -public define HTML_Off_Form tr(CoreAttrs attr, HTML_Off_Form content) = html_tag("tr", [attr], [content]).  
1661 -public define HTML_Off_Form tr(List(HTML_Off_Form) content) = html_tag("tr", [], content).  
1662 -public define HTML_Off_Form tr(HTML_Off_Form content) = html_tag("tr", [], [content]). 1682 +public define HTML_Off_Form tr(List(CoreAttrs) attrs, List(HTML_Off_Form) content) = html_tag("tr", attrs, content).
  1683 +public define HTML_Off_Form tr(List(CoreAttrs) attrs, HTML_Off_Form content) = html_tag("tr", attrs, [content]).
  1684 +public define HTML_Off_Form tr(CoreAttrs attr, List(HTML_Off_Form) content) = html_tag("tr", [attr], content).
  1685 +public define HTML_Off_Form tr(CoreAttrs attr, HTML_Off_Form content) = html_tag("tr", [attr], [content]).
  1686 +public define HTML_Off_Form tr(List(HTML_Off_Form) content) = html_tag("tr", [], content).
  1687 +public define HTML_Off_Form tr(HTML_Off_Form content) = html_tag("tr", [], [content]).
1663 1688
1664 1689
1665 // <textarea> 1690 // <textarea>
@@ -1755,8 +1780,8 @@ public define HTML_Off_Form @@ -1755,8 +1780,8 @@ public define HTML_Off_Form
1755 form(html_Id(form_name), options, action_name(action), extra_ops, contents). 1780 form(html_Id(form_name), options, action_name(action), extra_ops, contents).
1756 1781
1757 public define HTML_Off_Form literal(Printable_tree t) = literal_pt(t). 1782 public define HTML_Off_Form literal(Printable_tree t) = literal_pt(t).
1758 -public define HTML_Off_Form fixed_size(HTML_Size width, HTML_Size height, String name_of_HTML_file)  
1759 - = fixed_size_2(width,height,name_of_HTML_file). 1783 +//public define HTML_Off_Form fixed_size(HTML_Size width, HTML_Size height, String name_of_HTML_file)
  1784 +// = fixed_size_2(width,height,name_of_HTML_file).
1760 1785
1761 1786
1762 public define HTML_Off_Form 1787 public define HTML_Off_Form
@@ -2156,7 +2181,7 @@ public define HTTP_Answer @@ -2156,7 +2181,7 @@ public define HTTP_Answer
2156 ], 2181 ],
2157 2182
2158 // content of page 2183 // content of page
2159 - center(text(name+" Controller error")) 2184 + text(name+" Controller error")
2160 ) 2185 )
2161 ) 2186 )
2162 . 2187 .
@@ -5103,8 +5128,8 @@ define Printable_tree @@ -5103,8 +5128,8 @@ define Printable_tree
5103 sequence(l) then flat(map(format_element,l)), 5128 sequence(l) then flat(map(format_element,l)),
5104 text(opts,t) then 5129 text(opts,t) then
5105 format(cinfo,ic_v,any_text(opts,t),format_element,is_https, action_count, head_tags), 5130 format(cinfo,ic_v,any_text(opts,t),format_element,is_https, action_count, head_tags),
5106 - preformated(o,s) then  
5107 - format(cinfo,ic_v,any_preformated(o,s),format_element,is_https, action_count, head_tags), 5131 +// preformated(o,s) then
  5132 +// format(cinfo,ic_v,any_preformated(o,s),format_element,is_https, action_count, head_tags),
5108 // paragraph(opts,t) then 5133 // paragraph(opts,t) then
5109 // format(cinfo,ic_v,any_paragraph(opts,t),format_element,is_https, action_count, head_tags), 5134 // format(cinfo,ic_v,any_paragraph(opts,t),format_element,is_https, action_count, head_tags),
5110 // image(opts,url,alt) then 5135 // image(opts,url,alt) then
@@ -5113,16 +5138,16 @@ define Printable_tree @@ -5113,16 +5138,16 @@ define Printable_tree
5113 // format(cinfo,ic_v,any_image(opts,url,alt,w,h),format_element,is_https, action_count, head_tags), 5138 // format(cinfo,ic_v,any_image(opts,url,alt,w,h),format_element,is_https, action_count, head_tags),
5114 table(opts,header_row, rows, footer_row) then 5139 table(opts,header_row, rows, footer_row) then
5115 format(cinfo,ic_v,any_table(opts,header_row, rows, footer_row),format_element,is_https, action_count, head_tags), 5140 format(cinfo,ic_v,any_table(opts,header_row, rows, footer_row),format_element,is_https, action_count, head_tags),
5116 - center(e) then  
5117 - format(cinfo,ic_v,any_center(e),format_element,is_https, action_count, head_tags),  
5118 - mail_to(a,e) then  
5119 - format(cinfo,ic_v,any_mail_to(a,e),format_element,is_https, action_count, head_tags),  
5120 - scroller(w,h,cw,ch,c) then  
5121 - format(cinfo,ic_v,any_scroller(w,h,cw,ch,c),format_element,is_https, action_count, head_tags),  
5122 - fixed_size(w,h,c) then  
5123 - format(cinfo,ic_v,any_fixed_size(w,h,c),format_element,is_https, action_count, head_tags),  
5124 - fixed_size_2(w,h,fn) then  
5125 - format(cinfo,ic_v,any_fixed_size_2(w,h,fn),format_element,is_https, action_count, head_tags), 5141 +// center(e) then
  5142 +// format(cinfo,ic_v,any_center(e),format_element,is_https, action_count, head_tags),
  5143 +// mail_to(a,e) then
  5144 +// format(cinfo,ic_v,any_mail_to(a,e),format_element,is_https, action_count, head_tags),
  5145 +// scroller(w,h,cw,ch,c) then
  5146 +// format(cinfo,ic_v,any_scroller(w,h,cw,ch,c),format_element,is_https, action_count, head_tags),
  5147 +// fixed_size(w,h,c) then
  5148 +// format(cinfo,ic_v,any_fixed_size(w,h,c),format_element,is_https, action_count, head_tags),
  5149 +// fixed_size_2(w,h,fn) then
  5150 +// format(cinfo,ic_v,any_fixed_size_2(w,h,fn),format_element,is_https, action_count, head_tags),
5126 actioner(c,t,a,an,eo,ja) then 5151 actioner(c,t,a,an,eo,ja) then
5127 format(cinfo,ic_v,any_actioner(c,t,a,an,eo,ja,failure),format_element,is_https, action_count, head_tags), 5152 format(cinfo,ic_v,any_actioner(c,t,a,an,eo,ja,failure),format_element,is_https, action_count, head_tags),
5128 actioner(c,t,a,an,eo,ja,fn) then 5153 actioner(c,t,a,an,eo,ja,fn) then
@@ -5200,7 +5225,7 @@ define Printable_tree @@ -5200,7 +5225,7 @@ define Printable_tree
5200 head_tags <- *head_tags + tags; 5225 head_tags <- *head_tags + tags;
5201 format(cinfo, ic_v, html_elements, is_https, action_count, head_tags), 5226 format(cinfo, ic_v, html_elements, is_https, action_count, head_tags),
5202 // br then ["<br>"], 5227 // br then ["<br>"],
5203 - progress(options, value, max) then ["<progress max=\"",value,"\" value=\"",max,"\"",format_attrs(options),"></progress>"], 5228 +// progress(options, value, max) then ["<progress max=\"",max,"\" value=\"",value,"\"",format_attrs(options),"></progress>"],
5204 // ol(opts, t) then 5229 // ol(opts, t) then
5205 // format(cinfo,ic_v,any_ol(opts,t),format_element,is_https, action_count, head_tags), 5230 // format(cinfo,ic_v,any_ol(opts,t),format_element,is_https, action_count, head_tags),
5206 // ul(opts, t) then 5231 // ul(opts, t) then
web/types/making_a_web_site.anubis
@@ -439,15 +439,15 @@ public type HTML_Off_Form: @@ -439,15 +439,15 @@ public type HTML_Off_Form:
439 literal (String), 439 literal (String),
440 sequence (List(HTML_Off_Form) items), 440 sequence (List(HTML_Off_Form) items),
441 text (List(CoreAttrs), String the_text), 441 text (List(CoreAttrs), String the_text),
442 - preformated (List(Text_Option), String), 442 +// preformated (List(Text_Option), String),
443 table (List(Table_Option), HTML_Header_Row(HTML_Off_Form), List(HTML_Row(HTML_Off_Form)), HTML_Footer_Row(HTML_Off_Form)), 443 table (List(Table_Option), HTML_Header_Row(HTML_Off_Form), List(HTML_Row(HTML_Off_Form)), HTML_Footer_Row(HTML_Off_Form)),
444 - center (HTML_Off_Form),  
445 - mail_to (String email, HTML_Off_Form element),  
446 - scroller (Int width, Int height,  
447 - Int content_width, Int content_height,  
448 - HTML_Off_Form content),  
449 - fixed_size (HTML_Size width, HTML_Size height, HTML_Off_Form content),  
450 - fixed_size_2 (HTML_Size width, HTML_Size height, String name_of_HTML_file), 444 + //center (HTML_Off_Form),
  445 +// mail_to (String email, HTML_Off_Form element),
  446 +// scroller (Int width, Int height,
  447 +// Int content_width, Int content_height,
  448 +// HTML_Off_Form content),
  449 + //fixed_size (HTML_Size width, HTML_Size height, HTML_Off_Form content),
  450 + //fixed_size_2 (HTML_Size width, HTML_Size height, String name_of_HTML_file),
451 actioner (Actioner_Connection, Actioner_Target, Actioner_Aspect, 451 actioner (Actioner_Connection, Actioner_Target, Actioner_Aspect,
452 WEB_Action_Name action_name, List((String,String)) extra_ops, 452 WEB_Action_Name action_name, List((String,String)) extra_ops,
453 List(Actioner_Local_Action)), 453 List(Actioner_Local_Action)),
@@ -472,7 +472,7 @@ public type HTML_Off_Form: @@ -472,7 +472,7 @@ public type HTML_Off_Form:
472 List(JS_File) /*js_files*/, 472 List(JS_File) /*js_files*/,
473 HTML_Body /*body*/), 473 HTML_Body /*body*/),
474 partial (HTML_Partial_Content), 474 partial (HTML_Partial_Content),
475 - progress (List(CoreAttrs), Int value, Int max), 475 + //progress (List(CoreAttrs), Int value, Int max),
476 i (List(CoreAttrs), String text), 476 i (List(CoreAttrs), String text),
477 html_tag (String tag_name, List(CoreAttrs), List(HTML_Off_Form) content), 477 html_tag (String tag_name, List(CoreAttrs), List(HTML_Off_Form) content),
478 html_void_tag (String tag_name, List(CoreAttrs)) 478 html_void_tag (String tag_name, List(CoreAttrs))