mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-09 10:22:51 +03:00
@@ -97,6 +97,17 @@ function registerEditorShortcuts(editor) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Load custom HTML head content from the settings into the editor.
|
||||
* @param editor
|
||||
*/
|
||||
function loadCustomHeadContent(editor) {
|
||||
window.$http.get(window.baseUrl('/custom-head-content')).then(resp => {
|
||||
if (!resp.data) return;
|
||||
let head = editor.getDoc().querySelector('head');
|
||||
head.innerHTML += resp.data;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Create and enable our custom code plugin
|
||||
@@ -322,6 +333,9 @@ module.exports = {
|
||||
args.content = '';
|
||||
}
|
||||
},
|
||||
init_instance_callback: function(editor) {
|
||||
loadCustomHeadContent(editor);
|
||||
},
|
||||
setup: function (editor) {
|
||||
|
||||
editor.on('init ExecCommand change input NodeChange ObjectResized', editorChange);
|
||||
|
Reference in New Issue
Block a user