From 39b3fd4c67accf5f1c6a679a77896c6c2f6a3262 Mon Sep 17 00:00:00 2001 From: totoro Date: Sun, 26 Jul 2015 01:08:41 +0200 Subject: [PATCH] [+] add CoreAttrs options for img_link (able to add tooltip, class, etc) [+] add CoreAttrs option for img_button and img_button_flink [+] add group icon into icons_set --- web/CXM_making_a_web_site.anubis | 12 ++++++------ web/widgets/button.anubis | 41 +++++++++++++++++++++++++++++++---------- web/widgets/icons_set.anubis | 1 + 3 files changed, 38 insertions(+), 16 deletions(-) diff --git a/web/CXM_making_a_web_site.anubis b/web/CXM_making_a_web_site.anubis index 5f8492e..16679e4 100644 --- a/web/CXM_making_a_web_site.anubis +++ b/web/CXM_making_a_web_site.anubis @@ -951,7 +951,7 @@ public type Actioner_Target: public type Actioner_Aspect: link (List(Text_Option), String text, Maybe(String) name),// hypertext link - img_link (String img_url, String alt_text), + img_link (List(CoreAttrs),String img_url, String alt_text), push_button (List(CoreAttrs),String text), button (String url_off, String url_on), // rollover button button (String url_off, String url_on, Int w, Int h), // idem with size @@ -3478,7 +3478,7 @@ define Maybe(String) if aspect is { link(_,_,_) then failure, - img_link(_,_) then failure, + img_link(_,_,_) then failure, push_button(opts,_) then extract_id(opts), button(_,_) then failure, button(_,_,_,_) then failure, @@ -3523,9 +3523,9 @@ define Printable_tree text, "" ], - img_link(img, alt_text) then + img_link(opt, img, alt_text) then [ - "\""" ], push_button(options, text) then @@ -3586,9 +3586,9 @@ define Printable_tree text, "" ], - img_link(img, alt_text) then + img_link(options, img, alt_text) then [ - "\""" ], push_button(options, text) then diff --git a/web/widgets/button.anubis b/web/widgets/button.anubis index e13e778..2ba007a 100644 --- a/web/widgets/button.anubis +++ b/web/widgets/button.anubis @@ -17,29 +17,40 @@ read tools/basis.anubis public define HTML_Partial_Content img_button_flink ( - String img_path, - Actioner_Target target, - String url + String img_path, + List(CoreAttrs) core_attrs, + Actioner_Target target, + String url )= - partial_content(foreign_link_new(target, img_link(img_path, ""), url)). + partial_content(foreign_link_new(target, img_link(core_attrs, img_path, ""), url)). public define HTML_Partial_Content img_button_flink ( - String img_path, - String url + String img_path, + Actioner_Target target, + String url )= - img_button_flink(img_path, same, url). + img_button_flink(img_path, [], target, 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, + List(CoreAttrs) core_attrs, Actioner_Target target, String url, List((String, String)) extra_ops )= - partial_content(actioner(same, same, img_link(img_path, ""), url, extra_ops)). + partial_content(actioner(same, same, img_link(core_attrs, img_path, ""), url, extra_ops)). public define HTML_Partial_Content img_button @@ -47,7 +58,7 @@ public define HTML_Partial_Content String img_path, String url )= - img_button(img_path, same, url, []). + img_button(img_path, [], same, url, []). public define HTML_Partial_Content img_button @@ -56,8 +67,18 @@ public define HTML_Partial_Content String url, List((String, String)) extra_ops )= - img_button(img_path, same, url, extra_ops). + img_button(img_path, [], same, url, extra_ops). +public define HTML_Partial_Content + img_button + ( + String img_path, + List(CoreAttrs) core_attrs, + String url, + List((String, String)) extra_ops + )= + img_button(img_path, core_attrs, same, url, extra_ops). + define inline String img_button_confirm_js ( diff --git a/web/widgets/icons_set.anubis b/web/widgets/icons_set.anubis index 3c648a9..2a47ebb 100644 --- a/web/widgets/icons_set.anubis +++ b/web/widgets/icons_set.anubis @@ -14,6 +14,7 @@ public define String icn16_locked = "icons/16x16/locked.png". public define String icn16_clock = "icons/16x16/clock.png". public define String icn16_vcard_add = "icons/16x16/vcard_add.png". public define String icn16_folder_edit = "icons/16x16/folder_edit.png". +public define String icn16_group = "icons/16x16/group.png". /****------------------ MIME PART -----------------****/ -- libgit2 0.21.4