mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 19:05:59 +01:00
add API to add plugin buttons, fixes
This commit is contained in:
21
src/public/javascripts/api.js
Normal file
21
src/public/javascripts/api.js
Normal file
@@ -0,0 +1,21 @@
|
||||
const api = (function() {
|
||||
const pluginButtonsEl = $("#plugin-buttons");
|
||||
|
||||
async function activateNote(notePath) {
|
||||
await noteTree.activateNode(notePath);
|
||||
}
|
||||
|
||||
function addButtonToToolbar(buttonId, button) {
|
||||
$("#" + buttonId).remove();
|
||||
|
||||
button.attr('id', buttonId);
|
||||
|
||||
pluginButtonsEl.append(button);
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
addButtonToToolbar,
|
||||
activateNote
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user