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

@@ -4,6 +4,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.
@@ -191,6 +192,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;