xref: /webtrees/resources/views/modules/ckeditor/ckeditor-js.phtml (revision 90949315619051b772509f417394730bd8b1bda0)
1<script src="<?= e($ckeditor_path) ?>ckeditor.js"></script>
2
3<script>
4    const CKEDITOR_BASEPATH = <?= json_encode($ckeditor_path) ?>;
5
6    // Enable for all browsers
7    CKEDITOR.env.isCompatible = true;
8
9    // Disable toolbars
10    CKEDITOR.config.language = <?= json_encode(strtolower($language)) ?>;
11    CKEDITOR.config.removePlugins = "forms,newpage,preview,print,save,templates,flash,iframe";
12    CKEDITOR.config.extraAllowedContent = "area[shape,coords,href,target,alt,title];map[name];img[usemap];*[class,style]";
13
14    // Do not convert é to &eacute; in the editor
15    CKEDITOR.config.entities = false;
16
17    // Activate the editor
18    document.querySelectorAll("textarea.html-edit").forEach((node) => {
19        CKEDITOR.replace(node.id);
20    });
21</script>
22