mirror of
https://github.com/zadam/trilium.git
synced 2025-10-27 16:26:31 +01:00
expose text editor instance and method to add text to editor, closes #819
This commit is contained in:
@@ -324,12 +324,28 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte
|
||||
*/
|
||||
this.createNoteLink = linkService.createNoteLink;
|
||||
|
||||
/**
|
||||
* Adds given text to the editor cursor
|
||||
*
|
||||
* @param {string} text
|
||||
* @method
|
||||
*/
|
||||
this.addTextToActiveTabEditor = linkService.addTextToEditor;
|
||||
|
||||
/**
|
||||
* @method
|
||||
* @returns {NoteFull} active note (loaded into right pane)
|
||||
*/
|
||||
this.getActiveTabNote = noteDetailService.getActiveTabNote;
|
||||
|
||||
/**
|
||||
* See https://ckeditor.com/docs/ckeditor5/latest/api/module_core_editor_editor-Editor.html for a documentation on the returned instance.
|
||||
*
|
||||
* @method
|
||||
* @returns {Editor|null} CKEditor instance or null (e.g. if active note is not a text note)
|
||||
*/
|
||||
this.getActiveTabTextEditor = noteDetailService.getActiveEditor;
|
||||
|
||||
/**
|
||||
* @method
|
||||
* @returns {Promise<string|null>} returns note path of active note or null if there isn't active note
|
||||
|
||||
Reference in New Issue
Block a user