mirror of
https://github.com/zadam/trilium.git
synced 2025-11-09 23:05:51 +01:00
22 lines
552 B
TypeScript
22 lines
552 B
TypeScript
|
|
import { ButtonView, Plugin } from "ckeditor5";
|
||
|
|
import copyIcon from "../icons/copy.svg?raw";
|
||
|
|
|
||
|
|
export default class CopyToClipboardButton extends Plugin {
|
||
|
|
|
||
|
|
public init() {
|
||
|
|
const editor = this.editor;
|
||
|
|
const componentFactory = editor.ui.componentFactory;
|
||
|
|
|
||
|
|
componentFactory.add("copyToClipboard", locale => {
|
||
|
|
const button = new ButtonView(locale);
|
||
|
|
button.set({
|
||
|
|
tooltip: "Copy to clipboard",
|
||
|
|
icon: copyIcon
|
||
|
|
});
|
||
|
|
|
||
|
|
return button;
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|