custom-highlight-options.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 ClassicEditor, console, window, document */
  6. import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';
  7. ClassicEditor
  8. .create( document.querySelector( '#snippet-highlight-custom-options' ), {
  9. cloudServices: CS_CONFIG,
  10. toolbar: {
  11. items: [
  12. 'heading',
  13. '|',
  14. 'bulletedList',
  15. 'numberedList',
  16. '|',
  17. 'outdent',
  18. 'indent',
  19. '|',
  20. 'highlight',
  21. 'undo',
  22. 'redo'
  23. ],
  24. viewportTopOffset: window.getViewportTopOffsetConfig()
  25. },
  26. highlight: {
  27. options: [
  28. {
  29. model: 'greenMarker',
  30. class: 'marker-green',
  31. title: 'Green marker',
  32. color: 'var(--ck-highlight-marker-green)',
  33. type: 'marker'
  34. },
  35. {
  36. model: 'redPen',
  37. class: 'pen-red',
  38. title: 'Red pen',
  39. color: 'var(--ck-highlight-pen-red)',
  40. type: 'pen'
  41. }
  42. ]
  43. }
  44. } )
  45. .then( editor => {
  46. window.editor = editor;
  47. } )
  48. .catch( err => {
  49. console.error( err.stack );
  50. } );