From 977cbeed43de60adbd3d4ea25cb849ed030b6e9c Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 2 Apr 2023 15:17:44 +1200 Subject: [PATCH] Load available CM themes to global config --- server/app.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/server/app.js b/server/app.js index 5b153d115..0f56ee52a 100644 --- a/server/app.js +++ b/server/app.js @@ -17,6 +17,8 @@ const asyncHandler = require('express-async-handler'); const { DEFAULT_BREW } = require('./brewDefaults.js'); +const codeMirrorThemes = require('../themes/codeMirror/editorThemes.json'); + const splitTextStyleAndMetadata = (brew)=>{ brew.text = brew.text.replaceAll('\r\n', '\n'); if(brew.text.startsWith('```metadata')) { @@ -419,9 +421,10 @@ app.use(asyncHandler(async (req, res, next)=>{ // Create configuration object const configuration = { - local : isLocalEnvironment, - publicUrl : config.get('publicUrl') ?? '', - environment : nodeEnv + local : isLocalEnvironment, + publicUrl : config.get('publicUrl') ?? '', + environment : nodeEnv, + codeMirrorThemes : codeMirrorThemes }; const props = { version : require('./../package.json').version,