瀏覽代碼

Created playground and an empty feature.

Piotrek Koszuliński 9 年之前
父節點
當前提交
d478bd7c46

+ 21 - 0
packages/ckeditor5-clipboard/src/clipboard.js

@@ -0,0 +1,21 @@
+/**
+ * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+import Feature from '../core/feature.js';
+
+/**
+ * The clipboard feature. Currently, it's only responsible for intercepting the paste event and
+ * passing the pasted content through a paste pipeline.
+ *
+ * @memberOf clipboard
+ * @extends core.Feature
+ */
+export default class Clipboard extends Feature {
+	/**
+	 * @inheritDoc
+	 */
+	init() {
+	}
+}

+ 23 - 0
packages/ckeditor5-clipboard/tests/manual/pasting.html

@@ -0,0 +1,23 @@
+<head>
+	<link rel="stylesheet" href="%APPS_DIR%ckeditor/build/modules/amd/theme/ckeditor.css">
+</head>
+
+<div id="editor">
+	<h2>About CKEditor&nbsp;5, v0.3.0</h2>
+
+	<p>This is the <a href="http://ckeditor.com/blog/Third-Developer-Preview-of-CKEditor-5-Available">third developer preview</a> of <a href="https://ckeditor5.github.io">CKEditor&nbsp;5</a>.</p>
+
+	<p>After 2 years of work, building the next generation editor from scratch and closing over 670 tickets, we created a highly <strong>extensible and flexible architecture</strong> which consists of an <strong>amazing editing framework</strong> and <strong>editing solutions</strong> that will be built on top of it.</p>
+
+	<h3>Notes</h3>
+
+	<p><a href="https://ckeditor5.github.io">CKEditor&nbsp;5</a> is <em>under heavy development</em> and this demo is not production-ready software. For example:</p>
+
+	<ul>
+		<li><strong>only Chrome, Opera and Safari are supported</strong>,</li>
+		<li>Firefox requires enabling the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Document/onselectionchange">&ldquo;dom.select_events.enabled&rdquo;</a> option,</li>
+		<li><a href="https://github.com/ckeditor/ckeditor5/issues/342">support for pasting</a> is under development.</li>
+	</ul>
+
+	<p>It has <em>bugs</em> that we are aware of – and that we will be working on in the next few iterations of the project. Stay tuned for some updates soon!</p>
+</div>

+ 30 - 0
packages/ckeditor5-clipboard/tests/manual/pasting.js

@@ -0,0 +1,30 @@
+/**
+ * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+/* globals console, window, document */
+
+import ClassicEditor from '/ckeditor5/editor-classic/classic.js';
+
+ClassicEditor.create( document.querySelector( '#editor' ), {
+	features: [
+		'typing',
+		'paragraph',
+		'undo',
+		'enter',
+		'clipboard',
+		'link',
+		'list',
+		'heading',
+		'basic-styles/bold',
+		'basic-styles/italic'
+	],
+	toolbar: [ 'headings', 'bold', 'italic', 'link', 'bulletedList', 'numberedList', 'undo', 'redo' ]
+} )
+.then( editor => {
+	window.editor = editor;
+} )
+.catch( err => {
+	console.error( err.stack );
+} );

+ 10 - 0
packages/ckeditor5-clipboard/tests/manual/pasting.md

@@ -0,0 +1,10 @@
+@bender-ui: collapsed
+
+## Pasting
+
+Simply test pasting various content to the editor.
+
+Check:
+
+1. Copy & paste within the editor (nothing should be filtered out, nothing should be lost).
+2. Pasting from some websites (editor should not blow up).