removed deprecated API methods

This commit is contained in:
zadam
2023-02-15 23:45:25 +01:00
parent 4ffe36e4d0
commit 127486fdf5
4 changed files with 21 additions and 131 deletions

View File

@@ -202,12 +202,6 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
}
};
/**
* @deprecated new name of this API call is runOnBackend so use that
* @method
*/
this.runOnServer = this.runOnBackend;
/**
* This is a powerful search method - you can search by attributes and their values, e.g.:
* "#dateModified =* MONTH AND #log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
@@ -321,12 +315,6 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
*/
this.triggerEvent = (name, data) => appContext.triggerEvent(name, data);
/**
* @method
* @deprecated this is now no-op since all the changes should be gracefully handled per widget
*/
this.refreshTree = () => {};
/**
* Create note link (jQuery object) for given note.
*
@@ -340,19 +328,6 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
*/
this.createNoteLink = linkService.createNoteLink;
/**
* Adds given text to the editor cursor
*
* @method
* @deprecated use addTextToActiveContextEditor() instead
* @param {string} text - this must be clear text, HTML is not supported.
*/
this.addTextToActiveTabEditor = text => {
console.warn("api.addTextToActiveTabEditor() is deprecated, use addTextToActiveContextEditor() instead.");
return appContext.triggerCommand('addTextToActiveEditor', {text});
};
/**
* Adds given text to the editor cursor
*
@@ -361,36 +336,12 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
*/
this.addTextToActiveContextEditor = text => appContext.triggerCommand('addTextToActiveEditor', {text});
/**
* @method
* @deprecated use getActiveContextNote() instead
* @returns {FNote} active note (loaded into right pane)
*/
this.getActiveTabNote = () => {
console.warn("api.getActiveTabNote() is deprecated, use getActiveContextNote() instead.");
return appContext.tabManager.getActiveContextNote();
};
/**
* @method
* @returns {FNote} active note (loaded into right pane)
*/
this.getActiveContextNote = () => appContext.tabManager.getActiveContextNote();
/**
* See https://ckeditor.com/docs/ckeditor5/latest/api/module_core_editor_editor-Editor.html for a documentation on the returned instance.
*
* @method
* @deprecated use getActiveContextTextEditor()
* @param [callback] - callback receiving "textEditor" instance
*/
this.getActiveTabTextEditor = callback => {
console.warn("api.getActiveTabTextEditor() is deprecated, use getActiveContextTextEditor() instead.");
return appContext.tabManager.getActiveContext()?.getTextEditor(callback);
};
/**
* See https://ckeditor.com/docs/ckeditor5/latest/api/module_core_editor_editor-Editor.html for a documentation on the returned instance.
*
@@ -416,17 +367,6 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
*/
this.getActiveNoteDetailWidget = () => new Promise(resolve => appContext.triggerCommand('executeInActiveNoteDetailWidget', {callback: resolve}));
/**
* @method
* @deprecated use getActiveContextNotePath() instead
* @returns {Promise<string|null>} returns note path of active note or null if there isn't active note
*/
this.getActiveTabNotePath = () => {
console.warn("api.getActiveTabNotePath() is deprecated, use getActiveContextNotePath() instead.");
return appContext.tabManager.getActiveContextNotePath();
};
/**
* @method
* @returns {Promise<string|null>} returns note path of active note or null if there isn't active note
@@ -449,17 +389,6 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
*/
this.setupElementTooltip = noteTooltipService.setupElementTooltip;
/**
* @method
* @deprecated use protectNote and protectSubtree instead
* @returns {Promise<void>}
*/
this.protectActiveNote = async () => {
const activeNote = appContext.tabManager.getActiveContextNote();
await protectedSessionService.protectNote(activeNote.noteId, true, false);
};
/**
* @method
* @param {string} noteId
@@ -488,16 +417,6 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
*/
this.getTodayNote = dateNotesService.getTodayNote;
/**
* Returns day note for a given date. If it doesn't exist, it is automatically created.
*
* @method
* @param {string} date - e.g. "2019-04-29"
* @returns {Promise<FNote>}
* @deprecated use getDayNote instead
*/
this.getDateNote = dateNotesService.getDayNote;
/**
* Returns day note for a given date. If it doesn't exist, it is automatically created.
*