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:
parent
cb1c2db282
commit
4759fa1e1f
4 changed files with 40 additions and 1 deletions
resources/js
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue