DevAtlas Viewport and Customization Engine
  • API Overview
  • Documentation Notes
  • Reserved Features
  • Viewport Engine
    • Loading Windows
      • changeViewport()
      • Loading Customization Engine Plugins
    • Account Functions
      • logInAPI()
  • Customization Engine
    • Viewport Window
      • Viewport Window Definition
      • Viewport Window JS Object
      • Viewport Window JSON
    • Sidebar Icon
    • Announcements
Powered by GitBook
On this page
  • Defining the Object:
  • Parameters:
  • Identification Strings:
  • Functions:
  • Accessing Window Information:
  1. Customization Engine
  2. Viewport Window

Viewport Window JS Object

viewportWindowObject(active, pluginID, windowID)

Defining the Object:

You do not need to define the Viewport Window Object. When loaded with the Customization Engine, an object for your window will automatically be created and set to the loadedWindowObject variable. Whenever you need to use the object's functions, use loadedWindowObject.whateverFunctionYouNeed().

Parameters:

active (bool) - Defines weather or not the window is currently being viewed.

pluginID (string) - The plugin ID that your window is a child of. It is structured as company_pluginName.

windowID (string) - The window ID of the window this object represents. It is structured as company_pluginName_windowName

windowCode (string) - The content of the window this object represents.

windowJSON (object) - A sub-object containing information about the window.

iconJSON (object) - A sub-object containing information about the window's icon.

Identification Strings:

The window ID is structured as a child of the plugin ID.

Example:

devatlas_internal (plugin ID)

devatlas_internal_HTML5 (window ID)

Notice: the first two words in the window ID are THE SAME in the plugin ID string! The third word is added to make the window identifier unique.

Functions:

These functions are how you should access data about a window. Do not use your own methods, as it could crash the Viewport Engine.

viewportWindowObject.iconImageURL()
//Returns the image URL of the window's icon
viewportWindowObject.setWindowCode(code)
//Changes the window code
viewportWindowObject.setWindowJSON(JSON)
//Changes the window JSON information. Must be a valid JS object that has the same variables as the window JSON file.
viewportWindowObject.setIconJSON(JSON)
//Changes the icon JSON information. Must be a valid JS object that has the same variables as the icon JSON file.

Accessing Window Information:

Accessing this object's functions:

loadedWindowObject.whateverFunctionYouNeed()

Accessing this object's variables:

loadedWindowObject.variable

Accessing HTML data from your window:

Your window code is stored in a div like this:

<div id="customizationEnginePluginViewer" class="viewport"></div>

You can reference that div when trying to access elements.

You should also name elements in your window with the following format to avoid conflicting with other loaded pages: companyID_pluginID_windowID_elementID.

For example: devatlas_internal_HTML5_newThreadButton

It's more complicated, but it will ensure that there are no ID conflicts on the page, which will cause the Viewport Engine to fail.

PreviousViewport Window DefinitionNextViewport Window JSON

Last updated 3 months ago