mirror of
https://github.com/zadam/trilium.git
synced 2025-10-30 01:36:24 +01:00
refactor(server): remove dependency on codemirror project
This commit is contained in:
@@ -8,7 +8,6 @@ import type { Request } from "express";
|
||||
import { changeLanguage, getLocales } from "../../services/i18n.js";
|
||||
import { listSyntaxHighlightingThemes } from "../../services/code_block_theme.js";
|
||||
import type { OptionNames } from "@triliumnext/commons";
|
||||
import { ColorThemes } from "@triliumnext/codemirror";
|
||||
|
||||
// options allowed to be updated directly in the Options dialog
|
||||
const ALLOWED_OPTIONS = new Set<OptionNames>([
|
||||
@@ -195,13 +194,6 @@ function getSyntaxHighlightingThemes() {
|
||||
return listSyntaxHighlightingThemes();
|
||||
}
|
||||
|
||||
function getCodeNoteThemes() {
|
||||
return ColorThemes.map((theme) => ({
|
||||
val: `default:${theme.id}`,
|
||||
title: theme.name
|
||||
}));
|
||||
}
|
||||
|
||||
function getSupportedLocales() {
|
||||
return getLocales();
|
||||
}
|
||||
@@ -219,6 +211,5 @@ export default {
|
||||
updateOptions,
|
||||
getUserThemes,
|
||||
getSyntaxHighlightingThemes,
|
||||
getCodeNoteThemes,
|
||||
getSupportedLocales
|
||||
};
|
||||
|
||||
@@ -245,7 +245,6 @@ function register(app: express.Application) {
|
||||
apiRoute(PUT, "/api/options", optionsApiRoute.updateOptions);
|
||||
apiRoute(GET, "/api/options/user-themes", optionsApiRoute.getUserThemes);
|
||||
apiRoute(GET, "/api/options/codeblock-themes", optionsApiRoute.getSyntaxHighlightingThemes);
|
||||
apiRoute(GET, "/api/options/codenote-themes", optionsApiRoute.getCodeNoteThemes)
|
||||
apiRoute(GET, "/api/options/locales", optionsApiRoute.getSupportedLocales);
|
||||
|
||||
apiRoute(PST, "/api/password/change", passwordApiRoute.changePassword);
|
||||
|
||||
@@ -36,9 +36,6 @@
|
||||
{
|
||||
"path": "../../packages/ckeditor5/tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/codemirror/tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/turndown-plugin-gfm/tsconfig.lib.json"
|
||||
},
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
{
|
||||
"path": "../../packages/ckeditor5"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/codemirror"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/turndown-plugin-gfm"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user