mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 05:28:59 +01:00 
			
		
		
		
	add getCurrentNote() frontend API, #444
This commit is contained in:
		
							parent
							
								
									37d2a7939c
								
							
						
					
					
						commit
						6d09931a39
					
				@ -9,8 +9,6 @@ async function getAndExecuteBundle(noteId, originEntity = null) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
async function executeBundle(bundle, originEntity) {
 | 
					async function executeBundle(bundle, originEntity) {
 | 
				
			||||||
    console.log(bundle);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    const apiContext = await ScriptContext(bundle.noteId, bundle.allNoteIds, originEntity);
 | 
					    const apiContext = await ScriptContext(bundle.noteId, bundle.allNoteIds, originEntity);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    try {
 | 
					    try {
 | 
				
			||||||
 | 
				
			|||||||
@ -204,6 +204,12 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) {
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    this.getCurrentNoteContent = noteDetailService.getCurrentNoteContent;
 | 
					    this.getCurrentNoteContent = noteDetailService.getCurrentNoteContent;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * @method
 | 
				
			||||||
 | 
					     * @returns {NoteFull} currently loaded note in the editor (HTML, code etc.)
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    this.getCurrentNote = noteDetailService.getCurrentNote;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * This method checks whether user navigated away from the note from which the scripts has been started.
 | 
					     * 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
 | 
					     * 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