publish API to allow manipulating list of allowed mime types for #192

This commit is contained in:
azivner
2018-10-07 14:25:17 +02:00
parent 5f95ab95c9
commit b09071eb9b
2 changed files with 62 additions and 37 deletions

View File

@@ -5,6 +5,7 @@ import infoService from './info.js';
import linkService from './link.js';
import treeCache from './tree_cache.js';
import noteDetailService from './note_detail.js';
import noteTypeService from './note_type.js';
/**
* This is the main frontend API interface for scripts. It's published in the local "api" object.
@@ -204,6 +205,24 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null) {
* @param {function} func - callback called on note change as user is typing (not necessarily tied to save event)
*/
this.onNoteChange = noteDetailService.onNoteChange;
/**
* @method
* @returns {array} list of default code mime types
*/
this.getDefaultCodeMimeTypes = noteTypeService.getDefaultCodeMimeTypes;
/**
* @method
* @returns {array} list of currently used code mime types
*/
this.getCodeMimeTypes = noteTypeService.getCodeMimeTypes;
/**
* @method
* @param {array} types - list of mime types to be used
*/
this.setCodeMimeTypes = noteTypeService.setCodeMimeTypes;
}
export default FrontendScriptApi;