8
0
Просмотр исходного кода

Other: Add `pluginName` property to editing plugins.

Szymon Cofalik 6 лет назад
Родитель
Сommit
3879b034c2

+ 7 - 0
packages/ckeditor5-autoformat/src/blockautoformatediting.js

@@ -21,6 +21,13 @@ import LiveRange from '@ckeditor/ckeditor5-engine/src/model/liverange';
  * (lists, headings, bold and italic).
  * (lists, headings, bold and italic).
  */
  */
 export default class BlockAutoformatEditing {
 export default class BlockAutoformatEditing {
+	/**
+	 * @inheritDoc
+	 */
+	static get pluginName() {
+		return 'BlockAutoformatEditing';
+	}
+
 	/**
 	/**
 	 * Creates a listener triggered on `change` event in the document.
 	 * Creates a listener triggered on `change` event in the document.
 	 * Calls the callback when inserted text matches the regular expression or the command name
 	 * Calls the callback when inserted text matches the regular expression or the command name

+ 7 - 0
packages/ckeditor5-autoformat/src/inlineautoformatediting.js

@@ -21,6 +21,13 @@ import getLastTextLine from '@ckeditor/ckeditor5-typing/src/utils/getlasttextlin
  * (lists, headings, bold and italic).
  * (lists, headings, bold and italic).
  */
  */
 export default class InlineAutoformatEditing {
 export default class InlineAutoformatEditing {
+	/**
+	 * @inheritDoc
+	 */
+	static get pluginName() {
+		return 'InlineAutoformatEditing';
+	}
+
 	/**
 	/**
 	 * Enables autoformatting mechanism for a given {@link module:core/editor/editor~Editor}.
 	 * Enables autoformatting mechanism for a given {@link module:core/editor/editor~Editor}.
 	 *
 	 *

+ 4 - 0
packages/ckeditor5-autoformat/tests/blockautoformatediting.js

@@ -29,6 +29,10 @@ describe( 'BlockAutoformatEditing', () => {
 			} );
 			} );
 	} );
 	} );
 
 
+	it( 'should have pluginName', () => {
+		expect( BlockAutoformatEditing.pluginName ).to.equal( 'BlockAutoformatEditing' );
+	} );
+
 	describe( 'command name', () => {
 	describe( 'command name', () => {
 		it( 'should run a command when the pattern is matched', () => {
 		it( 'should run a command when the pattern is matched', () => {
 			const spy = testUtils.sinon.spy();
 			const spy = testUtils.sinon.spy();

+ 4 - 0
packages/ckeditor5-autoformat/tests/inlineautoformatediting.js

@@ -30,6 +30,10 @@ describe( 'InlineAutoformatEditing', () => {
 			} );
 			} );
 	} );
 	} );
 
 
+	it( 'should have pluginName', () => {
+		expect( InlineAutoformatEditing.pluginName ).to.equal( 'InlineAutoformatEditing' );
+	} );
+
 	describe( 'attribute', () => {
 	describe( 'attribute', () => {
 		it( 'should stop early if there are less than 3 capture groups', () => {
 		it( 'should stop early if there are less than 3 capture groups', () => {
 			new InlineAutoformatEditing( editor, /(\*)(.+?)\*/g, 'testAttribute' ); // eslint-disable-line no-new
 			new InlineAutoformatEditing( editor, /(\*)(.+?)\*/g, 'testAttribute' ); // eslint-disable-line no-new