custom-highlight-options.js 998 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /**
  2. * @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  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', '|', 'bulletedList', 'numberedList', 'highlight', 'undo', 'redo'
  13. ],
  14. viewportTopOffset: 60
  15. },
  16. highlight: {
  17. options: [
  18. {
  19. model: 'greenMarker',
  20. class: 'marker-green',
  21. title: 'Green marker',
  22. color: 'var(--ck-highlight-marker-green)',
  23. type: 'marker'
  24. },
  25. {
  26. model: 'redPen',
  27. class: 'pen-red',
  28. title: 'Red pen',
  29. color: 'var(--ck-highlight-pen-red)',
  30. type: 'pen'
  31. },
  32. ]
  33. }
  34. } )
  35. .then( editor => {
  36. window.editor = editor;
  37. } )
  38. .catch( err => {
  39. console.error( err.stack );
  40. } );