Skip to content
Eric edited this page Oct 30, 2017 · 129 revisions

Core

OGX.MobileCore as its name indicates, is the core of the mobile 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.

Instantiate

 let config = {
      scopes:_ARRAY_  //List of current permissions the user has - Defaults to ['public']
 };
 let app = new OGX.MobileCore(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(_SELETOR_, _VIEW_, _VIEW_CONFIG_);

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

Windows

 app.addWindow(_WINDOW_NAME_, _CONFIG_, _ANIMATION_, _ZINDEX_);
 app.getWindow(_WINDOW_NAME_);
 app.windowExists(_WINDOW_NAME_);
 app.showWindow(_WINDOW_NAME_, _ANIMATION_, _ANIMATION_PARAMS_);
 app.hideWindow(_WINDOW_NAME_, _CALLBACK_, _ANIMATION_, _ANIMATION_PARAMS_);
 app.snoozeWindow(_WINDOW_NAME_);
 app.wakeWindow(_WINDOW_NAME_);
 app.blurWindow(_WINDOW_NAME_);
 app.focusWindow(_WINDOW_NAME_);
 app.removeWindow(_WINDOW_NAME_);
 app.addToWindow(_WINDOW_NAME_, _VIEW_, _VIEW_CONFIG_, _SELECTOR_);
 app.removeFromWindow(_WINDOW_NAME_, _SELECTOR_);
 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.

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(_WIDTH_, _HEIGHT_, _VIEW_, _VIEW_CONFIG_, _ANIMATION_, _LISTEN_OVERLAY_);
 app.removePopup(_ANIMATION_);

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.

Clone this wiki locally