mention.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /**
  2. * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /* global console, window */
  6. import global from '@ckeditor/ckeditor5-utils/src/dom/global';
  7. import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
  8. import Mention from '../../src/mention';
  9. import Underline from '@ckeditor/ckeditor5-basic-styles/src/underline';
  10. import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset';
  11. import Font from '@ckeditor/ckeditor5-font/src/font';
  12. ClassicEditor
  13. .create( global.document.querySelector( '#editor' ), {
  14. plugins: [ ArticlePluginSet, Underline, Font, Mention ],
  15. toolbar: [
  16. 'heading',
  17. '|', 'bulletedList', 'numberedList', 'blockQuote',
  18. '|', 'bold', 'italic', 'underline', 'link',
  19. '|', 'fontFamily', 'fontSize', 'fontColor', 'fontBackgroundColor',
  20. '|', 'insertTable',
  21. '|', 'undo', 'redo'
  22. ],
  23. mention: {
  24. feeds: [
  25. {
  26. feed: [ 'Barney', 'Lily', 'Marshall', 'Robin', 'Ted' ]
  27. },
  28. {
  29. marker: '#',
  30. feed: [
  31. 'a01', 'a02', 'a03', 'a04', 'a05', 'a06', 'a07', 'a08', 'a09', 'a10',
  32. 'a11', 'a12', 'a13', 'a14', 'a15', 'a16', 'a17', 'a18', 'a19', 'a20'
  33. ]
  34. }
  35. ]
  36. }
  37. } )
  38. .then( editor => {
  39. window.editor = editor;
  40. } )
  41. .catch( err => {
  42. console.error( err.stack );
  43. } );