mirror of
https://github.com/zadam/trilium.git
synced 2025-12-19 22:59:53 +01:00
chore(dayjs): address requested changes
This commit is contained in:
@@ -23,7 +23,19 @@ function getBundle(script: string) {
|
|||||||
title: "Script note"
|
title: "Script note"
|
||||||
}).noteId;
|
}).noteId;
|
||||||
const bundle: Bundle = {
|
const bundle: Bundle = {
|
||||||
script: `\napiContext.modules['${id}'] = { exports: {} };\nreturn await ((async function(exports, module, require, api) {\ntry {\n${script}\n;\n} catch (e) { throw new Error(\"Load of script note \\\"Client\\\" (${id}) failed with: \" + e.message); }\nfor (const exportKey in exports) module.exports[exportKey] = exports[exportKey];\nreturn module.exports;\n}).call({}, {}, apiContext.modules['${id}'], apiContext.require([]), apiContext.apis['${id}']));\n`,
|
script: [
|
||||||
|
'',
|
||||||
|
`apiContext.modules['${id}'] = { exports: {} };`,
|
||||||
|
`return await ((async function(exports, module, require, api) {`,
|
||||||
|
`try {`,
|
||||||
|
`${script}`,
|
||||||
|
`;`,
|
||||||
|
`} catch (e) { throw new Error(\"Load of script note \\\"Client\\\" (${id}) failed with: \" + e.message); }`,
|
||||||
|
`for (const exportKey in exports) module.exports[exportKey] = exports[exportKey];`,
|
||||||
|
`return module.exports;`,
|
||||||
|
`}).call({}, {}, apiContext.modules['${id}'], apiContext.require([]), apiContext.apis['${id}']));`,
|
||||||
|
''
|
||||||
|
].join('\n'),
|
||||||
html: "",
|
html: "",
|
||||||
noteId: id,
|
noteId: id,
|
||||||
allNoteIds: [ id ]
|
allNoteIds: [ id ]
|
||||||
|
|||||||
Reference in New Issue
Block a user