mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	current note as in note loaded into right pane is now called "active note" in frontend API
This commit is contained in:
		| @@ -1244,6 +1244,214 @@ | |||||||
|      |      | ||||||
|  |  | ||||||
|      |      | ||||||
|  |     <h4 class="name" id="getActiveNote"><span class="type-signature"></span>getActiveNote<span class="signature">()</span><span class="type-signature"> → {<a href="NoteFull.html">NoteFull</a>}</span></h4> | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | <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#line211">line 211</a> | ||||||
|  |     </li></ul></dd> | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  | </dl> | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | <h5>Returns:</h5> | ||||||
|  |  | ||||||
|  |          | ||||||
|  | <div class="param-desc"> | ||||||
|  |     active note (loaded into right pane) | ||||||
|  | </div> | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | <dl> | ||||||
|  |     <dt> | ||||||
|  |         Type | ||||||
|  |     </dt> | ||||||
|  |     <dd> | ||||||
|  |          | ||||||
|  | <span class="param-type"><a href="NoteFull.html">NoteFull</a></span> | ||||||
|  |  | ||||||
|  |  | ||||||
|  |     </dd> | ||||||
|  | </dl> | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |          | ||||||
|  |              | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |     <h4 class="name" id="getActiveNoteContent"><span class="type-signature"></span>getActiveNoteContent<span class="signature">()</span><span class="type-signature"> → {string}</span></h4> | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | <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#line205">line 205</a> | ||||||
|  |     </li></ul></dd> | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|  | </dl> | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | <h5>Returns:</h5> | ||||||
|  |  | ||||||
|  |          | ||||||
|  | <div class="param-desc"> | ||||||
|  |     content of active note (loaded into right pane) | ||||||
|  | </div> | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | <dl> | ||||||
|  |     <dt> | ||||||
|  |         Type | ||||||
|  |     </dt> | ||||||
|  |     <dd> | ||||||
|  |          | ||||||
|  | <span class="param-type">string</span> | ||||||
|  |  | ||||||
|  |  | ||||||
|  |     </dd> | ||||||
|  | </dl> | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |          | ||||||
|  |              | ||||||
|  |  | ||||||
|  |      | ||||||
|  |  | ||||||
|  |      | ||||||
|     <h4 class="name" id="getCodeMimeTypes"><span class="type-signature"></span>getCodeMimeTypes<span class="signature">()</span><span class="type-signature"> → {array}</span></h4> |     <h4 class="name" id="getCodeMimeTypes"><span class="type-signature"></span>getCodeMimeTypes<span class="signature">()</span><span class="type-signature"> → {array}</span></h4> | ||||||
|      |      | ||||||
|  |  | ||||||
| @@ -1348,214 +1556,6 @@ | |||||||
|      |      | ||||||
|  |  | ||||||
|      |      | ||||||
|     <h4 class="name" id="getCurrentNote"><span class="type-signature"></span>getCurrentNote<span class="signature">()</span><span class="type-signature"> → {<a href="NoteFull.html">NoteFull</a>}</span></h4> |  | ||||||
|      |  | ||||||
|  |  | ||||||
|      |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| <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#line211">line 211</a> |  | ||||||
|     </li></ul></dd> |  | ||||||
|      |  | ||||||
|  |  | ||||||
|      |  | ||||||
|  |  | ||||||
|      |  | ||||||
|  |  | ||||||
|      |  | ||||||
| </dl> |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| <h5>Returns:</h5> |  | ||||||
|  |  | ||||||
|          |  | ||||||
| <div class="param-desc"> |  | ||||||
|     currently loaded note in the editor (HTML, code etc.) |  | ||||||
| </div> |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| <dl> |  | ||||||
|     <dt> |  | ||||||
|         Type |  | ||||||
|     </dt> |  | ||||||
|     <dd> |  | ||||||
|          |  | ||||||
| <span class="param-type"><a href="NoteFull.html">NoteFull</a></span> |  | ||||||
|  |  | ||||||
|  |  | ||||||
|     </dd> |  | ||||||
| </dl> |  | ||||||
|  |  | ||||||
|      |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|          |  | ||||||
|              |  | ||||||
|  |  | ||||||
|      |  | ||||||
|  |  | ||||||
|      |  | ||||||
|     <h4 class="name" id="getCurrentNoteContent"><span class="type-signature"></span>getCurrentNoteContent<span class="signature">()</span><span class="type-signature"> → {string}</span></h4> |  | ||||||
|      |  | ||||||
|  |  | ||||||
|      |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| <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#line205">line 205</a> |  | ||||||
|     </li></ul></dd> |  | ||||||
|      |  | ||||||
|  |  | ||||||
|      |  | ||||||
|  |  | ||||||
|      |  | ||||||
|  |  | ||||||
|      |  | ||||||
| </dl> |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| <h5>Returns:</h5> |  | ||||||
|  |  | ||||||
|          |  | ||||||
| <div class="param-desc"> |  | ||||||
|     content of currently loaded note in the editor (HTML, code etc.) |  | ||||||
| </div> |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| <dl> |  | ||||||
|     <dt> |  | ||||||
|         Type |  | ||||||
|     </dt> |  | ||||||
|     <dd> |  | ||||||
|          |  | ||||||
| <span class="param-type">string</span> |  | ||||||
|  |  | ||||||
|  |  | ||||||
|     </dd> |  | ||||||
| </dl> |  | ||||||
|  |  | ||||||
|      |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|          |  | ||||||
|              |  | ||||||
|  |  | ||||||
|      |  | ||||||
|  |  | ||||||
|      |  | ||||||
|     <h4 class="name" id="getDefaultCodeMimeTypes"><span class="type-signature"></span>getDefaultCodeMimeTypes<span class="signature">()</span><span class="type-signature"> → {array}</span></h4> |     <h4 class="name" id="getDefaultCodeMimeTypes"><span class="type-signature"></span>getDefaultCodeMimeTypes<span class="signature">()</span><span class="type-signature"> → {array}</span></h4> | ||||||
|      |      | ||||||
|  |  | ||||||
| @@ -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"> → {boolean}</span></h4> |     <h4 class="name" id="isNoteStillActive"><span class="type-signature"></span>isNoteStillActive<span class="signature">()</span><span class="type-signature"> → {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> | ||||||
|      |      | ||||||
|  |  | ||||||
|      |      | ||||||
|   | |||||||
| @@ -228,15 +228,15 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) { | |||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * @method |      * @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 |      * @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. |      * 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 |      * @method | ||||||
|      * @return {boolean} returns true if the original note is still loaded, false if user switched to another |      * @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(); |         return this.originEntity.noteId === noteDetailService.getCurrentNoteId(); | ||||||
|     }; |     }; | ||||||
|  |  | ||||||
| @@ -284,7 +284,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) { | |||||||
|     /** |     /** | ||||||
|      * @method |      * @method | ||||||
|      */ |      */ | ||||||
|     this.protectCurrentNote = protectedSessionService.protectNoteAndSendToServer; |     this.protectActiveNote = protectedSessionService.protectNoteAndSendToServer; | ||||||
| } | } | ||||||
|  |  | ||||||
| export default FrontendScriptApi;</code></pre> | export default FrontendScriptApi;</code></pre> | ||||||
|   | |||||||
| @@ -200,15 +200,15 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) { | |||||||
|  |  | ||||||
|     /** |     /** | ||||||
|      * @method |      * @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 |      * @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. |      * 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 |      * @method | ||||||
|      * @return {boolean} returns true if the original note is still loaded, false if user switched to another |      * @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(); |         return this.originEntity.noteId === noteDetailService.getCurrentNoteId(); | ||||||
|     }; |     }; | ||||||
|  |  | ||||||
| @@ -256,7 +256,7 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) { | |||||||
|     /** |     /** | ||||||
|      * @method |      * @method | ||||||
|      */ |      */ | ||||||
|     this.protectCurrentNote = protectedSessionService.protectNoteAndSendToServer; |     this.protectActiveNote = protectedSessionService.protectNoteAndSendToServer; | ||||||
| } | } | ||||||
|  |  | ||||||
| export default FrontendScriptApi; | export default FrontendScriptApi; | ||||||
		Reference in New Issue
	
	Block a user