瀏覽代碼

Introduced Typing feature which requires Input and Delete features.

Kamil Piechaczek 9 年之前
父節點
當前提交
1b049e2d4c
共有 2 個文件被更改,包括 43 次插入0 次删除
  1. 26 0
      packages/ckeditor5-typing/src/typing.js
  2. 17 0
      packages/ckeditor5-typing/tests/typing.js

+ 26 - 0
packages/ckeditor5-typing/src/typing.js

@@ -0,0 +1,26 @@
+/**
+ * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+import Feature from '../feature.js';
+import Input from './input';
+import Delete from './delete';
+
+/**
+ * The typing feature. Handles... typing.
+ *
+ * @memberOf typing
+ * @extends ckeditor5.Feature
+ */
+export default class Typing extends Feature {
+	static get requires() {
+		return [ Input, Delete ];
+	}
+
+	/**
+	 * @inheritDoc
+	 */
+	init() {
+	}
+}

+ 17 - 0
packages/ckeditor5-typing/tests/typing.js

@@ -0,0 +1,17 @@
+/**
+ * @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+import Typing from '/ckeditor5/typing/typing.js';
+import Input from '/ckeditor5/typing/input.js';
+import Delete from '/ckeditor5/typing/delete.js';
+
+describe( 'Typing feature', () => {
+	it( 'requires Input and Delete features', () => {
+		const typingRequirements = Typing.requires;
+
+		expect( typingRequirements ).to.contain( Input );
+		expect( typingRequirements ).to.contain( Delete );
+	} );
+} );