Skip to content
Eric edited this page Apr 12, 2018 · 129 revisions

OGX.Core

OGX.Core as its name indicates, is the core of the application. It can hold multi stages, add/remove windows into stages, add/remove views into stages and windows as well as some other base functions.

OGX.JS stack

Instantiate

 let config = {
      scopes:_ARRAY_  //List of current permissions the user has - Defaults to ['public']
 };
 let app = new OGX.App(config);

Stages

Add a stage to the app

 app.addStage(_STAGE_NAME_, _STAGE_OBJECT, _CONFIG_);

Remove that stage from the app

 app.removeStage(_STAGE_NAME_);

Use another stage (to add/remove views for instance)

 app.useStage(_STAGE_NAME_);

Snooze a stage (all views, windows of this stage)

 app.snoozeStage(_STAGE_NAME_);

Wake a stage (all views, windows of this stage)

 app.wakeStage(_STAGE_NAME_);

Show a stage (and hide the current one if any)

 app.showStage(_STAGE_NAME_, _ANIMATION_);

Add a view to the stage in use

 app.addToStage(_SELECTOR_, _VIEW_, _VIEW_CONFIG_);

Remove a view from the stage in use app.removeFromStage(SELECTOR);

Windows

Add a window to the current stage

 app.addWindow(_CONFIG_);

Get a window of the current stage

 app.getWindow(_WINDOW_NAME_);

Check if a window exists in the current stage

 app.windowExists(_WINDOW_NAME_);

Show a window in the current stage

 app.showWindow(_CONFIG_);

Hide it

 app.hideWindow(_CONFIG_);

Snooze it (and all its views)

 app.snoozeWindow(_WINDOW_NAME_);

Wake a window and its views

 app.wakeWindow(_WINDOW_NAME_);

Blur a window (fires the blur method of a view)

 app.blurWindow(_WINDOW_NAME_);

Focus a window (fires the focus method of a view)

 app.focusWindow(_WINDOW_NAME_);

remove a window

 app.removeWindow(_WINDOW_NAME_);

Add a view to a window

 app.addToWindow(_WINDOW_NAME_, _VIEW_, _VIEW_CONFIG_, _SELECTOR_);

Remove a view from a window

 app.removeFromWindow(_WINDOW_NAME_, _SELECTOR_);

Get the default view for a window if the window uses the default template (no html passed)

 app.getWindowView(_WINDOW_NAME_, _SELECTOR_);

By default, a window has a view element. If SELECTOR is not specified, app will use the default view element to display the view. But you can also create a custom window that holds 2 views (or more - #view1 and #view2 DIVs) and assign a view to each of these elements.

For more information, see Windows

Popups and Overlays

OGX.MobileCore has popups and overlays embedded in its core. A popup is a centered and detached view that can or cannot be placed over an overlay. Overlays can also be used under windows, to create for instance, a sliding menu.

 app.addPopup(_CONFIG_);
 app.removePopup(_ANIMATION_);

For more information about popups, see Popups

To easily add an overlay to the display, do

 app.addOverlay(_CLOSE_ON_CLICK, _ANIMATION_);

This way, it is possible to have different behaviors when it comes to popups and windows. For more information about overlays, see Overlays

Clone this wiki locally