1.js 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. /**
  2. * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* globals console, window, document */
  6. import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
  7. import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset';
  8. ClassicEditor
  9. .create( document.querySelector( '#editor' ), {
  10. plugins: [ ArticlePluginSet ],
  11. toolbar: [ 'headings', 'undo', 'redo' ],
  12. image: {
  13. toolbar: [ 'imageTextAlternative' ]
  14. }
  15. } )
  16. .then( editor => {
  17. window.editor = editor;
  18. // const schema = editor.model.schema;
  19. // TODO this requires a callback
  20. // schema.xdisallow( { name: '$text', attributes: [ 'linkHref', 'italic' ], inside: 'heading1' } );
  21. // schema.xdisallow( { name: '$text', attributes: [ 'italic' ], inside: 'heading2' } );
  22. // schema.xdisallow( { name: '$text', attributes: [ 'linkHref' ], inside: 'blockQuote listItem' } );
  23. // schema.xdisallow( { name: '$text', attributes: [ 'bold' ], inside: 'paragraph' } );
  24. // schema.xdisallow( { name: 'heading3', inside: '$root' } );
  25. } )
  26. .catch( err => {
  27. console.error( err.stack );
  28. } );