Methods
destructor
Releases occupied resources
void destructor();
exitFullScreen
Exits the full screen mode
void exitFullScreen();
fullScreen
Enters the full screen mode
void fullScreen();
getEditorAPI
Returns an object with editor API methods
object getEditorAPI();
Returns:
Type | Description |
---|---|
object | an object with API methods of the editor |
Details
The returned object contains a list of methods you can use to apply different operations to the editor. Check the list of editor API methods:
getStats
Returns statistics about the entered content
object getStats();
Returns:
Type | Description |
---|---|
object | an object with available statistical data about edited text |
Related samples: Get Stats
Details
Getting separate statistical data fields
You can get each field of statistical data separately, as it's described below.
Characters
To return the count of characters typed into the editor, use the chars
property of the getStats()
method.
Words
To return the count of words typed into the editor, use the words
property of the getStats()
method.
Characters without spaces
To return the count of characters typed into the editor excluding the number of spaces, use the charsExlSpace
property of the getStats()
method.
Getting custom statistics
It is also possible to return a value of the custom statistical parameter set via the customStats
configuration option, e.g. the number of sentences. For that, use the name of the custom property as a property of the getStats()
method:
getValue
Returns the content of the RichText editor in the chosen format
string getValue( [string mode] );
Parameter | Type | Description |
---|---|---|
mode | string | the format of returned content:"html" (default), "markdown" or "text" |
Returns:
Type | Description |
---|---|
string | the content of the RichText editor |
Related samples: Get Value
paint
Repaints RichText
void paint();
setValue
Adds content into the RichText editor
void setValue(string value,string mode);
Parameter | Type | Description |
---|---|---|
value | string | the context you want to add into the editor in either HTML or Markdown format |
mode | string | optional, the format of text parsing: "html" or "markdown" |
Related samples: Setting HTML content
Details
An example of adding Markdown content is given below:
Related samples: Setting Markdown Value
note
Note, that for a text in the Markdown format you need to define paragraphs by empty lines.