()
| 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; |
nothing calls this directly
no test coverage detected