浏览代码

Code style: Aligned code style to new ESLint version.

Piotrek Koszuliński 8 年之前
父节点
当前提交
7c6f04b050

+ 1 - 1
packages/ckeditor5-typing/src/input.js

@@ -311,7 +311,7 @@ const safeKeycodes = [
 	getCode( 'arrowRight' ),
 	getCode( 'arrowDown' ),
 	getCode( 'arrowLeft' ),
-	9,  // Tab
+	9, // Tab
 	16, // Shift
 	17, // Ctrl
 	18, // Alt

+ 9 - 8
packages/ckeditor5-typing/tests/bogusbr-integration.js

@@ -22,14 +22,15 @@ describe( 'Bogus BR integration', () => {
 		editorElement = document.createElement( 'div' );
 		document.body.appendChild( editorElement );
 
-		return ClassicTestEditor.create( editorElement, {
-			plugins: [ Typing, Paragraph, Bold ]
-		} )
-		.then( newEditor => {
-			editor = newEditor;
-			domRoot = editor.editing.view.getDomRoot();
-			mutationObserver = editor.editing.view.getObserver( MutationObserver );
-		} );
+		return ClassicTestEditor
+			.create( editorElement, {
+				plugins: [ Typing, Paragraph, Bold ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+				domRoot = editor.editing.view.getDomRoot();
+				mutationObserver = editor.editing.view.getObserver( MutationObserver );
+			} );
 	} );
 
 	afterEach( () => {

+ 13 - 12
packages/ckeditor5-typing/tests/inputcommand-integration.js

@@ -27,18 +27,19 @@ describe( 'InputCommand integration', () => {
 		editorElement = document.createElement( 'div' );
 		document.body.appendChild( editorElement );
 
-		return ClassicTestEditor.create( editorElement, {
-			plugins: [ Typing, Paragraph, Undo, Bold, Italic, Enter ],
-			typing: { undoStep: 3 }
-		} )
-		.then( newEditor => {
-			editor = newEditor;
-			doc = editor.document;
-			viewDocument = editor.editing.view;
-
-			boldView = editor.ui.componentFactory.create( 'bold' );
-			italicView = editor.ui.componentFactory.create( 'italic' );
-		} );
+		return ClassicTestEditor
+			.create( editorElement, {
+				plugins: [ Typing, Paragraph, Undo, Bold, Italic, Enter ],
+				typing: { undoStep: 3 }
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+				doc = editor.document;
+				viewDocument = editor.editing.view;
+
+				boldView = editor.ui.componentFactory.create( 'bold' );
+				italicView = editor.ui.componentFactory.create( 'italic' );
+			} );
 	} );
 
 	afterEach( () => {

+ 11 - 10
packages/ckeditor5-typing/tests/manual/20/1.js

@@ -12,13 +12,14 @@ import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
 import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
 import EssentialsPreset from '@ckeditor/ckeditor5-presets/src/essentials';
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ EssentialsPreset, Paragraph, Bold, Italic, Heading ],
-	toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo' ]
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ EssentialsPreset, Paragraph, Bold, Italic, Heading ],
+		toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo' ]
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 11 - 10
packages/ckeditor5-typing/tests/manual/21/1.js

@@ -12,13 +12,14 @@ import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
 import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
 import EssentialsPreset from '@ckeditor/ckeditor5-presets/src/essentials';
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ EssentialsPreset, Paragraph, Bold, Italic, Heading ],
-	toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo' ]
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ EssentialsPreset, Paragraph, Bold, Italic, Heading ],
+		toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo' ]
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 11 - 10
packages/ckeditor5-typing/tests/manual/40/1.js

@@ -10,13 +10,14 @@ import Enter from '@ckeditor/ckeditor5-enter/src/enter';
 import Typing from '../../../src/typing';
 import Heading from '@ckeditor/ckeditor5-heading/src/heading';
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ Enter, Typing, Heading ],
-	toolbar: [ 'headings' ]
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ Enter, Typing, Heading ],
+		toolbar: [ 'headings' ]
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 11 - 10
packages/ckeditor5-typing/tests/manual/52/1.js

@@ -17,13 +17,14 @@ window.setInterval( function() {
 	console.log( getData( window.editor.document ) );
 }, 3000 );
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ EssentialsPreset, Paragraph, Bold, Italic, Heading ],
-	toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo' ]
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ EssentialsPreset, Paragraph, Bold, Italic, Heading ],
+		toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo' ]
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 11 - 10
packages/ckeditor5-typing/tests/manual/59/1.js

@@ -10,13 +10,14 @@ import Typing from '../../../src/typing';
 import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
 import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ Typing, Paragraph, Bold ],
-	toolbar: [ 'bold' ]
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ Typing, Paragraph, Bold ],
+		toolbar: [ 'bold' ]
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 11 - 10
packages/ckeditor5-typing/tests/manual/82/1.js

@@ -15,13 +15,14 @@ window.setInterval( function() {
 	console.log( getData( window.editor.document ) );
 }, 3000 );
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ EssentialsPreset, Paragraph, Heading ],
-	toolbar: [ 'headings', 'undo', 'redo' ]
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ EssentialsPreset, Paragraph, Heading ],
+		toolbar: [ 'headings', 'undo', 'redo' ]
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 11 - 10
packages/ckeditor5-typing/tests/manual/86/1.js

@@ -14,13 +14,14 @@ window.setInterval( function() {
 	console.log( getData( window.editor.document ) );
 }, 3000 );
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ EssentialsPreset, Paragraph ],
-	toolbar: [ 'undo', 'redo' ]
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ EssentialsPreset, Paragraph ],
+		toolbar: [ 'undo', 'redo' ]
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 11 - 10
packages/ckeditor5-typing/tests/manual/delete.js

@@ -19,13 +19,14 @@ window.setInterval( function() {
 	console.log( getData( window.editor.document ) );
 }, 3000 );
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ EssentialsPreset, Paragraph, Bold, Italic, Heading ],
-	toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo' ]
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ EssentialsPreset, Paragraph, Bold, Italic, Heading ],
+		toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo' ]
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 11 - 10
packages/ckeditor5-typing/tests/manual/input.js

@@ -17,13 +17,14 @@ window.setInterval( function() {
 	console.log( getData( window.editor.document ) );
 }, 3000 );
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ EssentialsPreset, Paragraph, Bold, Italic, Heading ],
-	toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo' ]
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ EssentialsPreset, Paragraph, Bold, Italic, Heading ],
+		toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo' ]
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 30 - 29
packages/ckeditor5-typing/tests/manual/nbsp.js

@@ -12,37 +12,38 @@ import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
 import { getData as getModelData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';
 import { getData as getViewData } from '@ckeditor/ckeditor5-engine/src/dev-utils/view';
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ Enter, Typing, Paragraph ],
-	toolbar: []
-} )
-.then( editor => {
-	window.editor = editor;
-
-	editor.document.schema.allow( { name: '$text', inside: '$root' } );
-
-	const editable = editor.ui.view.editableElement;
-
-	document.querySelector( '#nbsp' ).addEventListener( 'click', () => {
-		editor.document.enqueueChanges( () => {
-			editor.document.selection.collapseToStart();
-			editor.document.batch().weakInsert( editor.document.selection.getFirstPosition(), '\u00A0' );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ Enter, Typing, Paragraph ],
+		toolbar: []
+	} )
+	.then( editor => {
+		window.editor = editor;
+
+		editor.document.schema.allow( { name: '$text', inside: '$root' } );
+
+		const editable = editor.ui.view.editableElement;
+
+		document.querySelector( '#nbsp' ).addEventListener( 'click', () => {
+			editor.document.enqueueChanges( () => {
+				editor.document.selection.collapseToStart();
+				editor.document.batch().weakInsert( editor.document.selection.getFirstPosition(), '\u00A0' );
+			} );
 		} );
-	} );
 
-	editor.document.on( 'changesDone', () => {
-		console.clear();
+		editor.document.on( 'changesDone', () => {
+			console.clear();
 
-		const modelData = getModelData( editor.document, { withoutSelection: true } );
-		console.log( 'model:', modelData.replace( /\u00A0/g, ' ' ) );
+			const modelData = getModelData( editor.document, { withoutSelection: true } );
+			console.log( 'model:', modelData.replace( /\u00A0/g, ' ' ) );
 
-		const viewData = getViewData( editor.editing.view, { withoutSelection: true } );
-		console.log( 'view:', viewData.replace( /\u00A0/g, ' ' ) );
+			const viewData = getViewData( editor.editing.view, { withoutSelection: true } );
+			console.log( 'view:', viewData.replace( /\u00A0/g, ' ' ) );
 
-		console.log( 'dom:', editable.innerHTML );
-		console.log( 'editor.getData', editor.getData() );
-	}, { priority: 'lowest' } );
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+			console.log( 'dom:', editable.innerHTML );
+			console.log( 'editor.getData', editor.getData() );
+		}, { priority: 'lowest' } );
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 21 - 19
packages/ckeditor5-typing/tests/manual/rtl.js

@@ -85,22 +85,24 @@ window.setInterval( function() {
 	}
 }, 3000 );
 
-ClassicEditor.create( document.querySelector( '#editor1' ), config )
-.then( editor => {
-	window.editor1 = editor;
-
-	// Editable doesn't automatically get this attribute right now.
-	// https://github.com/ckeditor/ckeditor5-editor-classic/issues/32
-	editor.editing.view.getDomRoot().setAttribute( 'dir', 'rtl' );
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
-
-ClassicEditor.create( document.querySelector( '#editor2' ), config )
-.then( editor => {
-	window.editor2 = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor1' ), config )
+	.then( editor => {
+		window.editor1 = editor;
+
+		// Editable doesn't automatically get this attribute right now.
+		// https://github.com/ckeditor/ckeditor5-editor-classic/issues/32
+		editor.editing.view.getDomRoot().setAttribute( 'dir', 'rtl' );
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );
+
+ClassicEditor
+	.create( document.querySelector( '#editor2' ), config )
+	.then( editor => {
+		window.editor2 = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 11 - 10
packages/ckeditor5-typing/tests/manual/selection.js

@@ -10,13 +10,14 @@ import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
 import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
 import EssentialsPreset from '@ckeditor/ckeditor5-presets/src/essentials';
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ EssentialsPreset, Paragraph, Bold ],
-	toolbar: [ 'bold' ]
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ EssentialsPreset, Paragraph, Bold ],
+		toolbar: [ 'bold' ]
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 11 - 10
packages/ckeditor5-typing/tests/manual/unicode.js

@@ -10,13 +10,14 @@ import Enter from '@ckeditor/ckeditor5-enter/src/enter';
 import Typing from '../../src/typing';
 import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
 
-ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ Enter, Typing, Paragraph ],
-	toolbar: []
-} )
-.then( editor => {
-	window.editor = editor;
-} )
-.catch( err => {
-	console.error( err.stack );
-} );
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ Enter, Typing, Paragraph ],
+		toolbar: []
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );

+ 7 - 6
packages/ckeditor5-typing/tests/spellchecking.js

@@ -26,12 +26,13 @@ describe( 'Spellchecking integration', () => {
 		container = document.createElement( 'div' );
 		document.body.appendChild( container );
 
-		return ClassicEditor.create( container, {
-			plugins: [ Enter, Typing, Paragraph, Bold, Undo ]
-		} )
-		.then( newEditor => {
-			editor = newEditor;
-		} );
+		return ClassicEditor
+			.create( container, {
+				plugins: [ Enter, Typing, Paragraph, Bold, Undo ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+			} );
 	} );
 
 	after( () => {

+ 7 - 6
packages/ckeditor5-typing/tests/tickets/59.js

@@ -19,12 +19,13 @@ describe( 'Bug ckeditor5-typing#59', () => {
 		container = document.createElement( 'div' );
 		document.body.appendChild( container );
 
-		return ClassicEditor.create( container, {
-			plugins: [ Typing, Paragraph, Bold ]
-		} )
-		.then( newEditor => {
-			editor = newEditor;
-		} );
+		return ClassicEditor
+			.create( container, {
+				plugins: [ Typing, Paragraph, Bold ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+			} );
 	} );
 
 	afterEach( () => {