horizontal-rule.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. /* globals window, document, console */
  6. import ClassicEditor from '@ckeditor/ckeditor5-build-classic/src/ckeditor';
  7. import HorizontalRule from '@ckeditor/ckeditor5-horizontal-rule/src/horizontalrule';
  8. import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';
  9. ClassicEditor.builtinPlugins.push( HorizontalRule );
  10. ClassicEditor
  11. .create( document.querySelector( '#demo-editor' ), {
  12. toolbar: {
  13. items: [
  14. 'heading',
  15. '|',
  16. 'bold',
  17. 'italic',
  18. 'bulletedList',
  19. 'numberedList',
  20. 'blockQuote',
  21. 'link',
  22. '|',
  23. 'imageUpload',
  24. 'mediaEmbed',
  25. 'insertTable',
  26. '|',
  27. 'undo',
  28. 'redo',
  29. '|',
  30. 'horizontalRule'
  31. ],
  32. viewportTopOffset: window.getViewportTopOffsetConfig()
  33. },
  34. image: {
  35. styles: [
  36. 'full',
  37. 'alignLeft',
  38. 'alignRight'
  39. ],
  40. toolbar: [
  41. 'imageStyle:alignLeft',
  42. 'imageStyle:full',
  43. 'imageStyle:alignRight',
  44. '|',
  45. 'imageTextAlternative'
  46. ]
  47. },
  48. table: {
  49. contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells' ]
  50. },
  51. cloudServices: CS_CONFIG
  52. } )
  53. .then( editor => {
  54. window.editor = editor;
  55. } )
  56. .catch( err => {
  57. console.error( err.stack );
  58. } );