Documentation
Insertion
set
html | String |
Returns: String
Set the content to Redactor.
this.insertion.set(html);
insertText
text | String |
Returns: Array
Insert the text string at the caret. Return the array of inserted text nodes.
this.insertion.insertText(text);
insertRaw
html | String |
Returns: Array
Insert the HTML string at the caret without cleaning. Return the array of inserted nodes.
this.insertion.insertRaw(html);
insertHtml
html | String |
Returns: Array
Insert the HTML string at the caret. Return the array of inserted nodes.
this.insertion.insertHtml(html);
insertNode
node | Node Element Dom Nodelist | |
caret (optional) | String |
Returns: Array
Insert the node or nodes at the caret. Return the array of inserted nodes.
this.insertion.insertNode(element);
By default the caret will be set after the last inserted node. But you can set other behaviours with caret
option (start, end, before and after). For example, set the caret at the start of the last inserted node:
this.insertion.insertNode(element, 'start');
insertChar
chart | String |
Returns: Array
Insert the HTML character at the caret. Return the array of inserted nodes.
this.insertion.insertChar('©');
insertToOffset
start | Number | |
html | String |
Returns: Array
Insert the HTML to the specified offset position of Redactor. Return the array of inserted nodes.
this.insertion.insertToOffset(10, html);
insertToPoint
e | Event | |
html | String |
Returns: Array
Insert the HTML at the event clientX and clientY point. Return the array of inserted nodes.
this.insertion.insertToPoint(e, html);
insertNewline
Returns: Array
Insert the new line at the caret for preformatted elements. Return the array of inserted nodes.
this.insertion.insertNewLine();
insertBreakLine
Returns: Array
Insert the breakline tag (br) at the caret. Return the array of inserted nodes.
this.insertion.insertBreakLine();