Explorar el Código

Merge branch 'master' into i/6120

Maciej Gołaszewski hace 5 años
padre
commit
a0c877f9e2

+ 5 - 10
packages/ckeditor5-media-embed/src/mediaembedui.js

@@ -41,19 +41,14 @@ export default class MediaEmbedUI extends Plugin {
 		const command = editor.commands.get( 'mediaEmbed' );
 		const registry = editor.plugins.get( MediaEmbedEditing ).registry;
 
-		/**
-		 * The form view displayed inside the drop-down.
-		 *
-		 * @member {module:media-embed/ui/mediaformview~MediaFormView}
-		 */
-		this.form = new MediaFormView( getFormValidators( editor.t, registry ), editor.locale );
-
 		// Setup `imageUpload` button.
 		editor.ui.componentFactory.add( 'mediaEmbed', locale => {
 			const dropdown = createDropdown( locale );
 
-			this._setUpDropdown( dropdown, this.form, command, editor );
-			this._setUpForm( this.form, dropdown, command );
+			const mediaForm = new MediaFormView( getFormValidators( editor.t, registry ), editor.locale );
+
+			this._setUpDropdown( dropdown, mediaForm, command, editor );
+			this._setUpForm( dropdown, mediaForm, command );
 
 			return dropdown;
 		} );
@@ -103,7 +98,7 @@ export default class MediaEmbedUI extends Plugin {
 		}
 	}
 
-	_setUpForm( form, dropdown, command ) {
+	_setUpForm( dropdown, form, command ) {
 		form.delegate( 'submit', 'cancel' ).to( dropdown );
 		form.urlInputView.bind( 'value' ).to( command, 'value' );
 

+ 9 - 0
packages/ckeditor5-media-embed/tests/mediaembedui.js

@@ -53,6 +53,15 @@ describe( 'MediaEmbedUI', () => {
 		expect( dropdown ).to.be.instanceOf( DropdownView );
 	} );
 
+	it( 'should allow creating two instances', () => {
+		let secondInstance;
+
+		expect( function createSecondInstance() {
+			secondInstance = editor.ui.componentFactory.create( 'mediaEmbed' );
+		} ).not.to.throw();
+		expect( dropdown ).to.not.equal( secondInstance );
+	} );
+
 	describe( 'dropdown', () => {
 		it( 'should bind #isEnabled to the command', () => {
 			const command = editor.commands.get( 'mediaEmbed' );

+ 4 - 4
packages/ckeditor5-table/src/tableui.js

@@ -141,15 +141,15 @@ export default class TableUI extends Plugin {
 				{
 					type: 'button',
 					model: {
-						commandName: 'insertTableRowBelow',
-						label: t( 'Insert row below' )
+						commandName: 'insertTableRowAbove',
+						label: t( 'Insert row above' )
 					}
 				},
 				{
 					type: 'button',
 					model: {
-						commandName: 'insertTableRowAbove',
-						label: t( 'Insert row above' )
+						commandName: 'insertTableRowBelow',
+						label: t( 'Insert row below' )
 					}
 				},
 				{

+ 3 - 3
packages/ckeditor5-table/tests/tableui.js

@@ -139,7 +139,7 @@ describe( 'TableUI', () => {
 			const labels = listView.items.map( item => item instanceof ListSeparatorView ? '|' : item.children.first.label );
 
 			expect( labels ).to.deep.equal(
-				[ 'Header row', '|', 'Insert row below', 'Insert row above', 'Delete row', 'Select row' ]
+				[ 'Header row', '|', 'Insert row above', 'Insert row below', 'Delete row', 'Select row' ]
 			);
 		} );
 
@@ -170,12 +170,12 @@ describe( 'TableUI', () => {
 			expect( items.first.children.first.isEnabled ).to.be.false;
 			expect( dropdown.buttonView.isEnabled ).to.be.true;
 
-			insertRowBelowCommand.isEnabled = false;
+			insertRowAboveCommand.isEnabled = false;
 
 			expect( items.get( 2 ).children.first.isEnabled ).to.be.false;
 			expect( dropdown.buttonView.isEnabled ).to.be.true;
 
-			insertRowAboveCommand.isEnabled = false;
+			insertRowBelowCommand.isEnabled = false;
 			expect( items.get( 3 ).children.first.isEnabled ).to.be.false;
 			expect( dropdown.buttonView.isEnabled ).to.be.true;
 

+ 1 - 1
scripts/docs/build-content-styles.js

@@ -103,7 +103,7 @@ runWebpack( webpackConfig )
 			` * CKEditor 5 (v${ version }) content styles.`,
 			` * Generated on ${ new Date().toUTCString() }.`,
 			` * For more information, check out ${ DOCUMENTATION_URL }`,
-			' */\n\n',
+			' */\n\n'
 		].join( '\n' );
 
 		data += ':root {\n';

+ 2 - 2
tests/_utils/utils.js

@@ -37,7 +37,7 @@ export function renderPerformanceDataButtons( container, extraLabels ) {
 		'medium': 'medium (semantic)',
 		'large': 'long (semantic)',
 		'smallInlineCss': 'short (styled)',
-		'fullWebsitesStyled': 'full websites (styled)',
+		'fullWebsitesStyled': 'full websites (styled)'
 	};
 
 	if ( extraLabels ) {
@@ -66,7 +66,7 @@ export function getPerformanceData() {
 		medium: mediumFixture,
 		large: largeFixture,
 		smallInlineCss: smallInlineCssFixture,
-		fullWebsitesStyled: fullWebsitesStyledFixture,
+		fullWebsitesStyled: fullWebsitesStyledFixture
 	};
 }
 

+ 1 - 1
tests/manual/wproofreader.js

@@ -40,7 +40,7 @@ ClassicEditor
 			Indent,
 			Mention,
 			PasteFromOffice,
-			RemoveFormat,
+			RemoveFormat
 		],
 		toolbar: [
 			'heading', 'fontFamily', 'fontSize', 'fontColor', 'fontBackgroundColor', 'highlight', 'alignment', '|',