Skip to content

Build your personal knowledge base with Trilium Notes

current note as in note loaded into right pane is now called "active note" in frontend API

zadam0144dc12dfe4
diff --git a/docs/frontend_api/FrontendScriptApi.html b/docs/frontend_api/FrontendScriptApi.html
index cb200a3983..73e9bb535a 100644
--- a/docs/frontend_api/FrontendScriptApi.html
+++ b/docs/frontend_api/FrontendScriptApi.html
@@ -1244,7 +1244,7 @@
- <h4 class="name" id="getCodeMimeTypes"><span class="type-signature"></span>getCodeMimeTypes<span class="signature">()</span><span class="type-signature"> &rarr; {array}</span></h4>
+ <h4 class="name" id="getActiveNote"><span class="type-signature"></span>getActiveNote<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="NoteFull.html">NoteFull</a>}</span></h4>
@@ -1292,7 +1292,7 @@
<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#line242">line 242</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line211">line 211</a>
</li></ul></dd>
@@ -1319,7 +1319,7 @@
<div class="param-desc">
- list of currently used code mime types
+ active note (loaded into right pane)
</div>
@@ -1330,7 +1330,7 @@
</dt>
<dd>
-<span class="param-type">array</span>
+<span class="param-type"><a href="NoteFull.html">NoteFull</a></span>
</dd>
@@ -1348,7 +1348,7 @@
- <h4 class="name" id="getCurrentNote"><span class="type-signature"></span>getCurrentNote<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="NoteFull.html">NoteFull</a>}</span></h4>
+ <h4 class="name" id="getActiveNoteContent"><span class="type-signature"></span>getActiveNoteContent<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
@@ -1396,7 +1396,7 @@
<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#line211">line 211</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line205">line 205</a>
</li></ul></dd>
@@ -1423,7 +1423,7 @@
<div class="param-desc">
- currently loaded note in the editor (HTML, code etc.)
+ content of active note (loaded into right pane)
</div>
@@ -1434,7 +1434,7 @@
</dt>
<dd>
-<span class="param-type"><a href="NoteFull.html">NoteFull</a></span>
+<span class="param-type">string</span>
</dd>
@@ -1452,7 +1452,7 @@
- <h4 class="name" id="getCurrentNoteContent"><span class="type-signature"></span>getCurrentNoteContent<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
+ <h4 class="name" id="getCodeMimeTypes"><span class="type-signature"></span>getCodeMimeTypes<span class="signature">()</span><span class="type-signature"> &rarr; {array}</span></h4>
@@ -1500,7 +1500,7 @@
<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#line205">line 205</a>
+ <a href="services_frontend_script_api.js.html">services/frontend_script_api.js</a>, <a href="services_frontend_script_api.js.html#line242">line 242</a>
</li></ul></dd>
@@ -1527,7 +1527,7 @@
<div class="param-desc">
- content of currently loaded note in the editor (HTML, code etc.)
+ list of currently used code mime types
</div>
@@ -1538,7 +1538,7 @@
</dt>
<dd>
-<span class="param-type">string</span>
+<span class="param-type">array</span>
</dd>
@@ -1964,7 +1964,7 @@ otherwise (by e.g. createNoteLink())
- <h4 class="name" id="isNoteStillLoaded"><span class="type-signature"></span>isNoteStillLoaded<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4>
+ <h4 class="name" id="isNoteStillActive"><span class="type-signature"></span>isNoteStillActive<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4>
@@ -2359,7 +2359,7 @@ note.
- <h4 class="name" id="protectCurrentNote"><span class="type-signature"></span>protectCurrentNote<span class="signature">()</span><span class="type-signature"></span></h4>
+ <h4 class="name" id="protectActiveNote"><span class="type-signature"></span>protectActiveNote<span class="signature">()</span><span class="type-signature"></span></h4>
diff --git a/docs/frontend_api/services_frontend_script_api.js.html b/docs/frontend_api/services_frontend_script_api.js.html
index a543684c6e..7d8adbce93 100644
--- a/docs/frontend_api/services_frontend_script_api.js.html
+++ b/docs/frontend_api/services_frontend_script_api.js.html
@@ -228,15 +228,15 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) {
/**
* @method
- * @returns {string} content of currently loaded note in the editor (HTML, code etc.)
+ * @returns {string} content of active note (loaded into right pane)
*/
- this.getCurrentNoteContent = noteDetailService.getCurrentNoteContent;
+ this.getActiveNoteContent = noteDetailService.getCurrentNoteContent;
/**
* @method
- * @returns {NoteFull} currently loaded note in the editor (HTML, code etc.)
+ * @returns {NoteFull} active note (loaded into right pane)
*/
- this.getCurrentNote = noteDetailService.getCurrentNote;
+ this.getActiveNote = noteDetailService.getCurrentNote;
/**
* This method checks whether user navigated away from the note from which the scripts has been started.
@@ -247,7 +247,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) {
* @method
* @return {boolean} returns true if the original note is still loaded, false if user switched to another
*/
- this.isNoteStillLoaded = () => {
+ this.isNoteStillActive = () => {
return this.originEntity.noteId === noteDetailService.getCurrentNoteId();
};
@@ -284,7 +284,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) {
/**
* @method
*/
- this.protectCurrentNote = protectedSessionService.protectNoteAndSendToServer;
+ this.protectActiveNote = protectedSessionService.protectNoteAndSendToServer;
}
export default FrontendScriptApi;</code></pre>
diff --git a/src/public/javascripts/services/frontend_script_api.js b/src/public/javascripts/services/frontend_script_api.js
index 1d15ad4539..7c79931d21 100644
--- a/src/public/javascripts/services/frontend_script_api.js
+++ b/src/public/javascripts/services/frontend_script_api.js
@@ -200,15 +200,15 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) {
/**
* @method
- * @returns {string} content of currently loaded note in the editor (HTML, code etc.)
+ * @returns {string} content of active note (loaded into right pane)
*/
- this.getCurrentNoteContent = noteDetailService.getCurrentNoteContent;
+ this.getActiveNoteContent = noteDetailService.getCurrentNoteContent;
/**
* @method
- * @returns {NoteFull} currently loaded note in the editor (HTML, code etc.)
+ * @returns {NoteFull} active note (loaded into right pane)
*/
- this.getCurrentNote = noteDetailService.getCurrentNote;
+ this.getActiveNote = noteDetailService.getCurrentNote;
/**
* This method checks whether user navigated away from the note from which the scripts has been started.
@@ -219,7 +219,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) {
* @method
* @return {boolean} returns true if the original note is still loaded, false if user switched to another
*/
- this.isNoteStillLoaded = () => {
+ this.isNoteStillActive = () => {
return this.originEntity.noteId === noteDetailService.getCurrentNoteId();
};
@@ -256,7 +256,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) {
/**
* @method
*/
- this.protectCurrentNote = protectedSessionService.protectNoteAndSendToServer;
+ this.protectActiveNote = protectedSessionService.protectNoteAndSendToServer;
}
export default FrontendScriptApi;
\ No newline at end of file