Module: siteKiosk.apps.current

This module provides access to the application that SiteKiosk is currently executing. It contains functions to notify SiteKiosk when the application's initialization is completed as well as functions to obtain information about the current application's guid, configuration, mode, etc.

It also allows listening to application specific events such as hiding.

Example

// After an arbitrary loading time tell SiteKiosk that the loading phase
// is complete and the app is ready to go
    siteKiosk.apps.current.loading("We are waiting for our timeout to trigger...");
    setTimeout(function () {

        siteKiosk.apps.current.ready();

    }, 10000);

Members

<static> events :siteKiosk.apps.current.events

Type:

<static> status :siteKiosk.apps.current.status

Type:

Methods

<static> close()

Closes the app and removes it from the view hierarchy.

<static> deletePrivateData(deleteTempFiles, deleteHistory, completed)

Deletes private data related to the application.
Parameters:
Name Type Description
deleteTempFiles boolean Whether to delete cached files
deleteHistory boolean Whether to delete the browsing history
completed siteKiosk.apps.current~deletePrivateDataCallback Callback, which will be invoked when private data has been deleted

<static> getConfig() → {string}

Gets the current apps configuration, which is typically an XML formatted string.
Returns:
The apps configuration
Type
string

<static> getConfig(callback)

Gets the current apps configuration, which is typically an JSON object.
Parameters:
Name Type Description
callback siteKiosk.apps.current~backCallback The callback, which will be triggered when the config has been loaded.

<static> getGuid() → {string}

Gets the current apps GUID.
Returns:
The GUID
Type
string

<static> getGuid() → {string}

Gets the current apps app GUID.
Returns:
The app GUID
Type
string

<static> getId() → {number}

Gets the apps current instance id.
Returns:
App instance id
Type
number

<static> getId() → {string}

Gets the current apps ID.
Returns:
The app ID
Type
string

<static> getInstanceId() → {string}

Gets the current apps instance ID.
Returns:
The instance ID
Type
string

<static> getMode() → {string}

Gets the current apps mode e.g. "screensaver" or "app"
Returns:
The current mode
Type
string

<static> getNonImmersive() → {boolean}

Gets whether this app is not immersive.
Returns:
Whether this app is not immersive
Type
boolean

<static> getSettings() → {*}

Gets the settings object used to find configuration values.
Returns:
Type
*

<static> getStartMode() → {string}

Gets the current apps start mode (normal, logout, screensaver)
Returns:
The start mode.
Type
string

<static> hide()

Moves the app to the background (hidden).

<static> isActive() → {boolean}

Returns whether the current app is active (resumed) or not (paused).
Returns:
Whether the current app is active (resumed) or not (paused).
Type
boolean

<static> isForeground() → {boolean}

Returns whether the current app is in the foreground (showing) or not (hidden).
Returns:
whether the current app is in the foreground (showing) or not (hidden)
Type
boolean

<static> loading(text)

Tells SiteKiosk, that this app has not completed initialization. When this method is called, SiteKiosk will display an overlay indicating that this app is still loading, showing the message, if provided.
Parameters:
Name Type Argument Description
text string <optional>
Message to be displayed on the loading overlay

<static> onBack(callback) → {siteKiosk.apps.current~eventSubscription}

Registers a callback which will be triggered when this application has received a back command, because the back button has been pressed while the application was in foreground
Parameters:
Name Type Description
callback siteKiosk.apps.current~backCallback The callback, which will be triggered when this application has received a back command
Returns:
An event subscription
Type
siteKiosk.apps.current~eventSubscription

<static> onHide(callback) → {siteKiosk.apps.current~eventSubscription}

Registers a callback, which will be called, when the application has been hidden.
Parameters:
Name Type Description
callback siteKiosk.apps.current~hideCallback The callback, which will be called when the application is no longer in foreground
Returns:
An event subscription
Type
siteKiosk.apps.current~eventSubscription

<static> onHome(callback) → {siteKiosk.apps.current~eventSubscription}

Registers a callback which will be called when the application received a home event.
Parameters:
Name Type Description
callback siteKiosk.apps.current~homeCallback The callback, which will be called when the application has received a home event
Returns:
An event subscription
Type
siteKiosk.apps.current~eventSubscription

<static> onPause(callback) → {siteKiosk.apps.current~eventSubscription}

Registers a callback which will be called when the application has been paused.
Parameters:
Name Type Description
callback siteKiosk.apps.current~pauseCallback The callback, which will be called when the application has been paused
Returns:
An event subscription
Type
siteKiosk.apps.current~eventSubscription

<static> onResume(callback) → {siteKiosk.apps.current~eventSubscription}

Registers a callback which will be called when the application has been resumed.
Parameters:
Name Type Description
callback siteKiosk.apps.current~resumeCallback The callback, which will be called when the application has been resumed
Returns:
An event subscription
Type
siteKiosk.apps.current~eventSubscription

<static> onShow(callback) → {siteKiosk.apps.current~eventSubscription}

Registers a callback which will be called when the application comes to foreground.
Parameters:
Name Type Description
callback siteKiosk.apps.current~showCallback The callback, which will be called when the application is being showed
Returns:
An event subscription
Type
siteKiosk.apps.current~eventSubscription

<static> ready()

Tells SiteKiosk, that this app has completed initialization. As long as this method is not called, SiteKiosk might display an overlay, indicating that this app is still loading

<static> show()

Brings the app to foreground (showing).

Type Definitions

deletePrivateDataCallback()

This callback will be called when private data has been deleted.

eventSubscription

An event subscription.
Type:
  • Object
Properties:
Name Type Description
unbind function Unsubscribes the event

hideCallback()

This callback will be invoked when the application is no longer in foreground.

homeCallback()

This callback will be called when the application received a home event.

pauseCallback()

This callback will be called when the application has been paused.

resumeCallback()

This callback will be called when the application has been resumed.

showCallback()

This callback will be called when the applications comes to foreground.
This module provides access to the application that SiteKiosk is currently executing. It contains functions to notify SiteKiosk when the application's initialization is completed as well as functions to obtain information about the current application's guid, configuration, mode, etc.

It also allows listening to application specific events such as hiding.

Example

// After an arbitrary loading time tell SiteKiosk that the loading phase
// is complete and the app is ready to go
    siteKiosk.apps.current.loading("We are waiting for our timeout to trigger...");
    setTimeout(function () {

        siteKiosk.apps.current.ready();

    }, 10000);

Members

<static> events :siteKiosk.apps.current.events

Type:

<static> status :siteKiosk.apps.current.status

Type:

Methods

<static> close()

Closes the app and removes it from the view hierarchy.

<static> deletePrivateData(deleteTempFiles, deleteHistory, completed)

Deletes private data related to the application.
Parameters:
Name Type Description
deleteTempFiles boolean Whether to delete cached files
deleteHistory boolean Whether to delete the browsing history
completed siteKiosk.apps.current~deletePrivateDataCallback Callback, which will be invoked when private data has been deleted

<static> getConfig() → {string}

Gets the current apps configuration, which is typically an XML formatted string.
Returns:
The apps configuration
Type
string

<static> getConfig(callback)

Gets the current apps configuration, which is typically an JSON object.
Parameters:
Name Type Description
callback siteKiosk.apps.current~backCallback The callback, which will be triggered when the config has been loaded.

<static> getGuid() → {string}

Gets the current apps GUID.
Returns:
The GUID
Type
string

<static> getGuid() → {string}

Gets the current apps app GUID.
Returns:
The app GUID
Type
string

<static> getId() → {number}

Gets the apps current instance id.
Returns:
App instance id
Type
number

<static> getId() → {string}

Gets the current apps ID.
Returns:
The app ID
Type
string

<static> getInstanceId() → {string}

Gets the current apps instance ID.
Returns:
The instance ID
Type
string

<static> getMode() → {string}

Gets the current apps mode e.g. "screensaver" or "app"
Returns:
The current mode
Type
string

<static> getNonImmersive() → {boolean}

Gets whether this app is not immersive.
Returns:
Whether this app is not immersive
Type
boolean

<static> getSettings() → {*}

Gets the settings object used to find configuration values.
Returns:
Type
*

<static> getStartMode() → {string}

Gets the current apps start mode (normal, logout, screensaver)
Returns:
The start mode.
Type
string

<static> hide()

Moves the app to the background (hidden).

<static> isActive() → {boolean}

Returns whether the current app is active (resumed) or not (paused).
Returns:
Whether the current app is active (resumed) or not (paused).
Type
boolean

<static> isForeground() → {boolean}

Returns whether the current app is in the foreground (showing) or not (hidden).
Returns:
whether the current app is in the foreground (showing) or not (hidden)
Type
boolean

<static> loading(text)

Tells SiteKiosk, that this app has not completed initialization. When this method is called, SiteKiosk will display an overlay indicating that this app is still loading, showing the message, if provided.
Parameters:
Name Type Argument Description
text string <optional>
Message to be displayed on the loading overlay

<static> onBack(callback) → {siteKiosk.apps.current~eventSubscription}

Registers a callback which will be triggered when this application has received a back command, because the back button has been pressed while the application was in foreground
Parameters:
Name Type Description
callback siteKiosk.apps.current~backCallback The callback, which will be triggered when this application has received a back command
Returns:
An event subscription
Type
siteKiosk.apps.current~eventSubscription

<static> onHide(callback) → {siteKiosk.apps.current~eventSubscription}

Registers a callback, which will be called, when the application has been hidden.
Parameters:
Name Type Description
callback siteKiosk.apps.current~hideCallback The callback, which will be called when the application is no longer in foreground
Returns:
An event subscription
Type
siteKiosk.apps.current~eventSubscription

<static> onHome(callback) → {siteKiosk.apps.current~eventSubscription}

Registers a callback which will be called when the application received a home event.
Parameters:
Name Type Description
callback siteKiosk.apps.current~homeCallback The callback, which will be called when the application has received a home event
Returns:
An event subscription
Type
siteKiosk.apps.current~eventSubscription

<static> onPause(callback) → {siteKiosk.apps.current~eventSubscription}

Registers a callback which will be called when the application has been paused.
Parameters:
Name Type Description
callback siteKiosk.apps.current~pauseCallback The callback, which will be called when the application has been paused
Returns:
An event subscription
Type
siteKiosk.apps.current~eventSubscription

<static> onResume(callback) → {siteKiosk.apps.current~eventSubscription}

Registers a callback which will be called when the application has been resumed.
Parameters:
Name Type Description
callback siteKiosk.apps.current~resumeCallback The callback, which will be called when the application has been resumed
Returns:
An event subscription
Type
siteKiosk.apps.current~eventSubscription

<static> onShow(callback) → {siteKiosk.apps.current~eventSubscription}

Registers a callback which will be called when the application comes to foreground.
Parameters:
Name Type Description
callback siteKiosk.apps.current~showCallback The callback, which will be called when the application is being showed
Returns:
An event subscription
Type
siteKiosk.apps.current~eventSubscription

<static> ready()

Tells SiteKiosk, that this app has completed initialization. As long as this method is not called, SiteKiosk might display an overlay, indicating that this app is still loading

<static> show()

Brings the app to foreground (showing).

Type Definitions

deletePrivateDataCallback()

This callback will be called when private data has been deleted.

eventSubscription

An event subscription.
Type:
  • Object
Properties:
Name Type Description
unbind function Unsubscribes the event

hideCallback()

This callback will be invoked when the application is no longer in foreground.

homeCallback()

This callback will be called when the application received a home event.

pauseCallback()

This callback will be called when the application has been paused.

resumeCallback()

This callback will be called when the application has been resumed.

showCallback()

This callback will be called when the applications comes to foreground.