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.
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:
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.
Last updated