mirror of
https://github.com/zadam/trilium.git
synced 2025-10-29 09:16:45 +01:00
fix recent notes (db & sync version increase)
This commit is contained in:
@@ -44,7 +44,7 @@ import dateNotesService from'./date_notes.js';
|
||||
* @constructor
|
||||
* @hideconstructor
|
||||
*/
|
||||
function FrontendScriptApi(startNote, currentNote, originEntity = null) {
|
||||
function FrontendScriptApi(startNote, currentNote, originEntity = null, tabContext = null) {
|
||||
const $pluginButtons = $("#plugin-buttons");
|
||||
|
||||
/** @property {object} note where script started executing */
|
||||
@@ -57,6 +57,9 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) {
|
||||
// to keep consistency with backend API
|
||||
this.dayjs = dayjs;
|
||||
|
||||
/** @property {TabContext|null} - experimental! */
|
||||
this.tabContext = tabContext;
|
||||
|
||||
/**
|
||||
* Activates note in the tree and in the note detail.
|
||||
*
|
||||
@@ -282,12 +285,6 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) {
|
||||
*/
|
||||
this.createNoteLink = linkService.createNoteLink;
|
||||
|
||||
/**
|
||||
* @method
|
||||
* @returns {string} content of active note (loaded into right pane)
|
||||
*/
|
||||
this.getActiveNoteContent = noteDetailService.getActiveNoteContent;
|
||||
|
||||
/**
|
||||
* @method
|
||||
* @returns {NoteFull} active note (loaded into right pane)
|
||||
@@ -296,9 +293,13 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) {
|
||||
|
||||
/**
|
||||
* @method
|
||||
* @returns {Promise<string>} returns note path of active note
|
||||
* @returns {Promise<string|null>} returns note path of active note or null if there isn't active note
|
||||
*/
|
||||
this.getActiveNotePath = treeService.getActiveNotePath;
|
||||
this.getActiveNotePath = () => {
|
||||
const activeTabContext = noteDetailService.getActiveTabContext();
|
||||
|
||||
return activeTabContext ? activeTabContext.notePath : null;
|
||||
};
|
||||
|
||||
/**
|
||||
* This method checks whether user navigated away from the note from which the scripts has been started.
|
||||
|
||||
Reference in New Issue
Block a user