todolistui.js 788 B

1234567891011121314151617181920212223242526272829
  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/todolistui
  7. */
  8. import { createUIComponent } from './utils';
  9. import todoListIcon from '../theme/icons/todolist.svg';
  10. import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
  11. /**
  12. * The to-do list UI feature. It introduces the `'todoList'` button that
  13. * allows to convert elements to and from to-do list items and to indent or outdent them.
  14. *
  15. * @extends module:core/plugin~Plugin
  16. */
  17. export default class TodoListUI extends Plugin {
  18. /**
  19. * @inheritDoc
  20. */
  21. init() {
  22. const t = this.editor.t;
  23. createUIComponent( this.editor, 'todoList', t( 'To-do List' ), todoListIcon );
  24. }
  25. }