mention.js 828 B

123456789101112131415161718192021222324252627282930313233
  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 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-mention' ), {
  9. cloudServices: CS_CONFIG,
  10. toolbar: {
  11. items: [
  12. 'heading', '|', 'bold', 'italic', '|', 'undo', 'redo'
  13. ],
  14. viewportTopOffset: window.getViewportTopOffsetConfig()
  15. },
  16. mention: {
  17. feeds: [
  18. {
  19. marker: '@',
  20. feed: [ '@Barney', '@Lily', '@Marshall', '@Robin', '@Ted' ]
  21. }
  22. ]
  23. }
  24. } )
  25. .then( editor => {
  26. window.editor = editor;
  27. } )
  28. .catch( err => {
  29. console.error( err.stack );
  30. } );