qms-angular 1.0.27 → 1.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/qms-angular.umd.js +888 -240
- package/bundles/qms-angular.umd.js.map +1 -1
- package/esm2015/lib/common/qms-icon.const.js +6 -0
- package/esm2015/lib/components/breadcrumb/breadcrumb-direction-icon.directive.js +20 -0
- package/esm2015/lib/components/breadcrumb/breadcrumb-item.directive.js +40 -0
- package/esm2015/lib/components/breadcrumb/breadcrumb.js +129 -0
- package/esm2015/lib/components/breadcrumb/breadcrumb.module.js +38 -0
- package/esm2015/lib/components/breadcrumb/enum/dropdown-node-width.enum.js +6 -0
- package/esm2015/lib/components/breadcrumb/model/breadcrumb-node.model.js +3 -0
- package/esm2015/lib/components/button/button-toggle.js +1 -1
- package/esm2015/lib/components/dialog/constant.js +4 -2
- package/esm2015/lib/components/dialog/dialog.js +4 -4
- package/esm2015/lib/components/related/common/data-type.enum.js +2 -2
- package/esm2015/lib/components/related/common/qms-icon.const.js +21 -1
- package/esm2015/lib/components/related/common/tree.function.js +10 -5
- package/esm2015/lib/components/related/list-other-related/list-related.component.js +10 -2
- package/esm2015/lib/components/related/model/popup-data.model.js +2 -1
- package/esm2015/lib/components/related/model/related-data.model.js +1 -1
- package/esm2015/lib/components/related/model/tree-config.model.js +1 -1
- package/esm2015/lib/components/related/model/tree-node.model.js +1 -1
- package/esm2015/lib/components/related/popup/related-popup.component.js +179 -12
- package/esm2015/lib/components/related/related.module.js +7 -5
- package/esm2015/lib/components/related/risk/analysis/analysis.component.js +1 -1
- package/esm2015/lib/components/related/service/related-global.service.js +5 -1
- package/esm2015/lib/components/related/tree/tree.component.js +37 -9
- package/esm2015/lib/components/table/table-action.js +2 -2
- package/esm2015/lib/directives/scrollbar/scrollbar.directive.js +8 -2
- package/esm2015/lib/directives/tooltip/tooltip-renderer.directive.js +4 -4
- package/esm2015/lib/model/en.js +7 -2
- package/esm2015/lib/model/no.js +7 -2
- package/esm2015/lib/qms-ckeditor-components/common/constants/ckeditorEvent.constant.js +3 -1
- package/esm2015/lib/qms-ckeditor-components/common/models/qms-ckeditor-data.model.js +1 -1
- package/esm2015/lib/qms-ckeditor-components/common/models/qms-ckeditor-input.model.js +2 -1
- package/esm2015/lib/qms-ckeditor-components/common/module/confirm/qms-ckeditor-confirm.component.js +1 -1
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-link/attachments/link-attachment.component.js +1 -1
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-link/qms-ckeditor-link.component.js +3 -3
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-load-template/qms-ckeditor-load-template.component.js +1 -1
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-relation/qmsckeditor-related.component.js +1 -1
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-template/qms-ckeditor-template.component.js +1 -1
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-tooltip/qms-ckeditor-tooltip.component.js +76 -0
- package/esm2015/lib/qms-ckeditor-components/models/qms-ckeditor-tooltip.model.js +7 -0
- package/esm2015/lib/qms-ckeditor-components/qms-ckeditor.component.js +51 -2
- package/esm2015/lib/qms-ckeditor-components/qms-ckeditor.module.js +4 -2
- package/esm2015/public-api.js +7 -1
- package/esm2015/qms-angular.js +3 -1
- package/fesm2015/qms-angular.js +910 -292
- package/fesm2015/qms-angular.js.map +1 -1
- package/lib/common/qms-icon.const.d.ts +1 -0
- package/lib/components/breadcrumb/breadcrumb-direction-icon.directive.d.ts +6 -0
- package/lib/components/breadcrumb/breadcrumb-item.directive.d.ts +12 -0
- package/lib/components/breadcrumb/breadcrumb.d.ts +32 -0
- package/lib/components/breadcrumb/breadcrumb.module.d.ts +2 -0
- package/lib/components/breadcrumb/enum/dropdown-node-width.enum.d.ts +4 -0
- package/lib/components/breadcrumb/model/breadcrumb-node.model.d.ts +13 -0
- package/lib/components/related/common/data-type.enum.d.ts +1 -1
- package/lib/components/related/common/qms-icon.const.d.ts +4 -0
- package/lib/components/related/list-other-related/list-related.component.d.ts +3 -0
- package/lib/components/related/model/popup-data.model.d.ts +1 -0
- package/lib/components/related/model/related-data.model.d.ts +4 -0
- package/lib/components/related/model/tree-config.model.d.ts +1 -0
- package/lib/components/related/model/tree-node.model.d.ts +1 -0
- package/lib/components/related/popup/related-popup.component.d.ts +18 -0
- package/lib/components/related/service/related-global.service.d.ts +2 -0
- package/lib/components/related/tree/tree.component.d.ts +7 -1
- package/lib/directives/scrollbar/scrollbar.directive.d.ts +1 -0
- package/lib/model/en.d.ts +6 -1
- package/lib/model/no.d.ts +6 -1
- package/lib/qms-ckeditor-components/common/constants/ckeditorEvent.constant.d.ts +2 -0
- package/lib/qms-ckeditor-components/common/models/qms-ckeditor-data.model.d.ts +1 -0
- package/lib/qms-ckeditor-components/common/models/qms-ckeditor-input.model.d.ts +1 -0
- package/lib/qms-ckeditor-components/components/qms-ckeditor-tooltip/qms-ckeditor-tooltip.component.d.ts +36 -0
- package/lib/qms-ckeditor-components/models/qms-ckeditor-tooltip.model.d.ts +6 -0
- package/lib/qms-ckeditor-components/qms-ckeditor.component.d.ts +6 -0
- package/package.json +1 -1
- package/public-api.d.ts +6 -0
- package/qms-angular.d.ts +2 -0
- package/qms-angular.metadata.json +1 -1
- package/src/assets/qms-ckeditor-plugin/build/ckeditor.js +2 -1
- package/src/assets/qms-ckeditor-plugin/build/ckeditor.js.map +1 -1
- package/src/assets/qms-ckeditor-plugin/package-lock.json +1224 -2042
- package/src/assets/qms-ckeditor-plugin/package.json +26 -19
- package/src/assets/qms-ckeditor-plugin/src/ckeditor.js +23 -1
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/findandreplace.js +132 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/findandreplaceediting.js +315 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/findandreplaceui.js +223 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/findcommand.js +90 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/findnextcommand.js +62 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/findpreviouscommand.js +28 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/index.js +10 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/replaceallcommand.js +54 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/replacecommand.js +66 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/ui/checkboxview.js +212 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/ui/findandreplaceformview.js +546 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/utils.js +158 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/theme/findandreplace.css +13 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/theme/findandreplaceform.css +226 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/theme/icons/find-replace.svg +1 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/index.js +16 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/specialcharacters.js +254 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/specialcharactersarrows.js +60 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/specialcharacterscurrency.js +78 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/specialcharactersessentials.js +43 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/specialcharacterslatin.js +170 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/specialcharactersmathematical.js +86 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/specialcharacterstext.js +69 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/ui/charactergridview.js +116 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/ui/characterinfoview.js +111 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/src/ui/specialcharactersnavigationview.js +127 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/theme/charactergrid.css +12 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/theme/characterinfo.css +9 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/theme/icons/specialcharacters.svg +1 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-special-characters/theme/specialcharacters.css +10 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/common/qmsCKEditorConstant.js +4 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/common/qmsCKEditorService.js +10 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/common/qmsCKEditorUtil.js +63 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/timestamp/timestamp.js +34 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/inserttooltipcommand.js +98 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/removetooltipcommand.js +41 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/tooltip.js +14 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/tooltipediting.js +280 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/tooltipui.js +203 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/ui/actionsview.js +95 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/tooltip/utils.js +70 -0
- package/src/assets/qms-ckeditor-plugin/src/themes/icons/information.svg +50 -0
- package/src/assets/qms-ckeditor-plugin/src/themes/icons/timestamp.svg +1 -0
- package/src/assets/qms-ckeditor-plugin/src/themes/tyles/tooltip.css +74 -0
- package/src/lib/components/breadcrumb/breadcrumb.scss +100 -0
- package/src/lib/components/button/button-toggle.scss +25 -1
- package/src/lib/components/dialog/dialog.scss +9 -0
- package/src/lib/components/related/popup/related-popup.component.scss +46 -0
- package/src/lib/components/table/table.scss +5 -27
- package/src/lib/qms-ckeditor-components/components/qms-ckeditor-tooltip/qms-ckeditor-tooltip.component.scss +11 -0
- package/src/lib/qms-ckeditor-components/qms-ckeditor.component.scss +29 -1
- package/src/lib/qms-ckeditor-components/styles/_modules.scss +6 -0
- package/src/themes/core/_form.scss +4 -0
- package/src/themes/core/_input.scss +8 -0
- package/src/themes/core/_scrollbar.scss +9 -2
- package/src/themes/core/_styles.scss +5 -0
- package/src/themes/core/_tab.scss +272 -6
@@ -0,0 +1,170 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
|
6
|
+
/**
|
7
|
+
* @module special-characters/specialcharacterslatin
|
8
|
+
*/
|
9
|
+
|
10
|
+
import { Plugin } from '@ckeditor/ckeditor5-core';
|
11
|
+
|
12
|
+
/**
|
13
|
+
* A plugin that provides special characters for the "Latin" category.
|
14
|
+
*
|
15
|
+
* ClassicEditor
|
16
|
+
* .create( {
|
17
|
+
* plugins: [ ..., SpecialCharacters, SpecialCharactersLatin ],
|
18
|
+
* } )
|
19
|
+
* .then( ... )
|
20
|
+
* .catch( ... );
|
21
|
+
*
|
22
|
+
* @extends module:core/plugin~Plugin
|
23
|
+
*/
|
24
|
+
export default class SpecialCharactersLatin extends Plugin {
|
25
|
+
/**
|
26
|
+
* @inheritDoc
|
27
|
+
*/
|
28
|
+
static get pluginName() {
|
29
|
+
return 'SpecialCharactersLatin';
|
30
|
+
}
|
31
|
+
|
32
|
+
/**
|
33
|
+
* @inheritDoc
|
34
|
+
*/
|
35
|
+
init() {
|
36
|
+
const editor = this.editor;
|
37
|
+
const t = editor.t;
|
38
|
+
|
39
|
+
editor.plugins.get( 'SpecialCharacters' ).addItems( 'Latin', [
|
40
|
+
{ character: 'Ā', title: t( 'Latin capital letter a with macron' ) },
|
41
|
+
{ character: 'ā', title: t( 'Latin small letter a with macron' ) },
|
42
|
+
{ character: 'Ă', title: t( 'Latin capital letter a with breve' ) },
|
43
|
+
{ character: 'ă', title: t( 'Latin small letter a with breve' ) },
|
44
|
+
{ character: 'Ą', title: t( 'Latin capital letter a with ogonek' ) },
|
45
|
+
{ character: 'ą', title: t( 'Latin small letter a with ogonek' ) },
|
46
|
+
{ character: 'Ć', title: t( 'Latin capital letter c with acute' ) },
|
47
|
+
{ character: 'ć', title: t( 'Latin small letter c with acute' ) },
|
48
|
+
{ character: 'Ĉ', title: t( 'Latin capital letter c with circumflex' ) },
|
49
|
+
{ character: 'ĉ', title: t( 'Latin small letter c with circumflex' ) },
|
50
|
+
{ character: 'Ċ', title: t( 'Latin capital letter c with dot above' ) },
|
51
|
+
{ character: 'ċ', title: t( 'Latin small letter c with dot above' ) },
|
52
|
+
{ character: 'Č', title: t( 'Latin capital letter c with caron' ) },
|
53
|
+
{ character: 'č', title: t( 'Latin small letter c with caron' ) },
|
54
|
+
{ character: 'Ď', title: t( 'Latin capital letter d with caron' ) },
|
55
|
+
{ character: 'ď', title: t( 'Latin small letter d with caron' ) },
|
56
|
+
{ character: 'Đ', title: t( 'Latin capital letter d with stroke' ) },
|
57
|
+
{ character: 'đ', title: t( 'Latin small letter d with stroke' ) },
|
58
|
+
{ character: 'Ē', title: t( 'Latin capital letter e with macron' ) },
|
59
|
+
{ character: 'ē', title: t( 'Latin small letter e with macron' ) },
|
60
|
+
{ character: 'Ĕ', title: t( 'Latin capital letter e with breve' ) },
|
61
|
+
{ character: 'ĕ', title: t( 'Latin small letter e with breve' ) },
|
62
|
+
{ character: 'Ė', title: t( 'Latin capital letter e with dot above' ) },
|
63
|
+
{ character: 'ė', title: t( 'Latin small letter e with dot above' ) },
|
64
|
+
{ character: 'Ę', title: t( 'Latin capital letter e with ogonek' ) },
|
65
|
+
{ character: 'ę', title: t( 'Latin small letter e with ogonek' ) },
|
66
|
+
{ character: 'Ě', title: t( 'Latin capital letter e with caron' ) },
|
67
|
+
{ character: 'ě', title: t( 'Latin small letter e with caron' ) },
|
68
|
+
{ character: 'Ĝ', title: t( 'Latin capital letter g with circumflex' ) },
|
69
|
+
{ character: 'ĝ', title: t( 'Latin small letter g with circumflex' ) },
|
70
|
+
{ character: 'Ğ', title: t( 'Latin capital letter g with breve' ) },
|
71
|
+
{ character: 'ğ', title: t( 'Latin small letter g with breve' ) },
|
72
|
+
{ character: 'Ġ', title: t( 'Latin capital letter g with dot above' ) },
|
73
|
+
{ character: 'ġ', title: t( 'Latin small letter g with dot above' ) },
|
74
|
+
{ character: 'Ģ', title: t( 'Latin capital letter g with cedilla' ) },
|
75
|
+
{ character: 'ģ', title: t( 'Latin small letter g with cedilla' ) },
|
76
|
+
{ character: 'Ĥ', title: t( 'Latin capital letter h with circumflex' ) },
|
77
|
+
{ character: 'ĥ', title: t( 'Latin small letter h with circumflex' ) },
|
78
|
+
{ character: 'Ħ', title: t( 'Latin capital letter h with stroke' ) },
|
79
|
+
{ character: 'ħ', title: t( 'Latin small letter h with stroke' ) },
|
80
|
+
{ character: 'Ĩ', title: t( 'Latin capital letter i with tilde' ) },
|
81
|
+
{ character: 'ĩ', title: t( 'Latin small letter i with tilde' ) },
|
82
|
+
{ character: 'Ī', title: t( 'Latin capital letter i with macron' ) },
|
83
|
+
{ character: 'ī', title: t( 'Latin small letter i with macron' ) },
|
84
|
+
{ character: 'Ĭ', title: t( 'Latin capital letter i with breve' ) },
|
85
|
+
{ character: 'ĭ', title: t( 'Latin small letter i with breve' ) },
|
86
|
+
{ character: 'Į', title: t( 'Latin capital letter i with ogonek' ) },
|
87
|
+
{ character: 'į', title: t( 'Latin small letter i with ogonek' ) },
|
88
|
+
{ character: 'İ', title: t( 'Latin capital letter i with dot above' ) },
|
89
|
+
{ character: 'ı', title: t( 'Latin small letter dotless i' ) },
|
90
|
+
{ character: 'IJ', title: t( 'Latin capital ligature ij' ) },
|
91
|
+
{ character: 'ij', title: t( 'Latin small ligature ij' ) },
|
92
|
+
{ character: 'Ĵ', title: t( 'Latin capital letter j with circumflex' ) },
|
93
|
+
{ character: 'ĵ', title: t( 'Latin small letter j with circumflex' ) },
|
94
|
+
{ character: 'Ķ', title: t( 'Latin capital letter k with cedilla' ) },
|
95
|
+
{ character: 'ķ', title: t( 'Latin small letter k with cedilla' ) },
|
96
|
+
{ character: 'ĸ', title: t( 'Latin small letter kra' ) },
|
97
|
+
{ character: 'Ĺ', title: t( 'Latin capital letter l with acute' ) },
|
98
|
+
{ character: 'ĺ', title: t( 'Latin small letter l with acute' ) },
|
99
|
+
{ character: 'Ļ', title: t( 'Latin capital letter l with cedilla' ) },
|
100
|
+
{ character: 'ļ', title: t( 'Latin small letter l with cedilla' ) },
|
101
|
+
{ character: 'Ľ', title: t( 'Latin capital letter l with caron' ) },
|
102
|
+
{ character: 'ľ', title: t( 'Latin small letter l with caron' ) },
|
103
|
+
{ character: 'Ŀ', title: t( 'Latin capital letter l with middle dot' ) },
|
104
|
+
{ character: 'ŀ', title: t( 'Latin small letter l with middle dot' ) },
|
105
|
+
{ character: 'Ł', title: t( 'Latin capital letter l with stroke' ) },
|
106
|
+
{ character: 'ł', title: t( 'Latin small letter l with stroke' ) },
|
107
|
+
{ character: 'Ń', title: t( 'Latin capital letter n with acute' ) },
|
108
|
+
{ character: 'ń', title: t( 'Latin small letter n with acute' ) },
|
109
|
+
{ character: 'Ņ', title: t( 'Latin capital letter n with cedilla' ) },
|
110
|
+
{ character: 'ņ', title: t( 'Latin small letter n with cedilla' ) },
|
111
|
+
{ character: 'Ň', title: t( 'Latin capital letter n with caron' ) },
|
112
|
+
{ character: 'ň', title: t( 'Latin small letter n with caron' ) },
|
113
|
+
{ character: 'ʼn', title: t( 'Latin small letter n preceded by apostrophe' ) },
|
114
|
+
{ character: 'Ŋ', title: t( 'Latin capital letter eng' ) },
|
115
|
+
{ character: 'ŋ', title: t( 'Latin small letter eng' ) },
|
116
|
+
{ character: 'Ō', title: t( 'Latin capital letter o with macron' ) },
|
117
|
+
{ character: 'ō', title: t( 'Latin small letter o with macron' ) },
|
118
|
+
{ character: 'Ŏ', title: t( 'Latin capital letter o with breve' ) },
|
119
|
+
{ character: 'ŏ', title: t( 'Latin small letter o with breve' ) },
|
120
|
+
{ character: 'Ő', title: t( 'Latin capital letter o with double acute' ) },
|
121
|
+
{ character: 'ő', title: t( 'Latin small letter o with double acute' ) },
|
122
|
+
{ character: 'Œ', title: t( 'Latin capital ligature oe' ) },
|
123
|
+
{ character: 'œ', title: t( 'Latin small ligature oe' ) },
|
124
|
+
{ character: 'Ŕ', title: t( 'Latin capital letter r with acute' ) },
|
125
|
+
{ character: 'ŕ', title: t( 'Latin small letter r with acute' ) },
|
126
|
+
{ character: 'Ŗ', title: t( 'Latin capital letter r with cedilla' ) },
|
127
|
+
{ character: 'ŗ', title: t( 'Latin small letter r with cedilla' ) },
|
128
|
+
{ character: 'Ř', title: t( 'Latin capital letter r with caron' ) },
|
129
|
+
{ character: 'ř', title: t( 'Latin small letter r with caron' ) },
|
130
|
+
{ character: 'Ś', title: t( 'Latin capital letter s with acute' ) },
|
131
|
+
{ character: 'ś', title: t( 'Latin small letter s with acute' ) },
|
132
|
+
{ character: 'Ŝ', title: t( 'Latin capital letter s with circumflex' ) },
|
133
|
+
{ character: 'ŝ', title: t( 'Latin small letter s with circumflex' ) },
|
134
|
+
{ character: 'Ş', title: t( 'Latin capital letter s with cedilla' ) },
|
135
|
+
{ character: 'ş', title: t( 'Latin small letter s with cedilla' ) },
|
136
|
+
{ character: 'Š', title: t( 'Latin capital letter s with caron' ) },
|
137
|
+
{ character: 'š', title: t( 'Latin small letter s with caron' ) },
|
138
|
+
{ character: 'Ţ', title: t( 'Latin capital letter t with cedilla' ) },
|
139
|
+
{ character: 'ţ', title: t( 'Latin small letter t with cedilla' ) },
|
140
|
+
{ character: 'Ť', title: t( 'Latin capital letter t with caron' ) },
|
141
|
+
{ character: 'ť', title: t( 'Latin small letter t with caron' ) },
|
142
|
+
{ character: 'Ŧ', title: t( 'Latin capital letter t with stroke' ) },
|
143
|
+
{ character: 'ŧ', title: t( 'Latin small letter t with stroke' ) },
|
144
|
+
{ character: 'Ũ', title: t( 'Latin capital letter u with tilde' ) },
|
145
|
+
{ character: 'ũ', title: t( 'Latin small letter u with tilde' ) },
|
146
|
+
{ character: 'Ū', title: t( 'Latin capital letter u with macron' ) },
|
147
|
+
{ character: 'ū', title: t( 'Latin small letter u with macron' ) },
|
148
|
+
{ character: 'Ŭ', title: t( 'Latin capital letter u with breve' ) },
|
149
|
+
{ character: 'ŭ', title: t( 'Latin small letter u with breve' ) },
|
150
|
+
{ character: 'Ů', title: t( 'Latin capital letter u with ring above' ) },
|
151
|
+
{ character: 'ů', title: t( 'Latin small letter u with ring above' ) },
|
152
|
+
{ character: 'Ű', title: t( 'Latin capital letter u with double acute' ) },
|
153
|
+
{ character: 'ű', title: t( 'Latin small letter u with double acute' ) },
|
154
|
+
{ character: 'Ų', title: t( 'Latin capital letter u with ogonek' ) },
|
155
|
+
{ character: 'ų', title: t( 'Latin small letter u with ogonek' ) },
|
156
|
+
{ character: 'Ŵ', title: t( 'Latin capital letter w with circumflex' ) },
|
157
|
+
{ character: 'ŵ', title: t( 'Latin small letter w with circumflex' ) },
|
158
|
+
{ character: 'Ŷ', title: t( 'Latin capital letter y with circumflex' ) },
|
159
|
+
{ character: 'ŷ', title: t( 'Latin small letter y with circumflex' ) },
|
160
|
+
{ character: 'Ÿ', title: t( 'Latin capital letter y with diaeresis' ) },
|
161
|
+
{ character: 'Ź', title: t( 'Latin capital letter z with acute' ) },
|
162
|
+
{ character: 'ź', title: t( 'Latin small letter z with acute' ) },
|
163
|
+
{ character: 'Ż', title: t( 'Latin capital letter z with dot above' ) },
|
164
|
+
{ character: 'ż', title: t( 'Latin small letter z with dot above' ) },
|
165
|
+
{ character: 'Ž', title: t( 'Latin capital letter z with caron' ) },
|
166
|
+
{ character: 'ž', title: t( 'Latin small letter z with caron' ) },
|
167
|
+
{ character: 'ſ', title: t( 'Latin small letter long s' ) }
|
168
|
+
] );
|
169
|
+
}
|
170
|
+
}
|
@@ -0,0 +1,86 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
|
6
|
+
/**
|
7
|
+
* @module special-characters/specialcharactersmathematical
|
8
|
+
*/
|
9
|
+
|
10
|
+
import { Plugin } from '@ckeditor/ckeditor5-core';
|
11
|
+
|
12
|
+
/**
|
13
|
+
* A plugin that provides special characters for the "Mathematical" category.
|
14
|
+
*
|
15
|
+
* ClassicEditor
|
16
|
+
* .create( {
|
17
|
+
* plugins: [ ..., SpecialCharacters, SpecialCharactersMathematical ],
|
18
|
+
* } )
|
19
|
+
* .then( ... )
|
20
|
+
* .catch( ... );
|
21
|
+
*
|
22
|
+
* @extends module:core/plugin~Plugin
|
23
|
+
*/
|
24
|
+
export default class SpecialCharactersMathematical extends Plugin {
|
25
|
+
/**
|
26
|
+
* @inheritDoc
|
27
|
+
*/
|
28
|
+
static get pluginName() {
|
29
|
+
return 'SpecialCharactersMathematical';
|
30
|
+
}
|
31
|
+
|
32
|
+
/**
|
33
|
+
* @inheritDoc
|
34
|
+
*/
|
35
|
+
init() {
|
36
|
+
const editor = this.editor;
|
37
|
+
const t = editor.t;
|
38
|
+
|
39
|
+
editor.plugins.get( 'SpecialCharacters' ).addItems( 'Mathematical', [
|
40
|
+
{ character: '<', title: t( 'Less-than sign' ) },
|
41
|
+
{ character: '>', title: t( 'Greater-than sign' ) },
|
42
|
+
{ character: '≤', title: t( 'Less-than or equal to' ) },
|
43
|
+
{ character: '≥', title: t( 'Greater-than or equal to' ) },
|
44
|
+
{ character: '–', title: t( 'En dash' ) },
|
45
|
+
{ character: '—', title: t( 'Em dash' ) },
|
46
|
+
{ character: '¯', title: t( 'Macron' ) },
|
47
|
+
{ character: '‾', title: t( 'Overline' ) },
|
48
|
+
{ character: '°', title: t( 'Degree sign' ) },
|
49
|
+
{ character: '−', title: t( 'Minus sign' ) },
|
50
|
+
{ character: '±', title: t( 'Plus-minus sign' ) },
|
51
|
+
{ character: '÷', title: t( 'Division sign' ) },
|
52
|
+
{ character: '⁄', title: t( 'Fraction slash' ) },
|
53
|
+
{ character: '×', title: t( 'Multiplication sign' ) },
|
54
|
+
{ character: 'ƒ', title: t( 'Latin small letter f with hook' ) },
|
55
|
+
{ character: '∫', title: t( 'Integral' ) },
|
56
|
+
{ character: '∑', title: t( 'N-ary summation' ) },
|
57
|
+
{ character: '∞', title: t( 'Infinity' ) },
|
58
|
+
{ character: '√', title: t( 'Square root' ) },
|
59
|
+
{ character: '∼', title: t( 'Tilde operator' ) },
|
60
|
+
{ character: '≅', title: t( 'Approximately equal to' ) },
|
61
|
+
{ character: '≈', title: t( 'Almost equal to' ) },
|
62
|
+
{ character: '≠', title: t( 'Not equal to' ) },
|
63
|
+
{ character: '≡', title: t( 'Identical to' ) },
|
64
|
+
{ character: '∈', title: t( 'Element of' ) },
|
65
|
+
{ character: '∉', title: t( 'Not an element of' ) },
|
66
|
+
{ character: '∋', title: t( 'Contains as member' ) },
|
67
|
+
{ character: '∏', title: t( 'N-ary product' ) },
|
68
|
+
{ character: '∧', title: t( 'Logical and' ) },
|
69
|
+
{ character: '∨', title: t( 'Logical or' ) },
|
70
|
+
{ character: '¬', title: t( 'Not sign' ) },
|
71
|
+
{ character: '∩', title: t( 'Intersection' ) },
|
72
|
+
{ character: '∪', title: t( 'Union' ) },
|
73
|
+
{ character: '∂', title: t( 'Partial differential' ) },
|
74
|
+
{ character: '∀', title: t( 'For all' ) },
|
75
|
+
{ character: '∃', title: t( 'There exists' ) },
|
76
|
+
{ character: '∅', title: t( 'Empty set' ) },
|
77
|
+
{ character: '∇', title: t( 'Nabla' ) },
|
78
|
+
{ character: '∗', title: t( 'Asterisk operator' ) },
|
79
|
+
{ character: '∝', title: t( 'Proportional to' ) },
|
80
|
+
{ character: '∠', title: t( 'Angle' ) },
|
81
|
+
{ character: '¼', title: t( 'Vulgar fraction one quarter' ) },
|
82
|
+
{ character: '½', title: t( 'Vulgar fraction one half' ) },
|
83
|
+
{ character: '¾', title: t( 'Vulgar fraction three quarters' ) }
|
84
|
+
] );
|
85
|
+
}
|
86
|
+
}
|
@@ -0,0 +1,69 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
|
6
|
+
/**
|
7
|
+
* @module special-characters/specialcharacterstext
|
8
|
+
*/
|
9
|
+
|
10
|
+
import { Plugin } from '@ckeditor/ckeditor5-core';
|
11
|
+
|
12
|
+
/**
|
13
|
+
* A plugin that provides special characters for the "Text" category.
|
14
|
+
*
|
15
|
+
* ClassicEditor
|
16
|
+
* .create( {
|
17
|
+
* plugins: [ ..., SpecialCharacters, SpecialCharactersText ],
|
18
|
+
* } )
|
19
|
+
* .then( ... )
|
20
|
+
* .catch( ... );
|
21
|
+
*
|
22
|
+
* @extends module:core/plugin~Plugin
|
23
|
+
*/
|
24
|
+
export default class SpecialCharactersText extends Plugin {
|
25
|
+
/**
|
26
|
+
* @inheritDoc
|
27
|
+
*/
|
28
|
+
static get pluginName() {
|
29
|
+
return 'SpecialCharactersText';
|
30
|
+
}
|
31
|
+
|
32
|
+
/**
|
33
|
+
* @inheritDoc
|
34
|
+
*/
|
35
|
+
init() {
|
36
|
+
const editor = this.editor;
|
37
|
+
const t = editor.t;
|
38
|
+
|
39
|
+
editor.plugins.get( 'SpecialCharacters' ).addItems( 'Text', [
|
40
|
+
{ character: '‹', title: t( 'Single left-pointing angle quotation mark' ) },
|
41
|
+
{ character: '›', title: t( 'Single right-pointing angle quotation mark' ) },
|
42
|
+
{ character: '«', title: t( 'Left-pointing double angle quotation mark' ) },
|
43
|
+
{ character: '»', title: t( 'Right-pointing double angle quotation mark' ) },
|
44
|
+
{ character: '‘', title: t( 'Left single quotation mark' ) },
|
45
|
+
{ character: '’', title: t( 'Right single quotation mark' ) },
|
46
|
+
{ character: '“', title: t( 'Left double quotation mark' ) },
|
47
|
+
{ character: '”', title: t( 'Right double quotation mark' ) },
|
48
|
+
{ character: '‚', title: t( 'Single low-9 quotation mark' ) },
|
49
|
+
{ character: '„', title: t( 'Double low-9 quotation mark' ) },
|
50
|
+
{ character: '¡', title: t( 'Inverted exclamation mark' ) },
|
51
|
+
{ character: '¿', title: t( 'Inverted question mark' ) },
|
52
|
+
{ character: '‥', title: t( 'Two dot leader' ) },
|
53
|
+
{ character: '…', title: t( 'Horizontal ellipsis' ) },
|
54
|
+
{ character: '‡', title: t( 'Double dagger' ) },
|
55
|
+
{ character: '‰', title: t( 'Per mille sign' ) },
|
56
|
+
{ character: '‱', title: t( 'Per ten thousand sign' ) },
|
57
|
+
{ character: '‼', title: t( 'Double exclamation mark' ) },
|
58
|
+
{ character: '⁈', title: t( 'Question exclamation mark' ) },
|
59
|
+
{ character: '⁉', title: t( 'Exclamation question mark' ) },
|
60
|
+
{ character: '⁇', title: t( 'Double question mark' ) },
|
61
|
+
{ character: '©', title: t( 'Copyright sign' ) },
|
62
|
+
{ character: '®', title: t( 'Registered sign' ) },
|
63
|
+
{ character: '™', title: t( 'Trade mark sign' ) },
|
64
|
+
{ character: '§', title: t( 'Section sign' ) },
|
65
|
+
{ character: '¶', title: t( 'Paragraph sign' ) },
|
66
|
+
{ character: '⁋', title: t( 'Reversed paragraph sign' ) }
|
67
|
+
] );
|
68
|
+
}
|
69
|
+
}
|
@@ -0,0 +1,116 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
|
6
|
+
/**
|
7
|
+
* @module special-characters/ui/charactergridview
|
8
|
+
*/
|
9
|
+
|
10
|
+
import { View, ButtonView } from '@ckeditor/ckeditor5-ui';
|
11
|
+
|
12
|
+
import '../../theme/charactergrid.css';
|
13
|
+
|
14
|
+
/**
|
15
|
+
* A grid of character tiles. It allows browsing special characters and selecting the character to
|
16
|
+
* be inserted into the content.
|
17
|
+
*
|
18
|
+
* @extends module:ui/view~View
|
19
|
+
*/
|
20
|
+
export default class CharacterGridView extends View {
|
21
|
+
/**
|
22
|
+
* Creates an instance of a character grid containing tiles representing special characters.
|
23
|
+
*
|
24
|
+
* @param {module:utils/locale~Locale} locale The localization services instance.
|
25
|
+
*/
|
26
|
+
constructor( locale ) {
|
27
|
+
super( locale );
|
28
|
+
|
29
|
+
/**
|
30
|
+
* A collection of the child tile views. Each tile represents a particular character.
|
31
|
+
*
|
32
|
+
* @readonly
|
33
|
+
* @member {module:ui/viewcollection~ViewCollection}
|
34
|
+
*/
|
35
|
+
this.tiles = this.createCollection();
|
36
|
+
|
37
|
+
this.setTemplate( {
|
38
|
+
tag: 'div',
|
39
|
+
children: [
|
40
|
+
{
|
41
|
+
tag: 'div',
|
42
|
+
attributes: {
|
43
|
+
class: [
|
44
|
+
'ck',
|
45
|
+
'ck-character-grid__tiles'
|
46
|
+
]
|
47
|
+
},
|
48
|
+
children: this.tiles
|
49
|
+
}
|
50
|
+
],
|
51
|
+
attributes: {
|
52
|
+
class: [
|
53
|
+
'ck',
|
54
|
+
'ck-character-grid'
|
55
|
+
]
|
56
|
+
}
|
57
|
+
} );
|
58
|
+
|
59
|
+
/**
|
60
|
+
* Fired when any of {@link #tiles grid tiles} is clicked.
|
61
|
+
*
|
62
|
+
* @event execute
|
63
|
+
* @param {Object} data Additional information about the event.
|
64
|
+
* @param {String} data.name The name of the tile that caused the event (e.g. "greek small letter epsilon").
|
65
|
+
* @param {String} data.character A human-readable character displayed as the label (e.g. "ε").
|
66
|
+
*/
|
67
|
+
|
68
|
+
/**
|
69
|
+
* Fired when a mouse or another pointing device caused the cursor to move onto any {@link #tiles grid tile}
|
70
|
+
* (similar to the native `mouseover` DOM event).
|
71
|
+
*
|
72
|
+
* @event tileHover
|
73
|
+
* @param {Object} data Additional information about the event.
|
74
|
+
* @param {String} data.name The name of the tile that caused the event (e.g. "greek small letter epsilon").
|
75
|
+
* @param {String} data.character A human-readable character displayed as the label (e.g. "ε").
|
76
|
+
*/
|
77
|
+
}
|
78
|
+
|
79
|
+
/**
|
80
|
+
* Creates a new tile for the grid.
|
81
|
+
*
|
82
|
+
* @param {String} character A human-readable character displayed as the label (e.g. "ε").
|
83
|
+
* @param {String} name The name of the character (e.g. "greek small letter epsilon").
|
84
|
+
* @returns {module:ui/button/buttonview~ButtonView}
|
85
|
+
*/
|
86
|
+
createTile( character, name ) {
|
87
|
+
const tile = new ButtonView( this.locale );
|
88
|
+
|
89
|
+
tile.set( {
|
90
|
+
label: character,
|
91
|
+
withText: true,
|
92
|
+
class: 'ck-character-grid__tile'
|
93
|
+
} );
|
94
|
+
|
95
|
+
// Labels are vital for the users to understand what character they're looking at.
|
96
|
+
// For now we're using native title attribute for that, see #5817.
|
97
|
+
tile.extendTemplate( {
|
98
|
+
attributes: {
|
99
|
+
title: name
|
100
|
+
},
|
101
|
+
on: {
|
102
|
+
mouseover: tile.bindTemplate.to( 'mouseover' )
|
103
|
+
}
|
104
|
+
} );
|
105
|
+
|
106
|
+
tile.on( 'mouseover', () => {
|
107
|
+
this.fire( 'tileHover', { name, character } );
|
108
|
+
} );
|
109
|
+
|
110
|
+
tile.on( 'execute', () => {
|
111
|
+
this.fire( 'execute', { name, character } );
|
112
|
+
} );
|
113
|
+
|
114
|
+
return tile;
|
115
|
+
}
|
116
|
+
}
|
@@ -0,0 +1,111 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
|
6
|
+
/**
|
7
|
+
* @module special-characters/ui/characterinfoview
|
8
|
+
*/
|
9
|
+
|
10
|
+
import { View } from '@ckeditor/ckeditor5-ui';
|
11
|
+
|
12
|
+
import '../../theme/characterinfo.css';
|
13
|
+
|
14
|
+
/**
|
15
|
+
* The view displaying detailed information about a special character glyph, e.g. upon
|
16
|
+
* hovering it with a mouse.
|
17
|
+
*
|
18
|
+
* @extends module:ui/view~View
|
19
|
+
*/
|
20
|
+
export default class CharacterInfoView extends View {
|
21
|
+
constructor( locale ) {
|
22
|
+
super( locale );
|
23
|
+
|
24
|
+
const bind = this.bindTemplate;
|
25
|
+
|
26
|
+
/**
|
27
|
+
* The character whose information is displayed by the view. For instance,
|
28
|
+
* "∑" or "¿".
|
29
|
+
*
|
30
|
+
* @observable
|
31
|
+
* @member {String|null} #character
|
32
|
+
*/
|
33
|
+
this.set( 'character', null );
|
34
|
+
|
35
|
+
/**
|
36
|
+
* The name of the {@link #character}. For instance,
|
37
|
+
* "N-ary summation" or "Inverted question mark".
|
38
|
+
*
|
39
|
+
* @observable
|
40
|
+
* @member {String|null} #name
|
41
|
+
*/
|
42
|
+
this.set( 'name', null );
|
43
|
+
|
44
|
+
/**
|
45
|
+
* The "Unicode string" of the {@link #character}. For instance,
|
46
|
+
* "U+0061".
|
47
|
+
*
|
48
|
+
* @observable
|
49
|
+
* @readonly
|
50
|
+
* @member {String} #code
|
51
|
+
*/
|
52
|
+
this.bind( 'code' ).to( this, 'character', characterToUnicodeString );
|
53
|
+
|
54
|
+
this.setTemplate( {
|
55
|
+
tag: 'div',
|
56
|
+
children: [
|
57
|
+
{
|
58
|
+
tag: 'span',
|
59
|
+
attributes: {
|
60
|
+
class: [
|
61
|
+
'ck-character-info__name'
|
62
|
+
]
|
63
|
+
},
|
64
|
+
children: [
|
65
|
+
{
|
66
|
+
// Note: ZWSP to prevent vertical collapsing.
|
67
|
+
text: bind.to( 'name', name => name ? name : '\u200B' )
|
68
|
+
}
|
69
|
+
]
|
70
|
+
},
|
71
|
+
{
|
72
|
+
tag: 'span',
|
73
|
+
attributes: {
|
74
|
+
class: [
|
75
|
+
'ck-character-info__code'
|
76
|
+
]
|
77
|
+
},
|
78
|
+
children: [
|
79
|
+
{
|
80
|
+
text: bind.to( 'code' )
|
81
|
+
}
|
82
|
+
]
|
83
|
+
}
|
84
|
+
],
|
85
|
+
attributes: {
|
86
|
+
class: [
|
87
|
+
'ck',
|
88
|
+
'ck-character-info'
|
89
|
+
]
|
90
|
+
}
|
91
|
+
} );
|
92
|
+
}
|
93
|
+
}
|
94
|
+
|
95
|
+
// Converts a character into a "Unicode string", for instance:
|
96
|
+
//
|
97
|
+
// "$" -> "U+0024"
|
98
|
+
//
|
99
|
+
// Returns an empty string when the character is `null`.
|
100
|
+
//
|
101
|
+
// @param {String} character
|
102
|
+
// @returns {String}
|
103
|
+
function characterToUnicodeString( character ) {
|
104
|
+
if ( character === null ) {
|
105
|
+
return '';
|
106
|
+
}
|
107
|
+
|
108
|
+
const hexCode = character.codePointAt( 0 ).toString( 16 );
|
109
|
+
|
110
|
+
return 'U+' + ( '0000' + hexCode ).slice( -4 );
|
111
|
+
}
|
@@ -0,0 +1,127 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
|
6
|
+
/**
|
7
|
+
* @module special-characters/ui/specialcharactersnavigationview
|
8
|
+
*/
|
9
|
+
|
10
|
+
import { Collection } from '@ckeditor/ckeditor5-utils';
|
11
|
+
import { Model, FormHeaderView, createDropdown, addListToDropdown } from '@ckeditor/ckeditor5-ui';
|
12
|
+
|
13
|
+
/**
|
14
|
+
* A class representing the navigation part of the special characters UI. It is responsible
|
15
|
+
* for describing the feature and allowing the user to select a particular character group.
|
16
|
+
*
|
17
|
+
* @extends module:ui/formheader/formheaderview~FormHeaderView
|
18
|
+
*/
|
19
|
+
export default class SpecialCharactersNavigationView extends FormHeaderView {
|
20
|
+
/**
|
21
|
+
* Creates an instance of the {@link module:special-characters/ui/specialcharactersnavigationview~SpecialCharactersNavigationView}
|
22
|
+
* class.
|
23
|
+
*
|
24
|
+
* @param {module:utils/locale~Locale} locale The localization services instance.
|
25
|
+
* @param {Iterable.<String>} groupNames The names of the character groups.
|
26
|
+
*/
|
27
|
+
constructor( locale, groupNames ) {
|
28
|
+
super( locale );
|
29
|
+
|
30
|
+
const t = locale.t;
|
31
|
+
|
32
|
+
this.set( 'class', 'ck-special-characters-navigation' );
|
33
|
+
|
34
|
+
/**
|
35
|
+
* A dropdown that allows selecting a group of special characters to be displayed.
|
36
|
+
*
|
37
|
+
* @member {module:ui/dropdown/dropdownview~DropdownView}
|
38
|
+
*/
|
39
|
+
this.groupDropdownView = this._createGroupDropdown( groupNames );
|
40
|
+
this.groupDropdownView.panelPosition = locale.uiLanguageDirection === 'rtl' ? 'se' : 'sw';
|
41
|
+
|
42
|
+
/**
|
43
|
+
* @inheritDoc
|
44
|
+
*/
|
45
|
+
this.label = t( 'Special characters' );
|
46
|
+
|
47
|
+
/**
|
48
|
+
* @inheritDoc
|
49
|
+
*/
|
50
|
+
this.children.add( this.groupDropdownView );
|
51
|
+
}
|
52
|
+
|
53
|
+
/**
|
54
|
+
* Returns the name of the character group currently selected in the {@link #groupDropdownView}.
|
55
|
+
*
|
56
|
+
* @type {String}
|
57
|
+
*/
|
58
|
+
get currentGroupName() {
|
59
|
+
return this.groupDropdownView.value;
|
60
|
+
}
|
61
|
+
|
62
|
+
/**
|
63
|
+
* Returns a dropdown that allows selecting character groups.
|
64
|
+
*
|
65
|
+
* @private
|
66
|
+
* @param {Iterable.<String>} groupNames The names of the character groups.
|
67
|
+
* @returns {module:ui/dropdown/dropdownview~DropdownView}
|
68
|
+
*/
|
69
|
+
_createGroupDropdown( groupNames ) {
|
70
|
+
const locale = this.locale;
|
71
|
+
const t = locale.t;
|
72
|
+
const dropdown = createDropdown( locale );
|
73
|
+
const groupDefinitions = this._getCharacterGroupListItemDefinitions( dropdown, groupNames );
|
74
|
+
|
75
|
+
dropdown.set( 'value', groupDefinitions.first.model.label );
|
76
|
+
|
77
|
+
dropdown.buttonView.bind( 'label' ).to( dropdown, 'value' );
|
78
|
+
|
79
|
+
dropdown.buttonView.set( {
|
80
|
+
isOn: false,
|
81
|
+
withText: true,
|
82
|
+
tooltip: t( 'Character categories' ),
|
83
|
+
class: [ 'ck-dropdown__button_label-width_auto' ]
|
84
|
+
} );
|
85
|
+
|
86
|
+
dropdown.on( 'execute', evt => {
|
87
|
+
dropdown.value = evt.source.label;
|
88
|
+
} );
|
89
|
+
|
90
|
+
dropdown.delegate( 'execute' ).to( this );
|
91
|
+
|
92
|
+
addListToDropdown( dropdown, groupDefinitions );
|
93
|
+
|
94
|
+
return dropdown;
|
95
|
+
}
|
96
|
+
|
97
|
+
/**
|
98
|
+
* Returns list item definitions to be used in the character group dropdown
|
99
|
+
* representing specific character groups.
|
100
|
+
*
|
101
|
+
* @private
|
102
|
+
* @param {module:ui/dropdown/dropdownview~DropdownView} dropdown
|
103
|
+
* @param {Iterable.<String>} groupNames The names of the character groups.
|
104
|
+
* @returns {Iterable.<module:ui/dropdown/utils~ListDropdownItemDefinition>}
|
105
|
+
*/
|
106
|
+
_getCharacterGroupListItemDefinitions( dropdown, groupNames ) {
|
107
|
+
const groupDefs = new Collection();
|
108
|
+
|
109
|
+
for ( const name of groupNames ) {
|
110
|
+
const definition = {
|
111
|
+
type: 'button',
|
112
|
+
model: new Model( {
|
113
|
+
label: name,
|
114
|
+
withText: true
|
115
|
+
} )
|
116
|
+
};
|
117
|
+
|
118
|
+
definition.model.bind( 'isOn' ).to( dropdown, 'value', value => {
|
119
|
+
return value === definition.model.label;
|
120
|
+
} );
|
121
|
+
|
122
|
+
groupDefs.add( definition );
|
123
|
+
}
|
124
|
+
|
125
|
+
return groupDefs;
|
126
|
+
}
|
127
|
+
}
|