mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	refactor(ckeditor5/codeblock): simplify copy clipboard plugin
This commit is contained in:
		| @@ -3,18 +3,11 @@ import copyIcon from "../icons/copy.svg?raw"; | ||||
|  | ||||
| export default class CopyToClipboardButton extends Plugin { | ||||
|  | ||||
|     static get requires() { | ||||
|         return [ CopyToClipboardEditing, CopyToClipboardUI ]; | ||||
|     } | ||||
|  | ||||
| } | ||||
|  | ||||
| export class CopyToClipboardUI extends Plugin { | ||||
|  | ||||
|     public init() { | ||||
|         const editor = this.editor; | ||||
|         const componentFactory = editor.ui.componentFactory; | ||||
|         editor.commands.add("copyToClipboard", new CopyToClipboardCommand(this.editor)); | ||||
|  | ||||
|         const componentFactory = editor.ui.componentFactory; | ||||
|         componentFactory.add("copyToClipboard", locale => { | ||||
|             const button = new ButtonView(locale); | ||||
|             button.set({ | ||||
| @@ -32,14 +25,6 @@ export class CopyToClipboardUI extends Plugin { | ||||
|  | ||||
| } | ||||
|  | ||||
| export class CopyToClipboardEditing extends Plugin { | ||||
|  | ||||
|     public init() { | ||||
|         this.editor.commands.add("copyToClipboard", new CopyToClipboardCommand(this.editor)); | ||||
|     } | ||||
|  | ||||
| } | ||||
|  | ||||
| export class CopyToClipboardCommand extends Command { | ||||
|  | ||||
|     execute(...args: Array<unknown>) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user