8
0
Просмотр исходного кода

Feature: Add Font & FontSize plugins stubs.

Maciej Gołaszewski 8 лет назад
Родитель
Сommit
6e2485e294

+ 35 - 0
packages/ckeditor5-font/src/font.js

@@ -0,0 +1,35 @@
+/**
+ * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+/**
+ * @module font/font
+ */
+
+import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
+
+import FontSize from './fontsize';
+
+/**
+ * The Font plugin.
+ *
+ * It requires {@link module:font/fontsize~FontSize} plugin.
+ *
+ * @extends module:core/plugin~Plugin
+ */
+export default class Font extends Plugin {
+	/**
+	 * @inheritDoc
+	 */
+	static get requires() {
+		return [ FontSize ];
+	}
+
+	/**
+	 * @inheritDoc
+	 */
+	static get pluginName() {
+		return 'Font';
+	}
+}

+ 31 - 0
packages/ckeditor5-font/src/fontsize.js

@@ -0,0 +1,31 @@
+/**
+ * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+/**
+ * @module font/fontsize
+ */
+
+import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
+
+/**
+ * The Font Size plugin.
+ *
+ * @extends module:core/plugin~Plugin
+ */
+export default class FontSize extends Plugin {
+	/**
+	 * @inheritDoc
+	 */
+	static get requires() {
+		return [];
+	}
+
+	/**
+	 * @inheritDoc
+	 */
+	static get pluginName() {
+		return 'FontSize';
+	}
+}

+ 38 - 0
packages/ckeditor5-font/tests/font.js

@@ -0,0 +1,38 @@
+/**
+ * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md.
+ */
+
+/* global document */
+
+import Font from './../src/font';
+import FontSize from './../src/fontsize';
+
+import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
+
+describe( 'Font', () => {
+	let editor, element;
+
+	beforeEach( () => {
+		element = document.createElement( 'div' );
+		document.body.appendChild( element );
+
+		return ClassicTestEditor
+			.create( element, {
+				plugins: [ Font ]
+			} )
+			.then( newEditor => {
+				editor = newEditor;
+			} );
+	} );
+
+	afterEach( () => {
+		element.remove();
+
+		return editor.destroy();
+	} );
+
+	it( 'requires FontSize', () => {
+		expect( Font.requires ).to.deep.equal( [ FontSize ] );
+	} );
+} );