Methods
_doLog(debugMessage){undefined}
Parameters
Name |
Type |
Description |
debugMessage |
Object
|
Message object to be logged (returned by this.getMessageObject method) |
Does actual logging to console (and log file is file logging is enabled)
_getStack(){array}
Helper method for getting call stack array for debug or user message objects
addBoundMethods(){undefined}
Method that sets up this.boundMethods property by binding this objects
functions to itself to be used as event listener handlers
addClass(element, className){HTMLElement}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to add class to |
className |
string
|
Array.<string>
|
Class name to add |
Adds css class to element
addDesktopNotification(message, data, dontTranslate, options, callbacks){undefined}
Parameters
Name |
Type |
Description |
message |
string
|
Notification message |
data |
array
|
An array of data strings that are to be applied to notification |
dontTranslate |
Boolean
|
Flag to prevent automatic notification translation |
options |
Object
|
Desktop notification options (passed to HTML5 Notification object constructor) |
callbacks |
Object
|
Object with onshow, onClicked, onClosed and onerror notification handlers |
Displays desktop notification
Notification message is being interpolated by replacing placeholders
such as '{1}', '{2}' etc. by corresponding values from 'data' argument
addEventListeners(){undefined}
Adds event listeners for this object
addModalMessage(message, type, data, important, dontTranslate, force, passToDebug){undefined}
Parameters
Name |
Type |
Description |
message |
string
|
Message to be logged |
type |
string
|
Type of log message (debug, info, warning, error) |
data |
array
|
An array of data strings that are to be applied to logging message |
important |
Boolean
|
Flag to indicate message importance |
dontTranslate |
Boolean
|
Flag to prevent automatic message translation |
force |
Boolean
|
Flag to force message output even if configuration wouldn't allow it |
passToDebug |
Boolean
|
Flag to force passing same message to debug log |
Adds modal message to currently open modal dialog
Message is being interpolated by replacing placeholders
such as '{1}', '{2}' etc. by corresponding values from 'data' argument
addNotification(message, type, data, dontTranslate, options){undefined}
Parameters
Name |
Type |
Description |
message |
string
|
Notification message |
type |
string
|
Notification message type |
data |
array
|
An array of data strings that are to be applied to notification |
dontTranslate |
Boolean
|
Flag to prevent automatic notification translation |
options |
Object
|
Additional notification options |
Displays app notification
Notification message is being interpolated by replacing placeholders
such as '{1}', '{2}' etc. by corresponding values from 'data' argument
addUserMessage(message, type, data, important, dontTranslate, force, passToDebug){undefined}
Parameters
Name |
Type |
Description |
message |
string
|
Message to be logged |
type |
string
|
Type of log message (debug, info, warning, error) |
data |
array
|
An array of data strings that are to be applied to logging message |
important |
Boolean
|
Flag to indicate message importance |
dontTranslate |
Boolean
|
Flag to prevent automatic message translation |
force |
Boolean
|
Flag to force message output even if configuration wouldn't allow it |
passToDebug |
Boolean
|
Flag to force passing same message to debug log |
Logs user message if conditions are met
Message is being interpolated by replacing placeholders
such as '{1}', '{2}' etc. by corresponding values from 'data' argument
asyncMessage(data){mixed}
Parameters
Name |
Type |
Description |
data |
Object
|
Message data object |
Emits 'asyncMessage' global event, listened by main script
asyncMessageInfo(data, verboseOutput){Object}
Parameters
Name |
Type |
Description |
data |
Object
|
Message data.data object |
verboseOutput |
Boolean
|
Toggles verbose output |
Returns info on async messages that can be passed to mainScript
canPasteText(element){Boolean}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to check |
Checks whether text can be pasted into given element
clearIntervals(){undefined}
Clears all intervals bound to this AppWrapper instance
clearTimeouts(){undefined}
Clears all timeouts bound to this AppWrapper instance
destroy(){undefined}
Destructor method - cleans up references for this instance
freeing memory upon object destruction
extendElementProto(){undefined}
Extends HTMLElement prototype with methods from htmlHelper
finalize(){Boolean}
Finalizes current class instance, setting up any additional properties
etc. Entire app structure, including frontend app is available here
forceSize(element, elementHeight, elementWidth){undefined}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to set fixed size on |
elementHeight |
Number
|
Optional height value to force element size |
elementWidth |
Number
|
Optional width value to force element size |
Forces element width and height to values from the arguments, if values are omitted, current element size is used
getAbsolutePosition(element){Object}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to get position for |
Gets absolute position for element
getAppState(){Object}
Helper method to get appState object
getAppWrapper(){AppWrapper}
Helper method to get appWrapper instance
getCloneRealDimensions(element, selector){Object}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to get dimensions (or parent in which selector argument will be applied) |
selector |
string
|
Optional selector to filter children in 'element' argument |
Gets element "real" dimensions, by cloning given element
getComputedStyle(element, propName){mixed}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to get style for |
propName |
string
|
Style property to get |
Returns single computed style property for given element
getComputedStyles(element){Object}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to get styles for |
Returns all computed styles for given element
getConfig(name, defaultValue){mixed}
Parameters
Name |
Type |
Description |
name |
string
|
String representing path to requested var (i.e. 'appConfig.appInfo.name') |
defaultValue |
mixed
|
Default value to be returned if configuration var is not found |
Returns configuration var value
getDebugMessageFileLine(message){string}
Parameters
Name |
Type |
Description |
message |
obj
|
Message object to be logged (returned by this.getMessageObject method) |
Returns string representing log line for appending
to debug log file
getDebugMessageFilePath(){string}
Returns path to debug message log file
getElementDefaultDisplay(element){string}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to get value for |
Gets default 'display' css property value for given element
getElementStyles(element){Object}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to get styles for |
Returns current element style values from style attribute
getHelper(name){Object}
Parameters
Name |
Type |
Description |
name |
string
|
Name of the helper |
Returns instance of helper object based on passed parameter (or false if helper can't be found)
getInputValue(element){string}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to get value from |
Gets input value for input elements
getMessageFileLine(message){string}
Parameters
Name |
Type |
Description |
message |
obj
|
Message object to be logged (returned by this.getMessageObject method) |
Gets JSON represenation of message object for saving into log file,
removing unneccessary properties and adding necessary ones
getMessageObject(messageLevel, message, type, data, important, dontTranslate, force){Object}
Parameters
Name |
Type |
Description |
messageLevel |
int
|
Number representing current message level (0=debug, 1=info, 2=warning, 3=error) |
message |
string
|
Message to be logged |
type |
string
|
Type of log message (debug, info, warning, error) |
data |
array
|
An array of data strings that are to be applied to logging message |
important |
Boolean
|
Flag to indicate message importance |
dontTranslate |
Boolean
|
Flag to prevent automatic message translation |
force |
Boolean
|
Flag to force message output even if configuration wouldn't allow it |
Returns prepared message object based on passed arguments.
Message is being interpolated by replacing placeholders
such as '{1}', '{2}' etc. by corresponding values from 'data' argument
getMessageObjectRow(index, messageRowData){Object}
Parameters
Name |
Type |
Description |
index |
mixed
|
Key or array index |
messageRowData |
Object
|
Message row data for logging |
Gets single row for tabular message logging
getParentByClass(element, targetClass){HTMLElement}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element whose parents will be searched |
targetClass |
string
|
Class name for searching |
Returns first element in parent tree that has given class name
getRealDimensions(element, selector){Object}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to get dimensions (or parent in which selector argument will be applied) |
selector |
string
|
Optional selector to filter children in 'element' argument |
Gets element "real" dimensions, taking paddings, borders etc. into consideration
getStateVar(varPath, defaultValue){mixed}
Parameters
Name |
Type |
Description |
varPath |
string
|
String representing path to requested var (i.e. 'appData.appMainData.cancelable') |
defaultValue |
mixed
|
Default value to be returned if appState var is not found |
Returns appState var value
getTableMessageData(message){Object}
Parameters
Name |
Type |
Description |
message |
Object
|
Tabular data |
Prepares table data for tabular message logging
getTransitionDuration(element){Number}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element for which should transition-duration be returned |
Gets transition duration in milliseconds for given element
getUniqueElementIdentifier(element, setAttr){string}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to set identifier on |
setAttr |
Boolean
|
Flag to indicate whether to set 'data-identifier' attribute on element |
Sets or returns elements unique identifier
getUserMessageFileLine(message){string}
Parameters
Name |
Type |
Description |
message |
obj
|
Message object to be logged (returned by this.getMessageObject method) |
Returns string representing log line for appending
to user message log file
getUserMessageFilePath(){string}
Returns path to user message log file
globalEmit(eventName, data){undefined}
Parameters
Name |
Type |
Description |
eventName |
String
|
Name of the event |
data |
Object
|
Event data object |
Emits event to globalEmitter (listened by both main script and app code)
hasClass(element, className){Boolean}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to check |
className |
string
|
Class name to check |
Checks whether given element has certain className
hide(element){undefined}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to hide |
Hides the element
initialize(){HtmlHelper}
Initializes htmlHelper and extends HTMLElement prototype with its methods
Parameters
Name |
Type |
Description |
options |
Object
|
Options for logging initialization (currently only 'silent' property is used, determining whether warnings should be printed if no config found) |
Determines whether logging for this class is regulated through
configuration, setting the logging by it (or warning if there
are no configuration settings for this class)
isDebugEnabled(){Boolean}
Checks whether debug mode is on
isTextSelectable(element){Boolean}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to check |
Checks whether text in given element can be selected
log(message, type, data, force){undefined}
Parameters
Name |
Type |
Description |
message |
string
|
Message to be logged |
type |
string
|
Type of log message (debug, info, warning, error, group, groupCollaped, groupend) |
data |
array
|
An array of data strings that are to be applied to logging message |
force |
Boolean
|
Flag to force logging output even if config does not allow it |
Logs debug message if conditions are met
Message is being interpolated by replacing placeholders
such as '{1}', '{2}' etc. by corresponding values from 'data' argument
makeInvisible(element){undefined}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to hide |
Hides hidden element by setting 'visibility' css property
makeVisible(element){undefined}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to show |
Shows hidden element by setting 'visibility' css property
message(data){undefined}
Parameters
Name |
Type |
Description |
data |
Object
|
Event data object |
Emits 'message' global event, listened by main script
messageInfo(data, verboseOutput){Object}
Parameters
Name |
Type |
Description |
data |
Object
|
Message data.data object |
verboseOutput |
Boolean
|
Toggles verbose output |
Returns info on messages that can be passed to mainScript
messageInfoOutput(messageData, verboseOutput){undefined}
Parameters
Name |
Type |
Description |
messageData |
Object
|
Message response data |
verboseOutput |
Boolean
|
Toggles verbose output |
Logs messages info to console
parentQuerySelector(element, selector){Boolean|HTMLElement}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to search |
selector |
String
|
Selector to search |
Returns first parent element that has children matching selector
removeBoundMethods(){undefined}
Method that cleans up this.boundMethods property
set in this.addBoundMethods method
removeClass(element, className){HTMLElement}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to remove class from |
className |
string
|
Array.<string>
|
Class name to remove |
Removes css class from element
removeElementStyles(element, propertyNames){undefined}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to remove styles from |
propertyNames |
Array.<string>
|
An array of style property names to remove |
Removes style properties from element style attribute
removeEventListeners(){undefined}
Removes event listeners for this object
resetAppError(){undefined}
Resets (turns off) application error, removing app-error component
scrollElementStep(element, stepIncrease, finalValue){undefined}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to scroll |
stepIncrease |
Number
|
Value for each scrolling step |
finalValue |
Number
|
Final element scroll value |
Helper method for animated element scrolling, used by this.scrollElementTo
scrollElementTo(element, to, duration){undefined}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to scroll |
to |
Number
|
Value to scroll to |
duration |
Number
|
Duration for animated scrolls |
Scrolls element to given value
scrollParentToElement(element, duration){undefined}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element whose parent will be scrolled |
duration |
Number
|
Duration for animated scrolls |
Scrolls parent until its child element is visible
selectAll(element){undefined}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to select |
Selects all text in element
setAppError(title, text, debugText, data, doNotTranslate, messageType, omitIcon){undefined}
Parameters
Name |
Type |
Description |
title |
String
|
App error title |
text |
String
|
App error text |
debugText |
String
|
App error debug text (shown only if debug is enabled) |
data |
Array.<String>
|
An array with replacement data for error title, text and debugText |
doNotTranslate |
Boolean
|
Flag to prevent automatic traslation of title and text |
messageType |
String
|
null
|
Type of messages to show in app-error ('user', 'debug' or null) |
omitIcon |
Boolean
|
Flag to control app-error icon rendering |
Sets (turns on) application error, triggering rendering of app-error component
setElementStyles(element, styles, merge){undefined}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Html element for style manipulation |
styles |
array
|
An array of objects representing style properties to set |
merge |
Boolean
|
Flag to indicate merging existing styles with new ones instead of rewriting entire style attribute |
Sets element CSS styles
setFixedSize(element, elementHeight, elementWidth){undefined}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to set fixed size on |
elementHeight |
Number
|
Optional height value to force element size |
elementWidth |
Number
|
Optional width value to force element size |
Sets element width and height to current values, forcing its size to be fixed
setInputValue(element, value){undefined}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to set value for |
value |
mixed
|
Value to set |
Sets input element value
show(element){undefined}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to show |
Shows hidden element
toggle(element){undefined}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to show or hide |
Shows or hides an element
toggleClass(element, className){HTMLElement}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to toggle class on |
className |
string
|
Class name to toggle |
Toggles css class on element
toggleVisibility(element){undefined}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to toggle visibility on |
Toggles 'visibility' css property, showing or hiding the element
translate(text, currentLanguage, data){string}
Parameters
Name |
Type |
Description |
text |
string
|
Text to be translated |
currentLanguage |
string
|
Curent language code |
data |
array
|
An array of data strings that are to be applied to translated message |
Returns translated value for passed arguments
Translation is being interpolated by replacing placeholders
such as '{1}', '{2}' etc. by corresponding values from 'data' argument
triggerCustomEvent(element, eventName, eventOptions){undefined}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to trigger event on |
eventName |
string
|
Name of the event |
eventOptions |
Object
|
Object with event options |
Triggers custom event on the element
unforceSize(element){undefined}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to unset fixed size on |
Removes forced size values from element style
unsetFixedSize(element){undefined}
Parameters
Name |
Type |
Description |
element |
HTMLElement
|
Element to unset fixed size on |
Removes fixed size set by this.setFixedSize method