瀏覽代碼

Update manual tests.

Maciej Gołaszewski 7 年之前
父節點
當前提交
ee42440016

+ 7 - 3
packages/ckeditor5-ckfinder/tests/manual/ckfinder.html

@@ -1,7 +1,11 @@
-<!--<script src="https://cksource.com/weuy2g4ryt278ywiue/ckfinder.js"></script>-->
-<script src="/build/ckfinder.js"></script>
+<script src="https://cksource.com/weuy2g4ryt278ywiue/ckfinder.js"></script>
 
 <div id="editor">
 	<h2>CKFinder sample</h2>
-	<p>Use the toolbar icon to insert an image to the content.</p>
+	<p>Use the toolbar icon to insert an image or link to a file to the content.</p>
+</div>
+
+<div style="margin-top:1em;">
+	CKFinder opener method: <span id="opener-method-label" style="font-weight:bold;">modal</span> -
+	<button id="opener-method">Switch to popup</button>
 </div>

+ 17 - 0
packages/ckeditor5-ckfinder/tests/manual/ckfinder.js

@@ -19,10 +19,27 @@ ClassicEditor
 		toolbar: [ 'heading', '|', 'undo', 'redo', 'ckfinder' ],
 		image: {
 			toolbar: [ 'imageStyle:full', 'imageStyle:side', '|', 'imageTextAlternative' ]
+		},
+		ckfinder: {
+			// openerMethod: 'popup'
 		}
 	} )
 	.then( editor => {
 		window.editor = editor;
+
+		const button = document.querySelector( '#opener-method' );
+		const label = document.querySelector( '#opener-method-label' );
+
+		button.addEventListener( 'click', () => {
+			const method = editor.config.get( 'ckfinder.openerMethod' );
+			const isPopup = method === 'popup';
+
+			const newMethod = isPopup ? 'modal' : 'popup';
+			editor.config.set( 'ckfinder.openerMethod', newMethod );
+
+			button.innerText = 'Switch to ' + ( isPopup ? 'popup' : 'modal' );
+			label.innerText = newMethod;
+		} );
 	} )
 	.catch( err => {
 		console.error( err.stack );

+ 1 - 0
packages/ckeditor5-ckfinder/tests/manual/ckfinder.md

@@ -2,3 +2,4 @@
 
 1. Use the toolbar icon insert an image.
 1. Use the toolbar icon insert link to a non-image file.
+1. Use the button below the editor to change opener method to "popup" and repeat steps 1-2.