From 6d09931a39601ec5ed7a592d9259bae8b5c7c020 Mon Sep 17 00:00:00 2001 From: zadam Date: Tue, 12 Mar 2019 21:39:35 +0100 Subject: [PATCH] add getCurrentNote() frontend API, #444 --- src/public/javascripts/services/bundle.js | 2 -- src/public/javascripts/services/frontend_script_api.js | 6 ++++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/public/javascripts/services/bundle.js b/src/public/javascripts/services/bundle.js index 1548a1e0f..a8de63181 100644 --- a/src/public/javascripts/services/bundle.js +++ b/src/public/javascripts/services/bundle.js @@ -9,8 +9,6 @@ async function getAndExecuteBundle(noteId, originEntity = null) { } async function executeBundle(bundle, originEntity) { - console.log(bundle); - const apiContext = await ScriptContext(bundle.noteId, bundle.allNoteIds, originEntity); try { diff --git a/src/public/javascripts/services/frontend_script_api.js b/src/public/javascripts/services/frontend_script_api.js index 1f89e1dac..1d15ad453 100644 --- a/src/public/javascripts/services/frontend_script_api.js +++ b/src/public/javascripts/services/frontend_script_api.js @@ -204,6 +204,12 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) { */ 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 is necessary because script execution is async and by the time it is finished, the user might have