Sfoglia il codice sorgente

Tests: Included Link in manual test to check focus management. Code refactoring and minor improvements in manual test.

Aleksander Nowodzinski 8 anni fa
parent
commit
c104bad903

+ 1 - 0
packages/ckeditor5-editor-inline/package.json

@@ -18,6 +18,7 @@
     "@ckeditor/ckeditor5-paragraph": "*",
     "@ckeditor/ckeditor5-undo": "*",
     "@ckeditor/ckeditor5-typing": "*",
+    "@ckeditor/ckeditor5-link": "*",
     "gulp": "^3.9.0",
     "guppy-pre-commit": "^0.4.0"
   },

+ 1 - 1
packages/ckeditor5-editor-inline/tests/manual/inline.html

@@ -18,6 +18,6 @@
 		margin-top: 200px;
 		margin-left: 100px;
 		margin-bottom: 200px;
-		width: 300px;
+		width: 450px;
 	}
 </style>

+ 4 - 3
packages/ckeditor5-editor-inline/tests/manual/inline.js

@@ -13,14 +13,15 @@ import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
 import Undo from '@ckeditor/ckeditor5-undo/src/undo';
 import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
 import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
+import Link from '@ckeditor/ckeditor5-link/src/link';
 import testUtils from '@ckeditor/ckeditor5-utils/tests/_utils/utils';
 
 let editor, editable, observer;
 
 function initEditor() {
 	InlineEditor.create( document.querySelector( '#editor' ), {
-		plugins: [ Enter, Typing, Paragraph, Undo, Heading, Bold, Italic ],
-		toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo' ]
+		plugins: [ Link, Enter, Typing, Paragraph, Undo, Heading, Bold, Italic ],
+		toolbar: [ 'headings', 'bold', 'italic', 'undo', 'redo', 'link', 'unlink' ]
 	} )
 	.then( newEditor => {
 		console.log( 'Editor was initialized', newEditor );
@@ -30,7 +31,7 @@ function initEditor() {
 		window.editable = editable = editor.editing.view.getRoot();
 
 		observer = testUtils.createObserver();
-		observer.observe( 'Editable', editable, [ 'isFocused' ] );
+		observer.observe( 'editor.ui.focusTracker', editor.ui.focusTracker, [ 'isFocused' ] );
 	} )
 	.catch( err => {
 		console.error( err.stack );

+ 2 - 2
packages/ckeditor5-editor-inline/tests/manual/inline.md

@@ -3,7 +3,7 @@
   * Inline editor should be created.
   * The element used as editable should remain visible.
     * It should preserve `.custom-class` and `custom-attr="foo"`.
-  * There should be a floating toolbar with "Bold", "Italic", "Undo" and "Redo" buttons.
+  * There should be a floating toolbar with "Bold", "Italic", "Undo", "Redo", "Link" and "Unlink" buttons.
 3. Scroll the webpage.
 4. Expected:
   * The toolbar should float around but always stick to editable.
@@ -20,5 +20,5 @@
 
 * You can play with:
   * `editable.isReadOnly`,
-* Changes to `editable.isFocused` should be logged to the console.
+* Changes to `editor.focusTracker.isFocused` should be logged to the console.
 * Features should work.