8
0

word-count.js 953 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /**
  2. * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4. */
  5. /* global document, window, console, ClassicEditor */
  6. ClassicEditor
  7. .create( document.querySelector( '#demo-editor' ), {
  8. toolbar: {
  9. items: [
  10. 'heading',
  11. '|',
  12. 'bold',
  13. 'italic',
  14. 'bulletedList',
  15. 'numberedList',
  16. '|',
  17. 'outdent',
  18. 'indent',
  19. '|',
  20. 'blockQuote',
  21. 'link',
  22. '|',
  23. 'mediaEmbed',
  24. 'insertTable',
  25. '|',
  26. 'undo',
  27. 'redo'
  28. ],
  29. viewportTopOffset: window.getViewportTopOffsetConfig()
  30. },
  31. table: {
  32. contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells' ]
  33. }
  34. } )
  35. .then( editor => {
  36. window.editor = editor;
  37. document.getElementById( 'demo-word-count' ).appendChild( editor.plugins.get( 'WordCount' ).wordCountContainer );
  38. } )
  39. .catch( err => {
  40. console.error( err.stack );
  41. } );