new frontend API - getCurrentNoteContent and onNoteChange

This commit is contained in:
azivner
2018-09-03 16:05:28 +02:00
parent a3feaa13b3
commit c7a609e349
42 changed files with 817 additions and 106 deletions

View File

@@ -32,6 +32,7 @@ import utils from './utils.js';
import infoService from './info.js';
import linkService from './link.js';
import treeCache from './tree_cache.js';
import noteDetailService from './note_detail.js';
/**
* This is the main frontend API interface for scripts. It's published in the local "api" object.
@@ -219,6 +220,18 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) {
* @param {string} [noteTitle] - if not present we'll use note title
*/
this.createNoteLink = linkService.createNoteLink;
/**
* @method
* @returns {string} content of currently loaded note in the editor (HTML, code etc.)
*/
this.getCurrentNoteContent = noteDetailService.getCurrentNoteContent;
/**
* @method
* @param {function} func - callback called on note change
*/
this.onNoteChange = noteDetailService.onNoteChange;
}
export default FrontendScriptApi;</code></pre>
@@ -237,7 +250,7 @@ export default FrontendScriptApi;</code></pre>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Aug 29 2018 20:44:07 GMT+0200 (CEST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Sep 03 2018 16:04:46 GMT+0200 (CEST)
</footer>
<script> prettyPrint(); </script>