瀏覽代碼

Update manual test to use new configuration optiona.

Mateusz Samsel 6 年之前
父節點
當前提交
b572075f4f

+ 1 - 1
packages/ckeditor5-word-count/tests/manual/wordcount.html

@@ -8,5 +8,5 @@
 <div id="editor">
 	Hello world.
 </div>
-<div id="words">
+<div id="other-words-container">
 </div>

+ 7 - 10
packages/ckeditor5-word-count/tests/manual/wordcount.js

@@ -14,20 +14,17 @@ ClassicEditor
 		plugins: [ ArticlePluginSet, WordCount ],
 		toolbar: [
 			'heading', 'bold', 'italic', 'bulletedList', 'numberedList', 'blockQuote', 'link', 'undo', 'redo'
-		]
+		],
+		wordCount: {
+			onUpdate: values => {
+				console.log( `Values from 'onUpdate': ${ JSON.stringify( values ) }` );
+			},
+			container: document.getElementById( 'other-words-container' )
+		}
 	} )
 	.then( editor => {
 		window.editor = editor;
 
-		const wordCountPlugin = editor.plugins.get( 'WordCount' );
-		const wordCount = wordCountPlugin.getWordCountContainer();
-
-		wordCountPlugin.on( 'update', ( evt, payload ) => {
-			console.log( JSON.stringify( payload ) );
-		} );
-
-		document.getElementById( 'words' ).appendChild( wordCount );
-
 		document.getElementById( 'destroy-editor' ).addEventListener( 'click', () => {
 			editor.destroy();
 		} );