Files
roundcubemail/plugins/markdown_editor/javascript/toolbar-button.js
Pablo Zmdl e34a813355 New plugin "markdown_editor": compose in markdown, send as HTML
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.
2025-10-27 15:34:19 +01:00

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);