mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 02:52:27 +08: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;
|
||
|
});
|
||
|
}
|
||
|
|
||
|
}
|