浏览代码

Other: Added `pluginName` property to editing plugins.

Szymon Cofalik 6 年之前
父节点
当前提交
fb6119e09b

+ 7 - 0
packages/ckeditor5-image/src/image/imageediting.js

@@ -35,6 +35,13 @@ export default class ImageEditing extends Plugin {
 	/**
 	 * @inheritDoc
 	 */
+	static get pluginName() {
+		return 'ImageEditing';
+	}
+
+	/**
+	 * @inheritDoc
+	 */
 	init() {
 		const editor = this.editor;
 		const schema = editor.model.schema;

+ 7 - 0
packages/ckeditor5-image/src/imagecaption/imagecaptionediting.js

@@ -23,6 +23,13 @@ export default class ImageCaptionEditing extends Plugin {
 	/**
 	 * @inheritDoc
 	 */
+	static get pluginName() {
+		return 'ImageCaptionEditing';
+	}
+
+	/**
+	 * @inheritDoc
+	 */
 	init() {
 		const editor = this.editor;
 		const view = editor.editing.view;

+ 7 - 0
packages/ckeditor5-image/src/imagetextalternative/imagetextalternativeediting.js

@@ -21,6 +21,13 @@ export default class ImageTextAlternativeEditing extends Plugin {
 	/**
 	 * @inheritDoc
 	 */
+	static get pluginName() {
+		return 'ImageTextAlternativeEditing';
+	}
+
+	/**
+	 * @inheritDoc
+	 */
 	init() {
 		this.editor.commands.add( 'imageTextAlternative', new ImageTextAlternativeCommand( this.editor ) );
 	}

+ 4 - 0
packages/ckeditor5-image/tests/image/imageediting.js

@@ -39,6 +39,10 @@ describe( 'ImageEditing', () => {
 			} );
 	} );
 
+	it( 'should have pluginName', () => {
+		expect( ImageEditing.pluginName ).to.equal( 'ImageEditing' );
+	} );
+
 	it( 'should be loaded', () => {
 		expect( editor.plugins.get( ImageEditing ) ).to.be.instanceOf( ImageEditing );
 	} );

+ 4 - 0
packages/ckeditor5-image/tests/imagecaption/imagecaptionediting.js

@@ -46,6 +46,10 @@ describe( 'ImageCaptionEditing', () => {
 			} );
 	} );
 
+	it( 'should have pluginName', () => {
+		expect( ImageCaptionEditing.pluginName ).to.equal( 'ImageCaptionEditing' );
+	} );
+
 	it( 'should be loaded', () => {
 		expect( editor.plugins.get( ImageCaptionEditing ) ).to.be.instanceOf( ImageCaptionEditing );
 	} );

+ 4 - 0
packages/ckeditor5-image/tests/imagetextalternative/imagetextalternativeediting.js

@@ -20,6 +20,10 @@ describe( 'ImageTextAlternativeEditing', () => {
 			} );
 	} );
 
+	it( 'should have pluginName', () => {
+		expect( ImageTextAlternativeEditing.pluginName ).to.equal( 'ImageTextAlternativeEditing' );
+	} );
+
 	it( 'should register ImageAlternativeTextCommand', () => {
 		expect( editor.commands.get( 'imageTextAlternative' ) ).to.be.instanceOf( ImageTextAlternativeCommand );
 	} );