2018-08-30 02:44:35 +08:00
<!DOCTYPE html>
< html lang = "en" >
< head >
< meta charset = "utf-8" >
< title > JSDoc: Class: FrontendScriptApi< / title >
< script src = "scripts/prettify/prettify.js" > < / script >
< script src = "scripts/prettify/lang-css.js" > < / script >
<!-- [if lt IE 9]>
< script src = "//html5shiv.googlecode.com/svn/trunk/html5.js" > < / script >
<![endif]-->
< link type = "text/css" rel = "stylesheet" href = "styles/prettify-tomorrow.css" >
< link type = "text/css" rel = "stylesheet" href = "styles/jsdoc-default.css" >
< / head >
< body >
< div id = "main" >
< h1 class = "page-title" > Class: FrontendScriptApi< / h1 >
< section >
< header >
< h2 > < span class = "attribs" > < span class = "type-signature" > < / span > < / span > FrontendScriptApi< / h2 >
< / header >
< article >
< div class = "container-overview" >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line24" > line 24< / a >
2018-08-30 02:44:35 +08:00
< / li > < / ul > < / dd >
< / dl >
2019-08-21 03:40:47 +08:00
2018-08-30 02:44:35 +08:00
< / div >
< h3 class = "subsection-title" > Members< / h3 >
2019-10-07 03:35:26 +08:00
< h4 class = "name" id = "$container" > < span class = "type-signature" > < / span > $container< span class = "type-signature" > < / span > < / h4 >
< h5 class = "subsection-title" > Properties:< / h5 >
< table class = "props" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > container< / code > < / td >
< td class = "type" >
< span class = "param-type" > jQuery< / span >
< / td >
< td class = "description last" > of all the rendered script content< / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line28" > line 28< / a >
< / li > < / ul > < / dd >
< / dl >
< h4 class = "name" id = "BasicWidget" > < span class = "type-signature" > < / span > BasicWidget< span class = "type-signature" > < / span > < / h4 >
< h5 class = "subsection-title" > Properties:< / h5 >
< table class = "props" >
< thead >
< tr >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "type" >
< span class = "param-type" > BasicWidget< / span >
< / td >
< td class = "description last" > < / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line50" > line 50< / a >
2019-10-07 03:35:26 +08:00
< / li > < / ul > < / dd >
< / dl >
2020-03-08 18:41:42 +08:00
< h4 class = "name" id = "CollapsibleWidget" > < span class = "type-signature" > < / span > CollapsibleWidget< span class = "type-signature" > < / span > < / h4 >
2018-08-30 02:44:35 +08:00
< h5 class = "subsection-title" > Properties:< / h5 >
< table class = "props" >
< thead >
< tr >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "type" >
2020-03-08 18:41:42 +08:00
< span class = "param-type" > CollapsibleWidget< / span >
2018-08-30 02:44:35 +08:00
< / td >
2020-03-08 18:41:42 +08:00
< td class = "description last" > < / td >
2018-08-30 02:44:35 +08:00
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line41" > line 41< / a >
2018-08-30 02:44:35 +08:00
< / li > < / ul > < / dd >
< / dl >
2020-03-08 18:41:42 +08:00
< h4 class = "name" id = "currentNote" > < span class = "type-signature" > < / span > currentNote< span class = "type-signature" > < / span > < / h4 >
2018-08-30 02:44:35 +08:00
< h5 class = "subsection-title" > Properties:< / h5 >
< table class = "props" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
2020-03-08 18:41:42 +08:00
< td class = "name" > < code > note< / code > < / td >
2018-08-30 02:44:35 +08:00
< td class = "type" >
< span class = "param-type" > object< / span >
< / td >
2020-03-08 18:41:42 +08:00
< td class = "description last" > where script is currently executing< / td >
2018-08-30 02:44:35 +08:00
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line33" > line 33< / a >
2019-08-21 03:40:47 +08:00
< / li > < / ul > < / dd >
< / dl >
2020-03-08 18:41:42 +08:00
< h4 class = "name" id = "originEntity" > < span class = "type-signature" > < / span > originEntity< span class = "type-signature" > < / span > < / h4 >
2019-08-21 03:40:47 +08:00
< h5 class = "subsection-title" > Properties:< / h5 >
< table class = "props" >
< thead >
< tr >
2020-03-08 18:41:42 +08:00
< th > Name< / th >
2019-08-21 03:40:47 +08:00
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
2020-03-08 18:41:42 +08:00
< td class = "name" > < code > entity< / code > < / td >
2019-08-21 03:40:47 +08:00
< td class = "type" >
2020-03-08 18:41:42 +08:00
< span class = "param-type" > object< / span >
|
< span class = "param-type" > null< / span >
2019-08-21 03:40:47 +08:00
< / td >
2020-03-08 18:41:42 +08:00
< td class = "description last" > whose event triggered this execution< / td >
2019-08-21 03:40:47 +08:00
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line35" > line 35< / a >
2018-08-30 02:44:35 +08:00
< / li > < / ul > < / dd >
< / dl >
< h4 class = "name" id = "startNote" > < span class = "type-signature" > < / span > startNote< span class = "type-signature" > < / span > < / h4 >
< h5 class = "subsection-title" > Properties:< / h5 >
< table class = "props" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > note< / code > < / td >
< td class = "type" >
< span class = "param-type" > object< / span >
< / td >
< td class = "description last" > where script started executing< / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line31" > line 31< / a >
< / li > < / ul > < / dd >
< / dl >
< h4 class = "name" id = "TabAwareWidget" > < span class = "type-signature" > < / span > TabAwareWidget< span class = "type-signature" > < / span > < / h4 >
< h5 class = "subsection-title" > Properties:< / h5 >
< table class = "props" >
< thead >
< tr >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "type" >
< span class = "param-type" > TabAwareWidget< / span >
< / td >
< td class = "description last" > < / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line44" > line 44< / a >
< / li > < / ul > < / dd >
< / dl >
< h4 class = "name" id = "TabCachingWidget" > < span class = "type-signature" > < / span > TabCachingWidget< span class = "type-signature" > < / span > < / h4 >
< h5 class = "subsection-title" > Properties:< / h5 >
< table class = "props" >
< thead >
< tr >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "type" >
< span class = "param-type" > TabCachingWidget< / span >
< / td >
< td class = "description last" > < / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line47" > line 47< / a >
2018-08-30 02:44:35 +08:00
< / li > < / ul > < / dd >
< / dl >
< h3 class = "subsection-title" > Methods< / h3 >
< h4 class = "name" id = "activateNewNote" > < span class = "type-signature" > < / span > activateNewNote< span class = "signature" > (notePath)< / span > < span class = "type-signature" > → {Promise.< void>}< / span > < / h4 >
< div class = "description" >
2020-01-05 04:53:49 +08:00
Activates newly created note. Compared to this.activateNote() also makes sure that frontend has been fully synced.
2018-08-30 02:44:35 +08:00
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > notePath< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > (or noteId)< / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line69" > line 69< / a >
2018-08-30 02:44:35 +08:00
< / li > < / ul > < / dd >
< / dl >
2019-08-21 03:40:47 +08:00
2018-08-30 02:44:35 +08:00
< h5 > Returns:< / h5 >
< dl >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise.< void>< / span >
< / dd >
< / dl >
< h4 class = "name" id = "activateNote" > < span class = "type-signature" > < / span > activateNote< span class = "signature" > (notePath)< / span > < span class = "type-signature" > → {Promise.< void>}< / span > < / h4 >
< div class = "description" >
Activates note in the tree and in the note detail.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > notePath< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > (or noteId)< / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line59" > line 59< / a >
2018-08-30 02:44:35 +08:00
< / li > < / ul > < / dd >
< / dl >
2019-08-21 03:40:47 +08:00
2018-08-30 02:44:35 +08:00
< h5 > Returns:< / h5 >
< dl >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise.< void>< / span >
< / dd >
< / dl >
< h4 class = "name" id = "addButtonToToolbar" > < span class = "type-signature" > < / span > addButtonToToolbar< span class = "signature" > (opts)< / span > < span class = "type-signature" > < / span > < / h4 >
< div class = "description" >
Adds new button the the plugin area.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > opts< / code > < / td >
< td class = "type" >
< span class = "param-type" > < a href = "global.html#ToolbarButtonOptions" > ToolbarButtonOptions< / a > < / span >
< / td >
< td class = "description last" > < / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line89" > line 89< / a >
2018-08-30 02:44:35 +08:00
< / li > < / ul > < / dd >
< / dl >
2019-08-21 03:40:47 +08:00
2020-01-11 03:10:17 +08:00
< h4 class = "name" id = "addTextToActiveTabEditor" > < span class = "type-signature" > < / span > addTextToActiveTabEditor< span class = "signature" > (text)< / span > < span class = "type-signature" > < / span > < / h4 >
< div class = "description" >
Adds given text to the editor cursor
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > text< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
2020-02-02 18:44:08 +08:00
< td class = "description last" > this must be clear text, HTML is not supported.< / td >
2020-01-11 03:10:17 +08:00
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line289" > line 289< / a >
2020-01-11 03:10:17 +08:00
< / li > < / ul > < / dd >
< / dl >
2019-11-06 04:26:54 +08:00
< h4 class = "name" id = "bindGlobalShortcut" > < span class = "type-signature" > < / span > bindGlobalShortcut< span class = "signature" > (keyboardShortcut, handler)< / span > < span class = "type-signature" > < / span > < / h4 >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > keyboardShortcut< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > e.g. "ctrl+shift+a"< / td >
< / tr >
< tr >
< td class = "name" > < code > handler< / code > < / td >
< td class = "type" >
< span class = "param-type" > function< / span >
< / td >
< td class = "description last" > < / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line394" > line 394< / a >
2019-11-06 04:26:54 +08:00
< / li > < / ul > < / dd >
< / dl >
2018-08-30 02:44:35 +08:00
< h4 class = "name" id = "createNoteLink" > < span class = "type-signature" > < / span > createNoteLink< span class = "signature" > (notePath, noteTitle< span class = "signature-attributes" > opt< / span > )< / span > < span class = "type-signature" > < / span > < / h4 >
< div class = "description" >
Create note link (jQuery object) for given note.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th > Attributes< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > notePath< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "attributes" >
< / td >
< td class = "description last" > (or noteId)< / td >
< / tr >
< tr >
< td class = "name" > < code > noteTitle< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "attributes" >
< optional>< br >
< / td >
< td class = "description last" > if not present we'll use note title< / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line281" > line 281< / a >
2018-08-30 02:44:35 +08:00
< / li > < / ul > < / dd >
< / dl >
2019-08-21 03:40:47 +08:00
2018-08-30 02:44:35 +08:00
< h4 class = "name" id = "formatDateISO" > < span class = "type-signature" > < / span > formatDateISO< span class = "signature" > (date)< / span > < span class = "type-signature" > → {string}< / span > < / h4 >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > date< / code > < / td >
< td class = "type" >
< span class = "param-type" > Date< / span >
< / td >
< td class = "description last" > < / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line243" > line 243< / a >
2018-08-30 02:44:35 +08:00
< / li > < / ul > < / dd >
< / dl >
2019-08-21 03:40:47 +08:00
2018-08-30 02:44:35 +08:00
< h5 > Returns:< / h5 >
< div class = "param-desc" >
date in YYYY-MM-DD format
< / div >
< dl >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > string< / span >
< / dd >
< / dl >
2020-02-02 18:44:08 +08:00
< h4 class = "name" id = "getActiveTabNote" > < span class = "type-signature" > < / span > getActiveTabNote< span class = "signature" > ()< / span > < span class = "type-signature" > → {< a href = "NoteShort.html" > NoteShort< / a > }< / span > < / h4 >
2018-10-07 22:27:12 +08:00
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line295" > line 295< / a >
2018-10-07 22:27:12 +08:00
< / li > < / ul > < / dd >
< / dl >
2019-08-21 03:40:47 +08:00
2018-10-07 22:27:12 +08:00
< h5 > Returns:< / h5 >
< div class = "param-desc" >
2019-03-13 04:52:19 +08:00
active note (loaded into right pane)
2018-10-07 22:27:12 +08:00
< / div >
< dl >
< dt >
Type
< / dt >
< dd >
2020-02-02 18:44:08 +08:00
< span class = "param-type" > < a href = "NoteShort.html" > NoteShort< / a > < / span >
2018-10-07 22:27:12 +08:00
< / dd >
< / dl >
2019-10-20 18:29:34 +08:00
< h4 class = "name" id = "getActiveTabNotePath" > < span class = "type-signature" > < / span > getActiveTabNotePath< span class = "signature" > ()< / span > < span class = "type-signature" > → {Promise.< (string|null)>}< / span > < / h4 >
2018-09-03 22:05:28 +08:00
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line309" > line 309< / a >
2018-09-03 22:05:28 +08:00
< / li > < / ul > < / dd >
< / dl >
2019-08-21 03:40:47 +08:00
2018-09-03 22:05:28 +08:00
< h5 > Returns:< / h5 >
< div class = "param-desc" >
2019-05-22 03:47:28 +08:00
returns note path of active note or null if there isn't active note
2018-09-03 22:05:28 +08:00
< / div >
< dl >
< dt >
Type
< / dt >
< dd >
2019-05-22 03:47:28 +08:00
< span class = "param-type" > Promise.< (string|null)>< / span >
2018-09-03 22:05:28 +08:00
< / dd >
< / dl >
2020-02-02 18:44:08 +08:00
< h4 class = "name" id = "getActiveTabTextEditor" > < span class = "type-signature" > < / span > getActiveTabTextEditor< span class = "signature" > (callback)< / span > < span class = "type-signature" > < / span > < / h4 >
2020-01-11 03:10:17 +08:00
< div class = "description" >
See https://ckeditor.com/docs/ckeditor5/latest/api/module_core_editor_editor-Editor.html for a documentation on the returned instance.
< / div >
2020-02-02 18:44:08 +08:00
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > callback< / code > < / td >
< td class = "type" >
< / td >
< td class = "description last" > method receiving "textEditor" instance< / td >
< / tr >
< / tbody >
< / table >
2020-01-11 03:10:17 +08:00
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line303" > line 303< / a >
2020-01-11 03:10:17 +08:00
< / li > < / ul > < / dd >
< / dl >
2019-04-14 18:24:48 +08:00
< h4 class = "name" id = "getDateNote" > < span class = "type-signature" > < / span > getDateNote< span class = "signature" > (date)< / span > < span class = "type-signature" > → {Promise.< < a href = "NoteShort.html" > NoteShort< / a > >}< / span > < / h4 >
2018-08-30 02:44:35 +08:00
< div class = "description" >
2019-04-14 18:24:48 +08:00
Returns date-note. If it doesn't exist, it is automatically created.
2018-08-30 02:44:35 +08:00
< / div >
2019-04-14 18:24:48 +08:00
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > date< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > e.g. "2019-04-29"< / td >
< / tr >
< / tbody >
< / table >
2018-08-30 02:44:35 +08:00
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line360" > line 360< / a >
2018-08-30 02:44:35 +08:00
< / li > < / ul > < / dd >
< / dl >
2019-08-21 03:40:47 +08:00
2018-08-30 02:44:35 +08:00
< h5 > Returns:< / h5 >
< dl >
< dt >
Type
< / dt >
< dd >
2019-04-14 18:24:48 +08:00
< span class = "param-type" > Promise.< < a href = "NoteShort.html" > NoteShort< / a > >< / span >
2018-08-30 02:44:35 +08:00
< / dd >
< / dl >
2019-04-14 18:24:48 +08:00
< h4 class = "name" id = "getInstanceName" > < span class = "type-signature" > < / span > getInstanceName< span class = "signature" > ()< / span > < span class = "type-signature" > → {string}< / span > < / h4 >
2019-02-21 05:24:51 +08:00
< div class = "description" >
2019-04-14 18:24:48 +08:00
Instance name identifies particular Trilium instance. It can be useful for scripts
if some action needs to happen on only one specific instance.
2019-02-21 05:24:51 +08:00
< / div >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line236" > line 236< / a >
2019-02-21 05:24:51 +08:00
< / li > < / ul > < / dd >
< / dl >
2019-08-21 03:40:47 +08:00
2019-02-21 05:24:51 +08:00
< h5 > Returns:< / h5 >
< dl >
< dt >
Type
< / dt >
< dd >
2019-04-14 18:24:48 +08:00
< span class = "param-type" > string< / span >
2019-02-21 05:24:51 +08:00
< / dd >
< / dl >
2019-04-14 18:24:48 +08:00
< h4 class = "name" id = "getMonthNote" > < span class = "type-signature" > < / span > getMonthNote< span class = "signature" > (month)< / span > < span class = "type-signature" > → {Promise.< < a href = "NoteShort.html" > NoteShort< / a > >}< / span > < / h4 >
2018-09-03 22:05:28 +08:00
2019-04-14 18:24:48 +08:00
< div class = "description" >
Returns month-note. If it doesn't exist, it is automatically created.
< / div >
2018-09-03 22:05:28 +08:00
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
2019-04-14 18:24:48 +08:00
< td class = "name" > < code > month< / code > < / td >
2018-09-03 22:05:28 +08:00
< td class = "type" >
2019-04-14 18:24:48 +08:00
< span class = "param-type" > string< / span >
2018-09-03 22:05:28 +08:00
< / td >
2019-04-14 18:24:48 +08:00
< td class = "description last" > e.g. "2019-04"< / td >
2018-09-03 22:05:28 +08:00
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line369" > line 369< / a >
2018-09-03 22:05:28 +08:00
< / li > < / ul > < / dd >
< / dl >
2019-08-21 03:40:47 +08:00
2019-04-14 18:24:48 +08:00
< h5 > Returns:< / h5 >
< dl >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise.< < a href = "NoteShort.html" > NoteShort< / a > >< / span >
< / dd >
< / dl >
2018-09-03 22:05:28 +08:00
2018-08-30 02:44:35 +08:00
2019-04-14 18:24:48 +08:00
< h4 class = "name" id = "getNote" > < span class = "type-signature" > < / span > getNote< span class = "signature" > (noteId)< / span > < span class = "type-signature" > → {Promise.< < a href = "NoteShort.html" > NoteShort< / a > >}< / span > < / h4 >
2018-08-30 02:44:35 +08:00
2019-04-14 18:24:48 +08:00
< div class = "description" >
Returns note by given noteId. If note is missing from cache, it's loaded.
*
< / div >
2018-08-30 02:44:35 +08:00
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
2019-04-14 18:24:48 +08:00
< td class = "name" > < code > noteId< / code > < / td >
2018-08-30 02:44:35 +08:00
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > < / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line208" > line 208< / a >
2018-08-30 02:44:35 +08:00
< / li > < / ul > < / dd >
< / dl >
2019-08-21 03:40:47 +08:00
2018-08-30 02:44:35 +08:00
< h5 > Returns:< / h5 >
< dl >
< dt >
Type
< / dt >
< dd >
2019-04-14 18:24:48 +08:00
< span class = "param-type" > Promise.< < a href = "NoteShort.html" > NoteShort< / a > >< / span >
2018-08-30 02:44:35 +08:00
< / dd >
< / dl >
2019-02-21 05:24:51 +08:00
2019-04-14 18:24:48 +08:00
< h4 class = "name" id = "getNotes" > < span class = "type-signature" > < / span > getNotes< span class = "signature" > (noteIds, silentNotFoundError< span class = "signature-attributes" > opt< / span > )< / span > < span class = "type-signature" > → {Promise.< Array.< < a href = "NoteShort.html" > NoteShort< / a > >>}< / span > < / h4 >
2019-02-21 05:24:51 +08:00
2019-04-14 18:24:48 +08:00
< div class = "description" >
Returns list of notes. If note is missing from cache, it's loaded.
2019-02-21 05:24:51 +08:00
2019-04-14 18:24:48 +08:00
This is often used to bulk-fill the cache with notes which would have to be picked one by one
otherwise (by e.g. createNoteLink())
< / div >
2019-02-21 05:24:51 +08:00
2019-04-14 18:24:48 +08:00
< h5 > Parameters:< / h5 >
2019-02-21 05:24:51 +08:00
2019-04-14 18:24:48 +08:00
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
2019-02-21 05:24:51 +08:00
2019-04-14 18:24:48 +08:00
< th > Type< / th >
2019-02-21 05:24:51 +08:00
2019-04-14 18:24:48 +08:00
< th > Attributes< / th >
2019-02-21 05:24:51 +08:00
2019-04-14 18:24:48 +08:00
2019-02-21 05:24:51 +08:00
2019-04-14 18:24:48 +08:00
< th class = "last" > Description< / th >
< / tr >
< / thead >
2019-02-21 05:24:51 +08:00
2019-04-14 18:24:48 +08:00
< tbody >
2019-02-21 05:24:51 +08:00
2019-04-14 18:24:48 +08:00
< tr >
< td class = "name" > < code > noteIds< / code > < / td >
< td class = "type" >
< span class = "param-type" > Array.< string>< / span >
< / td >
< td class = "attributes" >
< / td >
< td class = "description last" > < / td >
< / tr >
< tr >
< td class = "name" > < code > silentNotFoundError< / code > < / td >
< td class = "type" >
< span class = "param-type" > boolean< / span >
< / td >
< td class = "attributes" >
< optional>< br >
< / td >
< td class = "description last" > don't report error if the note is not found< / td >
< / tr >
< / tbody >
< / table >
2019-02-21 05:24:51 +08:00
2019-04-14 18:24:48 +08:00
< dl class = "details" >
2019-02-21 05:24:51 +08:00
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line220" > line 220< / a >
2019-02-21 05:24:51 +08:00
< / li > < / ul > < / dd >
< / dl >
2019-08-21 03:40:47 +08:00
2019-04-14 18:24:48 +08:00
< h5 > Returns:< / h5 >
< dl >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise.< Array.< < a href = "NoteShort.html" > NoteShort< / a > >>< / span >
< / dd >
< / dl >
2019-02-21 05:24:51 +08:00
2018-08-30 02:44:35 +08:00
2019-04-14 18:24:48 +08:00
< h4 class = "name" id = "getTodayNote" > < span class = "type-signature" > < / span > getTodayNote< span class = "signature" > ()< / span > < span class = "type-signature" > → {Promise.< < a href = "NoteShort.html" > NoteShort< / a > >}< / span > < / h4 >
2018-08-30 02:44:35 +08:00
< div class = "description" >
2019-04-14 18:24:48 +08:00
Returns date-note for today. If it doesn't exist, it is automatically created.
2018-08-30 02:44:35 +08:00
< / div >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line351" > line 351< / a >
2018-08-30 02:44:35 +08:00
< / li > < / ul > < / dd >
< / dl >
2019-08-21 03:40:47 +08:00
2018-08-30 02:44:35 +08:00
< h5 > Returns:< / h5 >
< dl >
< dt >
Type
< / dt >
< dd >
2019-04-14 18:24:48 +08:00
< span class = "param-type" > Promise.< < a href = "NoteShort.html" > NoteShort< / a > >< / span >
< / dd >
< / dl >
< h4 class = "name" id = "getYearNote" > < span class = "type-signature" > < / span > getYearNote< span class = "signature" > (year)< / span > < span class = "type-signature" > → {Promise.< < a href = "NoteShort.html" > NoteShort< / a > >}< / span > < / h4 >
< div class = "description" >
Returns year-note. If it doesn't exist, it is automatically created.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > year< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > e.g. "2019"< / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line378" > line 378< / a >
2019-04-14 18:24:48 +08:00
< / li > < / ul > < / dd >
< / dl >
2019-08-21 03:40:47 +08:00
2019-04-14 18:24:48 +08:00
< h5 > Returns:< / h5 >
< dl >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise.< < a href = "NoteShort.html" > NoteShort< / a > >< / span >
2018-08-30 02:44:35 +08:00
< / dd >
< / dl >
2019-04-14 18:24:48 +08:00
2020-03-08 18:41:42 +08:00
< h4 class = "name" id = "parseDate" > < span class = "type-signature" > < / span > parseDate< span class = "signature" > (str)< / span > < span class = "type-signature" > → {Date}< / span > < / h4 >
2019-04-14 18:24:48 +08:00
2020-03-08 18:41:42 +08:00
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > str< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > < / td >
< / tr >
< / tbody >
< / table >
2019-04-14 18:24:48 +08:00
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line250" > line 250< / a >
2019-04-14 18:24:48 +08:00
< / li > < / ul > < / dd >
< / dl >
2019-08-21 03:40:47 +08:00
2019-04-14 18:24:48 +08:00
< h5 > Returns:< / h5 >
< div class = "param-desc" >
2020-03-08 18:41:42 +08:00
parsed object
2019-04-14 18:24:48 +08:00
< / div >
< dl >
< dt >
Type
< / dt >
< dd >
2020-03-08 18:41:42 +08:00
< span class = "param-type" > Date< / span >
2019-04-14 18:24:48 +08:00
< / dd >
< / dl >
2020-03-08 18:41:42 +08:00
< h4 class = "name" id = "protectActiveNote" > < span class = "type-signature" > < / span > protectActiveNote< span class = "signature" > ()< / span > < span class = "type-signature" > < / span > < / h4 >
< dl class = "details" >
< dt class = "important tag-deprecated" > Deprecated:< / dt > < dd > < ul class = "dummy" > < li > use protectNote and protectSubtree instead< / li > < / ul > < / dd >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line321" > line 321< / a >
2020-03-08 18:41:42 +08:00
< / li > < / ul > < / dd >
< / dl >
< h4 class = "name" id = "protectNote" > < span class = "type-signature" > < / span > protectNote< span class = "signature" > (noteId, protect)< / span > < span class = "type-signature" > < / span > < / h4 >
2019-04-14 18:24:48 +08:00
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
2020-03-08 18:41:42 +08:00
< td class = "name" > < code > noteId< / code > < / td >
2019-04-14 18:24:48 +08:00
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > < / td >
< / tr >
2020-03-08 18:41:42 +08:00
< tr >
< td class = "name" > < code > protect< / code > < / td >
< td class = "type" >
< span class = "param-type" > boolean< / span >
< / td >
< td class = "description last" > true to protect note, false to unprotect< / td >
< / tr >
2019-04-14 18:24:48 +08:00
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line332" > line 332< / a >
2019-04-14 18:24:48 +08:00
< / li > < / ul > < / dd >
< / dl >
2019-08-21 03:40:47 +08:00
2019-04-14 18:24:48 +08:00
2020-03-08 18:41:42 +08:00
2019-04-14 18:24:48 +08:00
2020-03-08 18:41:42 +08:00
2019-04-14 18:24:48 +08:00
2020-03-08 18:41:42 +08:00
2019-04-14 18:24:48 +08:00
2020-03-08 18:41:42 +08:00
< h4 class = "name" id = "protectSubTree" > < span class = "type-signature" > < / span > protectSubTree< span class = "signature" > (noteId, protect)< / span > < span class = "type-signature" > < / span > < / h4 >
2019-04-14 18:24:48 +08:00
2020-03-08 18:41:42 +08:00
< h5 > Parameters:< / h5 >
2019-04-14 18:24:48 +08:00
2020-03-08 18:41:42 +08:00
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
2019-04-14 18:24:48 +08:00
2020-03-08 18:41:42 +08:00
< tr >
< td class = "name" > < code > noteId< / code > < / td >
2019-04-14 18:24:48 +08:00
2020-03-08 18:41:42 +08:00
< td class = "type" >
< span class = "param-type" > string< / span >
2019-04-14 18:24:48 +08:00
2020-03-08 18:41:42 +08:00
< / td >
2019-04-14 18:24:48 +08:00
2020-03-08 18:41:42 +08:00
2019-04-14 18:24:48 +08:00
2020-03-08 18:41:42 +08:00
2019-04-14 18:24:48 +08:00
2020-03-08 18:41:42 +08:00
< td class = "description last" > < / td >
< / tr >
2019-04-14 18:24:48 +08:00
2020-03-08 18:41:42 +08:00
2019-04-14 18:24:48 +08:00
2020-03-08 18:41:42 +08:00
< tr >
< td class = "name" > < code > protect< / code > < / td >
< td class = "type" >
< span class = "param-type" > boolean< / span >
< / td >
< td class = "description last" > true to protect subtree, false to unprotect< / td >
< / tr >
< / tbody >
< / table >
2019-04-14 18:24:48 +08:00
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line341" > line 341< / a >
2019-11-11 02:34:15 +08:00
< / li > < / ul > < / dd >
< / dl >
2019-04-14 18:24:48 +08:00
2020-04-08 01:19:20 +08:00
< h4 class = "name" id = "refreshTree" > < span class = "type-signature" > < / span > refreshTree< span class = "signature" > ()< / span > < span class = "type-signature" > < / span > < / h4 >
2019-04-14 18:24:48 +08:00
< dl class = "details" >
2020-04-08 01:19:20 +08:00
< dt class = "important tag-deprecated" > Deprecated:< / dt > < dd > < ul class = "dummy" > < li > - this is now no-op since all the changes should be gracefully handled per widget< / li > < / ul > < / dd >
2019-04-14 18:24:48 +08:00
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line272" > line 272< / a >
2019-04-14 18:24:48 +08:00
< / li > < / ul > < / dd >
< / dl >
2019-08-21 03:40:47 +08:00
2019-04-14 18:24:48 +08:00
2019-10-26 16:00:26 +08:00
< h4 class = "name" id = "reloadNotes" > < span class = "type-signature" > < / span > reloadNotes< span class = "signature" > (noteIds)< / span > < span class = "type-signature" > < / span > < / h4 >
2019-04-14 18:24:48 +08:00
2019-11-06 04:26:54 +08:00
< div class = "description" >
Update frontend tree (note) cache from the backend.
< / div >
2019-04-14 18:24:48 +08:00
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
2019-10-26 16:00:26 +08:00
< td class = "name" > < code > noteIds< / code > < / td >
2019-04-14 18:24:48 +08:00
< td class = "type" >
2019-10-26 16:00:26 +08:00
< span class = "param-type" > Array.< string>< / span >
2019-04-14 18:24:48 +08:00
< / td >
< td class = "description last" > < / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line228" > line 228< / a >
2019-04-14 18:24:48 +08:00
< / li > < / ul > < / dd >
< / dl >
2019-08-21 03:40:47 +08:00
2019-04-14 18:24:48 +08:00
2018-08-30 02:44:35 +08:00
2020-01-02 05:03:27 +08:00
< h4 class = "name" id = "runOnBackend" > < span class = "type-signature" > < / span > runOnBackend< span class = "signature" > (script, params)< / span > < span class = "type-signature" > → {Promise.< *>}< / span > < / h4 >
2018-08-30 02:44:35 +08:00
< div class = "description" >
2020-01-02 05:03:27 +08:00
Executes given anonymous function on the backend.
2018-08-30 02:44:35 +08:00
Internally this serializes the anonymous function into string and sends it to backend via AJAX.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > script< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > script to be executed on the backend< / td >
< / tr >
< tr >
< td class = "name" > < code > params< / code > < / td >
< td class = "type" >
< span class = "param-type" > Array.< ?>< / span >
< / td >
< td class = "description last" > list of parameters to the anonymous function to be send to backend< / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line139" > line 139< / a >
2018-08-30 02:44:35 +08:00
< / li > < / ul > < / dd >
< / dl >
2019-08-21 03:40:47 +08:00
2018-08-30 02:44:35 +08:00
< h5 > Returns:< / h5 >
< div class = "param-desc" >
return value of the executed function on the backend
< / div >
< dl >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise.< *>< / span >
< / dd >
< / dl >
2020-01-02 05:03:27 +08:00
< h4 class = "name" id = "runOnServer" > < span class = "type-signature" > < / span > runOnServer< span class = "signature" > ()< / span > < span class = "type-signature" > < / span > < / h4 >
< dl class = "details" >
< dt class = "important tag-deprecated" > Deprecated:< / dt > < dd > < ul class = "dummy" > < li > new name of this API call is runOnBackend so use that< / li > < / ul > < / dd >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line168" > line 168< / a >
2020-01-02 05:03:27 +08:00
< / li > < / ul > < / dd >
< / dl >
2018-08-30 02:44:35 +08:00
2018-10-07 22:27:12 +08:00
2019-04-23 04:52:09 +08:00
< h4 class = "name" id = "searchForNote" > < span class = "type-signature" > < / span > searchForNote< span class = "signature" > (searchString)< / span > < span class = "type-signature" > → {Promise.< (< a href = "NoteShort.html" > NoteShort< / a > |null)>}< / span > < / h4 >
< div class = "description" >
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
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > searchString< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > < / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line196" > line 196< / a >
2019-04-23 04:52:09 +08:00
< / li > < / ul > < / dd >
< / dl >
2019-08-21 03:40:47 +08:00
2019-04-23 04:52:09 +08:00
< h5 > Returns:< / h5 >
< dl >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise.< (< a href = "NoteShort.html" > NoteShort< / a > |null)>< / span >
< / dd >
< / dl >
< h4 class = "name" id = "searchForNotes" > < span class = "type-signature" > < / span > searchForNotes< span class = "signature" > (searchString)< / span > < span class = "type-signature" > → {Promise.< Array.< < a href = "NoteShort.html" > NoteShort< / a > >>}< / span > < / h4 >
< div class = "description" >
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
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > searchString< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > < / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line178" > line 178< / a >
2019-04-23 04:52:09 +08:00
< / li > < / ul > < / dd >
< / dl >
2019-08-21 03:40:47 +08:00
2019-04-23 04:52:09 +08:00
< h5 > Returns:< / h5 >
< dl >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise.< Array.< < a href = "NoteShort.html" > NoteShort< / a > >>< / span >
< / dd >
< / dl >
2018-12-23 05:28:49 +08:00
2019-10-22 03:22:53 +08:00
< h4 class = "name" id = "setHoistedNoteId" > < span class = "type-signature" > < / span > setHoistedNoteId< span class = "signature" > (noteId)< / span > < span class = "type-signature" > → {Promise}< / span > < / h4 >
< div class = "description" >
Hoist note. See https://github.com/zadam/trilium/wiki/Note-hoisting
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > noteId< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > set hoisted note. 'root' will effectively unhoist< / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line387" > line 387< / a >
2019-10-22 03:22:53 +08:00
< / li > < / ul > < / dd >
< / dl >
< h5 > Returns:< / h5 >
< dl >
< dt >
Type
< / dt >
< dd >
< span class = "param-type" > Promise< / span >
< / dd >
< / dl >
2018-12-23 05:28:49 +08:00
< h4 class = "name" id = "setupElementTooltip" > < span class = "type-signature" > < / span > setupElementTooltip< span class = "signature" > ($el)< / span > < span class = "type-signature" > < / span > < / h4 >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > $el< / code > < / td >
< td class = "type" >
< span class = "param-type" > object< / span >
< / td >
< td class = "description last" > jquery object on which to setup the tooltip< / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line315" > line 315< / a >
2018-10-07 22:27:12 +08:00
< / li > < / ul > < / dd >
< / dl >
2019-08-21 03:40:47 +08:00
2018-10-07 22:27:12 +08:00
2018-08-30 02:44:35 +08:00
< h4 class = "name" id = "showError" > < span class = "type-signature" > < / span > showError< span class = "signature" > (message)< / span > < span class = "type-signature" > < / span > < / h4 >
< div class = "description" >
Show error message to the user.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > message< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > < / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line266" > line 266< / a >
2018-08-30 02:44:35 +08:00
< / li > < / ul > < / dd >
< / dl >
2019-08-21 03:40:47 +08:00
2018-08-30 02:44:35 +08:00
< h4 class = "name" id = "showMessage" > < span class = "type-signature" > < / span > showMessage< span class = "signature" > (message)< / span > < span class = "type-signature" > < / span > < / h4 >
< div class = "description" >
Show info message to the user.
< / div >
< h5 > Parameters:< / h5 >
< table class = "params" >
< thead >
< tr >
< th > Name< / th >
< th > Type< / th >
< th class = "last" > Description< / th >
< / tr >
< / thead >
< tbody >
< tr >
< td class = "name" > < code > message< / code > < / td >
< td class = "type" >
< span class = "param-type" > string< / span >
< / td >
< td class = "description last" > < / td >
< / tr >
< / tbody >
< / table >
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line258" > line 258< / a >
2018-08-30 02:44:35 +08:00
< / li > < / ul > < / dd >
< / dl >
2019-08-21 03:40:47 +08:00
2019-12-11 06:04:18 +08:00
< h4 class = "name" id = "waitUntilSynced" > < span class = "type-signature" > < / span > waitUntilSynced< span class = "signature" > ()< / span > < span class = "type-signature" > < / span > < / h4 >
2020-01-02 05:03:27 +08:00
< div class = "description" >
Trilium runs in backend and frontend process, when something is changed on the backend from script,
frontend will get asynchronously synchronized.
This method returns a promise which resolves once all the backend -> frontend synchronization is finished.
Typical use case is when new note has been created, we should wait until it is synced into frontend and only then activate it.
< / div >
2019-12-11 06:04:18 +08:00
< dl class = "details" >
< dt class = "tag-source" > Source:< / dt >
< dd class = "tag-source" > < ul class = "dummy" > < li >
2020-04-08 01:19:20 +08:00
< a href = "services_frontend_script_api.js.html" > services/frontend_script_api.js< / a > , < a href = "services_frontend_script_api.js.html#line405" > line 405< / a >
2019-12-11 06:04:18 +08:00
< / li > < / ul > < / dd >
< / dl >
2018-08-30 02:44:35 +08:00
< / article >
< / section >
< / div >
< nav >
2020-04-22 05:14:55 +08:00
< h2 > < a href = "index.html" > Home< / a > < / h2 > < h3 > Classes< / h3 > < ul > < li > < a href = "Branch.html" > Branch< / a > < / li > < li > < a href = "FrontendScriptApi.html" > FrontendScriptApi< / a > < / li > < li > < a href = "NoteComplement.html" > NoteComplement< / a > < / li > < li > < a href = "NoteShort.html" > NoteShort< / a > < / li > < / ul > < h3 > Global< / h3 > < ul > < li > < a href = "global.html#decorateWidget" > decorateWidget< / a > < / li > < li > < a href = "global.html#doRenderBody" > doRenderBody< / a > < / li > < li > < a href = "global.html#widgetCollapsedStateChangedEvent" > widgetCollapsedStateChangedEvent< / a > < / li > < / ul >
2018-08-30 02:44:35 +08:00
< / nav >
< br class = "clear" >
< footer >
2020-04-08 01:19:20 +08:00
Documentation generated by < a href = "https://github.com/jsdoc/jsdoc" > JSDoc 3.6.4< / a >
2018-08-30 02:44:35 +08:00
< / footer >
< script > prettyPrint ( ) ; < / script >
< script src = "scripts/linenumber.js" > < / script >
< / body >
< / html >