mirror of
https://github.com/zadam/trilium.git
synced 2025-10-27 16:26:31 +01:00
API docs
This commit is contained in:
@@ -42,6 +42,7 @@ import NoteContextAwareWidget from "../widgets/note_context_aware_widget.js";
|
||||
import BasicWidget from "../widgets/basic_widget.js";
|
||||
import SpacedUpdate from "./spaced_update.js";
|
||||
import shortcutService from "./shortcuts.js";
|
||||
import dialogService from "./dialog.js";
|
||||
|
||||
|
||||
/**
|
||||
@@ -316,7 +317,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
this.parseDate = utils.parseDate;
|
||||
|
||||
/**
|
||||
* Show an info message to the user.
|
||||
* Show an info toast message to the user.
|
||||
*
|
||||
* @method
|
||||
* @param {string} message
|
||||
@@ -324,13 +325,43 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, $contain
|
||||
this.showMessage = toastService.showMessage;
|
||||
|
||||
/**
|
||||
* Show an error message to the user.
|
||||
* Show an error toast message to the user.
|
||||
*
|
||||
* @method
|
||||
* @param {string} message
|
||||
*/
|
||||
this.showError = toastService.showError;
|
||||
|
||||
/**
|
||||
* Show an info dialog to the user.
|
||||
*
|
||||
* @method
|
||||
* @param {string} message
|
||||
* @returns {Promise}
|
||||
*/
|
||||
this.showInfoDialog = dialogService.info;
|
||||
|
||||
/**
|
||||
* Show confirm dialog to the user.
|
||||
*
|
||||
* @method
|
||||
* @param {string} message
|
||||
* @returns {Promise<boolean>} promise resolving to true if the user confirmed
|
||||
*/
|
||||
this.showConfirmDialog = dialogService.confirm;
|
||||
|
||||
/**
|
||||
* Show prompt dialog to the user.
|
||||
*
|
||||
* @method
|
||||
* @param {object} props
|
||||
* @param {string} props.title
|
||||
* @param {string} props.message
|
||||
* @param {string} props.defaultValue
|
||||
* @returns {Promise<string>} promise resolving to the answer provided by the user
|
||||
*/
|
||||
this.showPromptDialog = dialogService.prompt;
|
||||
|
||||
/**
|
||||
* Trigger command. This is a very low-level API which should be avoided if possible.
|
||||
*
|
||||
@@ -625,7 +656,7 @@ export default FrontendScriptApi;
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BasicWidget.html">BasicWidget</a></li><li><a href="FAttachment.html">FAttachment</a></li><li><a href="FAttribute.html">FAttribute</a></li><li><a href="FBranch.html">FBranch</a></li><li><a href="FNote.html">FNote</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteContextAwareWidget.html">NoteContextAwareWidget</a></li><li><a href="RightPanelWidget.html">RightPanelWidget</a></li></ul><h3>Global</h3><ul><li><a href="global.html#api">api</a></li></ul>
|
||||
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BasicWidget.html">BasicWidget</a></li><li><a href="FAttachment.html">FAttachment</a></li><li><a href="FAttribute.html">FAttribute</a></li><li><a href="FBranch.html">FBranch</a></li><li><a href="FNote.html">FNote</a></li><li><a href="FrontendScriptApi.html">FrontendScriptApi</a></li><li><a href="NoteContextAwareWidget.html">NoteContextAwareWidget</a></li><li><a href="RightPanelWidget.html">RightPanelWidget</a></li></ul><h3>Global</h3><ul><li><a href="global.html#api">api</a></li><li><a href="global.html#getJsonContent">getJsonContent</a></li><li><a href="global.html#getJsonContentSafely">getJsonContentSafely</a></li></ul>
|
||||
</nav>
|
||||
|
||||
<br class="clear">
|
||||
|
||||
Reference in New Issue
Block a user