html-embed.js 1.4 KB

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