mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	frontend scripts now have startNote, currentNote and targetNote as NoteShort entities which e.g. provides easy access to relations/labels
This commit is contained in:
		| @@ -1,9 +1,13 @@ | ||||
| import FrontendScriptApi from './frontend_script_api.js'; | ||||
| import utils from './utils.js'; | ||||
| import treeCache from './tree_cache.js'; | ||||
|  | ||||
| function ScriptContext(startNote, allNotes, originEntity = null) { | ||||
| async function ScriptContext(startNoteId, allNoteIds, originEntity = null) { | ||||
|     const modules = {}; | ||||
|  | ||||
|     const startNote = await treeCache.getNote(startNoteId); | ||||
|     const allNotes = await treeCache.getNotes(allNoteIds); | ||||
|  | ||||
|     return { | ||||
|         modules: modules, | ||||
|         notes: utils.toObject(allNotes, note => [note.noteId, note]), | ||||
|   | ||||
		Reference in New Issue
	
	Block a user