horizontal-line.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 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. '|',
  21. 'alignment',
  22. '|',
  23. 'bulletedList',
  24. 'numberedList',
  25. '|',
  26. 'blockQuote',
  27. 'link',
  28. 'imageUpload',
  29. 'mediaEmbed',
  30. 'insertTable',
  31. 'horizontalLine',
  32. '|',
  33. 'undo',
  34. 'redo',
  35. ],
  36. viewportTopOffset: window.getViewportTopOffsetConfig()
  37. },
  38. image: {
  39. styles: [
  40. 'full',
  41. 'alignLeft',
  42. 'alignRight'
  43. ],
  44. toolbar: [
  45. 'imageStyle:alignLeft',
  46. 'imageStyle:full',
  47. 'imageStyle:alignRight',
  48. '|',
  49. 'imageTextAlternative'
  50. ]
  51. },
  52. table: {
  53. contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells' ]
  54. },
  55. cloudServices: CS_CONFIG
  56. } )
  57. .then( editor => {
  58. window.editor = editor;
  59. } )
  60. .catch( err => {
  61. console.error( err.stack );
  62. } );