Misc

animation #

Type: Boolean

Default: true

Turn off the animation for dropdowns, air toolbar and modal windows.

$R('#content', {
    animation: false
});

lang #

Type: String

Default: en

By default, Redactor is set to English language, but you can download (or create) and install your own language file. All you need is to set a language file after redactor.js:

<script src="/js/redactor/redactor.js"></script>
<script src="/js/redactor/es.js"></script>

And then set the lang option:

$R('#content', {
    lang: 'es'
});

direction #

Type: String

Default: ltr

Redactor supports both right-to-left and left-to-right text directions. By default, Redactor is set to work with left-to-right, to set it to right-to-left, use direction setting:

$R('#content', {
    direction: 'rtl'
});

spellcheck #

Type: Boolean

Default: true

This setting allows to turn off a browser spell checking for Redactor.

$R('#content', {
    spellcheck: false
});

structure #

Type: Boolean

Default: false

This settings introduces visual indicators for HTML tags h1-h6 and div, helping users understand the structure of the document.

$R('#content', {
    structure: true
});

scrollTarget #

Type: Boolean

Default: false

This setting sets the parent element when the editor is inside a scrollable layer.

$R('#content', {
    scrollTarget: '#my-scrollable-layer'
});

placeholder #

Type: Boolean String

Default: false

Placeholder can be set in two different ways.

You can set placeholder setting with text argument:

$R('#content', {
    placeholder: 'Enter a comment...'
});

Or you can set placeholder as an attribute of an HTML element that uses Redactor:

<textarea id="content" placeholder="Enter a comment..."></textarea>

inline #

Type: Boolean

Default: false

Redactor automatically starts in inline mode, if the source element is not textarea and not a div (for example, the span tag. is a right tag for inline mode). You can force this setting if you need the inline mode to be enabled for the div element.

$R('#content', {
    inline: true
});

In the inline mode, editing will occur in one line, and the following settings will be automatically set:

  • pasting text only plain text without the possibility of inserting images;
  • pressing enter key will not result for new lines;
  • the toolbar will not start;
  • the source view mode will not be available;
  • the content styles specified in redactor.css will not be applied;
  • auto-formatting the links will not work.

plugins #

Type: Array

Default: []

This setting allows to launch Redactor with plugins.

$R('#content', {
    plugins: ['myplugin', 'myplugin2']
});

callbacks #

Type: Object

Default: {}

This setting allows you to specify the functions (callbacks) that will be run at events in Redactor.

$R('#content', {
    callbacks: {
        start: function()
        {
            console.log('Hello!');
        }
    }
});

grammarly #

Type: Boolean

Default: true

This option allows to turn off Grammarly spell check for Redactor.

$R('#content', {
    grammarly: false
});

notranslate #

Type: Boolean

Default: false

This option allows to disable Google Translate to translate content of Redactor.

$R('#content', {
    notranslate: true
});