Lite Editor

Methods

Some methods can be called from the LiteEditor instances like below

editor.insertTag('h2', 'entry-title');

This is the list of the methods you can call.

name parameters description
focus focus to the editor area
registerButton [btn Object] add new button to the editor
activateEditorMode activate the wysiwyg mode
diactivateEditorMode disable the wysiwyg mode
on listen to the some events fired from the editor
hideEditor hide the editor area
showEditor show the editor area
hideBtns hide the btns
resetStyle reset the styles of the selected area
insertHtml html replace the html of the selected area
insertHtmlAtCursor html insert the html at the caret position
saveSelection save the selection
restoreSelection restore the selection
restoreSelection restore the selection
insertTag tag, className, sampleText wrap the selected area with the tag with the specified classname. when no area is selected sampleText will be inserted
canRedo check if you can redo the editor status. when you can redo return true else return false
canUndo check if you can undo the editor status. when you can undo return true else return false
redo redo the editor status
undo undo the editor status
checkCaretCoordinate return the caret position
getSelectionNode get the selected area's node
unwrapTag unwrap the tag of the selected area
showSource show the real html source code of the editor
hideSource show the wysiwyg and hide the source code
Getting Started
API