Alloy UI

aui-parse-content  1.0.1

 
Filters

Class ParseContent - extends Plugin.Base

A base class for ParseContent, providing:
  • After plug ParseContent on a A.Node instance the javascript chunks will be executed (remote and inline scripts)
  • All the javascripts within a content will be executed according to the order of apparition

NOTE: For performance reasons on DOM manipulation, ParseContent only parses the content passed to the setContent, prepend and append methods.

Quick Example:
node.plug(A.Plugin.ParseContent);
Check the list of Configuration Attributes available for ParseContent.

Constructor

ParseContent ( config )
Parameters:
config <Object> Object literal specifying widget configuration properties.

Properties

ParseContent.ATTRS - static Object

Static property used to define the default attribute configuration for the ParseContent.

ParseContent.NAME - static String

Static property provides a string to identify the class.

ParseContent.NS - static String

Static property provides a string to identify the namespace.

Properties inherited from Attribute:

Properties inherited from Base:

Properties inherited from Plugin.Base:

Configuration attributes inherited from Base:

Configuration attributes inherited from Plugin.Base:

Methods

_bindAOP

protected void _bindAOP ( )
Bind listeners on the insert and setContent methods of the Node instance where you are plugging the ParseContent. These listeners are responsible for intercept the HTML passed and parse them.

_dispatch

protected String _dispatch ( output )
Loop trough all extracted script tags and evaluate them.
Parameters:
output <Object> Object containing the reference for the fragment and the extracted script tags.

clean

protected Object clean ( content )
Create an HTML fragment with the String passed, extract all the script tags and return an Object with a reference for the extracted scripts and the fragment.
Parameters:
content <String> HTML content.

globalEval

void globalEval ( data )
Global eval the data passed.
Parameters:
data <String> JavaScript String.

initializer

protected void initializer ( )
Construction logic executed during ParseContent instantiation. Lifecycle.

parseContent

String parseContent ( content )
Extract the script tags from the string content and evaluate the chunks.
Parameters:
content <String> HTML string

Events inherited from Base:

Events inherited from Plugin.Base: