mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 13:39:01 +01:00 
			
		
		
		
	frontend API additions
This commit is contained in:
		
							parent
							
								
									83b4382787
								
							
						
					
					
						commit
						a27525af9e
					
				@ -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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user