new RichTextEditor()
Methods
-
<static> getEditorOptions()
-
Gets the Quill editor options.
Returns:
Quill options that are currently set. -
<static> setEditorOptions(options)
-
Sets the Quill editor options.
Parameters:
Name Type Description optionsCore.Annotations.FreeTextAnnotation.RichTextEditor.QuillEditorOptions Quill options to be set. -
blur()
-
Blurs the editor.
-
deleteText(index, length)
-
Delete some content from the editor.
Parameters:
Name Type Description indexnumber the start index of the range lengthnumber the length of the range -
format(format, value)
-
Format text at the current selection. If the current selection has length of 0, then the format will be set active.
Parameters:
Name Type Description formatCore.Annotations.FreeTextAnnotation.RichTextEditor.Format valueCore.Annotations.FreeTextAnnotation.RichTextEditor.FormatValue -
getContents()
-
Gets the current contents in the editor
Returns:
Returns the current contents in the editor- Type
- string
-
getFormat(index, length)
-
Gets the format of the text in the given range.
Parameters:
Name Type Description indexnumber the start index of the range lengthnumber the length of the range Returns:
Returns the format of the given range- Type
- object
-
getSelectedLinkURL()
-
While in inline content edit mode, if a the cursor is currently on a link, this method will return the link.
-
getSelection()
-
Gets the current selection range in the editor.
Returns:
Returns the current selection range -
hasFocus()
-
Checks if the editor is being focused.
Returns:
Whether the editor is focused- Type
- boolean
-
insertText(index, contents)
-
Insert the content in the editor.
Parameters:
Name Type Description indexnumber the start index of the range contentsstring the contents that need to be updated in the editor -
setSelection(index, length)
-
Sets the current selection in the editor.
Parameters:
Name Type Description indexnumber the start index of the range lengthnumber the length of the selection range -
setText(contents)
-
Sets the content in the editor.
Parameters:
Name Type Description contentsstring the contents that need to be updated in the editor
Type Definitions
-
Format
-
The available formats of an editor instance
Type:
- 'color' | 'bold' | 'italic' | 'underline' | 'strike'
-
FormatValue
-
The value of a format. The value should be a hex color string(e.g. #FF00FF) for the `color` format, and boolean for the rest of formats.
Type:
- string | boolean
-
QuillEditorOptions
-
Properties:
Name Type Description boundsElement DOM Element or a CSS selector for a DOM Element, within which the editor’s UI elements (i.e. tooltips, etc.) should be confined. Currently, it only considers left and right boundaries. debugstring Shortcut for debug. Note debug is a static method and will affect other instances of Quill editors on the page. Only warning and error messages are enabled by default. formatsobject [WARNING: this is not fully supported by WebViewer and may result in unexpected behavior] Whitelist of formats to allow in the editor. See Formats for a complete list. modulesobject Collection of modules to include and respective options. See Modules for more information. placeholderstring Placeholder text to show when editor is empty. readOnlyboolean Whether to instantiate the editor in read-only mode. scrollingContainerElement DOM Element or a CSS selector for a DOM Element, specifying which container has the scrollbars (i.e. overflow-y: auto), if is has been changed from the default ql-editor with custom CSS. Necessary to fix scroll jumping bugs when Quill is set to auto grow its height, and another ancestor container is responsible from the scrolling. themestring [WARNING: this is not fully supported by WebViewer and may result in unexpected behavior] Themes to use for the editor. shouldScrollContainerboolean Whether to scroll the container when text exceeds the Text Box.