Web actions

Elephant Web Actions is a specification used by several components to allow an easy way to execute actions based on URIs. The specification uses an action protocol to perform internal translations. Most of the actions could be executed using url:address, the specification liberates the user to remember special addresses and adds some helping attributes, like captions and icons.

The protocols

Protocol

Exposed as

Description

NAVIGATE

nav:value

Navigates internally. The value is an internal URL.

TAG

tag:value

Navigates internally. The value is a context WebTag.

ACTION

action:value

Internal application action. Current action values are:

  • signup
  • tellsomeone

URL

url:value

Generic navigation. The value is an URL.

MAIL

mailto:value

Mail to navigation URL. The value should be an email.

TEL

tel:value

Phone call navigation URL. The value should be a phone number.

WHATS

whats:value

Whatsapp send message URL. The value should be a phone number.

TGRAM

tgram:value

Telegram send message URL. The value should be a user identifier.

Elephant WebActions API is based on WebLinks and Icons classes. In combination, they make easy to create web actions based on protocols resulting in URLs.

WebLinks

WebLinks are created using the WebAction protocol, and they expose some useful methods when creating templates.

Method

Description

getType()

Returns the WebAction type used to create the link.

getCaption()

Returns the link caption.

getUrl()

Returns the URL for this link.

getIcon()

Returns the icon value.

getHelp()

Returns an extended value for this link, to be used as help. Usually is the original URL, the phone number, the user identifier or other value depending on the protocol type.

getIcons()

Return the Icons class, explained below.

isExternal()

Returns true when the link moves to another site.

isEmpty()

Return true when the WebLink has no values.

Icons

Icons is a utility class that helps adding icons to templates. Some methods can be concatenated, eliminating the necessity to make assignments.

Method

Description

Concatenated

cssClass(value)

Allows to add extra classes to the icon class. Mainly used for colors and size.

cssStyle(value)

Allows to add extra styles to the icon element.

path(value)

Adds a path for file based icons (ending with .png)

before(value)

HTML based value that will be added before the icon if there is an icon value.

after(value)

HTML based value that will be added after the icon if there is an icon value.

icon()

Returns the HTML to create the icon, or an empty string if the is not an icon value.

Printer version
English09/27/22 14:15Lluís Turró Cutiller
English10/07/22 16:27Lluís Turró Cutiller
English10/24/22 17:33Lluís Turró Cutiller