@dangl/angular-material-shared 2.1.1-beta0024 → 2.2.1-beta0031
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/dangl-angular-material-shared.d.ts +1 -0
- package/{esm2015/dangl-angular-material-shared.js → esm2020/dangl-angular-material-shared.mjs} +0 -0
- package/esm2020/lib/angular-material-shared.module.mjs +40 -0
- package/esm2020/lib/components/footer/footer.component.mjs +33 -0
- package/esm2020/lib/components/header/header.component.mjs +80 -0
- package/esm2020/lib/components/tiny-mce/tiny-mce.component.mjs +104 -0
- package/{esm2015/lib/models/footer-options.js → esm2020/lib/models/footer-options.mjs} +0 -0
- package/{esm2015/lib/utils/guid-generator.js → esm2020/lib/utils/guid-generator.mjs} +0 -0
- package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
- package/fesm2015/dangl-angular-material-shared.mjs +294 -0
- package/fesm2015/dangl-angular-material-shared.mjs.map +1 -0
- package/fesm2020/dangl-angular-material-shared.mjs +292 -0
- package/fesm2020/dangl-angular-material-shared.mjs.map +1 -0
- package/lib/angular-material-shared.module.d.ts +12 -0
- package/lib/components/footer/footer.component.d.ts +3 -0
- package/lib/components/header/header.component.d.ts +3 -0
- package/lib/components/tiny-mce/tiny-mce.component.d.ts +3 -0
- package/package.json +28 -16
- package/styles/material-style.scss +1 -1
- package/styles/material-theme.scss +4 -3
- package/styles/material-variables.scss +9 -8
- package/tinymce-assets/icons/default/icons.js +11 -1
- package/tinymce-assets/icons/default/icons.min.js +1 -1
- package/tinymce-assets/langs/bn_BD.js +419 -0
- package/tinymce-assets/langs/cs.js +118 -75
- package/tinymce-assets/langs/cy.js +61 -18
- package/tinymce-assets/langs/da.js +60 -17
- package/tinymce-assets/langs/de.js +60 -17
- package/tinymce-assets/langs/eo.js +334 -138
- package/tinymce-assets/langs/es_ES.js +32 -2
- package/tinymce-assets/langs/et.js +419 -0
- package/tinymce-assets/langs/fa.js +60 -17
- package/tinymce-assets/langs/fa_IR.js +31 -1
- package/tinymce-assets/langs/fr_FR.js +60 -17
- package/tinymce-assets/langs/hu_HU.js +60 -17
- package/tinymce-assets/langs/hy.js +419 -0
- package/tinymce-assets/langs/ja.js +60 -17
- package/tinymce-assets/langs/kab.js +419 -0
- package/tinymce-assets/langs/ko_KR.js +3 -3
- package/tinymce-assets/langs/ku.js +415 -0
- package/tinymce-assets/langs/nb_NO.js +61 -18
- package/tinymce-assets/langs/nl.js +60 -17
- package/tinymce-assets/langs/pl.js +60 -17
- package/tinymce-assets/langs/pt_BR.js +60 -17
- package/tinymce-assets/langs/pt_PT.js +60 -17
- package/tinymce-assets/langs/ro.js +60 -17
- package/tinymce-assets/langs/ro_RO.js +32 -2
- package/tinymce-assets/langs/ru.js +60 -17
- package/tinymce-assets/langs/ru_RU.js +445 -0
- package/tinymce-assets/langs/sl.js +59 -14
- package/tinymce-assets/langs/ta.js +60 -17
- package/tinymce-assets/langs/ta_IN.js +60 -17
- package/tinymce-assets/langs/th_TH.js +60 -17
- package/tinymce-assets/langs/tr_TR.js +81 -8
- package/tinymce-assets/langs/vi.js +179 -21
- package/tinymce-assets/langs/zh_CN.js +60 -17
- package/tinymce-assets/plugins/advlist/plugin.js +29 -48
- package/tinymce-assets/plugins/advlist/plugin.min.js +2 -2
- package/tinymce-assets/plugins/anchor/plugin.js +8 -8
- package/tinymce-assets/plugins/anchor/plugin.min.js +2 -2
- package/tinymce-assets/plugins/autolink/plugin.js +58 -30
- package/tinymce-assets/plugins/autolink/plugin.min.js +2 -2
- package/tinymce-assets/plugins/autoresize/plugin.js +25 -12
- package/tinymce-assets/plugins/autoresize/plugin.min.js +2 -2
- package/tinymce-assets/plugins/autosave/plugin.js +9 -9
- package/tinymce-assets/plugins/autosave/plugin.min.js +2 -2
- package/tinymce-assets/plugins/bbcode/plugin.js +6 -6
- package/tinymce-assets/plugins/bbcode/plugin.min.js +2 -2
- package/tinymce-assets/plugins/charmap/plugin.js +57 -67
- package/tinymce-assets/plugins/charmap/plugin.min.js +2 -2
- package/tinymce-assets/plugins/code/plugin.js +9 -10
- package/tinymce-assets/plugins/code/plugin.min.js +2 -2
- package/tinymce-assets/plugins/codesample/plugin.js +1921 -1914
- package/tinymce-assets/plugins/codesample/plugin.min.js +2 -2
- package/tinymce-assets/plugins/colorpicker/plugin.js +1 -2
- package/tinymce-assets/plugins/colorpicker/plugin.min.js +2 -2
- package/tinymce-assets/plugins/contextmenu/plugin.js +1 -2
- package/tinymce-assets/plugins/contextmenu/plugin.min.js +2 -2
- package/tinymce-assets/plugins/directionality/plugin.js +195 -62
- package/tinymce-assets/plugins/directionality/plugin.min.js +2 -2
- package/tinymce-assets/plugins/emoticons/js/emojiimages.js +1572 -1572
- package/tinymce-assets/plugins/emoticons/js/emojiimages.min.js +1 -1
- package/tinymce-assets/plugins/emoticons/js/emojis.js +1572 -1572
- package/tinymce-assets/plugins/emoticons/js/emojis.min.js +1 -1
- package/tinymce-assets/plugins/emoticons/plugin.js +231 -200
- package/tinymce-assets/plugins/emoticons/plugin.min.js +2 -2
- package/tinymce-assets/plugins/fullpage/plugin.js +42 -42
- package/tinymce-assets/plugins/fullpage/plugin.min.js +2 -2
- package/tinymce-assets/plugins/fullscreen/plugin.js +527 -160
- package/tinymce-assets/plugins/fullscreen/plugin.min.js +2 -2
- package/tinymce-assets/plugins/help/plugin.js +102 -123
- package/tinymce-assets/plugins/help/plugin.min.js +2 -2
- package/tinymce-assets/plugins/hr/plugin.js +9 -10
- package/tinymce-assets/plugins/hr/plugin.min.js +2 -2
- package/tinymce-assets/plugins/image/plugin.js +126 -117
- package/tinymce-assets/plugins/image/plugin.min.js +2 -2
- package/tinymce-assets/plugins/imagetools/plugin.js +515 -334
- package/tinymce-assets/plugins/imagetools/plugin.min.js +2 -2
- package/tinymce-assets/plugins/importcss/plugin.js +50 -51
- package/tinymce-assets/plugins/importcss/plugin.min.js +2 -2
- package/tinymce-assets/plugins/insertdatetime/plugin.js +22 -17
- package/tinymce-assets/plugins/insertdatetime/plugin.min.js +2 -2
- package/tinymce-assets/plugins/legacyoutput/plugin.js +8 -8
- package/tinymce-assets/plugins/legacyoutput/plugin.min.js +2 -2
- package/tinymce-assets/plugins/link/plugin.js +131 -125
- package/tinymce-assets/plugins/link/plugin.min.js +2 -2
- package/tinymce-assets/plugins/lists/plugin.js +401 -252
- package/tinymce-assets/plugins/lists/plugin.min.js +2 -2
- package/tinymce-assets/plugins/media/plugin.js +151 -174
- package/tinymce-assets/plugins/media/plugin.min.js +2 -2
- package/tinymce-assets/plugins/nonbreaking/plugin.js +13 -14
- package/tinymce-assets/plugins/nonbreaking/plugin.min.js +2 -2
- package/tinymce-assets/plugins/noneditable/plugin.js +6 -6
- package/tinymce-assets/plugins/noneditable/plugin.min.js +2 -2
- package/tinymce-assets/plugins/pagebreak/plugin.js +27 -30
- package/tinymce-assets/plugins/pagebreak/plugin.min.js +2 -2
- package/tinymce-assets/plugins/paste/plugin.js +213 -174
- package/tinymce-assets/plugins/paste/plugin.min.js +2 -2
- package/tinymce-assets/plugins/preview/plugin.js +13 -14
- package/tinymce-assets/plugins/preview/plugin.min.js +2 -2
- package/tinymce-assets/plugins/print/plugin.js +13 -14
- package/tinymce-assets/plugins/print/plugin.min.js +2 -2
- package/tinymce-assets/plugins/quickbars/plugin.js +67 -82
- package/tinymce-assets/plugins/quickbars/plugin.min.js +2 -2
- package/tinymce-assets/plugins/save/plugin.js +9 -8
- package/tinymce-assets/plugins/save/plugin.min.js +2 -2
- package/tinymce-assets/plugins/searchreplace/plugin.js +98 -95
- package/tinymce-assets/plugins/searchreplace/plugin.min.js +2 -2
- package/tinymce-assets/plugins/spellchecker/plugin.js +22 -23
- package/tinymce-assets/plugins/spellchecker/plugin.min.js +2 -2
- package/tinymce-assets/plugins/tabfocus/plugin.js +21 -20
- package/tinymce-assets/plugins/tabfocus/plugin.min.js +2 -2
- package/tinymce-assets/plugins/table/plugin.js +2889 -2320
- package/tinymce-assets/plugins/table/plugin.min.js +2 -2
- package/tinymce-assets/plugins/template/plugin.js +84 -70
- package/tinymce-assets/plugins/template/plugin.min.js +2 -2
- package/tinymce-assets/plugins/textcolor/plugin.js +1 -2
- package/tinymce-assets/plugins/textcolor/plugin.min.js +2 -2
- package/tinymce-assets/plugins/textpattern/plugin.js +97 -117
- package/tinymce-assets/plugins/textpattern/plugin.min.js +2 -2
- package/tinymce-assets/plugins/toc/plugin.js +31 -29
- package/tinymce-assets/plugins/toc/plugin.min.js +2 -2
- package/tinymce-assets/plugins/visualblocks/plugin.js +10 -11
- package/tinymce-assets/plugins/visualblocks/plugin.min.js +2 -2
- package/tinymce-assets/plugins/visualchars/plugin.js +76 -91
- package/tinymce-assets/plugins/visualchars/plugin.min.js +2 -2
- package/tinymce-assets/plugins/wordcount/plugin.js +67 -58
- package/tinymce-assets/plugins/wordcount/plugin.min.js +2 -2
- package/tinymce-assets/skins/ui/oxide/content.css +1 -1
- package/tinymce-assets/skins/ui/oxide/content.inline.css +1 -1
- package/tinymce-assets/skins/ui/oxide/content.inline.min.css +1 -1
- package/tinymce-assets/skins/ui/oxide/content.min.css +1 -1
- package/tinymce-assets/skins/ui/oxide/skin.css +42 -24
- package/tinymce-assets/skins/ui/oxide/skin.min.css +1 -1
- package/tinymce-assets/skins/ui/oxide/skin.shadowdom.css +7 -7
- package/tinymce-assets/skins/ui/oxide/skin.shadowdom.min.css +1 -1
- package/tinymce-assets/skins/ui/oxide-dark/content.css +1 -1
- package/tinymce-assets/skins/ui/oxide-dark/content.inline.css +1 -1
- package/tinymce-assets/skins/ui/oxide-dark/content.inline.min.css +1 -1
- package/tinymce-assets/skins/ui/oxide-dark/content.min.css +1 -1
- package/tinymce-assets/skins/ui/oxide-dark/skin.css +42 -24
- package/tinymce-assets/skins/ui/oxide-dark/skin.min.css +1 -1
- package/tinymce-assets/skins/ui/oxide-dark/skin.shadowdom.css +7 -7
- package/tinymce-assets/skins/ui/oxide-dark/skin.shadowdom.min.css +1 -1
- package/tinymce-assets/themes/mobile/theme.js +2836 -3286
- package/tinymce-assets/themes/mobile/theme.min.js +2 -2
- package/tinymce-assets/themes/silver/theme.js +25505 -25418
- package/tinymce-assets/themes/silver/theme.min.js +2 -2
- package/bundles/dangl-angular-material-shared.umd.js +0 -285
- package/bundles/dangl-angular-material-shared.umd.js.map +0 -1
- package/bundles/dangl-angular-material-shared.umd.min.js +0 -2
- package/bundles/dangl-angular-material-shared.umd.min.js.map +0 -1
- package/dangl-angular-material-shared.metadata.json +0 -1
- package/esm2015/lib/angular-material-shared.module.js +0 -25
- package/esm2015/lib/components/footer/footer.component.js +0 -27
- package/esm2015/lib/components/header/header.component.js +0 -67
- package/esm2015/lib/components/tiny-mce/tiny-mce.component.js +0 -100
- package/fesm2015/dangl-angular-material-shared.js +0 -259
- package/fesm2015/dangl-angular-material-shared.js.map +0 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
|
6
6
|
*
|
|
7
|
-
* Version: 5.
|
|
7
|
+
* Version: 5.10.3 (2022-02-09)
|
|
8
8
|
*/
|
|
9
9
|
(function () {
|
|
10
10
|
'use strict';
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
26
|
+
var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
27
27
|
|
|
28
|
-
var get = function (toggleState) {
|
|
28
|
+
var get$2 = function (toggleState) {
|
|
29
29
|
var isEnabled = function () {
|
|
30
30
|
return toggleState.get();
|
|
31
31
|
};
|
|
@@ -36,6 +36,32 @@
|
|
|
36
36
|
return editor.fire('VisualChars', { state: state });
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
+
var typeOf = function (x) {
|
|
40
|
+
var t = typeof x;
|
|
41
|
+
if (x === null) {
|
|
42
|
+
return 'null';
|
|
43
|
+
} else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
|
|
44
|
+
return 'array';
|
|
45
|
+
} else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
|
|
46
|
+
return 'string';
|
|
47
|
+
} else {
|
|
48
|
+
return t;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
var isType$1 = function (type) {
|
|
52
|
+
return function (value) {
|
|
53
|
+
return typeOf(value) === type;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
var isSimpleType = function (type) {
|
|
57
|
+
return function (value) {
|
|
58
|
+
return typeof value === type;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
var isString = isType$1('string');
|
|
62
|
+
var isBoolean = isSimpleType('boolean');
|
|
63
|
+
var isNumber = isSimpleType('number');
|
|
64
|
+
|
|
39
65
|
var noop = function () {
|
|
40
66
|
};
|
|
41
67
|
var constant = function (value) {
|
|
@@ -43,6 +69,9 @@
|
|
|
43
69
|
return value;
|
|
44
70
|
};
|
|
45
71
|
};
|
|
72
|
+
var identity = function (x) {
|
|
73
|
+
return x;
|
|
74
|
+
};
|
|
46
75
|
var never = constant(false);
|
|
47
76
|
var always = constant(true);
|
|
48
77
|
|
|
@@ -50,20 +79,14 @@
|
|
|
50
79
|
return NONE;
|
|
51
80
|
};
|
|
52
81
|
var NONE = function () {
|
|
53
|
-
var eq = function (o) {
|
|
54
|
-
return o.isNone();
|
|
55
|
-
};
|
|
56
82
|
var call = function (thunk) {
|
|
57
83
|
return thunk();
|
|
58
84
|
};
|
|
59
|
-
var id =
|
|
60
|
-
return n;
|
|
61
|
-
};
|
|
85
|
+
var id = identity;
|
|
62
86
|
var me = {
|
|
63
87
|
fold: function (n, _s) {
|
|
64
88
|
return n();
|
|
65
89
|
},
|
|
66
|
-
is: never,
|
|
67
90
|
isSome: never,
|
|
68
91
|
isNone: always,
|
|
69
92
|
getOr: id,
|
|
@@ -80,9 +103,9 @@
|
|
|
80
103
|
bind: none,
|
|
81
104
|
exists: never,
|
|
82
105
|
forall: always,
|
|
83
|
-
filter:
|
|
84
|
-
|
|
85
|
-
|
|
106
|
+
filter: function () {
|
|
107
|
+
return none();
|
|
108
|
+
},
|
|
86
109
|
toArray: function () {
|
|
87
110
|
return [];
|
|
88
111
|
},
|
|
@@ -102,9 +125,6 @@
|
|
|
102
125
|
fold: function (n, s) {
|
|
103
126
|
return s(a);
|
|
104
127
|
},
|
|
105
|
-
is: function (v) {
|
|
106
|
-
return a === v;
|
|
107
|
-
},
|
|
108
128
|
isSome: always,
|
|
109
129
|
isNone: never,
|
|
110
130
|
getOr: constant_a,
|
|
@@ -131,14 +151,6 @@
|
|
|
131
151
|
},
|
|
132
152
|
toString: function () {
|
|
133
153
|
return 'some(' + a + ')';
|
|
134
|
-
},
|
|
135
|
-
equals: function (o) {
|
|
136
|
-
return o.is(a);
|
|
137
|
-
},
|
|
138
|
-
equals_: function (o, elementEq) {
|
|
139
|
-
return o.fold(never, function (b) {
|
|
140
|
-
return elementEq(a, b);
|
|
141
|
-
});
|
|
142
154
|
}
|
|
143
155
|
};
|
|
144
156
|
return me;
|
|
@@ -152,32 +164,6 @@
|
|
|
152
164
|
from: from
|
|
153
165
|
};
|
|
154
166
|
|
|
155
|
-
var typeOf = function (x) {
|
|
156
|
-
var t = typeof x;
|
|
157
|
-
if (x === null) {
|
|
158
|
-
return 'null';
|
|
159
|
-
} else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
|
|
160
|
-
return 'array';
|
|
161
|
-
} else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
|
|
162
|
-
return 'string';
|
|
163
|
-
} else {
|
|
164
|
-
return t;
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
var isType = function (type) {
|
|
168
|
-
return function (value) {
|
|
169
|
-
return typeOf(value) === type;
|
|
170
|
-
};
|
|
171
|
-
};
|
|
172
|
-
var isSimpleType = function (type) {
|
|
173
|
-
return function (value) {
|
|
174
|
-
return typeof value === type;
|
|
175
|
-
};
|
|
176
|
-
};
|
|
177
|
-
var isString = isType('string');
|
|
178
|
-
var isBoolean = isSimpleType('boolean');
|
|
179
|
-
var isNumber = isSimpleType('number');
|
|
180
|
-
|
|
181
167
|
var map = function (xs, f) {
|
|
182
168
|
var len = xs.length;
|
|
183
169
|
var r = new Array(len);
|
|
@@ -187,7 +173,7 @@
|
|
|
187
173
|
}
|
|
188
174
|
return r;
|
|
189
175
|
};
|
|
190
|
-
var each = function (xs, f) {
|
|
176
|
+
var each$1 = function (xs, f) {
|
|
191
177
|
for (var i = 0, len = xs.length; i < len; i++) {
|
|
192
178
|
var x = xs[i];
|
|
193
179
|
f(x, i);
|
|
@@ -205,7 +191,7 @@
|
|
|
205
191
|
};
|
|
206
192
|
|
|
207
193
|
var keys = Object.keys;
|
|
208
|
-
var each
|
|
194
|
+
var each = function (obj, f) {
|
|
209
195
|
var props = keys(obj);
|
|
210
196
|
for (var k = 0, len = props.length; k < len; k++) {
|
|
211
197
|
var i = props[k];
|
|
@@ -214,7 +200,7 @@
|
|
|
214
200
|
}
|
|
215
201
|
};
|
|
216
202
|
|
|
217
|
-
|
|
203
|
+
typeof window !== 'undefined' ? window : Function('return this;')();
|
|
218
204
|
|
|
219
205
|
var TEXT = 3;
|
|
220
206
|
|
|
@@ -224,12 +210,12 @@
|
|
|
224
210
|
var value = function (element) {
|
|
225
211
|
return element.dom.nodeValue;
|
|
226
212
|
};
|
|
227
|
-
var isType
|
|
213
|
+
var isType = function (t) {
|
|
228
214
|
return function (element) {
|
|
229
215
|
return type(element) === t;
|
|
230
216
|
};
|
|
231
217
|
};
|
|
232
|
-
var isText = isType
|
|
218
|
+
var isText = isType(TEXT);
|
|
233
219
|
|
|
234
220
|
var rawSet = function (dom, key, value) {
|
|
235
221
|
if (isString(value) || isBoolean(value) || isNumber(value)) {
|
|
@@ -246,7 +232,7 @@
|
|
|
246
232
|
var v = element.dom.getAttribute(key);
|
|
247
233
|
return v === null ? undefined : v;
|
|
248
234
|
};
|
|
249
|
-
var remove = function (element, key) {
|
|
235
|
+
var remove$3 = function (element, key) {
|
|
250
236
|
element.dom.removeAttribute(key);
|
|
251
237
|
};
|
|
252
238
|
|
|
@@ -254,20 +240,20 @@
|
|
|
254
240
|
var value = get$1(element, attr);
|
|
255
241
|
return value === undefined || value === '' ? [] : value.split(' ');
|
|
256
242
|
};
|
|
257
|
-
var add = function (element, attr, id) {
|
|
243
|
+
var add$2 = function (element, attr, id) {
|
|
258
244
|
var old = read(element, attr);
|
|
259
245
|
var nu = old.concat([id]);
|
|
260
246
|
set(element, attr, nu.join(' '));
|
|
261
247
|
return true;
|
|
262
248
|
};
|
|
263
|
-
var remove$
|
|
249
|
+
var remove$2 = function (element, attr, id) {
|
|
264
250
|
var nu = filter(read(element, attr), function (v) {
|
|
265
251
|
return v !== id;
|
|
266
252
|
});
|
|
267
253
|
if (nu.length > 0) {
|
|
268
254
|
set(element, attr, nu.join(' '));
|
|
269
255
|
} else {
|
|
270
|
-
remove(element, attr);
|
|
256
|
+
remove$3(element, attr);
|
|
271
257
|
}
|
|
272
258
|
return false;
|
|
273
259
|
};
|
|
@@ -275,17 +261,17 @@
|
|
|
275
261
|
var supports = function (element) {
|
|
276
262
|
return element.dom.classList !== undefined;
|
|
277
263
|
};
|
|
278
|
-
var get
|
|
264
|
+
var get = function (element) {
|
|
279
265
|
return read(element, 'class');
|
|
280
266
|
};
|
|
281
267
|
var add$1 = function (element, clazz) {
|
|
282
|
-
return add(element, 'class', clazz);
|
|
268
|
+
return add$2(element, 'class', clazz);
|
|
283
269
|
};
|
|
284
|
-
var remove$
|
|
285
|
-
return remove$
|
|
270
|
+
var remove$1 = function (element, clazz) {
|
|
271
|
+
return remove$2(element, 'class', clazz);
|
|
286
272
|
};
|
|
287
273
|
|
|
288
|
-
var add
|
|
274
|
+
var add = function (element, clazz) {
|
|
289
275
|
if (supports(element)) {
|
|
290
276
|
element.dom.classList.add(clazz);
|
|
291
277
|
} else {
|
|
@@ -293,17 +279,17 @@
|
|
|
293
279
|
}
|
|
294
280
|
};
|
|
295
281
|
var cleanClass = function (element) {
|
|
296
|
-
var classList = supports(element) ? element.dom.classList : get
|
|
282
|
+
var classList = supports(element) ? element.dom.classList : get(element);
|
|
297
283
|
if (classList.length === 0) {
|
|
298
|
-
remove(element, 'class');
|
|
284
|
+
remove$3(element, 'class');
|
|
299
285
|
}
|
|
300
286
|
};
|
|
301
|
-
var remove
|
|
287
|
+
var remove = function (element, clazz) {
|
|
302
288
|
if (supports(element)) {
|
|
303
289
|
var classList = element.dom.classList;
|
|
304
290
|
classList.remove(clazz);
|
|
305
291
|
} else {
|
|
306
|
-
remove$
|
|
292
|
+
remove$1(element, clazz);
|
|
307
293
|
}
|
|
308
294
|
cleanClass(element);
|
|
309
295
|
};
|
|
@@ -351,14 +337,14 @@
|
|
|
351
337
|
};
|
|
352
338
|
var charMapToRegExp = function (charMap, global) {
|
|
353
339
|
var regExp = '';
|
|
354
|
-
each
|
|
340
|
+
each(charMap, function (_value, key) {
|
|
355
341
|
regExp += key;
|
|
356
342
|
});
|
|
357
343
|
return new RegExp('[' + regExp + ']', global ? 'g' : '');
|
|
358
344
|
};
|
|
359
345
|
var charMapToSelector = function (charMap) {
|
|
360
346
|
var selector = '';
|
|
361
|
-
each
|
|
347
|
+
each(charMap, function (value) {
|
|
362
348
|
if (selector) {
|
|
363
349
|
selector += ',';
|
|
364
350
|
}
|
|
@@ -383,7 +369,7 @@
|
|
|
383
369
|
var result = [];
|
|
384
370
|
var dom = scope.dom;
|
|
385
371
|
var children = map(dom.childNodes, SugarElement.fromDom);
|
|
386
|
-
each(children, function (x) {
|
|
372
|
+
each$1(children, function (x) {
|
|
387
373
|
if (predicate(x)) {
|
|
388
374
|
result = result.concat([x]);
|
|
389
375
|
}
|
|
@@ -408,10 +394,10 @@
|
|
|
408
394
|
};
|
|
409
395
|
var show = function (editor, rootElm) {
|
|
410
396
|
var nodeList = filterDescendants(SugarElement.fromDom(rootElm), isMatch);
|
|
411
|
-
each(nodeList, function (n) {
|
|
397
|
+
each$1(nodeList, function (n) {
|
|
412
398
|
var parent = n.dom.parentNode;
|
|
413
399
|
if (isWrappedNbsp(parent)) {
|
|
414
|
-
add
|
|
400
|
+
add(SugarElement.fromDom(parent), nbspClass);
|
|
415
401
|
} else {
|
|
416
402
|
var withSpans = replaceWithSpans(editor.dom.encode(value(n)));
|
|
417
403
|
var div = editor.dom.create('div', null, withSpans);
|
|
@@ -425,9 +411,9 @@
|
|
|
425
411
|
};
|
|
426
412
|
var hide = function (editor, rootElm) {
|
|
427
413
|
var nodeList = editor.dom.select(selector, rootElm);
|
|
428
|
-
each(nodeList, function (node) {
|
|
414
|
+
each$1(nodeList, function (node) {
|
|
429
415
|
if (isWrappedNbsp(node)) {
|
|
430
|
-
remove
|
|
416
|
+
remove(SugarElement.fromDom(node), nbspClass);
|
|
431
417
|
} else {
|
|
432
418
|
editor.dom.remove(node, true);
|
|
433
419
|
}
|
|
@@ -459,7 +445,7 @@
|
|
|
459
445
|
editor.selection.moveToBookmark(bookmark);
|
|
460
446
|
};
|
|
461
447
|
|
|
462
|
-
var register = function (editor, toggleState) {
|
|
448
|
+
var register$1 = function (editor, toggleState) {
|
|
463
449
|
editor.addCommand('mceVisualChars', function () {
|
|
464
450
|
toggleVisualChars(editor, toggleState);
|
|
465
451
|
});
|
|
@@ -472,16 +458,16 @@
|
|
|
472
458
|
return editor.getParam('forced_root_block') !== false;
|
|
473
459
|
};
|
|
474
460
|
|
|
475
|
-
var setup = function (editor, toggleState) {
|
|
461
|
+
var setup$1 = function (editor, toggleState) {
|
|
476
462
|
editor.on('init', function () {
|
|
477
463
|
applyVisualChars(editor, toggleState);
|
|
478
464
|
});
|
|
479
465
|
};
|
|
480
466
|
|
|
481
|
-
var global
|
|
467
|
+
var global = tinymce.util.Tools.resolve('tinymce.util.Delay');
|
|
482
468
|
|
|
483
|
-
var setup
|
|
484
|
-
var debouncedToggle = global
|
|
469
|
+
var setup = function (editor, toggleState) {
|
|
470
|
+
var debouncedToggle = global.debounce(function () {
|
|
485
471
|
toggle(editor);
|
|
486
472
|
}, 300);
|
|
487
473
|
if (hasForcedRootBlock(editor)) {
|
|
@@ -506,33 +492,32 @@
|
|
|
506
492
|
};
|
|
507
493
|
};
|
|
508
494
|
};
|
|
509
|
-
var register
|
|
495
|
+
var register = function (editor, toggleState) {
|
|
496
|
+
var onAction = function () {
|
|
497
|
+
return editor.execCommand('mceVisualChars');
|
|
498
|
+
};
|
|
510
499
|
editor.ui.registry.addToggleButton('visualchars', {
|
|
511
500
|
tooltip: 'Show invisible characters',
|
|
512
501
|
icon: 'visualchars',
|
|
513
|
-
onAction:
|
|
514
|
-
return editor.execCommand('mceVisualChars');
|
|
515
|
-
},
|
|
502
|
+
onAction: onAction,
|
|
516
503
|
onSetup: toggleActiveState(editor, toggleState)
|
|
517
504
|
});
|
|
518
505
|
editor.ui.registry.addToggleMenuItem('visualchars', {
|
|
519
506
|
text: 'Show invisible characters',
|
|
520
507
|
icon: 'visualchars',
|
|
521
|
-
onAction:
|
|
522
|
-
return editor.execCommand('mceVisualChars');
|
|
523
|
-
},
|
|
508
|
+
onAction: onAction,
|
|
524
509
|
onSetup: toggleActiveState(editor, toggleState)
|
|
525
510
|
});
|
|
526
511
|
};
|
|
527
512
|
|
|
528
513
|
function Plugin () {
|
|
529
|
-
global.add('visualchars', function (editor) {
|
|
514
|
+
global$1.add('visualchars', function (editor) {
|
|
530
515
|
var toggleState = Cell(isEnabledByDefault(editor));
|
|
531
|
-
register(editor, toggleState);
|
|
532
516
|
register$1(editor, toggleState);
|
|
533
|
-
|
|
517
|
+
register(editor, toggleState);
|
|
534
518
|
setup(editor, toggleState);
|
|
535
|
-
|
|
519
|
+
setup$1(editor, toggleState);
|
|
520
|
+
return get$2(toggleState);
|
|
536
521
|
});
|
|
537
522
|
}
|
|
538
523
|
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
|
6
6
|
*
|
|
7
|
-
* Version: 5.
|
|
7
|
+
* Version: 5.10.3 (2022-02-09)
|
|
8
8
|
*/
|
|
9
|
-
!function(){"use strict";
|
|
9
|
+
!function(){"use strict";function n(t){return function(n){return typeof n===t}}function i(n){return function(){return n}}function t(n){return n}function e(){return l}var o,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(n){return e=typeof(t=n),(null===t?"null":"object"==e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e)===o;var t,e},c=n("boolean"),a=n("number"),s=i(!(o="string")),f=i(!0),l={fold:function(n,t){return n()},isSome:s,isNone:f,getOr:t,getOrThunk:d,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:t,orThunk:d,map:e,each:function(){},bind:e,exists:s,forall:f,filter:function(){return l},toArray:function(){return[]},toString:i("none()")};function d(n){return n()}function m(n,t){for(var e=0,o=n.length;e<o;e++)t(n[e],e)}function v(n,t){for(var e=h(n),o=0,r=e.length;o<r;o++){var i=e[o];t(n[i],i)}}var g=function(e){function n(){return r}function t(n){return n(e)}var o=i(e),r={fold:function(n,t){return t(e)},isSome:f,isNone:s,getOr:o,getOrThunk:o,getOrDie:o,getOrNull:o,getOrUndefined:o,or:n,orThunk:n,map:function(n){return g(n(e))},each:function(n){n(e)},bind:t,exists:t,forall:t,filter:function(n){return n(e)?r:l},toArray:function(){return[e]},toString:function(){return"some("+e+")"}};return r},h=Object.keys;function p(n){return n.dom.nodeValue}function y(n,t,e){!function(n,t,e){if(!(u(e)||c(e)||a(e)))throw console.error("Invalid call to Attribute.set. Key ",t,":: Value ",e,":: Element ",n),new Error("Attribute value was not simple");n.setAttribute(t,e+"")}(n.dom,t,e)}function b(n,t){n.dom.removeAttribute(t)}function w(n,t){var e,o=null===(e=n.dom.getAttribute(t))?void 0:e;return void 0===o||""===o?[]:o.split(" ")}function T(n){return void 0!==n.dom.classList}function k(n,t){return i=t,0<(o=function(n){for(var t=[],e=0,o=n.length;e<o;e++){var r=n[e];r!==i&&t.push(r)}return t}(w(e=n,"class"))).length?y(e,"class",o.join(" ")):b(e,"class"),0;var e,i,o}function N(n,t){var e="";return v(n,function(n,t){e+=t}),new RegExp("["+e+"]",t?"g":"")}function A(n){return'<span data-mce-bogus="1" class="mce-'+H[n]+'">'+n+"</span>"}function O(n){var t=p(n);return j(n)&&void 0!==t&&_.test(t)}function C(n){return"span"===n.nodeName.toLowerCase()&&n.classList.contains("mce-nbsp-wrap")}function S(f,n){m(K(M.fromDom(n),O),function(n){var t,e,o,r,i,u=n.dom.parentNode;if(C(u))t=M.fromDom(u),e=U,T(t)?t.dom.classList.add(e):(r=e,i=w(o=t,"class").concat([r]),y(o,"class",i.join(" ")));else{for(var c,a=f.dom.encode(p(n)).replace(F,A),s=f.dom.create("div",null,a);c=s.lastChild;)f.dom.insertAfter(c,n.dom);f.dom.remove(n.dom)}})}function D(r,n){m(r.dom.select(I,n),function(n){var t,e,o;C(n)?(t=M.fromDom(n),e=U,T(t)?t.dom.classList.remove(e):k(t,e),0===(T(o=t)?o.dom.classList:w(o,"class")).length&&b(o,"class")):r.dom.remove(n,!0)})}function E(n){var t=n.getBody(),e=n.selection.getBookmark(),o=function(n,t){for(;n.parentNode;){if(n.parentNode===t)return n;n=n.parentNode}}(n.selection.getNode(),t);D(n,o=void 0!==o?o:t),S(n,o),n.selection.moveToBookmark(e)}function L(n,t){var e=n,o=t.get();e.fire("VisualChars",{state:o});var r=n.getBody();(!0===t.get()?S:D)(n,r)}function x(n,t){n.addCommand("mceVisualChars",function(){!function(n,t){t.set(!t.get());var e=n.selection.getBookmark();L(n,t),n.selection.moveToBookmark(e)}(n,t)})}function B(e,o){return function(t){function n(n){return t.setActive(n.state)}return t.setActive(o.get()),e.on("VisualChars",n),function(){return e.off("VisualChars",n)}}}"undefined"!=typeof window||Function("return this;")();function P(n){if(null==n)throw new Error("Node cannot be null or undefined");return{dom:n}}var V,j=function(n){return 3===n.dom.nodeType},M={fromHtml:function(n,t){var e=(t||document).createElement("div");if(e.innerHTML=n,!e.hasChildNodes()||1<e.childNodes.length)throw console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return P(e.childNodes[0])},fromTag:function(n,t){var e=(t||document).createElement(n);return P(e)},fromText:function(n,t){var e=(t||document).createTextNode(n);return P(e)},fromDom:P,fromPoint:function(n,t,e){return(null==(o=n.dom.elementFromPoint(t,e))?l:g(o)).map(P);var o}},H={"\xa0":"nbsp","\xad":"shy"},_=N(H),F=N(H,!0),I=(V="",v(H,function(n){V&&(V+=","),V+="span.mce-"+n}),V),U="mce-nbsp",K=function(n,t){var e=[];return m(function(n,t){for(var e=n.length,o=new Array(e),r=0;r<e;r++){var i=n[r];o[r]=t(i,r)}return o}(n.dom.childNodes,M.fromDom),function(n){e=(e=t(n)?e.concat([n]):e).concat(K(n,t))}),e},R=tinymce.util.Tools.resolve("tinymce.util.Delay");r.add("visualchars",function(n){var t,e,o,r,i,u,c,a,s,f,l=(t=n.getParam("visualchars_default_state",!1),e=t,{get:function(){return e},set:function(n){e=n}});function d(){return o.execCommand("mceVisualChars")}return x(n,l),(o=n).ui.registry.addToggleButton("visualchars",{tooltip:"Show invisible characters",icon:"visualchars",onAction:d,onSetup:B(o,r=l)}),o.ui.registry.addToggleMenuItem("visualchars",{text:"Show invisible characters",icon:"visualchars",onAction:d,onSetup:B(o,r)}),i=n,u=l,c=R.debounce(function(){E(i)},300),!1!==i.getParam("forced_root_block")&&i.on("keydown",function(n){!0===u.get()&&(13===n.keyCode?E(i):c())}),i.on("remove",c.stop),s=l,(a=n).on("init",function(){L(a,s)}),f=l,{isEnabled:function(){return f.get()}}})}();
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
|
6
6
|
*
|
|
7
|
-
* Version: 5.
|
|
7
|
+
* Version: 5.10.3 (2022-02-09)
|
|
8
8
|
*/
|
|
9
9
|
(function () {
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
12
|
+
var global$2 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
13
13
|
|
|
14
14
|
var identity = function (x) {
|
|
15
15
|
return x;
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
var zeroWidth = '\uFEFF';
|
|
32
|
-
var removeZwsp = function (s) {
|
|
32
|
+
var removeZwsp$1 = function (s) {
|
|
33
33
|
return s.replace(/\uFEFF/g, '');
|
|
34
34
|
};
|
|
35
35
|
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
AT: 12,
|
|
76
76
|
OTHER: 13
|
|
77
77
|
};
|
|
78
|
-
var SETS = [
|
|
78
|
+
var SETS$1 = [
|
|
79
79
|
new RegExp(regExps.aletter),
|
|
80
80
|
new RegExp(regExps.midnumlet),
|
|
81
81
|
new RegExp(regExps.midletter),
|
|
@@ -90,17 +90,17 @@
|
|
|
90
90
|
new RegExp(regExps.extendnumlet),
|
|
91
91
|
new RegExp('@')
|
|
92
92
|
];
|
|
93
|
-
var EMPTY_STRING = '';
|
|
94
|
-
var PUNCTUATION = new RegExp('^' + regExps.punctuation + '$');
|
|
95
|
-
var WHITESPACE = /^\s+$/;
|
|
93
|
+
var EMPTY_STRING$1 = '';
|
|
94
|
+
var PUNCTUATION$1 = new RegExp('^' + regExps.punctuation + '$');
|
|
95
|
+
var WHITESPACE$1 = /^\s+$/;
|
|
96
96
|
|
|
97
|
-
var SETS
|
|
97
|
+
var SETS = SETS$1;
|
|
98
98
|
var OTHER = characterIndices.OTHER;
|
|
99
99
|
var getType = function (char) {
|
|
100
100
|
var type = OTHER;
|
|
101
|
-
var setsLength = SETS
|
|
101
|
+
var setsLength = SETS.length;
|
|
102
102
|
for (var j = 0; j < setsLength; ++j) {
|
|
103
|
-
var set = SETS
|
|
103
|
+
var set = SETS[j];
|
|
104
104
|
if (set && set.test(char)) {
|
|
105
105
|
type = j;
|
|
106
106
|
break;
|
|
@@ -178,16 +178,16 @@
|
|
|
178
178
|
return true;
|
|
179
179
|
};
|
|
180
180
|
|
|
181
|
-
var EMPTY_STRING
|
|
182
|
-
var WHITESPACE
|
|
183
|
-
var PUNCTUATION
|
|
181
|
+
var EMPTY_STRING = EMPTY_STRING$1;
|
|
182
|
+
var WHITESPACE = WHITESPACE$1;
|
|
183
|
+
var PUNCTUATION = PUNCTUATION$1;
|
|
184
184
|
var isProtocol = function (str) {
|
|
185
185
|
return str === 'http' || str === 'https';
|
|
186
186
|
};
|
|
187
187
|
var findWordEnd = function (characters, startIndex) {
|
|
188
188
|
var i;
|
|
189
189
|
for (i = startIndex; i < characters.length; i++) {
|
|
190
|
-
if (WHITESPACE
|
|
190
|
+
if (WHITESPACE.test(characters[i])) {
|
|
191
191
|
break;
|
|
192
192
|
}
|
|
193
193
|
}
|
|
@@ -195,7 +195,7 @@
|
|
|
195
195
|
};
|
|
196
196
|
var findUrlEnd = function (characters, startIndex) {
|
|
197
197
|
var endIndex = findWordEnd(characters, startIndex + 1);
|
|
198
|
-
var peakedWord = characters.slice(startIndex + 1, endIndex).join(EMPTY_STRING
|
|
198
|
+
var peakedWord = characters.slice(startIndex + 1, endIndex).join(EMPTY_STRING);
|
|
199
199
|
return peakedWord.substr(0, 3) === '://' ? endIndex : startIndex;
|
|
200
200
|
};
|
|
201
201
|
var findWords = function (chars, sChars, characterMap, options) {
|
|
@@ -205,10 +205,10 @@
|
|
|
205
205
|
word.push(chars[i]);
|
|
206
206
|
if (isWordBoundary(characterMap, i)) {
|
|
207
207
|
var ch = sChars[i];
|
|
208
|
-
if ((options.includeWhitespace || !WHITESPACE
|
|
208
|
+
if ((options.includeWhitespace || !WHITESPACE.test(ch)) && (options.includePunctuation || !PUNCTUATION.test(ch))) {
|
|
209
209
|
var startOfWord = i - word.length + 1;
|
|
210
210
|
var endOfWord = i + 1;
|
|
211
|
-
var str = sChars.slice(startOfWord, endOfWord).join(EMPTY_STRING
|
|
211
|
+
var str = sChars.slice(startOfWord, endOfWord).join(EMPTY_STRING);
|
|
212
212
|
if (isProtocol(str)) {
|
|
213
213
|
var endOfUrl = findUrlEnd(sChars, i);
|
|
214
214
|
var url = chars.slice(endOfWord, endOfUrl);
|
|
@@ -228,7 +228,7 @@
|
|
|
228
228
|
includePunctuation: false
|
|
229
229
|
};
|
|
230
230
|
};
|
|
231
|
-
var getWords = function (chars, extract, options) {
|
|
231
|
+
var getWords$1 = function (chars, extract, options) {
|
|
232
232
|
options = __assign(__assign({}, getDefaultOptions()), options);
|
|
233
233
|
var filteredChars = [];
|
|
234
234
|
var extractedChars = [];
|
|
@@ -243,7 +243,7 @@
|
|
|
243
243
|
return findWords(filteredChars, extractedChars, characterMap, options);
|
|
244
244
|
};
|
|
245
245
|
|
|
246
|
-
var getWords
|
|
246
|
+
var getWords = getWords$1;
|
|
247
247
|
|
|
248
248
|
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker');
|
|
249
249
|
|
|
@@ -258,7 +258,7 @@
|
|
|
258
258
|
var treeWalker = new global$1(node, node);
|
|
259
259
|
while (node = treeWalker.next()) {
|
|
260
260
|
if (node.nodeType === 3) {
|
|
261
|
-
txt += removeZwsp(node.data);
|
|
261
|
+
txt += removeZwsp$1(node.data);
|
|
262
262
|
} else if (isNewline(node) && txt.length) {
|
|
263
263
|
textBlocks.push(txt);
|
|
264
264
|
txt = '';
|
|
@@ -270,12 +270,15 @@
|
|
|
270
270
|
return textBlocks;
|
|
271
271
|
};
|
|
272
272
|
|
|
273
|
+
var removeZwsp = function (text) {
|
|
274
|
+
return text.replace(/\u200B/g, '');
|
|
275
|
+
};
|
|
273
276
|
var strLen = function (str) {
|
|
274
277
|
return str.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, '_').length;
|
|
275
278
|
};
|
|
276
279
|
var countWords = function (node, schema) {
|
|
277
|
-
var text = getText(node, schema).join('\n');
|
|
278
|
-
return getWords
|
|
280
|
+
var text = removeZwsp(getText(node, schema).join('\n'));
|
|
281
|
+
return getWords(text.split(''), identity).length;
|
|
279
282
|
};
|
|
280
283
|
var countCharacters = function (node, schema) {
|
|
281
284
|
var text = getText(node, schema).join('');
|
|
@@ -315,33 +318,6 @@
|
|
|
315
318
|
};
|
|
316
319
|
};
|
|
317
320
|
|
|
318
|
-
var global$2 = tinymce.util.Tools.resolve('tinymce.util.Delay');
|
|
319
|
-
|
|
320
|
-
var fireWordCountUpdate = function (editor, api) {
|
|
321
|
-
editor.fire('wordCountUpdate', {
|
|
322
|
-
wordCount: {
|
|
323
|
-
words: api.body.getWordCount(),
|
|
324
|
-
characters: api.body.getCharacterCount(),
|
|
325
|
-
charactersWithoutSpaces: api.body.getCharacterCountWithoutSpaces()
|
|
326
|
-
}
|
|
327
|
-
});
|
|
328
|
-
};
|
|
329
|
-
|
|
330
|
-
var updateCount = function (editor, api) {
|
|
331
|
-
fireWordCountUpdate(editor, api);
|
|
332
|
-
};
|
|
333
|
-
var setup = function (editor, api, delay) {
|
|
334
|
-
var debouncedUpdate = global$2.debounce(function () {
|
|
335
|
-
return updateCount(editor, api);
|
|
336
|
-
}, delay);
|
|
337
|
-
editor.on('init', function () {
|
|
338
|
-
updateCount(editor, api);
|
|
339
|
-
global$2.setEditorTimeout(editor, function () {
|
|
340
|
-
editor.on('SetContent BeforeAddUndo Undo Redo keyup', debouncedUpdate);
|
|
341
|
-
}, 0);
|
|
342
|
-
});
|
|
343
|
-
};
|
|
344
|
-
|
|
345
321
|
var open = function (editor, api) {
|
|
346
322
|
editor.windowManager.open({
|
|
347
323
|
title: 'Word Count',
|
|
@@ -382,20 +358,52 @@
|
|
|
382
358
|
});
|
|
383
359
|
};
|
|
384
360
|
|
|
385
|
-
var register = function (editor, api) {
|
|
361
|
+
var register$1 = function (editor, api) {
|
|
362
|
+
editor.addCommand('mceWordCount', function () {
|
|
363
|
+
return open(editor, api);
|
|
364
|
+
});
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
var global = tinymce.util.Tools.resolve('tinymce.util.Delay');
|
|
368
|
+
|
|
369
|
+
var fireWordCountUpdate = function (editor, api) {
|
|
370
|
+
editor.fire('wordCountUpdate', {
|
|
371
|
+
wordCount: {
|
|
372
|
+
words: api.body.getWordCount(),
|
|
373
|
+
characters: api.body.getCharacterCount(),
|
|
374
|
+
charactersWithoutSpaces: api.body.getCharacterCountWithoutSpaces()
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
var updateCount = function (editor, api) {
|
|
380
|
+
fireWordCountUpdate(editor, api);
|
|
381
|
+
};
|
|
382
|
+
var setup = function (editor, api, delay) {
|
|
383
|
+
var debouncedUpdate = global.debounce(function () {
|
|
384
|
+
return updateCount(editor, api);
|
|
385
|
+
}, delay);
|
|
386
|
+
editor.on('init', function () {
|
|
387
|
+
updateCount(editor, api);
|
|
388
|
+
global.setEditorTimeout(editor, function () {
|
|
389
|
+
editor.on('SetContent BeforeAddUndo Undo Redo ViewUpdate keyup', debouncedUpdate);
|
|
390
|
+
}, 0);
|
|
391
|
+
});
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
var register = function (editor) {
|
|
395
|
+
var onAction = function () {
|
|
396
|
+
return editor.execCommand('mceWordCount');
|
|
397
|
+
};
|
|
386
398
|
editor.ui.registry.addButton('wordcount', {
|
|
387
399
|
tooltip: 'Word count',
|
|
388
400
|
icon: 'character-count',
|
|
389
|
-
onAction:
|
|
390
|
-
return open(editor, api);
|
|
391
|
-
}
|
|
401
|
+
onAction: onAction
|
|
392
402
|
});
|
|
393
403
|
editor.ui.registry.addMenuItem('wordcount', {
|
|
394
404
|
text: 'Word count',
|
|
395
405
|
icon: 'character-count',
|
|
396
|
-
onAction:
|
|
397
|
-
return open(editor, api);
|
|
398
|
-
}
|
|
406
|
+
onAction: onAction
|
|
399
407
|
});
|
|
400
408
|
};
|
|
401
409
|
|
|
@@ -403,9 +411,10 @@
|
|
|
403
411
|
if (delay === void 0) {
|
|
404
412
|
delay = 300;
|
|
405
413
|
}
|
|
406
|
-
global.add('wordcount', function (editor) {
|
|
414
|
+
global$2.add('wordcount', function (editor) {
|
|
407
415
|
var api = get(editor);
|
|
408
|
-
register(editor, api);
|
|
416
|
+
register$1(editor, api);
|
|
417
|
+
register(editor);
|
|
409
418
|
setup(editor, api, delay);
|
|
410
419
|
return api;
|
|
411
420
|
});
|