Browse Source

Tests: Added more image-specific features to the rich editor sample.

Marek Lewandowski 5 years ago
parent
commit
9184dc15ca
2 changed files with 36 additions and 1 deletions
  1. 21 1
      tests/manual/performance/richeditor.html
  2. 15 0
      tests/manual/performance/richeditor.js

+ 21 - 1
tests/manual/performance/richeditor.html

@@ -4,5 +4,25 @@
 
 <div id="editor">
 	<h1>Rich editor</h1>
-	<p>This editor features exceptionally high number of plugins.</p>
+	<p>
+		This editor features exceptionally high number of plugins.
+	</p>
+	<p>
+		It
+		<strong>features</strong>
+		<em>some basic</em>
+		<s>font</s>
+		<sub>styling &mdash;</sub>
+		<sup>nothing</sup>
+		<u>too crazy</u>.
+		<a href="https://ckeditor.com">Links</a> are also here.
+	</p>
+	<p>
+		Font can have customized
+		<span style="background-color:#e6e64c">background</span>,
+		<span style="color:#ff0000">foreground</span>,
+		<span style="font-family:'Trebuchet MS', Helvetica, sans-serif">font face</span>,
+		<span class="text-big">height</span>.
+		You can also <mark class="marker-yellow">mark</mark> it if you want to.
+	</p>
 </div>

+ 15 - 0
tests/manual/performance/richeditor.js

@@ -29,6 +29,9 @@ import PasteFromOffice from '@ckeditor/ckeditor5-paste-from-office/src/pastefrom
 import RemoveFormat from '@ckeditor/ckeditor5-remove-format/src/removeformat';
 import StandardEditingMode from '@ckeditor/ckeditor5-restricted-editing/src/standardeditingmode';
 import SpecialCharacters from '@ckeditor/ckeditor5-special-characters/src/specialcharacters';
+import ImageUpload from '@ckeditor/ckeditor5-image/src/imageupload';
+import ImageResize from '@ckeditor/ckeditor5-image/src/imageresize';
+import { UploadAdapterMock } from '@ckeditor/ckeditor5-upload/tests/_utils/mocks';
 import WordCount from '@ckeditor/ckeditor5-word-count/src/wordcount';
 
 ClassicEditor
@@ -56,6 +59,8 @@ ClassicEditor
 			RemoveFormat,
 			StandardEditingMode,
 			SpecialCharacters,
+			ImageUpload,
+			ImageResize,
 			WordCount
 		],
 		toolbar: {
@@ -99,12 +104,16 @@ ClassicEditor
 		},
 		table: {
 			contentToolbar: [ 'tableColumn', 'tableRow', 'mergeTableCells' ]
+		},
+		image: {
+			toolbar: [ 'imageStyle:full', 'imageStyle:side', 'imageTextAlternative' ]
 		}
 	} )
 	.then( editor => {
 		window.editor = editor;
 
 		addWordCountListener( editor );
+		addUploadMockAdapter( editor );
 	} )
 	.catch( err => {
 		console.error( err.stack );
@@ -128,3 +137,9 @@ function addWordCountListener( editor ) {
 
 	document.getElementById( 'word-count-wrapper' ).style.display = 'block';
 }
+
+function addUploadMockAdapter( editor ) {
+	editor.plugins.get( 'FileRepository' ).createUploadAdapter = loader => {
+		return new UploadAdapterMock( loader );
+	};
+}