Namespace JWL
It holds properties and methods used by JWL
- Defined in: JWL.js
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
JWL global namespace
|
Method Summary
Namespace Detail
JWL
JWL global namespace
Field Detail
<static>
{Object}
JWL.parserConfig
JWL parser configuration
<static>
{String}
JWL.registerPrefix
Default prefix for custom element tags
<static>
{String}
JWL.version
JWL version
Method Detail
-
<static> {Object} JWL.custom(oConfig)Callback to be used as the JWL.Parser custom factory to self-register and to create custom HTML elements. e.g. var oParser = new JWL.Parser({customFactory: 'JWL.custom'});
- Parameters:
- {Object} oConfig
- Configuration object
- Returns:
- {Object} New element
-
<static> {Object} JWL.factory(oConfig)Callback to be used as the JWL.Parser custom factory to create element wrappers. e.g. var oParser = new JWL.Parser({customFactory: 'JWL.factory'});
- Parameters:
- {Object} oConfig
- Configuration object
- Returns:
- {Object} Element wrapper instance
-
<static> {Object} JWL.get(oEl)Gets a wrapper object associated with an element
- Parameters:
- {Object} oEl
- DOM element or element ID
- Returns:
- {Object} Element wrapper, component root element, of null if not found
-
<static> {Object} JWL.load(sData, sWhat, sRoot)Loads component(s) from a string serialization
- Parameters:
- {String} sData
- Parameter description
- {String} sWhat Optional
- Name of a specific component to load
- {String} sRoot Optional
- Dotted path to read the component from the un-serialized object
- Returns:
- {Object} Component configuration
-
<static> {Array} JWL.loadCss(sComponent, fCall, oScope)Loads external CSS for a component using XMLHttpRequest
- Parameters:
- {String} sComponent
- Component name
- {Function} fCall Optional
- If supplied, the CSS will be loaded asynchronously
- {Object} oScope Optional
- Optional scope to run the callback in
- Returns:
- {Array} Array of CSS descriptors
-
<static> {Function} JWL.makeClass(sName, sNewNS, oParser)Creates an element wrapper class for a specific component
- Parameters:
- {String} sName
- Component name or existing HTML tag
- {String} sNewNS Optional
- Optional namespace under to put the class constructor, it defaults to 'JWL.
- {Object} oParser Optional
- Custom instance of JUL.UI.Parser to use instead of the default JWL.parser
- Returns:
- {Function} Class constructor
-
<static> {Function} JWL.register(sName, bDerived, sNewName, oParser)Registers a JWL component as a custom HTML element (W3C web components)
- Parameters:
- {String} sName
- Component name
- {Boolean} bDerived Optional
- Set it to true to register derived a custom HTML element
- {String} sNewName Optional
- Optional new tag name instead of prepending 'jwl-' to the component name
- {Object} oParser Optional
- Custom instance of JUL.UI.Parser to use instead of the default JWL.parser
- Returns:
- {Function} Registered element constructor
-
<static> {String} JWL.save(sWhat)Saves component(s) into a JSON serialization
- Parameters:
- {String} sWhat Optional
- Component to serialize, if omitted all components are saved
- Returns:
- {String} JSON string containing serialized component(s)
-
<static> {Boolean} JWL.trigger(oTarget, sEvent, oInit)Creates and triggers a custom DOM event
- Parameters:
- {Object} oTarget
- Target element or element wrapper to trigger the event on
- {String} sEvent
- Event name
- {Object} oInit Optional
- Hash of additional event properties
- Returns:
- {Boolean} The result of dispatching the event to its cascaded listeners