@dangl/angular-material-shared 2.2.0 → 2.3.0-beta0037
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/{esm2015/dangl-angular-material-shared.js → esm2020/dangl-angular-material-shared.mjs} +0 -0
- package/esm2020/lib/angular-material-shared.module.mjs +38 -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 +292 -0
- package/fesm2015/dangl-angular-material-shared.mjs.map +1 -0
- package/fesm2020/dangl-angular-material-shared.mjs +290 -0
- package/fesm2020/dangl-angular-material-shared.mjs.map +1 -0
- package/{dangl-angular-material-shared.d.ts → index.d.ts} +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/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/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/ja.js +60 -17
- package/tinymce-assets/langs/ko_KR.js +3 -3
- 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 +39 -49
- 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 +186 -53
- 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 +496 -129
- package/tinymce-assets/plugins/fullscreen/plugin.min.js +2 -2
- package/tinymce-assets/plugins/help/plugin.js +101 -122
- 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 +78 -73
- package/tinymce-assets/plugins/image/plugin.min.js +2 -2
- package/tinymce-assets/plugins/imagetools/plugin.js +484 -307
- 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 +256 -229
- package/tinymce-assets/plugins/lists/plugin.min.js +2 -2
- package/tinymce-assets/plugins/media/plugin.js +124 -147
- 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 +16 -17
- package/tinymce-assets/plugins/pagebreak/plugin.min.js +2 -2
- package/tinymce-assets/plugins/paste/plugin.js +196 -157
- 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 +33 -48
- 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 +73 -70
- 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 +2831 -2264
- 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 +76 -96
- 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 +52 -67
- 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 +35 -22
- 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 +35 -22
- 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 +2798 -3255
- package/tinymce-assets/themes/mobile/theme.min.js +2 -2
- package/tinymce-assets/themes/silver/theme.js +25400 -25371
- 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/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,19 +4,19 @@
|
|
|
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$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
13
13
|
|
|
14
14
|
var applyListFormat = function (editor, listName, styleValue) {
|
|
15
15
|
var cmd = listName === 'UL' ? 'InsertUnorderedList' : 'InsertOrderedList';
|
|
16
16
|
editor.execCommand(cmd, false, styleValue === false ? null : { 'list-style-type': styleValue });
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
var register = function (editor) {
|
|
19
|
+
var register$1 = function (editor) {
|
|
20
20
|
editor.addCommand('ApplyUnorderedListStyle', function (ui, value) {
|
|
21
21
|
applyListFormat(editor, 'UL', value['list-style-type']);
|
|
22
22
|
});
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
});
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
var global
|
|
28
|
+
var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
|
29
29
|
|
|
30
30
|
var getNumberStyles = function (editor) {
|
|
31
31
|
var styles = editor.getParam('advlist_number_styles', 'default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman');
|
|
@@ -43,6 +43,9 @@
|
|
|
43
43
|
return value;
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
|
+
var identity = function (x) {
|
|
47
|
+
return x;
|
|
48
|
+
};
|
|
46
49
|
var never = constant(false);
|
|
47
50
|
var always = constant(true);
|
|
48
51
|
|
|
@@ -50,20 +53,14 @@
|
|
|
50
53
|
return NONE;
|
|
51
54
|
};
|
|
52
55
|
var NONE = function () {
|
|
53
|
-
var eq = function (o) {
|
|
54
|
-
return o.isNone();
|
|
55
|
-
};
|
|
56
56
|
var call = function (thunk) {
|
|
57
57
|
return thunk();
|
|
58
58
|
};
|
|
59
|
-
var id =
|
|
60
|
-
return n;
|
|
61
|
-
};
|
|
59
|
+
var id = identity;
|
|
62
60
|
var me = {
|
|
63
61
|
fold: function (n, _s) {
|
|
64
62
|
return n();
|
|
65
63
|
},
|
|
66
|
-
is: never,
|
|
67
64
|
isSome: never,
|
|
68
65
|
isNone: always,
|
|
69
66
|
getOr: id,
|
|
@@ -80,9 +77,9 @@
|
|
|
80
77
|
bind: none,
|
|
81
78
|
exists: never,
|
|
82
79
|
forall: always,
|
|
83
|
-
filter:
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
filter: function () {
|
|
81
|
+
return none();
|
|
82
|
+
},
|
|
86
83
|
toArray: function () {
|
|
87
84
|
return [];
|
|
88
85
|
},
|
|
@@ -102,9 +99,6 @@
|
|
|
102
99
|
fold: function (n, s) {
|
|
103
100
|
return s(a);
|
|
104
101
|
},
|
|
105
|
-
is: function (v) {
|
|
106
|
-
return a === v;
|
|
107
|
-
},
|
|
108
102
|
isSome: always,
|
|
109
103
|
isNone: never,
|
|
110
104
|
getOr: constant_a,
|
|
@@ -131,14 +125,6 @@
|
|
|
131
125
|
},
|
|
132
126
|
toString: function () {
|
|
133
127
|
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
128
|
}
|
|
143
129
|
};
|
|
144
130
|
return me;
|
|
@@ -186,9 +172,20 @@
|
|
|
186
172
|
var isWithinList = function (editor, e, nodeName) {
|
|
187
173
|
var tableCellIndex = findIndex(e.parents, isTableCellNode);
|
|
188
174
|
var parents = tableCellIndex !== -1 ? e.parents.slice(0, tableCellIndex) : e.parents;
|
|
189
|
-
var lists = global
|
|
175
|
+
var lists = global.grep(parents, isListNode(editor));
|
|
190
176
|
return lists.length > 0 && lists[0].nodeName === nodeName;
|
|
191
177
|
};
|
|
178
|
+
var makeSetupHandler = function (editor, nodeName) {
|
|
179
|
+
return function (api) {
|
|
180
|
+
var nodeChangeHandler = function (e) {
|
|
181
|
+
api.setActive(isWithinList(editor, e, nodeName));
|
|
182
|
+
};
|
|
183
|
+
editor.on('NodeChange', nodeChangeHandler);
|
|
184
|
+
return function () {
|
|
185
|
+
return editor.off('NodeChange', nodeChangeHandler);
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
};
|
|
192
189
|
var addSplitButton = function (editor, id, tooltip, cmd, nodeName, styles) {
|
|
193
190
|
editor.ui.registry.addSplitButton(id, {
|
|
194
191
|
tooltip: tooltip,
|
|
@@ -196,7 +193,7 @@
|
|
|
196
193
|
presets: 'listpreview',
|
|
197
194
|
columns: 3,
|
|
198
195
|
fetch: function (callback) {
|
|
199
|
-
var items = global
|
|
196
|
+
var items = global.map(styles, function (styleValue) {
|
|
200
197
|
var iconStyle = nodeName === 'OL' ? 'num' : 'bull';
|
|
201
198
|
var iconName = styleValue === 'disc' || styleValue === 'decimal' ? 'default' : styleValue;
|
|
202
199
|
var itemValue = styleValue === 'default' ? '' : styleValue;
|
|
@@ -222,15 +219,7 @@
|
|
|
222
219
|
return value === listStyle;
|
|
223
220
|
}).getOr(false);
|
|
224
221
|
},
|
|
225
|
-
onSetup:
|
|
226
|
-
var nodeChangeHandler = function (e) {
|
|
227
|
-
api.setActive(isWithinList(editor, e, nodeName));
|
|
228
|
-
};
|
|
229
|
-
editor.on('NodeChange', nodeChangeHandler);
|
|
230
|
-
return function () {
|
|
231
|
-
return editor.off('NodeChange', nodeChangeHandler);
|
|
232
|
-
};
|
|
233
|
-
}
|
|
222
|
+
onSetup: makeSetupHandler(editor, nodeName)
|
|
234
223
|
});
|
|
235
224
|
};
|
|
236
225
|
var addButton = function (editor, id, tooltip, cmd, nodeName, _styles) {
|
|
@@ -238,15 +227,7 @@
|
|
|
238
227
|
active: false,
|
|
239
228
|
tooltip: tooltip,
|
|
240
229
|
icon: nodeName === 'OL' ? 'ordered-list' : 'unordered-list',
|
|
241
|
-
onSetup:
|
|
242
|
-
var nodeChangeHandler = function (e) {
|
|
243
|
-
api.setActive(isWithinList(editor, e, nodeName));
|
|
244
|
-
};
|
|
245
|
-
editor.on('NodeChange', nodeChangeHandler);
|
|
246
|
-
return function () {
|
|
247
|
-
return editor.off('NodeChange', nodeChangeHandler);
|
|
248
|
-
};
|
|
249
|
-
},
|
|
230
|
+
onSetup: makeSetupHandler(editor, nodeName),
|
|
250
231
|
onAction: function () {
|
|
251
232
|
return editor.execCommand(cmd);
|
|
252
233
|
}
|
|
@@ -259,16 +240,16 @@
|
|
|
259
240
|
addButton(editor, id, tooltip, cmd, nodeName);
|
|
260
241
|
}
|
|
261
242
|
};
|
|
262
|
-
var register
|
|
243
|
+
var register = function (editor) {
|
|
263
244
|
addControl(editor, 'numlist', 'Numbered list', 'InsertOrderedList', 'OL', getNumberStyles(editor));
|
|
264
245
|
addControl(editor, 'bullist', 'Bullet list', 'InsertUnorderedList', 'UL', getBulletStyles(editor));
|
|
265
246
|
};
|
|
266
247
|
|
|
267
248
|
function Plugin () {
|
|
268
|
-
global.add('advlist', function (editor) {
|
|
249
|
+
global$1.add('advlist', function (editor) {
|
|
269
250
|
if (editor.hasPlugin('lists')) {
|
|
270
|
-
register$1(editor);
|
|
271
251
|
register(editor);
|
|
252
|
+
register$1(editor);
|
|
272
253
|
} else {
|
|
273
254
|
console.error('Please use the Lists plugin together with the Advanced List plugin.');
|
|
274
255
|
}
|
|
@@ -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 f(t,e,n){t.execCommand("UL"===e?"InsertUnorderedList":"InsertOrderedList",!1,!1===n?null:{"list-style-type":n})}function i(t){return function(){return t}}function t(t){return t}function e(){return s}var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),g=tinymce.util.Tools.resolve("tinymce.util.Tools"),u=i(!1),l=i(!0),s={fold:function(t,e){return t()},isSome:u,isNone:l,getOr:t,getOrThunk:r,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:t,orThunk:r,map:e,each:function(){},bind:e,exists:u,forall:l,filter:function(){return s},toArray:function(){return[]},toString:i("none()")};function r(t){return t()}function d(t){return t&&/^(TH|TD)$/.test(t.nodeName)}function m(c,a){return function(s){function t(t){var e,n,r,o,i,u,l;s.setActive((e=c,r=a,i=-1!==(o=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return n;return-1}((n=t).parents,d))?n.parents.slice(0,o):n.parents,0<(u=g.grep(i,(l=e,function(t){return t&&/^(OL|UL|DL)$/.test(t.nodeName)&&(e=t,l.$.contains(l.getBody(),e));var e}))).length&&u[0].nodeName===r))}return c.on("NodeChange",t),function(){return c.off("NodeChange",t)}}}function c(t,e,n,r,o,i){var u,l,s,c,a,d;1<i.length?(c=r,a=o,d=i,(s=t).ui.registry.addSplitButton(e,{tooltip:n,icon:"OL"===a?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:function(t){t(g.map(d,function(t){return{type:"choiceitem",value:"default"===t?"":t,icon:"list-"+("OL"===a?"num":"bull")+"-"+("disc"===t||"decimal"===t?"default":t),text:t.replace(/\-/g," ").replace(/\b\w/g,function(t){return t.toUpperCase()})}}))},onAction:function(){return s.execCommand(c)},onItemAction:function(t,e){f(s,a,e)},select:function(e){var t,n=(t=s).dom.getParent(t.selection.getNode(),"ol,ul"),r=t.dom.getStyle(n,"listStyleType");return p(r).map(function(t){return e===t}).getOr(!1)},onSetup:m(s,a)})):(l=r,(u=t).ui.registry.addToggleButton(e,{active:!1,tooltip:n,icon:"OL"===o?"ordered-list":"unordered-list",onSetup:m(u,o),onAction:function(){return u.execCommand(l)}}))}var a=function(n){function t(){return o}function e(t){return t(n)}var r=i(n),o={fold:function(t,e){return e(n)},isSome:l,isNone:u,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:t,orThunk:t,map:function(t){return a(t(n))},each:function(t){t(n)},bind:e,exists:e,forall:e,filter:function(t){return t(n)?o:s},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},p=function(t){return null==t?s:a(t)};n.add("advlist",function(t){var n,e,r,o;t.hasPlugin("lists")?(c(e=t,"numlist","Numbered list","InsertOrderedList","OL",(r=e.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman"))?r.split(/[ ,]/):[]),c(e,"bullist","Bullet list","InsertUnorderedList","UL",(o=e.getParam("advlist_bullet_styles","default,circle,square"))?o.split(/[ ,]/):[]),(n=t).addCommand("ApplyUnorderedListStyle",function(t,e){f(n,"UL",e["list-style-type"])}),n.addCommand("ApplyOrderedListStyle",function(t,e){f(n,"OL",e["list-style-type"])})):console.error("Please use the Lists plugin together with the Advanced List plugin.")})}();
|
|
@@ -4,16 +4,16 @@
|
|
|
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 global$1 = tinymce.util.Tools.resolve('tinymce.dom.RangeUtils');
|
|
15
15
|
|
|
16
|
-
var global
|
|
16
|
+
var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
|
17
17
|
|
|
18
18
|
var allowHtmlInNamedAnchor = function (editor) {
|
|
19
19
|
return editor.getParam('allow_html_in_named_anchor', false, 'boolean');
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
var removeEmptyNamedAnchorsInSelection = function (editor) {
|
|
41
41
|
var dom = editor.dom;
|
|
42
42
|
global$1(dom).walk(editor.selection.getRng(), function (nodes) {
|
|
43
|
-
global
|
|
43
|
+
global.each(nodes, function (node) {
|
|
44
44
|
if (isEmptyNamedAnchor(node)) {
|
|
45
45
|
dom.remove(node, false);
|
|
46
46
|
}
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
});
|
|
138
138
|
};
|
|
139
139
|
|
|
140
|
-
var register = function (editor) {
|
|
140
|
+
var register$1 = function (editor) {
|
|
141
141
|
editor.addCommand('mceAnchor', function () {
|
|
142
142
|
open(editor);
|
|
143
143
|
});
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
});
|
|
181
181
|
};
|
|
182
182
|
|
|
183
|
-
var register
|
|
183
|
+
var register = function (editor) {
|
|
184
184
|
editor.ui.registry.addToggleButton('anchor', {
|
|
185
185
|
icon: 'bookmark',
|
|
186
186
|
tooltip: 'Anchor',
|
|
@@ -201,10 +201,10 @@
|
|
|
201
201
|
};
|
|
202
202
|
|
|
203
203
|
function Plugin () {
|
|
204
|
-
global.add('anchor', function (editor) {
|
|
204
|
+
global$2.add('anchor', function (editor) {
|
|
205
205
|
setup(editor);
|
|
206
|
-
register(editor);
|
|
207
206
|
register$1(editor);
|
|
207
|
+
register(editor);
|
|
208
208
|
editor.on('PreInit', function () {
|
|
209
209
|
registerFormats(editor);
|
|
210
210
|
});
|
|
@@ -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 a(e){return e.getAttribute("id")||e.getAttribute("name")||""}function c(e){return e&&"a"===e.nodeName.toLowerCase()&&!e.getAttribute("href")&&""!==a(e)}function d(e){return e.dom.getParent(e.selection.getStart(),l)}function r(e,t){var o,a,n,r,i,l=d(e);l?(n=e,r=t,(i=l).removeAttribute("name"),i.id=r,n.addVisual(),n.undoManager.add()):(a=t,(o=e).undoManager.transact(function(){var e,n;o.getParam("allow_html_in_named_anchor",!1,"boolean")||o.selection.collapse(!0),o.selection.isCollapsed()?o.insertContent(o.dom.createHTML("a",{id:a})):(n=(e=o).dom,u(n).walk(e.selection.getRng(),function(e){s.each(e,function(e){var t;c(t=e)&&!t.firstChild&&n.remove(e,!1)})}),o.formatter.remove("namedAnchor",null,null,!0),o.formatter.apply("namedAnchor",{value:a}),o.addVisual())})),e.focus()}function i(r){return function(e){for(var t,n=0;n<e.length;n++){var o=e[n],a=void 0;!(a=t=o)||a.attr("href")||!a.attr("id")&&!a.attr("name")||t.firstChild||o.attr("contenteditable",r)}}}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),s=tinymce.util.Tools.resolve("tinymce.util.Tools"),l="a:not([href])";e.add("anchor",function(e){var t,n,o;(t=e).on("PreInit",function(){t.parser.addNodeFilter("a",i("false")),t.serializer.addNodeFilter("a",i(null))}),(n=e).addCommand("mceAnchor",function(){var o,e,t;t=(e=d(o=n))?a(e):"",o.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:t},onSubmit:function(e){var t=o,n=e.getData().id;(/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(n)?(r(t,n),0):(t.windowManager.alert("Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),1))||e.close()}})}),(o=e).ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:function(){return o.execCommand("mceAnchor")},onSetup:function(e){return o.selection.selectorChangedWithUnbind("a:not([href])",e.setActive).unbind}}),o.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:function(){return o.execCommand("mceAnchor")}}),e.on("PreInit",function(){e.formatter.register("namedAnchor",{inline:"a",selector:l,remove:"all",split:!0,deep:!0,attributes:{id:"%value"},onmatch:c})})})}();
|
|
@@ -4,17 +4,32 @@
|
|
|
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$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var checkRange = function (str, substr, start) {
|
|
15
|
+
return substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr;
|
|
16
|
+
};
|
|
17
|
+
var contains = function (str, substr) {
|
|
18
|
+
return str.indexOf(substr) !== -1;
|
|
19
|
+
};
|
|
20
|
+
var startsWith = function (str, prefix) {
|
|
21
|
+
return checkRange(str, prefix, 0);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
var global = tinymce.util.Tools.resolve('tinymce.Env');
|
|
25
|
+
|
|
26
|
+
var link = function () {
|
|
27
|
+
return /(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-+~=.,%()\/\w]*[-+~=%()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g;
|
|
28
|
+
};
|
|
15
29
|
|
|
30
|
+
var defaultLinkPattern = new RegExp('^' + link().source + '$', 'i');
|
|
16
31
|
var getAutoLinkPattern = function (editor) {
|
|
17
|
-
return editor.getParam('autolink_pattern',
|
|
32
|
+
return editor.getParam('autolink_pattern', defaultLinkPattern);
|
|
18
33
|
};
|
|
19
34
|
var getDefaultLinkTarget = function (editor) {
|
|
20
35
|
return editor.getParam('default_link_target', false);
|
|
@@ -23,23 +38,29 @@
|
|
|
23
38
|
return editor.getParam('link_default_protocol', 'http', 'string');
|
|
24
39
|
};
|
|
25
40
|
|
|
26
|
-
var
|
|
27
|
-
return
|
|
41
|
+
var rangeEqualsBracketOrSpace = function (rangeString) {
|
|
42
|
+
return /^[(\[{ \u00a0]$/.test(rangeString);
|
|
43
|
+
};
|
|
44
|
+
var isTextNode = function (node) {
|
|
45
|
+
return node.nodeType === 3;
|
|
46
|
+
};
|
|
47
|
+
var isElement = function (node) {
|
|
48
|
+
return node.nodeType === 1;
|
|
28
49
|
};
|
|
29
|
-
var
|
|
30
|
-
parseCurrentLine(editor, -1
|
|
50
|
+
var handleBracket = function (editor) {
|
|
51
|
+
return parseCurrentLine(editor, -1);
|
|
31
52
|
};
|
|
32
53
|
var handleSpacebar = function (editor) {
|
|
33
|
-
parseCurrentLine(editor, 0
|
|
54
|
+
return parseCurrentLine(editor, 0);
|
|
34
55
|
};
|
|
35
56
|
var handleEnter = function (editor) {
|
|
36
|
-
parseCurrentLine(editor, -1
|
|
57
|
+
return parseCurrentLine(editor, -1);
|
|
37
58
|
};
|
|
38
59
|
var scopeIndex = function (container, index) {
|
|
39
60
|
if (index < 0) {
|
|
40
61
|
index = 0;
|
|
41
62
|
}
|
|
42
|
-
if (container
|
|
63
|
+
if (isTextNode(container)) {
|
|
43
64
|
var len = container.data.length;
|
|
44
65
|
if (index > len) {
|
|
45
66
|
index = len;
|
|
@@ -48,24 +69,30 @@
|
|
|
48
69
|
return index;
|
|
49
70
|
};
|
|
50
71
|
var setStart = function (rng, container, offset) {
|
|
51
|
-
if (container
|
|
72
|
+
if (!isElement(container) || container.hasChildNodes()) {
|
|
52
73
|
rng.setStart(container, scopeIndex(container, offset));
|
|
53
74
|
} else {
|
|
54
75
|
rng.setStartBefore(container);
|
|
55
76
|
}
|
|
56
77
|
};
|
|
57
78
|
var setEnd = function (rng, container, offset) {
|
|
58
|
-
if (container
|
|
79
|
+
if (!isElement(container) || container.hasChildNodes()) {
|
|
59
80
|
rng.setEnd(container, scopeIndex(container, offset));
|
|
60
81
|
} else {
|
|
61
82
|
rng.setEndAfter(container);
|
|
62
83
|
}
|
|
63
84
|
};
|
|
64
|
-
var
|
|
85
|
+
var hasProtocol = function (url) {
|
|
86
|
+
return /^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(url);
|
|
87
|
+
};
|
|
88
|
+
var isPunctuation = function (char) {
|
|
89
|
+
return /[?!,.;:]/.test(char);
|
|
90
|
+
};
|
|
91
|
+
var parseCurrentLine = function (editor, endOffset) {
|
|
65
92
|
var end, endContainer, bookmark, text, prev, len, rngText;
|
|
66
93
|
var autoLinkPattern = getAutoLinkPattern(editor);
|
|
67
94
|
var defaultLinkTarget = getDefaultLinkTarget(editor);
|
|
68
|
-
if (editor.selection.getNode()
|
|
95
|
+
if (editor.dom.getParent(editor.selection.getNode(), 'a[href]') !== null) {
|
|
69
96
|
return;
|
|
70
97
|
}
|
|
71
98
|
var rng = editor.selection.getRng().cloneRange();
|
|
@@ -87,11 +114,11 @@
|
|
|
87
114
|
endContainer = prev;
|
|
88
115
|
} else {
|
|
89
116
|
endContainer = rng.endContainer;
|
|
90
|
-
if (endContainer
|
|
91
|
-
while (endContainer
|
|
117
|
+
if (!isTextNode(endContainer) && endContainer.firstChild) {
|
|
118
|
+
while (!isTextNode(endContainer) && endContainer.firstChild) {
|
|
92
119
|
endContainer = endContainer.firstChild;
|
|
93
120
|
}
|
|
94
|
-
if (endContainer
|
|
121
|
+
if (isTextNode(endContainer)) {
|
|
95
122
|
setStart(rng, endContainer, 0);
|
|
96
123
|
setEnd(rng, endContainer, endContainer.nodeValue.length);
|
|
97
124
|
}
|
|
@@ -108,8 +135,8 @@
|
|
|
108
135
|
setEnd(rng, endContainer, end >= 1 ? end - 1 : 0);
|
|
109
136
|
end -= 1;
|
|
110
137
|
rngText = rng.toString();
|
|
111
|
-
} while (rngText
|
|
112
|
-
if (
|
|
138
|
+
} while (!rangeEqualsBracketOrSpace(rngText) && end - 2 >= 0);
|
|
139
|
+
if (rangeEqualsBracketOrSpace(rng.toString())) {
|
|
113
140
|
setStart(rng, endContainer, end);
|
|
114
141
|
setEnd(rng, endContainer, start);
|
|
115
142
|
end += 1;
|
|
@@ -121,21 +148,22 @@
|
|
|
121
148
|
setEnd(rng, endContainer, start);
|
|
122
149
|
}
|
|
123
150
|
text = rng.toString();
|
|
124
|
-
if (text.charAt(text.length - 1)
|
|
151
|
+
if (isPunctuation(text.charAt(text.length - 1))) {
|
|
125
152
|
setEnd(rng, endContainer, start - 1);
|
|
126
153
|
}
|
|
127
154
|
text = rng.toString().trim();
|
|
128
155
|
var matches = text.match(autoLinkPattern);
|
|
129
156
|
var protocol = getDefaultLinkProtocol(editor);
|
|
130
157
|
if (matches) {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
158
|
+
var url = matches[0];
|
|
159
|
+
if (startsWith(url, 'www.')) {
|
|
160
|
+
url = protocol + '://' + url;
|
|
161
|
+
} else if (contains(url, '@') && !hasProtocol(url)) {
|
|
162
|
+
url = 'mailto:' + url;
|
|
135
163
|
}
|
|
136
164
|
bookmark = editor.selection.getBookmark();
|
|
137
165
|
editor.selection.setRng(rng);
|
|
138
|
-
editor.execCommand('createlink', false,
|
|
166
|
+
editor.execCommand('createlink', false, url);
|
|
139
167
|
if (defaultLinkTarget !== false) {
|
|
140
168
|
editor.dom.setAttrib(editor.selection.getNode(), 'target', defaultLinkTarget);
|
|
141
169
|
}
|
|
@@ -150,7 +178,7 @@
|
|
|
150
178
|
return handleEnter(editor);
|
|
151
179
|
}
|
|
152
180
|
});
|
|
153
|
-
if (global
|
|
181
|
+
if (global.browser.isIE()) {
|
|
154
182
|
editor.on('focus', function () {
|
|
155
183
|
if (!autoUrlDetectState) {
|
|
156
184
|
autoUrlDetectState = true;
|
|
@@ -163,8 +191,8 @@
|
|
|
163
191
|
return;
|
|
164
192
|
}
|
|
165
193
|
editor.on('keypress', function (e) {
|
|
166
|
-
if (e.keyCode === 41) {
|
|
167
|
-
return
|
|
194
|
+
if (e.keyCode === 41 || e.keyCode === 93 || e.keyCode === 125) {
|
|
195
|
+
return handleBracket(editor);
|
|
168
196
|
}
|
|
169
197
|
});
|
|
170
198
|
editor.on('keyup', function (e) {
|
|
@@ -175,7 +203,7 @@
|
|
|
175
203
|
};
|
|
176
204
|
|
|
177
205
|
function Plugin () {
|
|
178
|
-
global.add('autolink', function (editor) {
|
|
206
|
+
global$1.add('autolink', function (editor) {
|
|
179
207
|
setup(editor);
|
|
180
208
|
});
|
|
181
209
|
}
|
|
@@ -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 k(e){return/^[(\[{ \u00a0]$/.test(e)}function w(e){return 3===e.nodeType}function i(e){return 1===e.nodeType}function o(e,t){var n;return t<0&&(t=0),!w(e)||(n=e.data.length)<t&&(t=n),t}function y(e,t,n){!i(t)||t.hasChildNodes()?e.setStart(t,o(t,n)):e.setStartBefore(t)}function v(e,t,n){!i(t)||t.hasChildNodes()?e.setEnd(t,o(t,n)):e.setEndAfter(t)}function r(e,t){var n,i,o,r,a,f=e.getParam("autolink_pattern",A),s=e.getParam("default_link_target",!1);if(null===e.dom.getParent(e.selection.getNode(),"a[href]")){var d=e.selection.getRng().cloneRange();if(d.startOffset<5){if(!(r=d.endContainer.previousSibling)){if(!d.endContainer.firstChild||!d.endContainer.firstChild.nextSibling)return;r=d.endContainer.firstChild.nextSibling}if(y(d,r,a=r.length),v(d,r,a),d.endOffset<5)return;n=d.endOffset,i=r}else{if(!w(i=d.endContainer)&&i.firstChild){for(;!w(i)&&i.firstChild;)i=i.firstChild;w(i)&&(y(d,i,0),v(d,i,i.nodeValue.length))}n=1===d.endOffset?2:d.endOffset-1-t}for(var l=n;y(d,i,2<=n?n-2:0),v(d,i,1<=n?n-1:0),--n,!k(d.toString())&&0<=n-2;);k(d.toString())?(y(d,i,n),v(d,i,l),n+=1):(0===d.startOffset?y(d,i,0):y(d,i,n),v(d,i,l)),u=d.toString(),/[?!,.;:]/.test(u.charAt(u.length-1))&&v(d,i,l-1);var u,c,g,h,C=(u=d.toString().trim()).match(f),m=e.getParam("link_default_protocol","http","string");C&&((g=c=C[0]).length>=(h="www.").length&&g.substr(0,0+h.length)===h?c=m+"://"+c:-1===c.indexOf("@")||/^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(c)||(c="mailto:"+c),o=e.selection.getBookmark(),e.selection.setRng(d),e.execCommand("createlink",!1,c),!1!==s&&e.dom.setAttrib(e.selection.getNode(),"target",s),e.selection.moveToBookmark(o),e.nodeChanged())}}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.Env"),A=new RegExp("^"+/(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-+~=.,%()\/\w]*[-+~=%()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g.source+"$","i");e.add("autolink",function(e){var t,n;(t=e).on("keydown",function(e){if(13===e.keyCode)return r(t,-1)}),a.browser.isIE()?t.on("focus",function(){if(!n){n=!0;try{t.execCommand("AutoUrlDetect",!1,!0)}catch(e){}}}):(t.on("keypress",function(e){if(41===e.keyCode||93===e.keyCode||125===e.keyCode)return r(t,-1)}),t.on("keyup",function(e){if(32===e.keyCode)return r(t,0)}))})}();
|
|
@@ -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,11 +23,16 @@
|
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var hasOwnProperty = Object.hasOwnProperty;
|
|
27
|
+
var has = function (obj, key) {
|
|
28
|
+
return hasOwnProperty.call(obj, key);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
var global$2 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
27
32
|
|
|
28
33
|
var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
|
|
29
34
|
|
|
30
|
-
var global
|
|
35
|
+
var global = tinymce.util.Tools.resolve('tinymce.util.Delay');
|
|
31
36
|
|
|
32
37
|
var fireResizeEditor = function (editor) {
|
|
33
38
|
return editor.fire('ResizeEditor');
|
|
@@ -53,7 +58,7 @@
|
|
|
53
58
|
return editor.plugins.fullscreen && editor.plugins.fullscreen.isFullscreen();
|
|
54
59
|
};
|
|
55
60
|
var wait = function (editor, oldSize, times, interval, callback) {
|
|
56
|
-
global
|
|
61
|
+
global.setEditorTimeout(editor, function () {
|
|
57
62
|
resize(editor, oldSize);
|
|
58
63
|
if (times--) {
|
|
59
64
|
wait(editor, oldSize, times, interval, callback);
|
|
@@ -75,7 +80,15 @@
|
|
|
75
80
|
var value = parseInt(dom.getStyle(elm, name, computed), 10);
|
|
76
81
|
return isNaN(value) ? 0 : value;
|
|
77
82
|
};
|
|
78
|
-
var
|
|
83
|
+
var shouldScrollIntoView = function (trigger) {
|
|
84
|
+
if ((trigger === null || trigger === void 0 ? void 0 : trigger.type.toLowerCase()) === 'setcontent') {
|
|
85
|
+
var setContentEvent = trigger;
|
|
86
|
+
return setContentEvent.selection === true || setContentEvent.paste === true;
|
|
87
|
+
} else {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
var resize = function (editor, oldSize, trigger) {
|
|
79
92
|
var dom = editor.dom;
|
|
80
93
|
var doc = editor.getDoc();
|
|
81
94
|
if (!doc) {
|
|
@@ -116,11 +129,11 @@
|
|
|
116
129
|
var win = editor.getWin();
|
|
117
130
|
win.scrollTo(win.pageXOffset, win.pageYOffset);
|
|
118
131
|
}
|
|
119
|
-
if (editor.hasFocus()) {
|
|
120
|
-
editor.selection.scrollIntoView(
|
|
132
|
+
if (editor.hasFocus() && shouldScrollIntoView(trigger)) {
|
|
133
|
+
editor.selection.scrollIntoView();
|
|
121
134
|
}
|
|
122
135
|
if (global$1.webkit && deltaSize < 0) {
|
|
123
|
-
resize(editor, oldSize);
|
|
136
|
+
resize(editor, oldSize, trigger);
|
|
124
137
|
}
|
|
125
138
|
}
|
|
126
139
|
};
|
|
@@ -135,8 +148,8 @@
|
|
|
135
148
|
'min-height': 0
|
|
136
149
|
});
|
|
137
150
|
});
|
|
138
|
-
editor.on('NodeChange SetContent keyup FullscreenStateChanged ResizeContent', function () {
|
|
139
|
-
resize(editor, oldSize);
|
|
151
|
+
editor.on('NodeChange SetContent keyup FullscreenStateChanged ResizeContent', function (e) {
|
|
152
|
+
resize(editor, oldSize, e);
|
|
140
153
|
});
|
|
141
154
|
if (shouldAutoResizeOnInit(editor)) {
|
|
142
155
|
editor.on('init', function () {
|
|
@@ -154,8 +167,8 @@
|
|
|
154
167
|
};
|
|
155
168
|
|
|
156
169
|
function Plugin () {
|
|
157
|
-
global.add('autoresize', function (editor) {
|
|
158
|
-
if (!editor.settings
|
|
170
|
+
global$2.add('autoresize', function (editor) {
|
|
171
|
+
if (!has(editor.settings, 'resize')) {
|
|
159
172
|
editor.settings.resize = false;
|
|
160
173
|
}
|
|
161
174
|
if (!editor.inline) {
|
|
@@ -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 y(e){return e.getParam("min_height",e.getElement().offsetHeight,"number")}function p(e,t){var n=e.getBody();n&&(n.style.overflowY=t?"":"hidden",t||(n.scrollTop=0))}function v(e,t,n,i){var o=parseInt(e.getStyle(t,n,i),10);return isNaN(o)?0:o}var l=Object.hasOwnProperty,e=tinymce.util.Tools.resolve("tinymce.PluginManager"),b=tinymce.util.Tools.resolve("tinymce.Env"),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),u=function(e,t,n,i,o){r.setEditorTimeout(e,function(){C(e,t),n--?u(e,t,n,i,o):o&&o()},i)},C=function(e,t,n){var i,o,r,s,a,l,u,g,c,m,f,d=e.dom,h=e.getDoc();h&&(e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen()?p(e,!0):(i=h.documentElement,o=e.getParam("autoresize_bottom_margin",50,"number"),r=y(e),s=v(d,i,"margin-top",!0),a=v(d,i,"margin-bottom",!0),(l=(l=i.offsetHeight+s+a+o)<0?0:l)+(u=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight)>y(e)&&(r=l+u),(g=e.getParam("max_height",0,"number"))&&g<r?(r=g,p(e,!0)):p(e,!1),r!==t.get()&&(c=r-t.get(),d.setStyle(e.getContainer(),"height",r+"px"),t.set(r),e.fire("ResizeEditor"),b.browser.isSafari()&&b.mac&&(m=e.getWin()).scrollTo(m.pageXOffset,m.pageYOffset),!e.hasFocus()||"setcontent"!==(null==(f=n)?void 0:f.type.toLowerCase())||!0!==f.selection&&!0!==f.paste||e.selection.scrollIntoView(),b.webkit&&c<0&&C(e,t,n))))};e.add("autoresize",function(e){var t,n,i,o,r,s,a=e.settings;l.call(a,"resize")||(e.settings.resize=!1),e.inline||(s=0,r=t={get:function(){return s},set:function(e){s=e}},(o=e).addCommand("mceAutoResize",function(){C(o,r)}),i=t,(n=e).on("init",function(){var e=n.getParam("autoresize_overflow_padding",1,"number"),t=n.dom;t.setStyles(n.getDoc().documentElement,{height:"auto"}),t.setStyles(n.getBody(),{paddingLeft:e,paddingRight:e,"min-height":0})}),n.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",function(e){C(n,i,e)}),n.getParam("autoresize_on_init",!0,"boolean")&&n.on("init",function(){u(n,i,20,100,function(){u(n,i,5,1e3)})}))})}();
|