Commit 39b3fd4c67accf5f1c6a679a77896c6c2f6a3262

Authored by totoro
1 parent 41eecab5

[+] 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
... ... @@ -951,7 +951,7 @@ public type Actioner_Target:
951 951  
952 952 public type Actioner_Aspect:
953 953 link (List(Text_Option), String text, Maybe(String) name),// hypertext link
954   - img_link (String img_url, String alt_text),
  954 + img_link (List(CoreAttrs),String img_url, String alt_text),
955 955 push_button (List(CoreAttrs),String text),
956 956 button (String url_off, String url_on), // rollover button
957 957 button (String url_off, String url_on, Int w, Int h), // idem with size
... ... @@ -3478,7 +3478,7 @@ define Maybe(String)
3478 3478 if aspect is
3479 3479 {
3480 3480 link(_,_,_) then failure,
3481   - img_link(_,_) then failure,
  3481 + img_link(_,_,_) then failure,
3482 3482 push_button(opts,_) then extract_id(opts),
3483 3483 button(_,_) then failure,
3484 3484 button(_,_,_,_) then failure,
... ... @@ -3523,9 +3523,9 @@ define Printable_tree
3523 3523 text,
3524 3524 "</a>"
3525 3525 ],
3526   - img_link(img, alt_text) then
  3526 + img_link(opt, img, alt_text) then
3527 3527 [
3528   - "<a href=\"", full_url ,"\"><img src=\"", img,
  3528 + "<a href=\"", full_url ,"\"", format_attrs(opt),"><img src=\"", img,
3529 3529 "\" alt=\"" + alt_text + "\" border=\"0\"></a>"
3530 3530 ],
3531 3531 push_button(options, text) then
... ... @@ -3586,9 +3586,9 @@ define Printable_tree
3586 3586 text,
3587 3587 "</a>"
3588 3588 ],
3589   - img_link(img, alt_text) then
  3589 + img_link(options, img, alt_text) then
3590 3590 [
3591   - "<a href=\"", url ,"\"><img src=\"", img,
  3591 + "<a href=\"", url,"\"", format_attrs(options),"><img src=\"", img,
3592 3592 "\" alt=\"" + alt_text + "\" border=\"0\"></a>"
3593 3593 ],
3594 3594 push_button(options, text) then
... ...
web/widgets/button.anubis
... ... @@ -17,29 +17,40 @@ read tools/basis.anubis
17 17 public define HTML_Partial_Content
18 18 img_button_flink
19 19 (
20   - String img_path,
21   - Actioner_Target target,
22   - String url
  20 + String img_path,
  21 + List(CoreAttrs) core_attrs,
  22 + Actioner_Target target,
  23 + String url
23 24 )=
24   - partial_content(foreign_link_new(target, img_link(img_path, ""), url)).
  25 + partial_content(foreign_link_new(target, img_link(core_attrs, img_path, ""), url)).
25 26  
26 27 public define HTML_Partial_Content
27 28 img_button_flink
28 29 (
29   - String img_path,
30   - String url
  30 + String img_path,
  31 + Actioner_Target target,
  32 + String url
31 33 )=
32   - img_button_flink(img_path, same, url).
  34 + img_button_flink(img_path, [], target, url).
33 35  
34 36 public define HTML_Partial_Content
  37 + img_button_flink
  38 + (
  39 + String img_path,
  40 + String url
  41 + )=
  42 + img_button_flink(img_path, [], same, url).
  43 +
  44 +public define HTML_Partial_Content
35 45 img_button
36 46 (
37 47 String img_path,
  48 + List(CoreAttrs) core_attrs,
38 49 Actioner_Target target,
39 50 String url,
40 51 List((String, String)) extra_ops
41 52 )=
42   - partial_content(actioner(same, same, img_link(img_path, ""), url, extra_ops)).
  53 + partial_content(actioner(same, same, img_link(core_attrs, img_path, ""), url, extra_ops)).
43 54  
44 55 public define HTML_Partial_Content
45 56 img_button
... ... @@ -47,7 +58,7 @@ public define HTML_Partial_Content
47 58 String img_path,
48 59 String url
49 60 )=
50   - img_button(img_path, same, url, []).
  61 + img_button(img_path, [], same, url, []).
51 62  
52 63 public define HTML_Partial_Content
53 64 img_button
... ... @@ -56,8 +67,18 @@ public define HTML_Partial_Content
56 67 String url,
57 68 List((String, String)) extra_ops
58 69 )=
59   - img_button(img_path, same, url, extra_ops).
  70 + img_button(img_path, [], same, url, extra_ops).
60 71  
  72 +public define HTML_Partial_Content
  73 + img_button
  74 + (
  75 + String img_path,
  76 + List(CoreAttrs) core_attrs,
  77 + String url,
  78 + List((String, String)) extra_ops
  79 + )=
  80 + img_button(img_path, core_attrs, same, url, extra_ops).
  81 +
61 82 define inline String
62 83 img_button_confirm_js
63 84 (
... ...
web/widgets/icons_set.anubis
... ... @@ -14,6 +14,7 @@ public define String icn16_locked = &quot;icons/16x16/locked.png&quot;.
14 14 public define String icn16_clock = "icons/16x16/clock.png".
15 15 public define String icn16_vcard_add = "icons/16x16/vcard_add.png".
16 16 public define String icn16_folder_edit = "icons/16x16/folder_edit.png".
  17 +public define String icn16_group = "icons/16x16/group.png".
17 18  
18 19 /****------------------ MIME PART -----------------****/
19 20  
... ...