Commit 006acf6bad84daf171b9d1b9f81d641af6210616

Authored by totoro
1 parent 1a7e5340

add a HTML tag

add parameter JQuery_dialog_size in jq_dialog_create
some clean up by replacing literal by real HTML tag which wasn't exist when the code was written.
web/CXM_making_a_web_site.anubis
@@ -1695,10 +1695,49 @@ public define HTML_In_Form @@ -1695,10 +1695,49 @@ public define HTML_In_Form
1695 hidden (WebArgName name, WebArgValue value) 1695 hidden (WebArgName name, WebArgValue value)
1696 = 1696 =
1697 hidden(html_Id(""), name, value). 1697 hidden(html_Id(""), name, value).
1698 - 1698 +
  1699 +public type Input_Type:
  1700 +button,
  1701 +checkbox,
  1702 +color,
  1703 +date,
  1704 +datetime_local,
  1705 +email,
  1706 +file,
  1707 +hidden,
  1708 +image,
  1709 +month,
  1710 +number,
  1711 +password,
  1712 +radio,
  1713 +range,
  1714 +reset,
  1715 +search,
  1716 +submit,
  1717 +tel,
  1718 +text,
  1719 +time,
  1720 +url,
  1721 +week
  1722 +.
  1723 +
  1724 +public type A_href:
  1725 + href(String href),
  1726 + href(WEB_Action_Name action, List((String,String)) extra_ops)
  1727 +.
  1728 +
  1729 +public type A_target:
  1730 + _blank,
  1731 + _self,
  1732 + _parent,
  1733 + _top,
  1734 + framename(String name)
  1735 +.
  1736 +
1699 public type HTML_Body:... 1737 public type HTML_Body:...
1700 1738
1701 public type HTML_Off_Form: 1739 public type HTML_Off_Form:
  1740 + a (List(CoreAttrs), A_href, A_target, List(HTML_Off_Form) content),
1702 empty, 1741 empty,
1703 literal_pt (Printable_tree), 1742 literal_pt (Printable_tree),
1704 literal (String), 1743 literal (String),
@@ -1762,6 +1801,14 @@ public type HTML_Off_Form: @@ -1762,6 +1801,14 @@ public type HTML_Off_Form:
1762 1801
1763 'HTML_Off_Form' defines all the elements you may put outside any form. 1802 'HTML_Off_Form' defines all the elements you may put outside any form.
1764 1803
  1804 +public define HTML_Off_Form a(A_href _href) = a([], _href, _self, []).
  1805 +public define HTML_Off_Form a(List(CoreAttrs) attrs, A_href _href) = a(attrs, _href, _self, []).
  1806 +public define HTML_Off_Form a(List(CoreAttrs) attrs, A_href _href, HTML_Off_Form content) = a(attrs, _href, _self, [content]).
  1807 +public define HTML_Off_Form a(List(CoreAttrs) attrs, A_href _href, List(HTML_Off_Form) content) = a(attrs, _href, _self, content).
  1808 +public define HTML_Off_Form a(A_href _href, HTML_Off_Form content) = a([], _href, _self, [content]).
  1809 +public define HTML_Off_Form a(A_href _href, List(HTML_Off_Form) content) = a([], _href, _self, content).
  1810 +
  1811 +
1765 public define HTML_Off_Form strong(HTML_Off_Form content) = strong([], [content]). 1812 public define HTML_Off_Form strong(HTML_Off_Form content) = strong([], [content]).
1766 public define HTML_Off_Form strong(List(HTML_Off_Form) content) = strong([], content). 1813 public define HTML_Off_Form strong(List(HTML_Off_Form) content) = strong([], content).
1767 public define HTML_Off_Form strong(List(CoreAttrs) attrs, HTML_Off_Form content) = strong(attrs, [content]). 1814 public define HTML_Off_Form strong(List(CoreAttrs) attrs, HTML_Off_Form content) = strong(attrs, [content]).
@@ -2334,6 +2381,13 @@ public define HTML_Partial_Content @@ -2334,6 +2381,13 @@ public define HTML_Partial_Content
2334 public define HTML_Partial_Content 2381 public define HTML_Partial_Content
2335 partial_content 2382 partial_content
2336 ( 2383 (
  2384 + List(HTML_Off_Form) content
  2385 + )=
  2386 + partial_content([], sequence(content)).
  2387 +
  2388 +public define HTML_Partial_Content
  2389 + partial_content
  2390 + (
2337 List(HTML_Head_Tag) tags, 2391 List(HTML_Head_Tag) tags,
2338 HTML_Partial_Content p_content 2392 HTML_Partial_Content p_content
2339 )= 2393 )=
@@ -5716,7 +5770,34 @@ define String @@ -5716,7 +5770,34 @@ define String
5716 "" 5770 ""
5717 . 5771 .
5718 5772
5719 - 5773 +define Printable_tree
  5774 + format_href
  5775 + (
  5776 + A_href _href
  5777 + )=
  5778 + if _href is
  5779 + {
  5780 + href(str) then if str = "" then [] else [" href=\"", str, "\""],
  5781 + href(action, extra) then [" href=\"",format_web_action_name(action, extra), "\""]
  5782 + }
  5783 +.
  5784 +
  5785 +define Printable_tree
  5786 + format_target
  5787 + (
  5788 + A_target _target
  5789 + )=
  5790 + [" target=\"",
  5791 + if _target is
  5792 + {
  5793 + _blank then "_blank",
  5794 + _self then "_self",
  5795 + _parent then "_parent",
  5796 + _top then "_top",
  5797 + framename(name) then name
  5798 + },
  5799 + "\""]
  5800 +.
5720 5801
5721 define Printable_tree 5802 define Printable_tree
5722 format 5803 format
@@ -5730,9 +5811,10 @@ define Printable_tree @@ -5730,9 +5811,10 @@ define Printable_tree
5730 ) = 5811 ) =
5731 if cinfo is info(common_name,http_port,https_port,site_directory,secret) then 5812 if cinfo is info(common_name,http_port,https_port,site_directory,secret) then
5732 with format_element = (HTML_Off_Form e) |-> format(cinfo, ic_v, e, is_https, action_count, head_tags), 5813 with format_element = (HTML_Off_Form e) |-> format(cinfo, ic_v, e, is_https, action_count, head_tags),
5733 - if element is  
5734 - {  
5735 - empty then [], 5814 + if element is
  5815 + {
  5816 + a(opts, _href, _target, l) then ["<a ", format_attrs(opts), format_href(_href), format_target(_target), ">",flat(map(format_element,l)),"</a>\n"],
  5817 + empty then [],
5736 literal_pt(t) then t, 5818 literal_pt(t) then t,
5737 literal(t) then [t], 5819 literal(t) then [t],
5738 sequence(l) then flat(map(format_element,l)), 5820 sequence(l) then flat(map(format_element,l)),
web/jQuery/CXM_jquery_dialog.anubis
@@ -78,6 +78,25 @@ $( \&quot;#&quot;+dlg_id+&quot;\&quot; ).dialog({ @@ -78,6 +78,25 @@ $( \&quot;#&quot;+dlg_id+&quot;\&quot; ).dialog({
78 public define HTML_Partial_Content 78 public define HTML_Partial_Content
79 jq_dialog_create 79 jq_dialog_create
80 ( 80 (
  81 + JQuery_dialog_id dial_id,
  82 + JQuery_dialog content,
  83 + JQuery_dialog_size size,
  84 + String extra_param
  85 + )=
  86 + jq_dialog_create(dial_id, content, false, size, extra_param).
  87 +
  88 +public define HTML_Partial_Content
  89 + jq_dialog_create
  90 + (
  91 + JQuery_dialog_id dial_id,
  92 + JQuery_dialog content,
  93 + JQuery_dialog_size size
  94 + )=
  95 + jq_dialog_create(dial_id, content, false, size, "").
  96 +
  97 +public define HTML_Partial_Content
  98 + jq_dialog_create
  99 + (
81 JQuery_dialog_id dial_id, 100 JQuery_dialog_id dial_id,
82 JQuery_dialog content, 101 JQuery_dialog content,
83 String extra_param 102 String extra_param
web/jQuery/CXM_jquery_tabs.anubis
@@ -44,7 +44,7 @@ define HTML_Partial_Content @@ -44,7 +44,7 @@ define HTML_Partial_Content
44 partial_content( 44 partial_content(
45 tabs_heads, 45 tabs_heads,
46 sequence([ 46 sequence([
47 - literal("<ul>"+tabs_titles+"</ul>"), 47 + ul(tabs_titles),
48 sequence(reverse(tabs_contents)) 48 sequence(reverse(tabs_contents))
49 ]) 49 ])
50 ), 50 ),
@@ -56,11 +56,7 @@ define HTML_Partial_Content @@ -56,11 +56,7 @@ define HTML_Partial_Content
56 t, 56 t,
57 tabs_titles + "<li><a href=\"#"+tabs_container_id+"-tab-"+count+"\">"+title+"</a></li>", 57 tabs_titles + "<li><a href=\"#"+tabs_container_id+"-tab-"+count+"\">"+title+"</a></li>",
58 [ 58 [
59 - sequence([  
60 - literal("<div id=\""+tabs_container_id+"-tab-"+count+"\">"),  
61 - content,  
62 - literal("</div>")  
63 - ]) 59 + div([id(tabs_container_id+"-tab-"+count)], content)
64 . 60 .
65 tabs_contents 61 tabs_contents
66 ], 62 ],
@@ -106,11 +102,8 @@ public define HTML_Partial_Content @@ -106,11 +102,8 @@ public define HTML_Partial_Content
106 . 102 .
107 tags 103 tags
108 ], 104 ],
109 - sequence([  
110 - literal("<div id=\""+tabs_container_id+"\">"),  
111 - html,  
112 - literal("</div>")  
113 - ]) 105 +
  106 + div([id(tabs_container_id)], html)
114 ). 107 ).
115 108
116 public define HTML_Partial_Content 109 public define HTML_Partial_Content