Sfoglia il codice sorgente

Renamed AttributeCommand class.

Oskar Wrobel 9 anni fa
parent
commit
60f0feb5fe

+ 2 - 2
packages/ckeditor5-basic-styles/src/boldengine.js

@@ -6,7 +6,7 @@
 import Feature from '../core/feature.js';
 import buildModelConverter from '../engine/conversion/buildmodelconverter.js';
 import buildViewConverter from '../engine/conversion/buildviewconverter.js';
-import AttributeCommand from '../core/command/attributecommand.js';
+import ToggleAttributeCommand from '../core/command/toggleattributecommand.js';
 
 const BOLD = 'bold';
 
@@ -44,6 +44,6 @@ export default class BoldEngine extends Feature {
 			.toAttribute( BOLD, true );
 
 		// Create bold command.
-		editor.commands.set( BOLD, new AttributeCommand( editor, BOLD ) );
+		editor.commands.set( BOLD, new ToggleAttributeCommand( editor, BOLD ) );
 	}
 }

+ 2 - 2
packages/ckeditor5-basic-styles/src/italicengine.js

@@ -6,7 +6,7 @@
 import Feature from '../core/feature.js';
 import buildModelConverter from '../engine/conversion/buildmodelconverter.js';
 import buildViewConverter from '../engine/conversion/buildviewconverter.js';
-import AttributeCommand from '../core/command/attributecommand.js';
+import ToggleAttributeCommand from '../core/command/toggleattributecommand.js';
 
 const ITALIC = 'italic';
 
@@ -44,6 +44,6 @@ export default class ItalicEngine extends Feature {
 			.toAttribute( ITALIC, true );
 
 		// Create italic command.
-		editor.commands.set( ITALIC, new AttributeCommand( editor, ITALIC ) );
+		editor.commands.set( ITALIC, new ToggleAttributeCommand( editor, ITALIC ) );
 	}
 }

+ 2 - 2
packages/ckeditor5-basic-styles/tests/boldengine.js

@@ -7,7 +7,7 @@ import BoldEngine from '/ckeditor5/basic-styles/boldengine.js';
 import VirtualTestEditor from '/tests/core/_utils/virtualtesteditor.js';
 import { getData as getModelData, setData as setModelData } from '/tests/engine/_utils/model.js';
 import { getData as getViewData } from '/tests/engine/_utils/view.js';
-import AttributeCommand from '/ckeditor5/core/command/attributecommand.js';
+import ToggleAttributeCommand from '/ckeditor5/core/command/toggleattributecommand.js';
 
 describe( 'BoldEngine', () => {
 	let editor, doc;
@@ -39,7 +39,7 @@ describe( 'BoldEngine', () => {
 
 			const command = editor.commands.get( 'bold' );
 
-			expect( command ).to.be.instanceOf( AttributeCommand );
+			expect( command ).to.be.instanceOf( ToggleAttributeCommand );
 			expect( command ).to.have.property( 'attributeKey', 'bold' );
 		} );
 	} );

+ 2 - 2
packages/ckeditor5-basic-styles/tests/italicengine.js

@@ -7,7 +7,7 @@ import ItalicEngine from '/ckeditor5/basic-styles/italicengine.js';
 import VirtualTestEditor from '/tests/core/_utils/virtualtesteditor.js';
 import { getData as getModelData, setData as setModelData } from '/tests/engine/_utils/model.js';
 import { getData as getViewData } from '/tests/engine/_utils/view.js';
-import AttributeCommand from '/ckeditor5/core/command/attributecommand.js';
+import ToggleAttributeCommand from '/ckeditor5/core/command/toggleattributecommand.js';
 
 describe( 'ItalicEngine', () => {
 	let editor, doc;
@@ -39,7 +39,7 @@ describe( 'ItalicEngine', () => {
 
 			const command = editor.commands.get( 'italic' );
 
-			expect( command ).to.be.instanceOf( AttributeCommand );
+			expect( command ).to.be.instanceOf( ToggleAttributeCommand );
 			expect( command ).to.have.property( 'attributeKey', 'italic' );
 		} );
 	} );