From 5d5ed725badc4a52ca9cce8b579bd2cd5a63eb77 Mon Sep 17 00:00:00 2001 From: totoro Date: Sat, 9 May 2015 22:21:20 +0200 Subject: [PATCH] [+] 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 | 5 +++++ web/widgets/button.anubis | 29 ++++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/web/CXM_making_a_web_site.anubis b/web/CXM_making_a_web_site.anubis index 439c861..8db0a3e 100644 --- a/web/CXM_making_a_web_site.anubis +++ b/web/CXM_making_a_web_site.anubis @@ -1078,6 +1078,7 @@ public define List(HTML_Head_Tag) map((JS_File js_f) |-> js(js_f), js_file_list). public type HTML_In_Form: + empty, literal_pt (Printable_tree), literal (String), sequence (List(HTML_In_Form) items), @@ -1269,6 +1270,7 @@ public define HTML_In_Form public type HTML_Body:... public type HTML_Off_Form: + empty, literal_pt (Printable_tree), literal (String), sequence (List(HTML_Off_Form) items), @@ -4242,6 +4244,7 @@ define Printable_tree with format_element = (HTML_In_Form e) |-> format(cinfo, fn, sn, ic_v, e, is_https, action_count, head_tags), if element is { + empty then [], literal_pt(t) then t, literal(t) then [t], sequence(l) then flat(map(format_element,l)) @@ -4371,6 +4374,7 @@ define Bool ) = if form_content is { + empty then false, literal_pt(t) then false, literal(t) then false, sequence(l) then mapor(contains_an_upload,l) @@ -4434,6 +4438,7 @@ define Printable_tree with format_element = (HTML_Off_Form e) |-> format(cinfo, sn, ic_v, e, is_https, action_count, head_tags), if element is { + empty then [], literal_pt(t) then t, literal(t) then [t], sequence(l) then flat(map(format_element,l)), diff --git a/web/widgets/button.anubis b/web/widgets/button.anubis index 74a400d..f78c30e 100644 --- a/web/widgets/button.anubis +++ b/web/widgets/button.anubis @@ -18,9 +18,27 @@ public define String icn16_phone = "icons/16x16/phone.png". public define String icn16_locked = "icons/16x16/locked.png". public define HTML_Partial_Content + img_button_flink + ( + String img_path, + Actioner_Target target, + String url + )= + partial_content(foreign_link_new(target, img_link(img_path, ""), url)). + +public define HTML_Partial_Content + img_button_flink + ( + String img_path, + String url + )= + img_button_flink(img_path, same, url). + +public define HTML_Partial_Content img_button ( String img_path, + Actioner_Target target, String url, List((String, String)) extra_ops )= @@ -32,7 +50,16 @@ public define HTML_Partial_Content String img_path, String url )= - img_button(img_path, url, []). + img_button(img_path, same, url, []). + +public define HTML_Partial_Content + img_button + ( + String img_path, + String url, + List((String, String)) extra_ops + )= + img_button(img_path, same, url, extra_ops). public define HTML_Partial_Content img_button_confirm -- libgit2 0.21.4