Commit 5d5ed725badc4a52ca9cce8b579bd2cd5a63eb77

Authored by totoro
1 parent 8229545e

[+] Add img button with foreign link

[+] Add "empty" alternative in HTML_Off_Form and HTML_In_Form. This avoid to use literal with an empty content
web/CXM_making_a_web_site.anubis
@@ -1078,6 +1078,7 @@ public define List(HTML_Head_Tag) @@ -1078,6 +1078,7 @@ public define List(HTML_Head_Tag)
1078 map((JS_File js_f) |-> js(js_f), js_file_list). 1078 map((JS_File js_f) |-> js(js_f), js_file_list).
1079 1079
1080 public type HTML_In_Form: 1080 public type HTML_In_Form:
  1081 + empty,
1081 literal_pt (Printable_tree), 1082 literal_pt (Printable_tree),
1082 literal (String), 1083 literal (String),
1083 sequence (List(HTML_In_Form) items), 1084 sequence (List(HTML_In_Form) items),
@@ -1269,6 +1270,7 @@ public define HTML_In_Form @@ -1269,6 +1270,7 @@ public define HTML_In_Form
1269 public type HTML_Body:... 1270 public type HTML_Body:...
1270 1271
1271 public type HTML_Off_Form: 1272 public type HTML_Off_Form:
  1273 + empty,
1272 literal_pt (Printable_tree), 1274 literal_pt (Printable_tree),
1273 literal (String), 1275 literal (String),
1274 sequence (List(HTML_Off_Form) items), 1276 sequence (List(HTML_Off_Form) items),
@@ -4242,6 +4244,7 @@ define Printable_tree @@ -4242,6 +4244,7 @@ define Printable_tree
4242 with format_element = (HTML_In_Form e) |-> format(cinfo, fn, sn, ic_v, e, is_https, action_count, head_tags), 4244 with format_element = (HTML_In_Form e) |-> format(cinfo, fn, sn, ic_v, e, is_https, action_count, head_tags),
4243 if element is 4245 if element is
4244 { 4246 {
  4247 + empty then [],
4245 literal_pt(t) then t, 4248 literal_pt(t) then t,
4246 literal(t) then [t], 4249 literal(t) then [t],
4247 sequence(l) then flat(map(format_element,l)) 4250 sequence(l) then flat(map(format_element,l))
@@ -4371,6 +4374,7 @@ define Bool @@ -4371,6 +4374,7 @@ define Bool
4371 ) = 4374 ) =
4372 if form_content is 4375 if form_content is
4373 { 4376 {
  4377 + empty then false,
4374 literal_pt(t) then false, 4378 literal_pt(t) then false,
4375 literal(t) then false, 4379 literal(t) then false,
4376 sequence(l) then mapor(contains_an_upload,l) 4380 sequence(l) then mapor(contains_an_upload,l)
@@ -4434,6 +4438,7 @@ define Printable_tree @@ -4434,6 +4438,7 @@ define Printable_tree
4434 with format_element = (HTML_Off_Form e) |-> format(cinfo, sn, ic_v, e, is_https, action_count, head_tags), 4438 with format_element = (HTML_Off_Form e) |-> format(cinfo, sn, ic_v, e, is_https, action_count, head_tags),
4435 if element is 4439 if element is
4436 { 4440 {
  4441 + empty then [],
4437 literal_pt(t) then t, 4442 literal_pt(t) then t,
4438 literal(t) then [t], 4443 literal(t) then [t],
4439 sequence(l) then flat(map(format_element,l)), 4444 sequence(l) then flat(map(format_element,l)),
web/widgets/button.anubis
@@ -18,9 +18,27 @@ public define String icn16_phone = "icons/16x16/phone.png". @@ -18,9 +18,27 @@ public define String icn16_phone = "icons/16x16/phone.png".
18 public define String icn16_locked = "icons/16x16/locked.png". 18 public define String icn16_locked = "icons/16x16/locked.png".
19 19
20 public define HTML_Partial_Content 20 public define HTML_Partial_Content
  21 + img_button_flink
  22 + (
  23 + String img_path,
  24 + Actioner_Target target,
  25 + String url
  26 + )=
  27 + partial_content(foreign_link_new(target, img_link(img_path, ""), url)).
  28 +
  29 +public define HTML_Partial_Content
  30 + img_button_flink
  31 + (
  32 + String img_path,
  33 + String url
  34 + )=
  35 + img_button_flink(img_path, same, url).
  36 +
  37 +public define HTML_Partial_Content
21 img_button 38 img_button
22 ( 39 (
23 String img_path, 40 String img_path,
  41 + Actioner_Target target,
24 String url, 42 String url,
25 List((String, String)) extra_ops 43 List((String, String)) extra_ops
26 )= 44 )=
@@ -32,7 +50,16 @@ public define HTML_Partial_Content @@ -32,7 +50,16 @@ public define HTML_Partial_Content
32 String img_path, 50 String img_path,
33 String url 51 String url
34 )= 52 )=
35 - img_button(img_path, url, []). 53 + img_button(img_path, same, url, []).
  54 +
  55 +public define HTML_Partial_Content
  56 + img_button
  57 + (
  58 + String img_path,
  59 + String url,
  60 + List((String, String)) extra_ops
  61 + )=
  62 + img_button(img_path, same, url, extra_ops).
36 63
37 public define HTML_Partial_Content 64 public define HTML_Partial_Content
38 img_button_confirm 65 img_button_confirm