From e7f984366b6fa43eae416614ca2fbcffae0ef737 Mon Sep 17 00:00:00 2001 From: totoro Date: Sat, 10 Jun 2017 17:22:25 +0200 Subject: [PATCH] add specialized HTML elements like: phone number with possibility to initiate call, email with mailto link --- web/widgets/specialized_elements.anubis | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+), 0 deletions(-) create mode 100644 web/widgets/specialized_elements.anubis diff --git a/web/widgets/specialized_elements.anubis b/web/widgets/specialized_elements.anubis new file mode 100644 index 0000000..8733820 --- /dev/null +++ b/web/widgets/specialized_elements.anubis @@ -0,0 +1,55 @@ +/* + * 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 define HTML_Off_Form + phone + ( + List(CoreAttrs) attrs, + String phone_number + )= + if phone_number = "" then empty + else + with _attrs = [data("phone-number", phone_number), event(onclick, "hk_phone_call(this)"), class("phone_click") . attrs], + div([ + image(_attrs, "/icons/16x16/phone.png"), + text(_attrs, phone_number) + ]) +. + +public define HTML_Off_Form + phone + ( + String phone_number + )= + phone([], phone_number) +. + +public define HTML_Off_Form + email + ( + List(CoreAttrs) attrs, + String email_str + )= + if email_str = "" then empty + else + with _attrs = [data("email", email_str), event(onclick, "hk_send_email(this)"), class("email_click") . attrs], + div([ + image(_attrs, "/icons/16x16/email.png"), + text(_attrs, email_str) + ]) +. + +public define HTML_Off_Form + email + ( + String phone_number + )= + email([], phone_number) +. -- libgit2 0.21.4