8
0
Просмотр исходного кода

Code style: Aligned code style to new ESLint version.

Kamil Piechaczek 8 лет назад
Родитель
Сommit
432d6d470f

+ 44 - 38
packages/ckeditor5-editor-balloon/tests/balloontoolbareditor.js

@@ -74,12 +74,13 @@ describe( 'BalloonToolbarEditor', () => {
 
 
 	describe( 'create()', () => {
 	describe( 'create()', () => {
 		beforeEach( function() {
 		beforeEach( function() {
-			return BalloonToolbarEditor.create( editorElement, {
-				plugins: [ Paragraph, Bold ]
-			} )
-			.then( newEditor => {
-				editor = newEditor;
-			} );
+			return BalloonToolbarEditor
+				.create( editorElement, {
+					plugins: [ Paragraph, Bold ]
+				} )
+				.then( newEditor => {
+					editor = newEditor;
+				} );
 		} );
 		} );
 
 
 		afterEach( () => {
 		afterEach( () => {
@@ -113,19 +114,20 @@ describe( 'BalloonToolbarEditor', () => {
 
 
 			class CustomBalloonToolbarEditor extends BalloonToolbarEditor {}
 			class CustomBalloonToolbarEditor extends BalloonToolbarEditor {}
 
 
-			return CustomBalloonToolbarEditor.create( editorElement, {
-				plugins: [ Paragraph, Bold ]
-			} )
-			.then( newEditor => {
-				expect( newEditor ).to.be.instanceof( CustomBalloonToolbarEditor );
-				expect( newEditor ).to.be.instanceof( BalloonToolbarEditor );
+			return CustomBalloonToolbarEditor
+				.create( editorElement, {
+					plugins: [ Paragraph, Bold ]
+				} )
+				.then( newEditor => {
+					expect( newEditor ).to.be.instanceof( CustomBalloonToolbarEditor );
+					expect( newEditor ).to.be.instanceof( BalloonToolbarEditor );
 
 
-				expect( newEditor.getData() ).to.equal( '<p><strong>foo</strong> bar</p>' );
+					expect( newEditor.getData() ).to.equal( '<p><strong>foo</strong> bar</p>' );
 
 
-				editorElement.remove();
+					editorElement.remove();
 
 
-				return newEditor.destroy();
-			} );
+					return newEditor.destroy();
+				} );
 		} );
 		} );
 	} );
 	} );
 
 
@@ -150,14 +152,15 @@ describe( 'BalloonToolbarEditor', () => {
 				}
 				}
 			}
 			}
 
 
-			return BalloonToolbarEditor.create( editorElement, {
-				plugins: [ EventWatcher ]
-			} )
-			.then( newEditor => {
-				expect( fired ).to.deep.equal( [ 'pluginsReady', 'uiReady', 'dataReady', 'ready' ] );
+			return BalloonToolbarEditor
+				.create( editorElement, {
+					plugins: [ EventWatcher ]
+				} )
+				.then( newEditor => {
+					expect( fired ).to.deep.equal( [ 'pluginsReady', 'uiReady', 'dataReady', 'ready' ] );
 
 
-				editor = newEditor;
-			} );
+					editor = newEditor;
+				} );
 		} );
 		} );
 
 
 		it( 'fires dataReady once data is loaded', () => {
 		it( 'fires dataReady once data is loaded', () => {
@@ -171,14 +174,15 @@ describe( 'BalloonToolbarEditor', () => {
 				}
 				}
 			}
 			}
 
 
-			return BalloonToolbarEditor.create( editorElement, {
-				plugins: [ EventWatcher, Paragraph, Bold ]
-			} )
-			.then( newEditor => {
-				expect( data ).to.equal( '<p><strong>foo</strong> bar</p>' );
+			return BalloonToolbarEditor
+				.create( editorElement, {
+					plugins: [ EventWatcher, Paragraph, Bold ]
+				} )
+				.then( newEditor => {
+					expect( data ).to.equal( '<p><strong>foo</strong> bar</p>' );
 
 
-				editor = newEditor;
-			} );
+					editor = newEditor;
+				} );
 		} );
 		} );
 
 
 		it( 'fires uiReady once UI is ready', () => {
 		it( 'fires uiReady once UI is ready', () => {
@@ -192,20 +196,22 @@ describe( 'BalloonToolbarEditor', () => {
 				}
 				}
 			}
 			}
 
 
-			return BalloonToolbarEditor.create( editorElement, {
-				plugins: [ EventWatcher ]
-			} )
-			.then( newEditor => {
-				expect( isReady ).to.be.true;
+			return BalloonToolbarEditor
+				.create( editorElement, {
+					plugins: [ EventWatcher ]
+				} )
+				.then( newEditor => {
+					expect( isReady ).to.be.true;
 
 
-				editor = newEditor;
-			} );
+					editor = newEditor;
+				} );
 		} );
 		} );
 	} );
 	} );
 
 
 	describe( 'destroy()', () => {
 	describe( 'destroy()', () => {
 		beforeEach( function() {
 		beforeEach( function() {
-			return BalloonToolbarEditor.create( editorElement, { plugins: [ Paragraph ] } )
+			return BalloonToolbarEditor
+				.create( editorElement, { plugins: [ Paragraph ] } )
 				.then( newEditor => {
 				.then( newEditor => {
 					editor = newEditor;
 					editor = newEditor;
 
 

+ 24 - 23
packages/ckeditor5-editor-balloon/tests/manual/balloontoolbareditor.js

@@ -18,33 +18,34 @@ function initEditors() {
 	init( '#editor-2' );
 	init( '#editor-2' );
 
 
 	function init( selector ) {
 	function init( selector ) {
-		BalloonToolbarEditor.create( document.querySelector( selector ), {
-			plugins: [ ArticlePreset ],
-			toolbar: [ 'headings', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'blockQuote' ],
-			image: {
-				toolbar: [ 'imageStyleFull', 'imageStyleSide', '|', 'imageTextAlternative' ]
-			}
-		} )
-		.then( editor => {
-			console.log( `${ selector } has been initialized`, editor );
-			console.log( 'It has been added to global `editors` and `editables`.' );
+		BalloonToolbarEditor
+			.create( document.querySelector( selector ), {
+				plugins: [ ArticlePreset ],
+				toolbar: [ 'headings', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'blockQuote' ],
+				image: {
+					toolbar: [ 'imageStyleFull', 'imageStyleSide', '|', 'imageTextAlternative' ]
+				}
+			} )
+			.then( editor => {
+				console.log( `${ selector } has been initialized`, editor );
+				console.log( 'It has been added to global `editors` and `editables`.' );
 
 
-			window.editors[ selector ] = editor;
-			window.editables.push( editor.editing.view.getRoot() );
+				window.editors[ selector ] = editor;
+				window.editables.push( editor.editing.view.getRoot() );
 
 
-			const observer = testUtils.createObserver();
+				const observer = testUtils.createObserver();
 
 
-			observer.observe(
-				`${ selector }.ui.focusTracker`,
-				editor.ui.focusTracker,
-				[ 'isFocused' ]
-			);
+				observer.observe(
+					`${ selector }.ui.focusTracker`,
+					editor.ui.focusTracker,
+					[ 'isFocused' ]
+				);
 
 
-			window._observers.push( observer );
-		} )
-		.catch( err => {
-			console.error( err.stack );
-		} );
+				window._observers.push( observer );
+			} )
+			.catch( err => {
+				console.error( err.stack );
+			} );
 	}
 	}
 }
 }