xref: /webtrees/resources/views/modules/ckeditor/ckeditor-js.phtml (revision c5e5c1cea5f7d35d6fd56eb77c9a68e91d21befe)
1<?php use Fisharebest\Webtrees\Module\CkeditorModule; ?>
2<?php use Fisharebest\Webtrees\Services\ModuleService; ?>
3<?php use Fisharebest\Webtrees\View; ?>
4
5<?php if (app()->make(ModuleService::class)->findByInterface(CkeditorModule::class)): ?>
6    <?php View::push('javascript') ?>
7    <script src="<?= e(CkeditorModule::CKEDITOR_PATH) ?>ckeditor.js"></script>
8    <script src="<?= e(CkeditorModule::CKEDITOR_PATH) ?>adapters/jquery.js"></script>
9
10    <script>
11    var CKEDITOR_BASEPATH = <?= json_encode(CkeditorModule::CKEDITOR_PATH) ?>;
12
13    // Enable for all browsers
14    CKEDITOR.env.isCompatible = true;
15
16    // Disable toolbars
17    CKEDITOR.config.language = "<?= strtolower(WT_LOCALE) ?>";
18    CKEDITOR.config.removePlugins = "forms,newpage,preview,print,save,templates,flash,iframe";
19    CKEDITOR.config.extraAllowedContent = "area[shape,coords,href,target,alt,title];map[name];img[usemap];*[class,style]";
20
21    // Activate the editor
22    $("textarea.html-edit").ckeditor();
23    </script>
24    <?php View::endpush() ?>
25<?php endif ?>
26