HTML5 front-end functions

 

The table below shows the built-in functions implemented by the front end in the "html5" module.

 

The names of front-end functions and pre-defined arguments are case-sensitive.

 

Function

Description

Lycia

Desktop

LyciaWeb

eval

executes the JavaScript provided as the argument:

 

ui.Interface.frontCall("html5", "eval", [text], [result])

 

text = text to be interpreted as JAVA script

result = variable which holds the results of the function execution

fileinfo

returns size, MIME type, and time of previous modification for any file specified as an argument:

 

ui.Interface.frontCall("html5", "fileinfo", [file_name], [result])

 

file_name = name of the file in interest

result = variable which holds the results of the function execution

 

For LyciaWeb, will work only if there is a TextField in the Lycia 3 form with the FileUpload class  

setLocalStorage

sets the value specified as its second argument to the value of the HTML5 local storage by the name specified as its first argument:

 

ui.Interface.frontCall("html5", "setLocalStorage", ["key", "value"], [result])

 

key = name to be given to the HTML5 local storage

value = value set for the HTML5 local storage with the given name

result = variable which holds the results of the function execution

getLocalStorage

returns values stored in the HTML5 local storage by the name specified as an argument:

 

ui.Interface.frontCall("html5", "getLocalStorage", [key], [result])

 

key = name of the HTML5 local storage

result = variable which holds the results of function execution

styleImport

imports CSS styles by URL:

 

ui.Interface.frontCall("html5", "styleImport", ["url", "copy", id], [])

 

url = URL of the imported style

copy (optional) = specifies whether the imported style must be copied to native window context for LyciaDesktop

id (optional) = identifier for the imported style

 

Any URL pattern can be used, including qx:// <> to access files which are already part of the project  

scriptImport

imports script files by URL:

 

ui.Interface.frontCall("html5", "scriptImport", ["url", "nowait"], [])

 

url = URL of the imported script

nowait (optional) = specifies whether the function should exit immediately without waiting for the successful script uploading

 

Any URL pattern can be used, including qx:// <> to access files which are already part of the project

htmlImport

imports HTML5 WebComponents.

A new experimental HTML importing facility currently not supported by browsers, so it is unlikely that it will work properly unless some simulation libraries are loaded.

 

 

Related article:

FrontCall()

Standard front-end functions

Extending Lycia clients with plug-ins

Creating Application Themes by Concatenation