Преглед изворни кода

Internal: Added text special characters plugin.

Marek Lewandowski пре 6 година
родитељ
комит
408f5e4cd8

+ 2 - 0
packages/ckeditor5-special-characters/src/specialcharactersessentials.js

@@ -13,6 +13,7 @@ import SpecialCharactersCurrency from './specialcharacterscurrency';
 import SpecialCharactersMathematical from './specialcharactersmathematical';
 import SpecialCharactersArrows from './specialcharactersarrows';
 import SpecialCharactersLatin from './specialcharacterslatin';
+import SpecialCharactersText from './specialcharacterstext';
 
 export default class SpecialCharactersEssentials extends Plugin {
 	/**
@@ -21,6 +22,7 @@ export default class SpecialCharactersEssentials extends Plugin {
 	static get requires() {
 		return [
 			SpecialCharactersCurrency,
+			SpecialCharactersText,
 			SpecialCharactersMathematical,
 			SpecialCharactersArrows,
 			SpecialCharactersLatin

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

@@ -12,22 +12,6 @@ import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
 export default class SpecialCharactersMathematical extends Plugin {
 	init() {
 		this.editor.plugins.get( 'SpecialCharacters' ).addItems( 'Mathematical', [
-			{
-				character: '‹',
-				title: 'Single left-pointing angle quotation mark'
-			},
-			{
-				character: '›',
-				title: 'Single right-pointing angle quotation mark'
-			},
-			{
-				character: '«',
-				title: 'Left-pointing double angle quotation mark'
-			},
-			{
-				character: '»',
-				title: 'Right-pointing double angle quotation mark'
-			},
 			{
 				character: '<',
 				title: 'Less-than sign'

+ 101 - 0
packages/ckeditor5-special-characters/src/specialcharacterstext.js

@@ -0,0 +1,101 @@
+/**
+ * @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 SpecialCharactersText extends Plugin {
+	init() {
+		this.editor.plugins.get( 'SpecialCharacters' ).addItems( 'Text', [
+			{
+				character: '‹',
+				title: 'Single left-pointing angle quotation mark'
+			},
+			{
+				character: '›',
+				title: 'Single right-pointing angle quotation mark'
+			},
+			{
+				character: '«',
+				title: 'Left-pointing double angle quotation mark'
+			},
+			{
+				character: '»',
+				title: 'Right-pointing double angle quotation mark'
+			},
+			{
+				character: '‘',
+				title: 'Left single quotation mark'
+			},
+			{
+				character: '’',
+				title: 'Right single quotation mark'
+			},
+			{
+				character: '“',
+				title: 'Left double quotation mark'
+			},
+			{
+				character: '”',
+				title: 'Right double quotation mark'
+			},
+			{
+				character: '‚',
+				title: 'Single low-9 quotation mark'
+			},
+			{
+				character: '„',
+				title: 'Double low-9 quotation mark'
+			},
+			{
+				character: '¡',
+				title: 'Inverted exclamation mark'
+			},
+			{
+				character: '¿',
+				title: 'Inverted question mark'
+			},
+			{
+				character: '‥',
+				title: 'Two dot leader'
+			},
+			{
+				character: '…',
+				title: 'Horizontal ellipsis'
+			},
+			{
+				character: '‡',
+				title: 'Double dagger'
+			},
+			{
+				character: '‰',
+				title: 'Per mille sign'
+			},
+			{
+				character: '‱',
+				title: 'Per ten thousand sign'
+			},
+			{
+				character: '‼',
+				title: 'Double exclamation mark'
+			},
+			{
+				character: '⁈',
+				title: 'Question exclamation mark'
+			},
+			{
+				character: '⁉',
+				title: 'Exclamation question mark'
+			},
+			{
+				character: '⁇',
+				title: 'Double question mark'
+			}
+		] );
+	}
+}

+ 2 - 0
packages/ckeditor5-special-characters/tests/specialcharactersessentials.js

@@ -6,6 +6,7 @@
 import SpecialCharactersEssentials from '../src/specialcharactersessentials';
 
 import SpecialCharactersCurrency from '../src/specialcharacterscurrency';
+import SpecialCharactersText from '../src/specialcharacterstext';
 import SpecialCharactersMathematical from '../src/specialcharactersmathematical';
 import SpecialCharactersArrows from '../src/specialcharactersarrows';
 import SpecialCharactersLatin from '../src/specialcharacterslatin';
@@ -14,6 +15,7 @@ describe( 'SpecialCharactersEssentials', () => {
 	it( 'includes other required plugins', () => {
 		expect( SpecialCharactersEssentials.requires ).to.deep.equal( [
 			SpecialCharactersCurrency,
+			SpecialCharactersText,
 			SpecialCharactersMathematical,
 			SpecialCharactersArrows,
 			SpecialCharactersLatin

+ 2 - 2
packages/ckeditor5-special-characters/tests/specialcharactersui.js

@@ -91,7 +91,7 @@ describe( 'SpecialCharactersUI', () => {
 			sinon.assert.calledOnce( executeSpy );
 			sinon.assert.calledOnce( focusSpy );
 			sinon.assert.calledWithExactly( executeSpy.firstCall, 'specialCharacters', {
-				item: 'Left-pointing double angle quotation mark'
+				item: 'Less-than or equal to'
 			} );
 		} );
 
@@ -118,7 +118,7 @@ describe( 'SpecialCharactersUI', () => {
 			it( 'is updated when navigation view fires #execute', () => {
 				const navigation = dropdown.panelView.children.first;
 
-				expect( grid.tiles.get( 0 ).label ).to.equal( '' );
+				expect( grid.tiles.get( 0 ).label ).to.equal( '<' );
 				navigation.groupDropdownView.fire( new EventInfo( { label: 'Arrows' }, 'execute' ) );
 
 				expect( grid.tiles.get( 0 ).label ).to.equal( '⇐' );