specialized_elements.anubis 1.29 KB
/*
 * 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,
    Bool            image_only
  )=
  if phone_number = "" then empty
  else
      with _attrs = [data("phone-number", phone_number), event(onclick, "hk_phone_call(this)"), class("phone_click") . attrs],
  div([
    img(_attrs, "/icons/16x16/phone.png"),
    if image_only then empty else
      text(_attrs, phone_number)
  ])
.

public define HTML_Off_Form
  phone
  (
    List(CoreAttrs) attrs,
    String          phone_number
  )= phone(attrs, phone_number, false).
  
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([
    img(_attrs, "/icons/16x16/email.png"),
    text(_attrs, email_str)
  ])
.

public define HTML_Off_Form
  email
  (
    String          phone_number
  )=
  email([], phone_number)
.