Class: AutoLauncher

Kekule.Widget. AutoLauncher

new AutoLauncher()

Helper class to create and bind Kekule widgets while loading HTML page. Generally, the auto launcher will iterate through elements in document. If an element is with a data-widget attribute, it will be regarded as a Kekule related one. Then a specified Kekule widget will be created (according to data-widget attribute) on this tag. Widget property will also be set from "data-XXX" attribute.
Source:

Members

(static) deferring

If true, the launch process on each element will be deferred, try not to block the UI.
Source:

(static) enableCascadeLaunch

A flag to enable or disable launching child widgets inside a widget element.
Source:

(static) enabled

A flag to turn on or off auto launcher.
Source:

(static) enableDynamicDomCheck

A flag to enable or disable checking dynamic inserted content in HTML page.
Source:

(static) enableOnEditable

A flag to enable or disable launching widgets on element in HTML editor (usually should not).
Source:

(static) PlaceHolderStrategies

PlaceHolder creation strategy for autolauncher
Properties:
Name Type Description
DISABLED PlaceHolder will be totally disabled.
IMPLICIT Placeholder will be created when possible.
EXPLICIT Placeholder will only be created when attribute placeholder is explicitly set to true in element.
Source:

(static) placeHolderStrategy

If true, Placeholder maybe created during auto launching.
Source:

Methods

execute(rootElem, deferCreation, callback)

Launch all widgets inside element.
Parameters:
Name Type Description
rootElem HTMLElement
deferCreation Bool
callback Func A callback function that will be called when the task is done (since deferCreation may be true).
Source:

executeOnElemBySelector(doc, rootElem, parentWidget)

Execute launch process on element and its children. Widget created will be set as child of parentWidget. This method will use querySelector method to perform a fast launch on supported browser.
Parameters:
Name Type Description
doc HTMLDocument
rootElem HTMLElement
parentWidget Kekule.Widget.BaseWidget Can be null.
Source:

isElemLaunchable(elem) → {Bool}

Return whether the element should be launched as a widget.
Parameters:
Name Type Description
elem HTMLElement
Source:
Returns:
Type
Bool

Kekule.Widget. AutoLauncher

new AutoLauncher()

Source:

Members

(static) deferring

If true, the launch process on each element will be deferred, try not to block the UI.
Source:

(static) enableCascadeLaunch

A flag to enable or disable launching child widgets inside a widget element.
Source:

(static) enabled

A flag to turn on or off auto launcher.
Source:

(static) enableDynamicDomCheck

A flag to enable or disable checking dynamic inserted content in HTML page.
Source:

(static) enableOnEditable

A flag to enable or disable launching widgets on element in HTML editor (usually should not).
Source:

(static) PlaceHolderStrategies

PlaceHolder creation strategy for autolauncher
Properties:
Name Type Description
DISABLED PlaceHolder will be totally disabled.
IMPLICIT Placeholder will be created when possible.
EXPLICIT Placeholder will only be created when attribute placeholder is explicitly set to true in element.
Source:

(static) placeHolderStrategy

If true, Placeholder maybe created during auto launching.
Source:

Methods

execute(rootElem, deferCreation, callback)

Launch all widgets inside element.
Parameters:
Name Type Description
rootElem HTMLElement
deferCreation Bool
callback Func A callback function that will be called when the task is done (since deferCreation may be true).
Source:

executeOnElemBySelector(doc, rootElem, parentWidget)

Execute launch process on element and its children. Widget created will be set as child of parentWidget. This method will use querySelector method to perform a fast launch on supported browser.
Parameters:
Name Type Description
doc HTMLDocument
rootElem HTMLElement
parentWidget Kekule.Widget.BaseWidget Can be null.
Source:

isElemLaunchable(elem) → {Bool}

Return whether the element should be launched as a widget.
Parameters:
Name Type Description
elem HTMLElement
Source:
Returns:
Type
Bool