Documentation

Inspector

isText

Arguments
value Mixed

Returns: Boolean

Check if the value is the text (not html) or the text node.

var is = this.inspector.isText(value);

isInlineTag

Arguments
tag String

Returns: Boolean

Check if the tag is a inline tag.

var is = this.inspector.isInlineTag('b');

isBlockTag

Arguments
tag String

Returns: Boolean

Check if the tag is a block tag.

var is = this.inspector.isBlockTag('p');

isTableCellTag

Arguments
tag String

Returns: Boolean

Check if the tag is a table cell tag (td or th).

var is = this.inspector.isTableCellTag('td');

isHeadingTag

Arguments
tag String

Returns: Boolean

Check if the tag is a heading tag (h1, h2, h3, h4, h5, h6).

var is = this.inspector.isHeadingTag('h1');

parse

Arguments
el Node Element Dom

Returns: Object

Parse the element to the inspector object.

var data = this.inspector.parse(el);

isEditor

Returns: Boolean

Check if the element is the editor node.

var data = this.inspector.parse(el);
var is = data.isEditor();

isInEditor

Returns: Boolean

Check if the element is in the editor.

var data = this.inspector.parse(el);
var is = data.isInEditor();

isComponent

Returns: Boolean

Check if the element is a component (widget, variable etc).

var data = this.inspector.parse(el);
var is = data.isComponent();

isComponentType

Arguments
type String

Returns: Boolean

Check if the element is a component and has the specified type.

var data = this.inspector.parse(el);
var is = data.isComponentType('widget');

isComponentEditable

Returns: Boolean

Check if the element is a component and is editable (table or code in the figure).

var data = this.inspector.parse(el);
var is = data.isComponentEditable();

isFigcaption

Returns: Boolean

Check if the element is a figcaption.

var data = this.inspector.parse(el);
var is = data.isFigcaption();

isPre

Returns: Boolean

Check if the element is a pre.

var data = this.inspector.parse(el);
var is = data.isPre();

isCode

Returns: Boolean

Check if the element is a code.

var data = this.inspector.parse(el);
var is = data.isCode();

isList

Returns: Boolean

Check if the element is a list (ul or ol).

var data = this.inspector.parse(el);
var is = data.isList();

isFirstListItem

Returns: Boolean

Check if the element is the first list item (first li tag).

var data = this.inspector.parse(el);
var is = data.isFirstListItem();

isLastListItem

Returns: Boolean

Check if the element is the last list item (last li tag).

var data = this.inspector.parse(el);
var is = data.isLastListItem();

isFirstTableCell

Returns: Boolean

Check if the element is the first table cell (td or th tag).

var data = this.inspector.parse(el);
var is = data.isFirstTableCell();

isLastTableCell

Returns: Boolean

Check if the element is the last table cell (td or th tag).

var data = this.inspector.parse(el);
var is = data.isLastTableCell();

isTable

Returns: Boolean

Check if the element is a table.

var data = this.inspector.parse(el);
var is = data.isTable();

isHeading

Returns: Boolean

Check if the element is a heading (h1, h2, h3, h4, h5, h6).

var data = this.inspector.parse(el);
var is = data.isHeading();

isBlockquote

Returns: Boolean

Check if the element is a blockquote.

var data = this.inspector.parse(el);
var is = data.isBlockquote();

isDl

Returns: Boolean

Check if the element is a dl list.

var data = this.inspector.parse(el);
var is = data.isDl();

isParagraph

Returns: Boolean

Check if the element is a paragraph.

var data = this.inspector.parse(el);
var is = data.isParagraph();

isLink

Returns: Boolean

Check if the element is a link (a tag).

var data = this.inspector.parse(el);
var is = data.isLink();

isFile

Returns: Boolean

Check if the element is a file (a tag with data-file attribute).

var data = this.inspector.parse(el);
var is = data.isFile();

isText

Returns: Boolean

Check if the element is a text node.

var data = this.inspector.parse(el);
var is = data.isText();

isInline

Returns: Boolean

Check if the element is an inline.

var data = this.inspector.parse(el);
var is = data.isInline();

isBlock

Returns: Boolean

Check if the element is a block.

var data = this.inspector.parse(el);
var is = data.isBlock();

isElement

Returns: Boolean

Check if the element is an inline or a block (not a text node).

var data = this.inspector.parse(el);
var is = data.isElement();

hasParent

Arguments
tags Array

Returns: Boolean

Check if the element has the specified tags as parents.

var data = this.inspector.parse(el);
var has = data.hasParent(['h1', 'p']);

getNode

Returns: Node

Get the node of the element.

var data = this.inspector.parse(el);
var node = data.getNode();

getTag

Returns: String

Get the tag of the element.

var data = this.inspector.parse(el);
var tag = data.getTag();

getComponent

Returns: Node Boolean

Get the component node relative to the element.

var data = this.inspector.parse(el);
var node = data.getComponent();

getComponentType

Returns: String Boolean

Get the element component type.

var data = this.inspector.parse(el);
var type = data.getComponentType();

getFirstNode

Returns: Node Boolean

Get the first node inside the element.

var data = this.inspector.parse(el);
var node = data.getFirstNode();

getLastNode

Returns: Node Boolean

Get the last node inside the element.

var data = this.inspector.parse(el);
var node = data.getLastNode();

getFirstElement

Returns: Node Boolean

Get the first element (not text node) inside the element.

var data = this.inspector.parse(el);
var node = data.getFirstElement();

getLastElement

Returns: Node Boolean

Get the last element (not text node) inside the element.

var data = this.inspector.parse(el);
var node = data.getLastElement();

getFigcaption

Returns: Node Boolean

Get the figcaption node relative to the element.

var data = this.inspector.parse(el);
var node = data.getFigcaption();

getPre

Returns: Node Boolean

Get the pre node relative to the element.

var data = this.inspector.parse(el);
var node = data.getPre();

getCode

Returns: Node Boolean

Get the code node relative to the element.

var data = this.inspector.parse(el);
var node = data.getCode();

getList

Returns: Node Boolean

Get the list (ul or ol) node relative to the element.

var data = this.inspector.parse(el);
var node = data.getList();

getListItem

Returns: Node Boolean

Get the list item (li element) node relative to the element.

var data = this.inspector.parse(el);
var node = data.getListItem();

getTable

Returns: Node Boolean

Get the table node relative to the element.

var data = this.inspector.parse(el);
var node = data.getTable();

getTableCell

Returns: Node Boolean

Get the table cell (td or th) node relative to the element.

var data = this.inspector.parse(el);
var node = data.getTableCell();

getComponentCodeElement

Returns: Node Boolean

Get the code or pre node inside figure component relative to the element.

var data = this.inspector.parse(el);
var node = data.getComponentCodeElement();

getImageElement

Returns: Node Boolean

Get the image node inside component relative to the element.

var data = this.inspector.parse(el);
var node = data.getImageElement();

getParagraph

Returns: Node Boolean

Get the paragraph node relative to the element.

var data = this.inspector.parse(el);
var node = data.getParagraph();

getHeading

Returns: Node Boolean

Get the heading (h1-h6) node relative to the element.

var data = this.inspector.parse(el);
var node = data.getHeading();

getDl

Returns: Node Boolean

Get the dl list node relative to the element.

var data = this.inspector.parse(el);
var node = data.getDl();

getBlockquote

Returns: Node Boolean

Get the blockquote node relative to the element.

var data = this.inspector.parse(el);
var node = data.getBlockquote();

getLink

Returns: Node Boolean

Get the link (a element) node relative to the element.

var data = this.inspector.parse(el);
var node = data.getLink();

getFile

Returns: Node Boolean

Get the file (a element with data-file attribute) node relative to the element.

var data = this.inspector.parse(el);
var node = data.getFile();

findFirstNode

Arguments
selector String

Returns: Node Boolean

Find the first node inside the element by the specified selector.

var data = this.inspector.parse(el);
var node = data.findFirstNode('td, th');

findLastNode

Arguments
selector String

Returns: Node Boolean

Find the last node inside the element by the specified selector.

var data = this.inspector.parse(el);
var node = data.findLastNode('td, th');