import treeService from './tree.js'; import server from './server.js'; import utils from './utils.js'; import infoService from './info.js'; import linkService from './link.js'; import treeCache from './tree_cache.js'; function ScriptApi(startNote, currentNote, originEntity = null) { const $pluginButtons = $("#plugin-buttons"); async function activateNote(notePath) { await treeService.activateNode(notePath); } async function activateNewNote(notePath) { await treeService.reload(); await treeService.activateNode(notePath, true); } function addButtonToToolbar(opts) { const buttonId = "toolbar-button-" + opts.title.replace(/[^a-zA-Z0-9]/g, "-"); $("#" + buttonId).remove(); const icon = $("") .addClass("ui-icon ui-icon-" + opts.icon); const button = $('