diff --git a/docs/frontend_api/FrontendScriptApi.html b/docs/frontend_api/FrontendScriptApi.html index 9168cc1a5..b6a5c6857 100644 --- a/docs/frontend_api/FrontendScriptApi.html +++ b/docs/frontend_api/FrontendScriptApi.html @@ -1683,112 +1683,6 @@ -

getCodeMimeTypes() → {array}

- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- list of currently used code mime types -
- - - -
-
- Type -
-
- -array - - -
-
- - - - - - - - - - - - -

getDateNote(date) → {Promise.<NoteShort>}

@@ -1890,7 +1784,7 @@
Source:
@@ -1944,112 +1838,6 @@ -

getDefaultCodeMimeTypes() → {array}

- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - -
Returns:
- - -
- list of default code mime types -
- - - -
-
- Type -
-
- -array - - -
-
- - - - - - - - - - - - -

getInstanceName() → {string}

@@ -2258,7 +2046,7 @@ if some action needs to happen on only one specific instance.
Source:
@@ -2721,7 +2509,7 @@ otherwise (by e.g. createNoteLink())
Source:
@@ -2876,7 +2664,7 @@ otherwise (by e.g. createNoteLink())
Source:
@@ -3379,7 +3167,7 @@ note.
Source:
@@ -4276,139 +4064,6 @@ Internally this serializes the anonymous function into string and sends it to ba - - - - - - -

setCodeMimeTypes(types)

- - - - - - - - - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
types - - -array - - - - list of mime types to be used
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - @@ -4512,7 +4167,7 @@ Internally this serializes the anonymous function into string and sends it to ba
Source:
diff --git a/docs/frontend_api/services_frontend_script_api.js.html b/docs/frontend_api/services_frontend_script_api.js.html index 203536ab3..40e144f13 100644 --- a/docs/frontend_api/services_frontend_script_api.js.html +++ b/docs/frontend_api/services_frontend_script_api.js.html @@ -332,24 +332,6 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte */ 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; - /** * @method * @param {object} $el - jquery object on which to setup the tooltip diff --git a/src/public/javascripts/services/frontend_script_api.js b/src/public/javascripts/services/frontend_script_api.js index 13d29f20d..846a9471f 100644 --- a/src/public/javascripts/services/frontend_script_api.js +++ b/src/public/javascripts/services/frontend_script_api.js @@ -304,24 +304,6 @@ function FrontendScriptApi(startNote, currentNote, originEntity = null, tabConte */ 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; - /** * @method * @param {object} $el - jquery object on which to setup the tooltip diff --git a/src/public/javascripts/services/note_type.js b/src/public/javascripts/services/note_type.js index 3d0b9b59d..9665bb7cd 100644 --- a/src/public/javascripts/services/note_type.js +++ b/src/public/javascripts/services/note_type.js @@ -1,7 +1,6 @@ import treeService from './tree.js'; import noteDetailService from './note_detail.js'; import server from './server.js'; -import infoService from "./info.js"; const NOTE_TYPES = [ { type: "file", title: "File", selectable: false }, @@ -53,7 +52,7 @@ const DEFAULT_MIME_TYPES = [ let mimeTypes = DEFAULT_MIME_TYPES; -class NoteTypeContext { +export default class NoteTypeContext { /** * @param {TabContext} ctx */ @@ -76,6 +75,7 @@ class NoteTypeContext { this.$noteTypeDesc.text(this.findTypeTitle(this.ctx.note.type)); } + /** actual body is rendered lazily on note-type button click */ renderDropdown() { this.$noteTypeDropdown.empty(); @@ -153,14 +153,4 @@ class NoteTypeContext { const confirmDialog = await import("../dialogs/confirm.js"); return await confirmDialog.confirm("It is not recommended to change note type when note content is not empty. Do you want to continue anyway?"); } -} - -export default { - getDefaultCodeMimeTypes: () => DEFAULT_MIME_TYPES.slice(), - getCodeMimeTypes: () => mimeTypes, - setCodeMimeTypes: types => { mimeTypes = types; } -}; - -export { - NoteTypeContext -}; \ No newline at end of file +} \ No newline at end of file diff --git a/src/public/javascripts/services/tab_context.js b/src/public/javascripts/services/tab_context.js index e283befad..3d97f7831 100644 --- a/src/public/javascripts/services/tab_context.js +++ b/src/public/javascripts/services/tab_context.js @@ -5,7 +5,7 @@ import bundleService from "./bundle.js"; import Attributes from "./attributes.js"; import treeUtils from "./tree_utils.js"; import utils from "./utils.js"; -import {NoteTypeContext} from "./note_type.js"; +import NoteTypeContext from "./note_type.js"; import noteDetailService from "./note_detail.js"; import noteDetailEmpty from "./note_detail_empty.js"; import noteDetailText from "./note_detail_text.js";