From e9b2d3fbe2c764f46485120217a7d7a3aba1d24a Mon Sep 17 00:00:00 2001 From: totoro Date: Sat, 6 Jan 2018 17:28:47 +0100 Subject: [PATCH] add sms icon option with cellphone --- web/CXM_form.anubis | 14 ++++++++++---- web/widgets/specialized_elements.anubis | 5 +++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/web/CXM_form.anubis b/web/CXM_form.anubis index 6836109..1ef0053 100644 --- a/web/CXM_form.anubis +++ b/web/CXM_form.anubis @@ -87,11 +87,12 @@ public type CXM_Form_Field: InitialValue init_value, Width width, Mandatory mandatory), - + //--- phone field ------------------------------------------------------------ phone_input( - List(CoreAttrs) icon_options, - List(CoreAttrs) options, + Maybe(List(CoreAttrs)) sms_icon_options, //if there is sms available it's success with the options (generally the js call to edit sms) + List(CoreAttrs) phone_icon_options, + List(CoreAttrs) text_options, HTML_Label label, HTML_Id id, WebArgName web_arg_name, @@ -539,8 +540,13 @@ public define HTML_In_Form password_input(options, _label, id, name, init, w, mand) then password_input([class("in") . options], star(_label, mand), id, name, init, pixels(w)), - phone_input(icon_options, options, _label, id, wan, default, phone_type, w, mand) then + phone_input(mb_sms_options, icon_options, options, _label, id, wan, default, phone_type, w, mand) then sequence([ + if mb_sms_options is + { + failure then empty, + success(sms_options) then image([event(onmouseover, "/icons/16x16/send_sms.png")]+sms_options, "/icons/16x16/sms.png", "") + }, image(icon_options, "/icons/16x16/"+to_Icon(phone_type), ""), text_input([class("in") . options], star(_label, mand), id, wan, init(get_String(lwa, wan.name, default.value)), pixels(w)), ]), diff --git a/web/widgets/specialized_elements.anubis b/web/widgets/specialized_elements.anubis index f73bc97..3353aed 100644 --- a/web/widgets/specialized_elements.anubis +++ b/web/widgets/specialized_elements.anubis @@ -41,6 +41,11 @@ public define HTML_Off_Form else with _attrs = if phone_type = fax then [] else [data("phone-number", phone_number), event(onclick, "hk_phone_call(this)"), class("clickable") . attrs], sequence([ + //add sms + if phone_type = cellphone then + img([event(onmouseover, "/icons/16x16/send_sms.png"), event(onclick, "hk_send_sms(this)"), class("clickable icon_in_text")], "/icons/16x16/sms.png","") + else + empty, img(_attrs+[class("icon_in_text")], "/icons/16x16/"+to_Icon(phone_type)), if show_text then text(_attrs, phone_number) -- libgit2 0.21.4