瀏覽代碼

Added a testing special characters.

Kamil Piechaczek 6 年之前
父節點
當前提交
ad12022e3b

+ 36 - 0
packages/ckeditor5-special-characters/src/specialcharactersarrows.js

@@ -0,0 +1,36 @@
+/**
+ * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
+ */
+
+/**
+ * @module special-characters/specialcharacters
+ */
+
+import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
+
+export default class SpecialCharactersArrows extends Plugin {
+	init() {
+		this.editor.plugins.get( 'SpecialCharacters' ).addItems( 'Arrows', [
+			{
+				title: 'arrow left',
+				character: '←'
+			},
+			{
+				title: 'arrow right',
+				character: '→'
+			}
+		] );
+
+		this.editor.plugins.get( 'SpecialCharacters' ).addItems( 'Arrows', [
+			{
+				title: 'arrow up',
+				character: '↑'
+			},
+			{
+				title: 'arrow down',
+				character: '↓'
+			}
+		] );
+	}
+}

+ 36 - 0
packages/ckeditor5-special-characters/src/specialcharactersmathematical.js

@@ -0,0 +1,36 @@
+/**
+ * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
+ */
+
+/**
+ * @module special-characters/specialcharacters
+ */
+
+import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
+
+export default class SpecialCharactersMathematical extends Plugin {
+	init() {
+		this.editor.plugins.get( 'SpecialCharacters' ).addItems( 'Mathematical', [
+			{
+				title: 'precedes',
+				character: '≺'
+			},
+			{
+				title: 'succeeds',
+				character: '≻'
+			}
+		] );
+
+		this.editor.plugins.get( 'SpecialCharacters' ).addItems( 'Mathematical', [
+			{
+				title: 'precedes or equal to',
+				character: '≼'
+			},
+			{
+				title: 'succeeds or equal to',
+				character: '≽'
+			}
+		] );
+	}
+}