mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 20:06:08 +01:00
decoupled protected session holder from presentation stuff and similar things
This commit is contained in:
13
src/public/javascripts/services/bundle.js
Normal file
13
src/public/javascripts/services/bundle.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import ScriptContext from "./script_context";
|
||||
|
||||
async function executeBundle(bundle) {
|
||||
const apiContext = ScriptContext(bundle.note, bundle.allNotes);
|
||||
|
||||
return await (function () {
|
||||
return eval(`const apiContext = this; (async function() { ${bundle.script}\r\n})()`);
|
||||
}.call(apiContext));
|
||||
}
|
||||
|
||||
export default {
|
||||
executeBundle
|
||||
}
|
||||
Reference in New Issue
Block a user