0
0
Fork 0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-05-20 15:09:38 +00:00

Made the "Custom HTML Head Content" setting a highlighted code editor

This commit is contained in:
Dan Brown 2022-05-17 17:39:31 +01:00
parent cb1c2db282
commit 4759fa1e1f
No known key found for this signature in database
GPG key ID: 46D9F943C24A2EF9
4 changed files with 40 additions and 1 deletions
resources/js

View file

@ -242,6 +242,21 @@ export function popupEditor(elem, modeSuggestion) {
});
}
/**
* Create an inline editor to replace the given textarea.
* @param {HTMLTextAreaElement} textArea
* @param {String} mode
* @returns {CodeMirror3}
*/
export function inlineEditor(textArea, mode) {
return CodeMirror.fromTextArea(textArea, {
mode: getMode(mode, textArea.value),
lineNumbers: true,
lineWrapping: false,
theme: getTheme(),
});
}
/**
* Set the mode of a codemirror instance.
* @param cmInstance