word-count.js 906 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /**
  2. * @license Copyright (c) 2003-2019, 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. 'blockQuote',
  17. 'link',
  18. '|',
  19. 'mediaEmbed',
  20. 'insertTable',
  21. '|',
  22. 'undo',
  23. 'redo'
  24. ],
  25. viewportTopOffset: window.getViewportTopOffsetConfig()
  26. },
  27. table: {
  28. contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells' ]
  29. }
  30. } )
  31. .then( editor => {
  32. window.editor = editor;
  33. document.getElementById( 'demo-word-count' ).appendChild( editor.plugins.get( 'WordCount' ).wordCountContainer );
  34. } )
  35. .catch( err => {
  36. console.error( err.stack );
  37. } );