tinymce.html.Schema

Namespace tinymce.html
Class Schema
Schema validator class.
Version:3.4

Example

Public Methods

Method Defined By
Schema(settings:Object)
Constructs a new Schema instance.
Schema
addCustomElements(custom_elements:String):void
Adds custom non HTML elements to the schema.
Schema
addValidChildren(valid_children:String):void
Parses a valid children string and adds them to the schema structure.
Schema
addValidElements(valid_elements:String):void
Parses a valid elements string and adds it to the schema.
Schema
getBoolAttrs():Object
Returns a map with boolean attributes.
Schema
getBoolAttrs():Object
Returns a map with block elements.
Schema
getElementRule(name:String):Object
Returns true/false if the specified element is valid or not according to the schema.
Schema
Returns a map with empty elements.
Schema
Returns a map with elements where white space is to be preserved like PRE or SCRIPT.
Schema
isValidChild(name:String, child:String):Boolean
Returns true/false if the specified element and it's child is valid or not according to the schema.
Schema
setValidElements(valid_elements:String):void
Parses a valid elements string and sets it to the schema.
Schema

Method details

Schemaconstructor

public function Schema(settings:Object)
Constructs a new Schema instance.

Parameters

settings:Object Name/value settings object.

addCustomElementsmethod

public function addCustomElements(custom_elements:String):void
Adds custom non HTML elements to the schema.

Parameters

custom_elements:String Comma separated list of custom elements to add.

addValidChildrenmethod

public function addValidChildren(valid_children:String):void
Parses a valid children string and adds them to the schema structure. The valid children format is for example: "element[child1|child2]".

Parameters

valid_children:String Valid children elements string to parse

addValidElementsmethod

public function addValidElements(valid_elements:String):void
Parses a valid elements string and adds it to the schema. The valid elements format is for example "element[attr=default|otherattr]". Existing rules will be replaced with the ones specified, so this extends the schema.

Parameters

valid_elements:String String in the valid elements format to be parsed.

getBoolAttrsmethod

public function getBoolAttrs():Object
Returns a map with boolean attributes.

Returns

Object - Name/value lookup map for boolean attributes.

getBoolAttrsmethod

public function getBoolAttrs():Object
Returns a map with block elements.

Returns

Object - Name/value lookup map for block elements.

getElementRulemethod

public function getElementRule(name:String):Object
Returns true/false if the specified element is valid or not according to the schema.

Parameters

name:String Element name to check for.

Returns

Object - Element object or undefined if the element isn't valid.

getEmptyElementsmethod

public function getEmptyElements():Object
Returns a map with empty elements.

Returns

Object - Name/value lookup map for empty elements.

getWhiteSpaceElementsmethod

public function getWhiteSpaceElements():Object
Returns a map with elements where white space is to be preserved like PRE or SCRIPT.

Returns

Object - Name/value lookup map for white space elements.

isValidChildmethod

public function isValidChild(name:String, child:String):Boolean
Returns true/false if the specified element and it's child is valid or not according to the schema.

Parameters

name:String Element name to check for.
child:String Element child to verify.

Returns

Boolean - True/false if the element is a valid child of the specified parent.

setValidElementsmethod

public function setValidElements(valid_elements:String):void
Parses a valid elements string and sets it to the schema. The valid elements format is for example "element[attr=default|otherattr]". Existing rules will be replaced with the ones specified, so this extends the schema.

Parameters

valid_elements:String String in the valid elements format to be parsed.