mirror of
https://github.com/zadam/trilium.git
synced 2025-11-07 22:05:44 +01:00
removed frontend APIs to modify code note types
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
};
|
||||
}
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user