Răsfoiți Sursa

Code style: Aligned code style to new ESLint version.

Piotrek Koszuliński 8 ani în urmă
părinte
comite
0f0dbace91

+ 9 - 8
packages/ckeditor5-image/tests/image.js

@@ -20,14 +20,15 @@ describe( 'Image', () => {
 		editorElement = global.document.createElement( 'div' );
 		global.document.body.appendChild( editorElement );
 
-		return ClassicTestEditor.create( editorElement, {
-			plugins: [ Image ]
-		} )
-		.then( newEditor => {
-			editor = newEditor;
-			document = editor.document;
-			viewDocument = editor.editing.view;
-		} );
+		return ClassicTestEditor
+			.create( editorElement, {
+				plugins: [ Image ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+				document = editor.document;
+				viewDocument = editor.editing.view;
+			} );
 	} );
 
 	afterEach( () => {

+ 10 - 9
packages/ckeditor5-image/tests/image/ui/utils.js

@@ -20,15 +20,16 @@ describe( 'Utils', () => {
 		editorElement = global.document.createElement( 'div' );
 		global.document.body.appendChild( editorElement );
 
-		return ClassicEditor.create( editorElement, {
-			plugins: [ Image, Paragraph, ContextualBalloon ]
-		} )
-		.then( newEditor => {
-			editor = newEditor;
-			doc = editor.document;
-			editingView = editor.editing.view;
-			balloon = editor.plugins.get( 'ContextualBalloon' );
-		} );
+		return ClassicEditor
+			.create( editorElement, {
+				plugins: [ Image, Paragraph, ContextualBalloon ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+				doc = editor.document;
+				editingView = editor.editing.view;
+				balloon = editor.plugins.get( 'ContextualBalloon' );
+			} );
 	} );
 
 	afterEach( () => {

+ 7 - 6
packages/ckeditor5-image/tests/imagecaption.js

@@ -16,12 +16,13 @@ describe( 'ImageCaption', () => {
 		const editorElement = window.document.createElement( 'div' );
 		window.document.body.appendChild( editorElement );
 
-		return ClassicTestEditor.create( editorElement, {
-			plugins: [ ImageCaption ]
-		} )
-		.then( newEditor => {
-			editor = newEditor;
-		} );
+		return ClassicTestEditor
+			.create( editorElement, {
+				plugins: [ ImageCaption ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+			} );
 	} );
 
 	it( 'should be loaded', () => {

+ 22 - 20
packages/ckeditor5-image/tests/imagestyle.js

@@ -21,15 +21,16 @@ describe( 'ImageStyle', () => {
 		const editorElement = global.document.createElement( 'div' );
 		global.document.body.appendChild( editorElement );
 
-		return ClassicTestEditor.create( editorElement, {
-			plugins: [ ImageStyle ],
-			image: {
-				styles
-			}
-		} )
-		.then( newEditor => {
-			editor = newEditor;
-		} );
+		return ClassicTestEditor
+			.create( editorElement, {
+				plugins: [ ImageStyle ],
+				image: {
+					styles
+				}
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+			} );
 	} );
 
 	afterEach( () => {
@@ -71,16 +72,17 @@ describe( 'ImageStyle', () => {
 		const editorElement = global.document.createElement( 'div' );
 		global.document.body.appendChild( editorElement );
 
-		return ClassicTestEditor.create( editorElement, {
-			plugins: [ ImageStyle ],
-			image: {
-				styles,
-				toolbar: [ 'foo', 'bar' ]
-			}
-		} )
-		.then( newEditor => {
-			expect( newEditor.config.get( 'image.toolbar' ) ).to.eql( [ 'foo', 'bar' ] );
-			newEditor.destroy();
-		} );
+		return ClassicTestEditor
+			.create( editorElement, {
+				plugins: [ ImageStyle ],
+				image: {
+					styles,
+					toolbar: [ 'foo', 'bar' ]
+				}
+			} )
+			.then( newEditor => {
+				expect( newEditor.config.get( 'image.toolbar' ) ).to.eql( [ 'foo', 'bar' ] );
+				newEditor.destroy();
+			} );
 	} );
 } );

+ 15 - 14
packages/ckeditor5-image/tests/imagetextalternative.js

@@ -22,20 +22,21 @@ describe( 'ImageTextAlternative', () => {
 		editorElement = global.document.createElement( 'div' );
 		global.document.body.appendChild( editorElement );
 
-		return ClassicTestEditor.create( editorElement, {
-			plugins: [ ImageTextAlternative, Image ]
-		} )
-		.then( newEditor => {
-			editor = newEditor;
-			editingView = editor.editing.view;
-			doc = editor.document;
-			newEditor.editing.view.attachDomRoot( editorElement );
-			plugin = editor.plugins.get( ImageTextAlternative );
-			command = editor.commands.get( 'imageTextAlternative' );
-			form = plugin._form;
-			balloon = editor.plugins.get( 'ContextualBalloon' );
-			button = editor.ui.componentFactory.create( 'imageTextAlternative' );
-		} );
+		return ClassicTestEditor
+			.create( editorElement, {
+				plugins: [ ImageTextAlternative, Image ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+				editingView = editor.editing.view;
+				doc = editor.document;
+				newEditor.editing.view.attachDomRoot( editorElement );
+				plugin = editor.plugins.get( ImageTextAlternative );
+				command = editor.commands.get( 'imageTextAlternative' );
+				form = plugin._form;
+				balloon = editor.plugins.get( 'ContextualBalloon' );
+				button = editor.ui.componentFactory.create( 'imageTextAlternative' );
+			} );
 	} );
 
 	afterEach( () => {

+ 15 - 14
packages/ckeditor5-image/tests/imagetoolbar.js

@@ -23,20 +23,21 @@ describe( 'ImageToolbar', () => {
 		editorElement = global.document.createElement( 'div' );
 		global.document.body.appendChild( editorElement );
 
-		return ClassicEditor.create( editorElement, {
-			plugins: [ Paragraph, Image, ImageToolbar, FakeButton ],
-			image: {
-				toolbar: [ 'fake_button' ]
-			}
-		} )
-		.then( newEditor => {
-			editor = newEditor;
-			doc = editor.document;
-			plugin = editor.plugins.get( ImageToolbar );
-			toolbar = plugin._toolbar;
-			editingView = editor.editing.view;
-			balloon = editor.plugins.get( 'ContextualBalloon' );
-		} );
+		return ClassicEditor
+			.create( editorElement, {
+				plugins: [ Paragraph, Image, ImageToolbar, FakeButton ],
+				image: {
+					toolbar: [ 'fake_button' ]
+				}
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+				doc = editor.document;
+				plugin = editor.plugins.get( ImageToolbar );
+				toolbar = plugin._toolbar;
+				editingView = editor.editing.view;
+				balloon = editor.plugins.get( 'ContextualBalloon' );
+			} );
 	} );
 
 	afterEach( () => {

+ 18 - 17
packages/ckeditor5-image/tests/integration.js

@@ -19,23 +19,24 @@ describe( 'Image integration', () => {
 			editorElement = global.document.createElement( 'div' );
 			global.document.body.appendChild( editorElement );
 
-			return ClassicTestEditor.create( editorElement, {
-				plugins: [ Image, ContextualToolbar, Paragraph ]
-			} )
-			.then( editor => {
-				newEditor = editor;
-				balloon = newEditor.plugins.get( 'ContextualBalloon' );
-				contextualToolbar = newEditor.plugins.get( 'ContextualToolbar' );
-				const button = new View();
-
-				button.element = global.document.createElement( 'div' );
-
-				// There must be at least one toolbar items which is not disabled to show it.
-				// https://github.com/ckeditor/ckeditor5-ui/issues/269
-				contextualToolbar.toolbarView.items.add( button );
-
-				newEditor.editing.view.isFocused = true;
-			} );
+			return ClassicTestEditor
+				.create( editorElement, {
+					plugins: [ Image, ContextualToolbar, Paragraph ]
+				} )
+				.then( editor => {
+					newEditor = editor;
+					balloon = newEditor.plugins.get( 'ContextualBalloon' );
+					contextualToolbar = newEditor.plugins.get( 'ContextualToolbar' );
+					const button = new View();
+
+					button.element = global.document.createElement( 'div' );
+
+					// There must be at least one toolbar items which is not disabled to show it.
+					// https://github.com/ckeditor/ckeditor5-ui/issues/269
+					contextualToolbar.toolbarView.items.add( button );
+
+					newEditor.editing.view.isFocused = true;
+				} );
 		} );
 
 		afterEach( () => {

+ 18 - 17
packages/ckeditor5-image/tests/manual/autohoist.js

@@ -17,20 +17,21 @@ import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
 import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
 import List from '@ckeditor/ckeditor5-list/src/list';
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [
-		EssentialsPreset,
-		Paragraph, Heading, Image, ImageToolbar,
-		ImageCaption, ImageStyle, Bold, Italic, Heading, List
-	],
-	toolbar: [ 'headings', 'undo', 'redo', 'bold', 'italic', 'bulletedList', 'numberedList' ],
-	image: {
-		toolbar: [ 'imageStyleFull', 'imageStyleSide', '|', 'imageTextAlternative' ]
-	}
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [
+			EssentialsPreset,
+			Paragraph, Heading, Image, ImageToolbar,
+			ImageCaption, ImageStyle, Bold, Italic, Heading, List
+		],
+		toolbar: [ 'headings', 'undo', 'redo', 'bold', 'italic', 'bulletedList', 'numberedList' ],
+		image: {
+			toolbar: [ 'imageStyleFull', 'imageStyleSide', '|', 'imageTextAlternative' ]
+		}
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 17 - 16
packages/ckeditor5-image/tests/manual/caption.js

@@ -20,19 +20,20 @@ import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
 import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
 import List from '@ckeditor/ckeditor5-list/src/list';
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [
-		Enter, Typing, Paragraph, Heading, Image, ImageToolbar,
-		Undo, Clipboard, ImageCaption, ImageStyle, Bold, Italic, Heading, List
-	],
-	toolbar: [ 'headings', 'undo', 'redo', 'bold', 'italic', 'bulletedList', 'numberedList' ],
-	image: {
-		toolbar: [ 'imageStyleFull', 'imageStyleSide', '|', 'imageTextAlternative' ]
-	}
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [
+			Enter, Typing, Paragraph, Heading, Image, ImageToolbar,
+			Undo, Clipboard, ImageCaption, ImageStyle, Bold, Italic, Heading, List
+		],
+		toolbar: [ 'headings', 'undo', 'redo', 'bold', 'italic', 'bulletedList', 'numberedList' ],
+		image: {
+			toolbar: [ 'imageStyleFull', 'imageStyleSide', '|', 'imageTextAlternative' ]
+		}
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 11 - 10
packages/ckeditor5-image/tests/manual/image.js

@@ -14,13 +14,14 @@ import ImagePlugin from '../../src/image';
 import UndoPlugin from '@ckeditor/ckeditor5-undo/src/undo';
 import ClipboardPlugin from '@ckeditor/ckeditor5-clipboard/src/clipboard';
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ EnterPlugin, TypingPlugin, ParagraphPlugin, HeadingPlugin, ImagePlugin, UndoPlugin, ClipboardPlugin ],
-	toolbar: [ 'headings', 'undo', 'redo' ]
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ EnterPlugin, TypingPlugin, ParagraphPlugin, HeadingPlugin, ImagePlugin, UndoPlugin, ClipboardPlugin ],
+		toolbar: [ 'headings', 'undo', 'redo' ]
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 24 - 23
packages/ckeditor5-image/tests/manual/imagestyle.js

@@ -16,26 +16,27 @@ import ClipboardPlugin from '@ckeditor/ckeditor5-clipboard/src/clipboard';
 import ImageStyle from '../../src/imagestyle';
 import ImageToolbar from '../../src/imagetoolbar';
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [
-		ImageToolbar,
-		EnterPlugin,
-		TypingPlugin,
-		ParagraphPlugin,
-		HeadingPlugin,
-		ImagePlugin,
-		UndoPlugin,
-		ClipboardPlugin,
-		ImageStyle
-	],
-	toolbar: [ 'headings', 'undo', 'redo' ],
-	image: {
-		toolbar: [ 'imageStyleFull', 'imageStyleSide' ]
-	}
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [
+			ImageToolbar,
+			EnterPlugin,
+			TypingPlugin,
+			ParagraphPlugin,
+			HeadingPlugin,
+			ImagePlugin,
+			UndoPlugin,
+			ClipboardPlugin,
+			ImageStyle
+		],
+		toolbar: [ 'headings', 'undo', 'redo' ],
+		image: {
+			toolbar: [ 'imageStyleFull', 'imageStyleSide' ]
+		}
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 14 - 13
packages/ckeditor5-image/tests/manual/textalternative.js

@@ -15,16 +15,17 @@ import UndoPlugin from '@ckeditor/ckeditor5-undo/src/undo';
 import ClipboardPlugin from '@ckeditor/ckeditor5-clipboard/src/clipboard';
 import ImageToolbar from '../../src/imagetoolbar';
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ EnterPlugin, TypingPlugin, ParagraphPlugin, HeadingPlugin, ImagePlugin, UndoPlugin, ClipboardPlugin, ImageToolbar ],
-	toolbar: [ 'headings', 'undo', 'redo' ],
-	image: {
-		toolbar: [ 'imageTextAlternative' ]
-	}
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ EnterPlugin, TypingPlugin, ParagraphPlugin, HeadingPlugin, ImagePlugin, UndoPlugin, ClipboardPlugin, ImageToolbar ],
+		toolbar: [ 'headings', 'undo', 'redo' ],
+		image: {
+			toolbar: [ 'imageTextAlternative' ]
+		}
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 14 - 13
packages/ckeditor5-image/tests/manual/tickets/110/1.js

@@ -15,16 +15,17 @@ import UndoPlugin from '@ckeditor/ckeditor5-undo/src/undo';
 import ContextualToolbar from '@ckeditor/ckeditor5-ui/src/toolbar/contextual/contextualtoolbar';
 import ImageToolbar from '../../../../src/imagetoolbar';
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ EnterPlugin, TypingPlugin, ParagraphPlugin, HeadingPlugin, ImagePlugin, UndoPlugin, ImageToolbar, ContextualToolbar ],
-	contextualToolbar: [ 'headings', 'undo', 'redo' ],
-	image: {
-		toolbar: [ 'imageTextAlternative' ]
-	}
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ EnterPlugin, TypingPlugin, ParagraphPlugin, HeadingPlugin, ImagePlugin, UndoPlugin, ImageToolbar, ContextualToolbar ],
+		contextualToolbar: [ 'headings', 'undo', 'redo' ],
+		image: {
+			toolbar: [ 'imageTextAlternative' ]
+		}
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );