mirror of
https://github.com/roundcube/roundcubemail.git
synced 2026-03-03 14:54:01 +01:00
This adds a markdown editor that sends HTML to the server. It uses codemirror and some custom code to show a syntax highlighted textarea and some buttons to help editing (including a preview). Drafts get marked via an internal email header that causes the markdown editor to automatically start if a message composition is continued that was started using the markdown editor.
24 lines
660 B
JavaScript
24 lines
660 B
JavaScript
export default class ToolbarButton extends HTMLElement {
|
|
constructor(name, content, command) {
|
|
super();
|
|
this.name = name;
|
|
this.className = `fa-icon toolbar-button-${name}`;
|
|
this.title = rcmail.get_label(`markdown_editor.toolbar_button_${name}`),
|
|
this.command = command;
|
|
this.append(content);
|
|
}
|
|
|
|
set disabled(value) {
|
|
if (value) {
|
|
this.classList.add('disabled');
|
|
} else {
|
|
this.classList.remove('disabled');
|
|
}
|
|
}
|
|
|
|
get disabled() {
|
|
return this.classList.contains('disabled');
|
|
}
|
|
}
|
|
customElements.define('toolbar-button', ToolbarButton);
|