specialized_elements.anubis
3.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
/*
* Created by PyramIDE.
* User: フランスのトトロ aka (David RENÉ)
* Date: 01/06/2017
* Time: 12:03
* © Calexium
*/
read calexium_lib/web/CXM_making_a_web_site.anubis
public type Phone_Type:
generic, //Nothing special, normal phone number like home, mobile, etc..
landline, //wired phone line number
cellphone, //mobile or cell phone line number
fax //fax line number
.
public define String
to_Icon
(
Phone_Type phone_type
)=
if phone_type is
{
generic then "desktop_phone.png",
landline then "desktop_phone.png",
cellphone then "cellphone.png",
fax then "fax.png"
}
.
public define HTML_Off_Form
phone_icon
(
List(CoreAttrs) attrs,
String phone_number,
Phone_Type phone_type,
Bool show_text
)=
if phone_number = "" then empty
else
with _attrs = if phone_type = fax then [] else [data("phone-number", phone_number), event(onclick, "hk_phone_call(this)"), class("clickable") . attrs],
sequence([
img(_attrs+[class("icon_in_text")], "/icons/16x16/"+to_Icon(phone_type)),
if show_text then
text(_attrs, phone_number)
else
empty
])
.
public define HTML_Off_Form
phone_icon
(
List(CoreAttrs) attrs,
String phone_number
)= phone_icon(attrs, phone_number, generic, true).
public define HTML_Off_Form
phone_icon
(
String phone_number
)=
phone_icon([], phone_number, generic, true)
.
public define HTML_Off_Form
phone_icon
(
String phone_number,
Phone_Type phone_type,
Bool show_number
)=
phone_icon([], phone_number, phone_type, show_number)
.
public define HTML_Off_Form
phone_icon
(
String phone_number,
Phone_Type phone_type
)=
phone_icon([], phone_number, phone_type, true)
.
public define HTML_Off_Form
email_icon
(
List(CoreAttrs) attrs,
String email_str,
Bool show_text
)=
if email_str = "" then empty
else
with _attrs = [data("email", email_str), event(onclick, "hk_send_email(this)"), class("clickable") . attrs],
sequence([
img(_attrs+[class("icon_in_text")], "/icons/16x16/email.png"),
if show_text then
text(_attrs, email_str)
else
empty
])
.
public define HTML_Off_Form
email_icon
(
String email_address,
Bool show_text
)=
email_icon([], email_address, show_text)
.
public define HTML_Off_Form
email_icon
(
String email_address
)=
email_icon([], email_address, true)
.
public define HTML_Off_Form
url_icon
(
List(CoreAttrs) attrs,
String url_string,
Bool show_text
)=
if url_string = "" then empty
else
with _attrs = [data("url", url_string), event(onclick, "hk_go_url(this)"), class("clickable") . attrs],
sequence([
img(_attrs+[class("icon_in_text")], "/icons/16x16/url.png"),
if show_text then
text(_attrs, url_string)
else
empty
])
.
public define HTML_Off_Form
url_icon
(
String url_string, //url to open
Bool show_text //if true show the url link near the icon
)=
url_icon([], url_string, show_text)
.
public define HTML_Off_Form
url_icon
(
String url_string
)=
url_icon(url_string, true)
.