mirror of
https://github.com/zadam/trilium.git
synced 2025-11-09 23:05:51 +01:00
feat(ckeditor5/codeblock): add copy icon
This commit is contained in:
21
packages/ckeditor5/src/plugins/copy_to_clipboard_button.ts
Normal file
21
packages/ckeditor5/src/plugins/copy_to_clipboard_button.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
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;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user