Documentation

Editor

setTemplate

Sets a template to the editor.

this.app.editor.setTemplate('template code');

insertContent

This method inserts Revolvapp tags depending on the cursor position. The inserted html must always be enclosed in a re-block tag. If the cursor is not in a block tag, but for example in a text block, the editor will automatically detect this and insert the code without wrapping in the block.

this.app.editor.insertContent({
    html: '<re-block><re-text>My text</re-text></re-block>'
});

Please, see the example that demonstrates how this method works.

getFrame

Returns the editor iframe.

var $frame = this.app.editor.getFrame();

getDoc

Returns the document object of editor iframe.

var $doc = this.app.editor.getDoc();

getWin

Returns the window object of editor iframe.

var $win = this.app.editor.getWin();

getHead

Returns the head tag of editor iframe.

var $head = this.app.editor.getHead();

getBody

Returns the body tag of editor iframe.

var $body = this.app.editor.getBody();

getBodyInstance

Returns the instance of body tag.

var instance = this.app.editor.getBodyInstance();

getHtml

Arguments
tidy (optional) Boolean

Returns the html code of template.

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

If the tidy argument is enabled, it will return the formatted code of html.

var html = this.app.editor.getHtml(true);

getText

Returns the email as a plaint text.

var text = this.app.editor.getText();

getTemplate

Arguments
tidy (optional) Boolean

Returns the modified code of template.

var template = this.app.editor.getTemplate();

If the tidy argument is enabled, it will return the formatted code of template.

var template = this.app.editor.getTemplate(true);

getTemplateSource

Arguments
tidy (optional) Boolean

Returns the initial code of template.

var template = this.app.editor.getTemplateSource();

If the tidy argument is enabled, it will return the formatted code of template.

var template = this.app.editor.getTemplateSource();

isSourceMode

Checks if the editor in the source mode.

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

isMobileMode

Checks if the editor in the mobile view mode.

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

setData

Arguments
data Object

Sets properties to the body tag.

this.app.editor.setData({
    'background-color': '#fff'
});

getData

Returns properties of the body tag.

var data = this.app.editor.getData();

adjustHeight

Adjusts the height of the frame to the height of the content in it.

this.app.editor.adjustHeight();