8
0

indentediting.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 indent/indentediting
  7. */
  8. import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
  9. import MultiCommand from '@ckeditor/ckeditor5-core/src/multicommand';
  10. /**
  11. * The indent editing feature.
  12. *
  13. * This plugin registers the `'indent'` and `'outdent'` commands.
  14. *
  15. * **Note**: In order for the commands to work, at least one of the compatible features is required. Read more in the
  16. * {@link module:indent/indent~Indent indent feature} API documentation.
  17. *
  18. * @extends module:core/plugin~Plugin
  19. */
  20. export default class IndentEditing extends Plugin {
  21. /**
  22. * @inheritDoc
  23. */
  24. static get pluginName() {
  25. return 'IndentEditing';
  26. }
  27. /**
  28. * @inheritDoc
  29. */
  30. init() {
  31. const editor = this.editor;
  32. editor.commands.add( 'indent', new MultiCommand( editor ) );
  33. editor.commands.add( 'outdent', new MultiCommand( editor ) );
  34. }
  35. }