浏览代码

Add manual test for restricted document.

Maciej Gołaszewski 6 年之前
父节点
当前提交
9c7d2922c8

+ 33 - 0
packages/ckeditor5-restricted-editing/tests/manual/restricteddocument.html

@@ -0,0 +1,33 @@
+<button id="read-only">Turn on read-only mode</button>
+
+<div id="editor">
+	<h2>Heading 1</h2>
+	<p>Paragraph <span class="ck-non-restricted">it is editable</span></p>
+	<p><strong>Bold</strong> <i>Italic</i> <a href="foo">Link</a></p>
+	<ul>
+		<li>UL List item 1</li>
+		<li>UL List item 2</li>
+	</ul>
+	<ol>
+		<li>OL List item 1</li>
+		<li>OL List item 2</li>
+	</ol>
+	<figure class="image image-style-side">
+		<img alt="bar" src="sample.jpg">
+		<figcaption>Caption</figcaption>
+	</figure>
+	<blockquote>
+		<p>Quote</p>
+		<ul>
+			<li>Quoted UL List item 1</li>
+			<li>Quoted UL List item 2</li>
+		</ul>
+		<p>Quote</p>
+	</blockquote>
+</div>
+
+<style>
+	.ck-non-restricted {
+		background: orange;
+	}
+</style>

+ 27 - 0
packages/ckeditor5-restricted-editing/tests/manual/restricteddocument.js

@@ -0,0 +1,27 @@
+/**
+ * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
+ */
+
+/* globals console, window, document */
+
+import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
+
+import ArticlePluginSet from '../_utils/articlepluginset';
+import RestrictedDocument from '../../src/restricteddocument';
+
+ClassicEditor
+	.create( document.querySelector( '#editor' ), {
+		plugins: [ ArticlePluginSet, RestrictedDocument ],
+		toolbar: [ 'heading', '|', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'blockQuote', 'undo', 'redo' ],
+		image: {
+			toolbar: [ 'imageStyle:full', 'imageStyle:side', '|', 'imageTextAlternative' ],
+		}
+	} )
+	.then( editor => {
+		window.editor = editor;
+	} )
+	.catch( err => {
+		console.error( err.stack );
+	} );
+

+ 2 - 0
packages/ckeditor5-restricted-editing/tests/manual/restricteddocument.md

@@ -0,0 +1,2 @@
+## Restricted document
+