horizontal-line.js 1.5 KB

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