在同一页面“ CKEDITOR5”上使用多个不同的编辑器

时间:2020-03-19 13:17:33

标签: javascript html ckeditor ckeditor5

在同一页面“ CKEDITOR5 ”上使用多个不同的编辑器 经典e气球

我不能在页面上放置两种不同类型的编辑器。 下面,我举一个例子说明放置2个不同的编辑器的样子。

但是当我为每种类型的编辑器都有一个库时,它似乎会显示“ CKEditorError:ckeditor-duplicated-modules:某些CKEditor 5模块是重复的。

对不起,英语不好。

<div class="editorclassic">
</div>
<div class="editorballoon">
</div>

// The two libraries repeated but each adapted to a type of editor
<script src="plugins/ckeditor5classic/build/ckeditor.js"></script>
<script src="plugins/ckeditor5ballon/build/ckeditor.js"></script>

// Initialize both types of editors
<script>
            ClassicEditor
            .create( document.querySelector( '.editornormal' ), {
                toolbar: {
                    items: [
                        'heading',
                        '|',
                        'bold',
                        'italic',
                        'bulletedList',
                        'numberedList',
                        '|',
                        '|',
                        'imageUpload',
                        'blockQuote',
                        'insertTable',
                        'mediaEmbed',
                        'undo',
                        'redo'
                    ]
                },
                language: 'pt',
                licenseKey: '',

            } )
            .then( editor => {
                window.editor = editor;
            } )
            .catch( error => {
                console.error( error );
            } );



            BalloonEditor
            .create( document.querySelector( '.editorballon' ), {
                toolbar: {
                    items: [
                        'heading',
                        '|',
                        'bold',
                        'italic',
                        'link',
                        'bulletedList',
                        'numberedList',
                        '|',
                        'indent',
                        'outdent',
                        '|',
                        'imageUpload',
                        'blockQuote',
                        'insertTable',
                        'mediaEmbed',
                        'undo',
                        'redo'
                    ]
                },
                language: 'pt',
                image: {
                    toolbar: [
                        'imageTextAlternative',
                        'imageStyle:full',
                        'imageStyle:side'
                    ]
                },
                table: {
                    contentToolbar: [
                        'tableColumn',
                        'tableRow',
                        'mergeTableCells'
                    ]
                },
                licenseKey: '',

            } )
            .then( editor => {
                window.editor = editor;
            } )
            .catch( error => {
                console.error( error );
            } );
    </script>

1 个答案:

答案 0 :(得分:-1)

dim rst     as dao.RecordSet
dim strSQL  as string
strSQL = "select * from DAT2M where Ref2id = " & me!id
set rst = Currentdb.OpenRecordSet(strSQL)
rst.edit
rst.Fields("[uzivatel]") = uzivDB
rst.Update
rst.close
document.addEventListener("DOMContentLoaded", function(event) { 
var numb = 1;
  do {
    ClassicEditor
    .create( document.querySelector( '#body'+ numb ), {
      removePlugins: [ 'insertImage', 'insertMedia', 'Link', 'blockQuote' ],
      toolbar: [ 'Heading', 'bold', 'italic', 'bulletedList', 'numberedList',  ]
    } ) 
    .catch( error => {
      console.error( error );
    } )
    numb++;
  }
  while (numb < 4);
}); 
.ck-editor__editable_inline {
    min-height: 150px;  
  }