Kaynağa Gözat

Rename document color collection to follow naming path from other places.

Mateusz Samsel 6 yıl önce
ebeveyn
işleme
26e0904139

+ 3 - 3
packages/ckeditor5-font/src/documentcolorscollection.js

@@ -3,7 +3,7 @@ import ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin';
 import mix from '@ckeditor/ckeditor5-utils/src/mix';
 
 /**
- * @module font/documentcolorscollection
+ * @module font/documentcolorcollection
  */
 
 /**
@@ -12,7 +12,7 @@ import mix from '@ckeditor/ckeditor5-utils/src/mix';
  * @mixes module:utils/observablemixin~ObservableMixin
  * @extends module:utils/collection~Collection
  */
-export default class DocumentColorsCollection extends Collection {
+export default class DocumentColorCollection extends Collection {
 	constructor( options ) {
 		super( options );
 
@@ -75,4 +75,4 @@ export default class DocumentColorsCollection extends Collection {
 	}
 }
 
-mix( DocumentColorsCollection, ObservableMixin );
+mix( DocumentColorCollection, ObservableMixin );

+ 3 - 3
packages/ckeditor5-font/src/ui/colortableview.js

@@ -12,7 +12,7 @@ import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview';
 import ColorTileView from '@ckeditor/ckeditor5-ui/src/colorgrid/colortileview';
 import ColorGridView from '@ckeditor/ckeditor5-ui/src/colorgrid/colorgridview';
 import LabelView from '@ckeditor/ckeditor5-ui/src/label/labelview';
-import DocumentColorsCollection from '../documentcolorscollection';
+import DocumentColorCollection from '../documentcolorcollection';
 import Template from '@ckeditor/ckeditor5-ui/src/template';
 import FocusTracker from '@ckeditor/ckeditor5-utils/src/focustracker';
 import FocusCycler from '@ckeditor/ckeditor5-ui/src/focuscycler';
@@ -101,9 +101,9 @@ export default class ColorTableView extends View {
 		 * A collection of definitions stores document colors.
 		 *
 		 * @readonly
-		 * @member {module:font/fontcolor/documentcolorscollection~DocumentColorsCollection}
+		 * @member {module:font/documentcolorcollection~DocumentColorCollection}
 		 */
-		this.documentColors = new DocumentColorsCollection();
+		this.documentColors = new DocumentColorCollection();
 
 		/**
 		 * Maximum number of colors in document colors section.

+ 61 - 0
packages/ckeditor5-font/tests/documentcolorcollection.js

@@ -0,0 +1,61 @@
+/**
+ * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
+ */
+
+import DocumentColorCollection from '../src/documentcolorcollection';
+import Collection from '@ckeditor/ckeditor5-utils/src/collection';
+
+describe( 'DocumentColorCollection', () => {
+	let documentColorCollection;
+
+	const colors = [
+		{
+			color: '111',
+		},
+		{
+			color: '222'
+		},
+		{
+			color: '333'
+		},
+		{
+			color: '444'
+		}
+	];
+
+	beforeEach( () => {
+		documentColorCollection = new DocumentColorCollection();
+
+		colors.forEach( item => {
+			documentColorCollection.add( item );
+		} );
+	} );
+
+	it( 'constructor()', () => {
+		expect( documentColorCollection ).to.be.instanceOf( DocumentColorCollection );
+		expect( documentColorCollection ).to.be.instanceOf( Collection );
+	} );
+
+	it( 'has observable "isEmpty" parameter', () => {
+		expect( documentColorCollection.isEmpty ).to.be.false;
+
+		documentColorCollection.clear();
+		expect( documentColorCollection.isEmpty ).to.be.true;
+
+		documentColorCollection.add( colors[ 0 ] );
+		expect( documentColorCollection.isEmpty ).to.be.false;
+	} );
+
+	it( 'prevent of adding duplicated colors', () => {
+		expect( documentColorCollection.length ).to.equal( 4 );
+
+		documentColorCollection.add( { color: '111' } );
+		expect( documentColorCollection.length ).to.equal( 4 );
+	} );
+
+	it( 'hasColor()', () => {
+		expect( documentColorCollection.hasColor( '111' ) ).to.be.true;
+		expect( documentColorCollection.hasColor( '555' ) ).to.be.false;
+	} );
+} );

+ 0 - 61
packages/ckeditor5-font/tests/documentcolorscollection.js

@@ -1,61 +0,0 @@
-/**
- * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
- */
-
-import DocumentColorsCollection from '../src/documentcolorscollection';
-import Collection from '@ckeditor/ckeditor5-utils/src/collection';
-
-describe( 'DocumentColorsCollection', () => {
-	let documentColorsCollection;
-
-	const colors = [
-		{
-			color: '111',
-		},
-		{
-			color: '222'
-		},
-		{
-			color: '333'
-		},
-		{
-			color: '444'
-		}
-	];
-
-	beforeEach( () => {
-		documentColorsCollection = new DocumentColorsCollection();
-
-		colors.forEach( item => {
-			documentColorsCollection.add( item );
-		} );
-	} );
-
-	it( 'constructor()', () => {
-		expect( documentColorsCollection ).to.be.instanceOf( DocumentColorsCollection );
-		expect( documentColorsCollection ).to.be.instanceOf( Collection );
-	} );
-
-	it( 'has observable "isEmpty" parameter', () => {
-		expect( documentColorsCollection.isEmpty ).to.be.false;
-
-		documentColorsCollection.clear();
-		expect( documentColorsCollection.isEmpty ).to.be.true;
-
-		documentColorsCollection.add( colors[ 0 ] );
-		expect( documentColorsCollection.isEmpty ).to.be.false;
-	} );
-
-	it( 'prevent of adding duplicated colors', () => {
-		expect( documentColorsCollection.length ).to.equal( 4 );
-
-		documentColorsCollection.add( { color: '111' } );
-		expect( documentColorsCollection.length ).to.equal( 4 );
-	} );
-
-	it( 'hasColor()', () => {
-		expect( documentColorsCollection.hasColor( '111' ) ).to.be.true;
-		expect( documentColorsCollection.hasColor( '555' ) ).to.be.false;
-	} );
-} );