Documentation

Editor

$editor #

Access to the Dom of the editor element.

var html = this.app.editor.$editor.html();

content.set #

Arguments
html String

Sets content to the editor.

this.app.editor.content.set('<p>Hello world!</p>');

content.get #

Gets content from the editor.

var html = this.app.editor.content.get();

content.insert #

Arguments
html String

Inserts content to the editor.

this.app.editor.content.insert('<p>Hello world!</p>');

is #

Arguments
element Node Nodelist Dom

Checks if the element is the editor.

var is = this.app.editor.is(element);

isSourceMode #

Checks if the editor in the source mode.

var is = this.app.editor.isSourceMode();

isSelectedAll #

Checks if all blocks in the editor selected.

var is = this.app.editor.isSelecctedAll();

setSelectedAll #

Selects all blocks in the editor.

this.app.editor.setSelectedAll(true);

Unselects blocks in the editor.

this.app.editor.setSelectedAll(false);

isEmpty #

Checks if the editor empty.

var is = this.app.editor.isEmpty();

empty #

Sets the editor empty.

this.app.editor.empty();

rebuild #

Rebuilds blocks and editor events, for example, after adding a new block manually.

this.app.editor.rebuild();

blocks.get #

Arguments:

  • type (optional) String

Gets the Dom wrapped blocks from the editor.

var $blocks = this.app.editor.blocks.get();
var $blocks = this.app.editor.blocks.get('editable');
var $blocks = this.app.editor.blocks.get('first-level');
var $block = this.app.editor.blocks.get('first');

images.get #

Checks which images have been removed from the content.

var changes = this.app.editor.images.get();
for (var key in changes) {
    if (changes[key].status === false) {
        // element was deleted
    }
    else {
        // element is still in the content
    }
}