summaryrefslogtreecommitdiff
path: root/resources/views/modules/ckeditor/ckeditor-js.phtml
blob: d443da103f782f89a66bb1cbcfda1b3ace48f16e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<script src="<?= e($ckeditor_path) ?>ckeditor.js"></script>

<script>
    const CKEDITOR_BASEPATH = <?= json_encode($ckeditor_path) ?>;

    // Enable for all browsers
    CKEDITOR.env.isCompatible = true;

    // Disable toolbars
    CKEDITOR.config.language = <?= json_encode(strtolower($language)) ?>;
    CKEDITOR.config.removePlugins = "forms,newpage,preview,print,save,templates,flash,iframe";
    CKEDITOR.config.extraAllowedContent = "area[shape,coords,href,target,alt,title];map[name];img[usemap];*[class,style]";

    // Activate the editor
    document.querySelectorAll("textarea.html-edit").forEach((node) => {
        CKEDITOR.replace(node.id);
    });
</script>