client: Apply syntax highlight in real-time

This commit is contained in:
Elian Doran 2024-10-27 20:08:12 +02:00
parent 0d270cbeb6
commit 2fdff29067
No known key found for this signature in database
2 changed files with 3 additions and 0 deletions

View File

@ -177,6 +177,7 @@ function loadHighlightingTheme(theme) {
export default {
requireCss,
requireLibrary,
loadHighlightingTheme,
CKEDITOR,
CODE_MIRROR,
ESLINT,

View File

@ -1,3 +1,4 @@
import library_loader from "../../../../services/library_loader.js";
import server from "../../../../services/server.js";
import OptionsWidget from "../options_widget.js";
@ -20,6 +21,7 @@ export default class HighlightingOptions extends OptionsWidget {
this.$themeSelect = this.$widget.find(".theme-select");
this.$themeSelect.on("change", async () => {
const newTheme = this.$themeSelect.val();
library_loader.loadHighlightingTheme(newTheme);
await server.put(`options/highlightingTheme/${newTheme}`);
});
}