MCPcopy
hub / github.com/TriliumNext/Trilium / init

Method init

packages/ckeditor5/src/plugins/cuttonote.ts:8–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6 private htmlDataProcessor!: HtmlDataProcessor;
7
8 init() {
9 this.htmlDataProcessor = new HtmlDataProcessor(this.editor.editing.view.document);
10
11 this.editor.ui.componentFactory.add( 'cutToNote', locale => {
12 const view = new ButtonView( locale );
13
14 view.set( {
15 label: 'Cut & paste selection to sub-note',
16 icon: scissorsIcon,
17 tooltip: true
18 } );
19
20 // Callback executed once the image is clicked.
21 view.on('execute', () => {
22 const editorEl = this.editor.editing.view.getDomRoot();
23 const component = glob.getComponentByEl(editorEl);
24
25 component.triggerCommand('cutIntoNote');
26 });
27
28 return view;
29 } );
30
31 this.editor.getSelectedHtml = () => this.getSelectedHtml();
32 this.editor.removeSelection = () => this.removeSelection();
33 }
34
35 getSelectedHtml() {
36 const model = this.editor.model;

Callers

nothing calls this directly

Calls 7

getSelectedHtmlMethod · 0.95
removeSelectionMethod · 0.95
onMethod · 0.65
getComponentByElMethod · 0.65
triggerCommandMethod · 0.65
addMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected