mirror of
https://github.com/zadam/trilium.git
synced 2025-02-21 21:43:55 +08:00
frontend API additions
This commit is contained in:
parent
83b4382787
commit
a27525af9e
1 changed files with 14 additions and 0 deletions
|
@ -131,6 +131,14 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) {
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns note by given noteId. If note is missing from cache, it's loaded.
|
||||
**
|
||||
* @param {string} noteId
|
||||
* @return {Promise<NoteShort>}
|
||||
*/
|
||||
this.getNote = async noteId => await treeCache.getNote(noteId);
|
||||
|
||||
/**
|
||||
* Returns list of notes. If note is missing from cache, it's loaded.
|
||||
*
|
||||
|
@ -210,6 +218,12 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) {
|
|||
*/
|
||||
this.getActiveNote = noteDetailService.getActiveNote;
|
||||
|
||||
/**
|
||||
* @method
|
||||
* @returns {string} returns note path of active note
|
||||
*/
|
||||
this.getActiveNotePath = treeService.getActiveNotePath;
|
||||
|
||||
/**
|
||||
* This method checks whether user navigated away from the note from which the scripts has been started.
|
||||
* This is necessary because script execution is async and by the time it is finished, the user might have
|
||||
|
|
Loading…
Reference in a new issue