Utility Function Api

An API exposed that gives access to various utility functions. These functions are available under the `convenienceApi.utilities` namespace.

Methods

keyValueArrayToJsonArrayTransformer(arrayToTransform, inputValueKey)Array
Convert an array of name value pairs into a array with values for given key.
getHtmlEventTarget(htmlEvent)Object | null
Gets the target of an HTML element, the target is dependent on the browser, for example IE uses __target.
reload()undefined
Reloads route and form initiates form view model activation.
createKeyValuePair(key, value)Object
Creates a key / value pair.
getMainKeyCharCode(keys, charName)Number
Gets the charCode from a Name of the Main key in a KeyboardShortCut
getMainKeyFromCharCode(keys, charCode)String
Gets the name of the character from a charCode of the Main key in a KeyboardShortCut
escapeString(string)String
Sanitizes a string
unescapeString(string)String
De-sanitizes a string
sanitizeHtmlString(string)String
Returns a HTML sanitized string given a string as input
getRelativityPageBaseWindow()Object
Returns the window with the Relativity context on it

Properties Details

keyValueArrayToJsonArrayTransformer(arrayToTransform, inputValueKey) ⇒ Array

Convert an array of name value pairs into a array with values for given key.

Returns: Array - Returns an array of the transformed ObjectArray.

Param Type Description
arrayToTransform Object to be transformed into a dictionary.
inputValueKey String the name the object of the value key in array elements.

getHtmlEventTarget(htmlEvent) ⇒ Object | null

Gets the target of an HTML element, the target is dependent on the browser, for example IE uses __target.

Returns: Object | null - Returns the target of the htmlEvent or null if htmlEvent doesnt have a target.

Param Type Description
htmlEvent Event HTML Event to retrieve the target

reload() ⇒ undefined

Reloads route and form initiates form view model activation.

createKeyValuePair(key, value) ⇒ Object

Creates a key / value pair.

Returns: Object - A Key/Value pair object

Param Type Description
key String the key for the key/value pair
value String the value for the key/value pair

getMainKeyCharCode(keys, charName) ⇒ Number

Gets the charCode from a Name of the Main key in a KeyboardShortCut

Returns: Number - returns an integer which represent the UTF character

Param Type Description
keys Array.<Object> list of char keys
charName String name of the Main Key

getMainKeyFromCharCode(keys, charCode) ⇒ String

Gets the name of the character from a charCode of the Main key in a KeyboardShortCut

Returns: String - returns a string from the specified UTF code unit

Param Type Description
keys Array.<Object> list of char keys
charCode Number charCode of the Main key

escapeString(string) ⇒ String

Sanitizes a string

Returns: String - An sanitized string

Param Type Description
string String the string to sanitize

unescapeString(string) ⇒ String

De-sanitizes a string

Returns: String - A de-sanitized string

Param Type Description
string String the string to de-sanitize

sanitizeHtmlString(string) ⇒ String

Returns a HTML sanitized string given a string as input

Returns: String - A sanitized string

Param Type Description
string String the string to sanitize

getRelativityPageBaseWindow() ⇒ Object

Returns the window with the Relativity context on it

Returns: Object - A window object with the Relativity context