custom-highlight-options.js 878 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. ClassicEditor
  7. .create( document.querySelector( '#snippet-highlight-custom-options' ), {
  8. toolbar: {
  9. items: [
  10. 'headings', '|', 'bulletedList', 'numberedList', 'highlightDropdown', 'undo', 'redo'
  11. ],
  12. viewportTopOffset: 60
  13. },
  14. highlight: {
  15. options: [
  16. {
  17. model: 'greenMarker',
  18. class: 'marker-green',
  19. title: 'Green marker',
  20. color: 'var(--ck-highlight-marker-green)',
  21. type: 'marker'
  22. },
  23. {
  24. model: 'redPen',
  25. class: 'pen-red',
  26. title: 'Red pen',
  27. color: 'var(--ck-highlight-pen-red)',
  28. type: 'pen'
  29. },
  30. ]
  31. }
  32. } )
  33. .then( editor => {
  34. window.editor = editor;
  35. } )
  36. .catch( err => {
  37. console.error( err.stack );
  38. } );