@dangl/angular-material-shared 1.2.1-beta0001 → 1.2.1-beta0007
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/package.json +1 -1
- package/tinymce-assets/icons/default/icons.js +11 -1
- package/tinymce-assets/icons/default/icons.min.js +1 -1
- 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 +34 -12
- 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 +495 -128
- 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 +48 -50
- 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 +72 -74
- 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 +2830 -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 +26 -28
- 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 +61 -55
- 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 +25337 -25368
- package/tinymce-assets/themes/silver/theme.min.js +2 -2
|
@@ -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.0 (2021-10-11)
|
|
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.0 (2021-10-11)
|
|
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.0 (2021-10-11)
|
|
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.0 (2021-10-11)
|
|
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.0 (2021-10-11)
|
|
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');
|
|
15
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
|
+
};
|
|
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);
|
|
@@ -61,6 +76,12 @@
|
|
|
61
76
|
rng.setEndAfter(container);
|
|
62
77
|
}
|
|
63
78
|
};
|
|
79
|
+
var hasProtocol = function (url) {
|
|
80
|
+
return /^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(url);
|
|
81
|
+
};
|
|
82
|
+
var isPunctuation = function (char) {
|
|
83
|
+
return /[?!,.;:]/.test(char);
|
|
84
|
+
};
|
|
64
85
|
var parseCurrentLine = function (editor, endOffset, delimiter) {
|
|
65
86
|
var end, endContainer, bookmark, text, prev, len, rngText;
|
|
66
87
|
var autoLinkPattern = getAutoLinkPattern(editor);
|
|
@@ -121,21 +142,22 @@
|
|
|
121
142
|
setEnd(rng, endContainer, start);
|
|
122
143
|
}
|
|
123
144
|
text = rng.toString();
|
|
124
|
-
if (text.charAt(text.length - 1)
|
|
145
|
+
if (isPunctuation(text.charAt(text.length - 1))) {
|
|
125
146
|
setEnd(rng, endContainer, start - 1);
|
|
126
147
|
}
|
|
127
148
|
text = rng.toString().trim();
|
|
128
149
|
var matches = text.match(autoLinkPattern);
|
|
129
150
|
var protocol = getDefaultLinkProtocol(editor);
|
|
130
151
|
if (matches) {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
152
|
+
var url = matches[0];
|
|
153
|
+
if (startsWith(url, 'www.')) {
|
|
154
|
+
url = protocol + '://' + url;
|
|
155
|
+
} else if (contains(url, '@') && !hasProtocol(url)) {
|
|
156
|
+
url = 'mailto:' + url;
|
|
135
157
|
}
|
|
136
158
|
bookmark = editor.selection.getBookmark();
|
|
137
159
|
editor.selection.setRng(rng);
|
|
138
|
-
editor.execCommand('createlink', false,
|
|
160
|
+
editor.execCommand('createlink', false, url);
|
|
139
161
|
if (defaultLinkTarget !== false) {
|
|
140
162
|
editor.dom.setAttrib(editor.selection.getNode(), 'target', defaultLinkTarget);
|
|
141
163
|
}
|
|
@@ -150,7 +172,7 @@
|
|
|
150
172
|
return handleEnter(editor);
|
|
151
173
|
}
|
|
152
174
|
});
|
|
153
|
-
if (global
|
|
175
|
+
if (global.browser.isIE()) {
|
|
154
176
|
editor.on('focus', function () {
|
|
155
177
|
if (!autoUrlDetectState) {
|
|
156
178
|
autoUrlDetectState = true;
|
|
@@ -175,7 +197,7 @@
|
|
|
175
197
|
};
|
|
176
198
|
|
|
177
199
|
function Plugin () {
|
|
178
|
-
global.add('autolink', function (editor) {
|
|
200
|
+
global$1.add('autolink', function (editor) {
|
|
179
201
|
setup(editor);
|
|
180
202
|
});
|
|
181
203
|
}
|
|
@@ -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.0 (2021-10-11)
|
|
8
8
|
*/
|
|
9
|
-
!function(){"use strict";
|
|
9
|
+
!function(){"use strict";function o(e,t){var n;return t<0&&(t=0),3!==e.nodeType||(n=e.data.length)<t&&(t=n),t}function p(e,t,n){1!==t.nodeType||t.hasChildNodes()?e.setStart(t,o(t,n)):e.setStartBefore(t)}function A(e,t,n){1!==t.nodeType||t.hasChildNodes()?e.setEnd(t,o(t,n)):e.setEndAfter(t)}function i(e,t,n){var o,i,r,a,d,s,l=e.getParam("autolink_pattern",v),f=e.getParam("default_link_target",!1);if("A"!==e.selection.getNode().tagName){var c=e.selection.getRng().cloneRange();if(c.startOffset<5){if(!(a=c.endContainer.previousSibling)){if(!c.endContainer.firstChild||!c.endContainer.firstChild.nextSibling)return;a=c.endContainer.firstChild.nextSibling}if(p(c,a,d=a.length),A(c,a,d),c.endOffset<5)return;o=c.endOffset,i=a}else{if(3!==(i=c.endContainer).nodeType&&i.firstChild){for(;3!==i.nodeType&&i.firstChild;)i=i.firstChild;3===i.nodeType&&(p(c,i,0),A(c,i,i.nodeValue.length))}o=1===c.endOffset?2:c.endOffset-1-t}for(var g,u=o;p(c,i,2<=o?o-2:0),A(c,i,1<=o?o-1:0),--o," "!==(s=c.toString())&&""!==s&&160!==s.charCodeAt(0)&&0<=o-2&&s!==n;);(g=c.toString())===n||" "===g||160===g.charCodeAt(0)?(p(c,i,o),A(c,i,u),o+=1):(0===c.startOffset?p(c,i,0):p(c,i,o),A(c,i,u)),h=c.toString(),/[?!,.;:]/.test(h.charAt(h.length-1))&&A(c,i,u-1);var h,C,m,y,k=(h=c.toString().trim()).match(l),w=e.getParam("link_default_protocol","http","string");k&&((m=C=k[0]).length>=(y="www.").length&&m.substr(0,0+y.length)===y?C=w+"://"+C:-1===C.indexOf("@")||/^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(C)||(C="mailto:"+C),r=e.selection.getBookmark(),e.selection.setRng(c),e.execCommand("createlink",!1,C),!1!==f&&e.dom.setAttrib(e.selection.getNode(),"target",f),e.selection.moveToBookmark(r),e.nodeChanged())}}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=tinymce.util.Tools.resolve("tinymce.Env"),v=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){13===e.keyCode&&i(t,-1,"")}),r.browser.isIE()?t.on("focus",function(){if(!n){n=!0;try{t.execCommand("AutoUrlDetect",!1,!0)}catch(e){}}}):(t.on("keypress",function(e){41===e.keyCode&&i(t,-1,"(")}),t.on("keyup",function(e){32===e.keyCode&&i(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.0 (2021-10-11)
|
|
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.0 (2021-10-11)
|
|
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)})}))})}();
|
|
@@ -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.0 (2021-10-11)
|
|
8
8
|
*/
|
|
9
9
|
(function () {
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
12
|
+
var global$4 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
13
13
|
|
|
14
14
|
var eq = function (t) {
|
|
15
15
|
return function (a) {
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
};
|
|
19
19
|
var isUndefined = eq(undefined);
|
|
20
20
|
|
|
21
|
-
var global$
|
|
21
|
+
var global$3 = tinymce.util.Tools.resolve('tinymce.util.Delay');
|
|
22
22
|
|
|
23
23
|
var global$2 = tinymce.util.Tools.resolve('tinymce.util.LocalStorage');
|
|
24
24
|
|
|
25
|
-
var global$
|
|
25
|
+
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
|
26
26
|
|
|
27
27
|
var fireRestoreDraft = function (editor) {
|
|
28
28
|
return editor.fire('RestoreDraft');
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
if (isUndefined(html)) {
|
|
66
66
|
return editor.dom.isEmpty(editor.getBody());
|
|
67
67
|
} else {
|
|
68
|
-
var trimmedHtml = global$
|
|
68
|
+
var trimmedHtml = global$1.trim(html);
|
|
69
69
|
if (trimmedHtml === '') {
|
|
70
70
|
return true;
|
|
71
71
|
} else {
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
};
|
|
111
111
|
var startStoreDraft = function (editor) {
|
|
112
112
|
var interval = getAutoSaveInterval(editor);
|
|
113
|
-
global$
|
|
113
|
+
global$3.setEditorInterval(editor, function () {
|
|
114
114
|
storeDraft(editor);
|
|
115
115
|
}, interval);
|
|
116
116
|
};
|
|
@@ -142,12 +142,12 @@
|
|
|
142
142
|
};
|
|
143
143
|
};
|
|
144
144
|
|
|
145
|
-
var global
|
|
145
|
+
var global = tinymce.util.Tools.resolve('tinymce.EditorManager');
|
|
146
146
|
|
|
147
147
|
var setup = function (editor) {
|
|
148
148
|
editor.editorManager.on('BeforeUnload', function (e) {
|
|
149
149
|
var msg;
|
|
150
|
-
global$
|
|
150
|
+
global$1.each(global.get(), function (editor) {
|
|
151
151
|
if (editor.plugins.autosave) {
|
|
152
152
|
editor.plugins.autosave.storeDraft();
|
|
153
153
|
}
|
|
@@ -195,7 +195,7 @@
|
|
|
195
195
|
};
|
|
196
196
|
|
|
197
197
|
function Plugin () {
|
|
198
|
-
global.add('autosave', function (editor) {
|
|
198
|
+
global$4.add('autosave', function (editor) {
|
|
199
199
|
setup(editor);
|
|
200
200
|
register(editor);
|
|
201
201
|
editor.on('init', function () {
|
|
@@ -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.0 (2021-10-11)
|
|
8
8
|
*/
|
|
9
|
-
!function(){"use strict";
|
|
9
|
+
!function(){"use strict";function o(t,e){var r=t||e,n=/^(\d+)([ms]?)$/.exec(""+r);return(n[2]?{s:1e3,m:6e4}[n[2]]:1)*parseInt(r,10)}function n(t){var e=document.location;return t.getParam("autosave_prefix","tinymce-autosave-{path}{query}{hash}-{id}-").replace(/{path}/g,e.pathname).replace(/{query}/g,e.search).replace(/{hash}/g,e.hash).replace(/{id}/g,t.id)}function i(t,e){if(a(e))return t.dom.isEmpty(t.getBody());var r=d.trim(e);if(""===r)return!0;var n=(new DOMParser).parseFromString(r,"text/html");return t.dom.isEmpty(n)}function u(t){var e=parseInt(v.getItem(n(t)+"time"),10)||0;return!((new Date).getTime()-e>o(t.getParam("autosave_retention"),"20m")&&(g(t,!1),1))}function s(t){var e=n(t);!i(t)&&t.isDirty()&&(v.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),v.setItem(e+"time",(new Date).getTime().toString()),t.fire("StoreDraft"))}function f(t){var e=n(t);u(t)&&(t.setContent(v.getItem(e+"draft"),{format:"raw"}),t.fire("RestoreDraft"))}function c(t){t.undoManager.transact(function(){f(t),g(t)}),t.focus()}function m(r){return function(t){function e(){return t.setDisabled(!u(r))}return t.setDisabled(!u(r)),r.on("StoreDraft RestoreDraft RemoveDraft",e),function(){return r.off("StoreDraft RestoreDraft RemoveDraft",e)}}}var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(t){return void 0===t},l=tinymce.util.Tools.resolve("tinymce.util.Delay"),v=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),d=tinymce.util.Tools.resolve("tinymce.util.Tools"),g=function(t,e){var r=n(t);v.removeItem(r+"draft"),v.removeItem(r+"time"),!1!==e&&t.fire("RemoveDraft")},y=tinymce.util.Tools.resolve("tinymce.EditorManager");t.add("autosave",function(t){var e,r,n,a;return t.editorManager.on("BeforeUnload",function(t){var e;d.each(y.get(),function(t){t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&t.getParam("autosave_ask_before_unload",!0)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))}),e&&(t.preventDefault(),t.returnValue=e)}),n=e=t,a=o(n.getParam("autosave_interval"),"30s"),l.setEditorInterval(n,function(){s(n)},a),e.ui.registry.addButton("restoredraft",{tooltip:"Restore last draft",icon:"restore-draft",onAction:function(){c(e)},onSetup:m(e)}),e.ui.registry.addMenuItem("restoredraft",{text:"Restore last draft",icon:"restore-draft",onAction:function(){c(e)},onSetup:m(e)}),t.on("init",function(){t.getParam("autosave_restore_when_empty",!1)&&t.dom.isEmpty(t.getBody())&&f(t)}),r=t,{hasDraft:function(){return u(r)},storeDraft:function(){return s(r)},restoreDraft:function(){return f(r)},removeDraft:function(t){return g(r,t)},isEmpty:function(t){return i(r,t)}}})}();
|