Javascript HTML editor

Quick reference

Considering the example below:

<html>
<script src="https://jsuites.net/v4/jsuites.js"></script>
<link rel="stylesheet" href="https://jsuites.net/v4/jsuites.css" type="text/css" />

<div id="editor"></div>

<script>
var myEditor = jSuites.editor(document.getElementById('editor'));
</script>
</html>


Available Methods

Method Description
myEditor.setData()Set new data to the editor.
myEditor.getData()Get the current data.
myEditor.reset()Clear the content of the editor.
myEditor.destroy()Destroy the editor.


Initialiation properties

Property Description
value: stringInitial HTML value
snippet: objectSnippet object
toolbar: boolan | objectTrue for the default toolbar, or a items of a customized toolbar.
remoteParser: stringA URL for the remote URL/image parser.
parseURL: booleanParse URL inside the editor to create a snippet.
filterPaste: booleanFilter all content onpaste
dropZone: booleanAllow images or files to be dropped in the editor.
acceptFiles: booleanAccept PDF on the editor.
acceptImages: booleanAccept images on the editor.
dropAsAttachment: booleanWhen images are dropped, they are included as attachement.
maxFileSize: numberMax filesize in bytes.
border: booleanAdd borders to the editor.
padding: booleanAdd padding to the editor.
maxHeight: numberMax height for the editor.
focus: booleanFocus on the contente after the data is loaded.
placeholder: stringContent placeholder


Available Events

Event Description
onclickWhen a click happens on the editor.
(element: HTMLElement, instance: Object, event: Object) => void
onfocusWhen the editor is focused.
(element: HTMLElement, instance: Object, currentValue: string) => void
onblurWhen the editor is blured.
(element: HTMLElement, instance: Object, currentValue: string) => void
onloadA method is execute when the modal is closed.
(element: HTMLElement, instance: Object, editor: HTMLElement) => void
onkeyupWhen a new key from the keyboard is released.
(element: HTMLElement, instance: Object, event: Object) => void
onkeydownWhen a new key from the keyboard is pressed.
(element: HTMLElement, instance: Object, event: Object) => void