listui.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  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. /**
  6. * @module list/listui
  7. */
  8. import { createUIComponent } from './utils';
  9. import numberedListIcon from '../theme/icons/numberedlist.svg';
  10. import bulletedListIcon from '../theme/icons/bulletedlist.svg';
  11. import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
  12. /**
  13. * The list UI feature. It introduces the `'numberedList'` and `'bulletedList'` buttons that
  14. * allow to convert paragraphs to and from list items and indent or outdent them.
  15. *
  16. * @extends module:core/plugin~Plugin
  17. */
  18. export default class ListUI extends Plugin {
  19. /**
  20. * @inheritDoc
  21. */
  22. init() {
  23. const t = this.editor.t;
  24. // Create two buttons and link them with numberedList and bulletedList commands.
  25. createUIComponent( this.editor, 'numberedList', t( 'Numbered List' ), numberedListIcon );
  26. createUIComponent( this.editor, 'bulletedList', t( 'Bulleted List' ), bulletedListIcon );
  27. }
  28. }