Sandbox for Modules of Legal Box Scalable JavaScript Application
A new instance of Sandbox gets attributed to each instance of Module. It acts both as a proxy and a facade to the application core, restricting modifications to the box assigned to the module, an HTML element which encloses the module.
The methods related to the module itself are defined on the Sandbox. Other methods are defined by separate plugin modules.
The plugins are loaded by the Sandbox Builder. The sandbox API can be customized by configuring a different sandbox builder to load additional or alternative plugins. See lb.core.plugins.builder for details.
Eric Bréchemier © 2011-2013, Some Rights Reserved Legal-Box SAS © 2010-2011, All Rights Reserved
BSD License http://creativecommons.org/licenses/BSD/
2013-09-10
lb. | Sandbox for Modules of Legal Box Scalable JavaScript Application |
Functions | |
new Sandbox(id): Sandbox | Constructor of a new Sandbox. |
sandbox. | Get the identifier of the module, when optional parameter is omitted. |
sandbox. | Get the root HTML element for this module. |
sandbox. | Check whether the given element is in the box. |
Constructor of a new Sandbox.
id | string, the identifier of the module, which is also the id of the root HTML element for this module. If the element does not exist in the document, it will get created on the first call to getBox(). |
object, the new instance of Sandbox
Get the identifier of the module, when optional parameter is omitted. With optional parameter, get the full identifier corresponding to the given local identifier.
localId | string, optional local identifier |
string, the identifier of the module, as provided in constructor, or the full identifier corresponding to given local identifier.
The full identifier is made of the module identifier, followed by the separator ‘.’, followed by the local identifier.
Get the root HTML element for this module.
createIfMissing | boolean, optional, defaults to true, Whether to create the box element if it is not found in the document. Note: In case createIfMissing is true (by default) and no HTML element is found in the document with the module id, a new div element is created with this id and inserted last in the document body. |