This means you simply have to use the data-jd-text-editor
attibute to create a basic text editor! Simple enough, no?
Text editor
A text editor, for JD is a great poet
Demonstration
Quick use
The HTML part
A bit of CSS
Parameters
Customizing the buttons
To use your own buttons style, you can specify which templates to use:
A quick summary of the attributes used on the textarea itself:
Attribute | Role | Default value |
---|---|---|
data-jd-text-editor
|
Creates the text editor | No value |
data-base-url
|
Defines the absolute URL to use for relative paths in src and href attributes in the preview |
'' (empty string) |
data-active-buttons
|
The (comma separated) list of buttons to show | None, all available buttons are shown by default |
data-buttons-tpl
|
The id of the template used for the buttons container | None, a default template is used |
data-single-button-tpl
|
The id of the template used for each button | None, a default template is used |
Now for the attributes used on the buttons container:
Attribute | Role | Default value |
---|---|---|
data-inject-buttons
|
Used on the element where the buttons should be injected | No value |
And finally, the attributes used on the buttons:
Attribute | Role | Default value |
---|---|---|
data-button
|
Used on the button to apply the click listener (required to make it work) | No value |
You can also use some template markes to customize your buttons:
Property name | Description |
---|---|
id
|
Unique identifier of the button (something like bold , italic , image …) |
title
|
A small description as to what the button might do |
content
|
A super short text (usually a single character or emoji) used as the button's text content |