Namespace: OrionConnection

OrionConnection

Collection of methods private to Connection.

Source:

Methods

<static> activateWindow(starletName)

Unhides, unminimizes, and brings to the front the window the Starlet is in.

Parameters:
Name Type Description
starletName String

Framework name of Starlet.

Source:
See:

<static> bulkMessageStarlets(starletArray)

Sends the same data to multiple Starlets.

Parameters:
Name Type Description
starletArray Array:.<Object:>

List of addressing objects containing data to send.

Source:
See:
Example
var starletArray =
[
   {
       'starlets':
       [
           {
               'starletName' : 'some_starlet',
               'objectName'  : 'window',
               'functionName': 'callback_800'
           },
           
           // ...
       ],
       'data': [], // arguments
   },
   
   // ...
];

OrionConnection.bulkMessageStarlets(starletArray);

<static> closeFramework(restart, clearCache)

Closes the framework.

Parameters:
Name Type Description
restart Boolean

Whether to reopen the Framework after closing.

clearCache Boolean

Whether to clear Browser cache before closing, useful for upgrades.

Source:
See:

<static> closeStarlet(starletName)

Closes the starlet (and it's WebView). This does not check to see if the starlet is the visible one or not.

Parameters:
Name Type Description
starletName String

Framework name of Starlet.

Source:
See:

<static> focusStarlet(starletName, focus)

Controls keyboard focus of a named Starlet .

Parameters:
Name Type Description
starletName String

Framework name of Starlet.

focus Boolean

Whether the Starlet should gain or lose keyboard focus.

Source:
Example
OrionConnection.focusStarlet('orion_app_messages', true);

<static> getFrameworkSettings(objectName, callbackName)

Asks the framework to return the current framework settings for start on login and start minimized. The callback will return an object identical to that described in setFrameworkSettings.

Parameters:
Name Type Argument Default Description
objectName String <optional>
'window'

Namespace containing method.

callbackName String

Name of method.

Source:
See:
Fires:
Example
OrionConnection.getFrameworkSettings('', 'settingsCallback');

function settingsCallback(data)
{
   var startOnLogin   = data.start,
       startMinimized = data.minimize;
   
   // ...
}

<static> getLocalStarlets(objectName, callbackName)

Gets a list of local starlets listed in starlets.sql (if there are any to get).

Parameters:
Name Type Argument Default Description
objectName String <optional>
'window'

Namespace containing method.

callbackName String

Name of method.

Source:
Fires:
Example
OrionConnection.getLocalStarlets('', 'localStarletCallback');

function localStarletCallback(starletObject)
{
   // ...
}

<static> hideWindow(starletName)

Hides the window the starlet is in.

Parameters:
Name Type Description
starletName String

Framework name of Starlet.

Source:
See:

<static> loadHTML(starletName, html)

Loads HTML content in the Starlet.

Parameters:
Name Type Description
starletName String

Framework name of Starlet.

html String

Content to replace with.

Source:
See:
To Do:
  • Determine if HTML needs to be escaped in any way.
Example
OrionConnection.loadHTML('navigation' ,"<html><head><title>Test</title></head><body>Navigation!</body></html>");

<static> loadURL(starletName, url)

Loads a URL in the Starlet.

Parameters:
Name Type Description
starletName String

Framework name of Starlet.

url String

Location to navigate to.

Source:
See:

<static> logoffApplication()

Log off and return to the splash screen.

Source:
See:

<static> logoffApplicationWithMessage()

Log off and return to the splash screen while displaying a message.

Source:
See:

<static> messageAllStarlets(starletName, objectName, callbackName, arguments)

Calls a javascript function in all Starlets except Connection.

Parameters:
Name Type Argument Default Description
starletName String

Framework name of Starlet.

objectName String <optional>
'window'

Namespace containing method.

callbackName String

Name of method.

arguments Array:.<(Object:|Array:|String:|Number:|Boolean:)>

Parameters to pass to method.

Source:
See:

<static> messageStarlet(starletName, objectName, callbackName, arguments)

Calls a javascript function of the Starlet specified by starletName.

Parameters:
Name Type Argument Default Description
starletName String

Framework name of Starlet.

objectName String <optional>
'window'

Namespace containing method.

callbackName String

Name of method.

arguments Array:.<(Object:|Array:|String:|Number:|Boolean:)>

Parameters to pass to method.

Source:
See:

<static> openStarlets(starletObject)

Used to give the framework a list of starlets to open.

Parameters:
Name Type Description
starletObject Object:.<Object:>

Indexed object whose keys are Framework names of Starlets. Properties in sub-objects correspond to starlets.sql.

Properties
Name Type Description
starlet_id Number

Framework's id of Starlet (internal, must only ascend).

name String

Framework name of Starlet.

title String

Display name of Starlet.

type String

Determines permissions/abilities and methods available to Starlet.

url String

Location of Starlet's WebView.

width Number

Desired width of Starlet's WebView (px).

height Number

Desired height of Starlet's WebView (px).

starlet_order Number

Framework's ordering of Starlet (deprecated, use 0).

Source:
See:
To Do:
  • Only requires a subset of SQL columns, verify which are necessary.

<static> reloadAllStarlets()

Reloads all Starlets except Connection.

Source:
See:

<static> reloadStarlet(starletName, ignoreCache)

Reloads the Starlet specified by starletName.

Parameters:
Name Type Description
starletName String

Framework name of Starlet.

ignoreCache Boolean

Whether to fetch from server when reloading.

Source:
See:

<static> reloadStarletWithURL(starletName, url)

Reloads the Starlet specified by starletName.

Parameters:
Name Type Description
starletName String

Framework name of Starlet.

url String

New location to load in Starlet's WebView.

Source:
See:

<static> resizeWindow(starletName, width, height)

Resizes the webview the starlet is in.

Parameters:
Name Type Description
starletName String

Framework name of Starlet.

width Number

Desired width of WebView (px).

height Number

Desired height of WebView (px).

Source:
See:

<static> setAnimationStepCallback(objectName, callbackName)

Sets a callback to alert you that there is an animation in progress, and give you the pixel values for this frame of animation.

Parameters:
Name Type Argument Default Description
objectName String <optional>
'window'

Namespace containing method.

callbackName String

Name of method.

Source:
See:
Fires:
Example
OrionConnection.setAnimationStepCallback('', 'animationCallback');

function animationCallback(event)
{
   if (event.eventName == 'animationStep')
   {
       var x = event.x,
           y = event.y;
       
       // ...
   }
}

<static> setCrashCallback(objectName, callbackName)

Sets a callback to alert you that a starlet has been terminated unexpectedly. It will pass along the starlet name and a status code.

Parameters:
Name Type Argument Default Description
objectName String <optional>
'window'

Namespace containing method.

callbackName String

Name of method.

Source:
See:
Example
OrionConnection.setCrashCallback('', 'crashCallback');

function crashCallback(starletName, status)
{
   // ...
}

<static> setFrameworkSettings(data)

Sets framework specific settings that must be stored locally.

Parameters:
Name Type Description
data Object:.<Boolean:>

Key/value pairs to save.

Properties
Name Type Description
start Boolean

Whether the Framework should start on logging into the OS.

minimize Boolean

When start is true, whether framework should start minimized.

Source:
See:
Example
OrionConnection.setLinkCallback('', 'linkCallback');

function linkCallback(data)
{
   // URL in the format 'orionapp://hello?foo=bar&bar=spam'
}

<static> setKeyboardShortcut(keyCode, modifiers, objectName, callbackName)

Sets a global keyboard shortcut. When the shortcut is used, it will call your callback.

Parameters:
Name Type Argument Default Description
keyCode Number

Raw JavaScript keyCode.

modifiers Number

ORed together modifier values.

objectName String <optional>
'window'

Namespace containing method.

callbackName String

Name of method.

Source:
See:
Example
var modifiers = 0;

modifiers |= 1; // adding in ALT
modifiers |= 8; // adding in SHIFT

// modifiers is now ALT + SHIFT.

OrionConnection.setKeyboardShortcut(keyCode, modifiers, '', 'keyboardCallback');

function keyboardCallback(eventType, repeat)
{
   // eventType 0 - keyDown
   // eventType 1 - keyDown
   // eventType 2 - keyUp
   // eventType 3 - keyChar

   // if repeat = true it's a repeat keypress (due to being held down) KEYDOWN EVENTS ONLY

   // the shortcut you set was used
}

<static> setKeyboardShortcut(keyCode, modifiers, objectName, callbackName)

Called with a blank objectName and callbackName to unset the callback.

Parameters:
Name Type Description
keyCode Number

Raw JavaScript keyCode.

modifiers Number

ORed together modifier values.

objectName String

''

callbackName String

''

Source:
See:
Example
var modifiers = 0;

modifiers |= 1; // adding in ALT
modifiers |= 8; // adding in SHIFT

// modifiers is now ALT + SHIFT.

OrionConnection.setKeyboardShortcut(keyCode, modifiers, '', '');

<static> setLinkCallback(objectName, callbackName)

Sets a callback to alert you that an ORIONAPP link was pressed. It will pass along a string of the "url" to your callback function. Note that if the framework was started via an ORIONAPP link, the framework will call this callback as soon as it's registered.

Parameters:
Name Type Argument Default Description
objectName String <optional>
'window'

Namespace containing method.

callbackName String

Name of method.

Source:
See:
Fires:
Example
OrionConnection.setLinkCallback('', 'linkCallback');

function linkCallback(data)
{
   // URL in the format 'orionapp://hello?foo=bar&bar=spam'
}

<static> setStarletAPIKey(key, password)

Tells the framework the starlet API key and password.

Parameters:
Name Type Description
key String

New API key.

password String

New API password.

Source:
Example
OrionConnection.setStarletAPIKey('new_key', 'new_password');

<static> setUserPassword(passwordHash)

Sets the framework saved password to passwordHash, if changed in settings.

Parameters:
Name Type Description
passwordHash String

Hash of new password.

Source:
Example
OrionConnection.setUserPassword('57392Efksjei291');

<static> showWindow(starletName)

Shows a window that a starlet is in that has been hidden.

Parameters:
Name Type Description
starletName String

Framework name of Starlet.

Source:
See:

<static> unsetAnimationStepCallback()

Clears the animation step callback, stopping those events from being sent.

Source:
See:

<static> unsetCrashCallback()

Clears the crash callback, stopping those events from being sent.

Source:
See:

<static> unsetLinkCallback()

Clears the link callback, stopping those events from being sent.

Source:
See:

<static> xmppStatus(state, msg)

Used to update the framework of the status of the xmpp connection.

Parameters:
Name Type Description
state String

State of XMPP connection.

msg String

Description of state.

Deprecated:
  • since version 1.9
Source: