@dangl/angular-material-shared 2.9.0-beta0047 → 2.9.0-beta0048
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 +9 -46
- package/tinymce-assets/icons/default/icons.min.js +1 -1
- package/tinymce-assets/models/dom/model.js +7239 -8193
- package/tinymce-assets/models/dom/model.min.js +1 -1
- package/tinymce-assets/plugins/accordion/plugin.js +879 -1174
- package/tinymce-assets/plugins/accordion/plugin.min.js +5 -1
- package/tinymce-assets/plugins/advlist/plugin.js +200 -412
- package/tinymce-assets/plugins/advlist/plugin.min.js +5 -1
- package/tinymce-assets/plugins/anchor/plugin.js +166 -189
- package/tinymce-assets/plugins/anchor/plugin.min.js +5 -1
- package/tinymce-assets/plugins/autolink/plugin.js +220 -310
- package/tinymce-assets/plugins/autolink/plugin.min.js +5 -1
- package/tinymce-assets/plugins/autoresize/plugin.js +149 -180
- package/tinymce-assets/plugins/autoresize/plugin.min.js +5 -1
- package/tinymce-assets/plugins/autosave/plugin.js +189 -208
- package/tinymce-assets/plugins/autosave/plugin.min.js +5 -1
- package/tinymce-assets/plugins/charmap/plugin.js +1566 -905
- package/tinymce-assets/plugins/charmap/plugin.min.js +5 -1
- package/tinymce-assets/plugins/code/plugin.js +61 -73
- package/tinymce-assets/plugins/code/plugin.min.js +4 -0
- package/tinymce-assets/plugins/codesample/plugin.js +2409 -3592
- package/tinymce-assets/plugins/codesample/plugin.min.js +12 -8
- package/tinymce-assets/plugins/directionality/plugin.js +304 -545
- package/tinymce-assets/plugins/directionality/plugin.min.js +5 -1
- package/tinymce-assets/plugins/emoticons/plugin.js +488 -702
- package/tinymce-assets/plugins/emoticons/plugin.min.js +5 -1
- package/tinymce-assets/plugins/fullscreen/plugin.js +1049 -1409
- package/tinymce-assets/plugins/fullscreen/plugin.min.js +5 -1
- package/tinymce-assets/plugins/help/js/i18n/keynav/ar.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/bg_BG.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/ca.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/cs.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/da.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/de.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/el.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/en.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/es.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/eu.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/fa.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/fi.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/fr_FR.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/he_IL.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/hi.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/hr.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/hu_HU.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/id.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/it.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/ja.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/kk.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/ko_KR.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/ms.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/nb_NO.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/nl.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/pl.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/pt_BR.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/pt_PT.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/ro.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/ru.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/sk.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/sl_SI.js +2 -5
- package/tinymce-assets/plugins/help/js/i18n/keynav/sv_SE.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/th_TH.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/tr.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/uk.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/vi.js +1 -4
- package/tinymce-assets/plugins/help/js/i18n/keynav/zh_CN.js +5 -8
- package/tinymce-assets/plugins/help/js/i18n/keynav/zh_TW.js +1 -4
- package/tinymce-assets/plugins/help/plugin.js +809 -739
- package/tinymce-assets/plugins/help/plugin.min.js +5 -1
- package/tinymce-assets/plugins/image/plugin.js +1291 -1475
- package/tinymce-assets/plugins/image/plugin.min.js +5 -1
- package/tinymce-assets/plugins/importcss/plugin.js +269 -328
- package/tinymce-assets/plugins/importcss/plugin.min.js +5 -1
- package/tinymce-assets/plugins/insertdatetime/plugin.js +141 -140
- package/tinymce-assets/plugins/insertdatetime/plugin.min.js +5 -1
- package/tinymce-assets/plugins/link/plugin.js +1084 -1419
- package/tinymce-assets/plugins/link/plugin.min.js +5 -1
- package/tinymce-assets/plugins/lists/plugin.js +1805 -2177
- package/tinymce-assets/plugins/lists/plugin.min.js +5 -1
- package/tinymce-assets/plugins/media/plugin.js +1047 -1305
- package/tinymce-assets/plugins/media/plugin.min.js +5 -1
- package/tinymce-assets/plugins/nonbreaking/plugin.js +88 -93
- package/tinymce-assets/plugins/nonbreaking/plugin.min.js +4 -0
- package/tinymce-assets/plugins/pagebreak/plugin.js +85 -91
- package/tinymce-assets/plugins/pagebreak/plugin.min.js +4 -0
- package/tinymce-assets/plugins/preview/plugin.js +74 -742
- package/tinymce-assets/plugins/preview/plugin.min.js +5 -1
- package/tinymce-assets/plugins/quickbars/plugin.js +375 -582
- package/tinymce-assets/plugins/quickbars/plugin.min.js +5 -1
- package/tinymce-assets/plugins/save/plugin.js +82 -100
- package/tinymce-assets/plugins/save/plugin.min.js +5 -1
- package/tinymce-assets/plugins/searchreplace/plugin.js +906 -1183
- package/tinymce-assets/plugins/searchreplace/plugin.min.js +5 -1
- package/tinymce-assets/plugins/table/plugin.js +3094 -3651
- package/tinymce-assets/plugins/table/plugin.min.js +5 -1
- package/tinymce-assets/plugins/template/index.js +7 -0
- package/tinymce-assets/plugins/template/plugin.js +567 -0
- package/tinymce-assets/plugins/template/plugin.min.js +5 -0
- package/tinymce-assets/plugins/visualblocks/plugin.js +63 -71
- package/tinymce-assets/plugins/visualblocks/plugin.min.js +5 -1
- package/tinymce-assets/plugins/visualchars/plugin.js +436 -685
- package/tinymce-assets/plugins/visualchars/plugin.min.js +5 -1
- package/tinymce-assets/plugins/wordcount/plugin.js +307 -382
- package/tinymce-assets/plugins/wordcount/plugin.min.js +5 -1
- package/tinymce-assets/skins/content/dark/content.css +4 -0
- package/tinymce-assets/skins/content/dark/content.js +6 -1
- package/tinymce-assets/skins/content/dark/content.min.css +4 -0
- package/tinymce-assets/skins/content/default/content.css +4 -0
- package/tinymce-assets/skins/content/default/content.js +6 -1
- package/tinymce-assets/skins/content/default/content.min.css +4 -0
- package/tinymce-assets/skins/content/document/content.css +4 -0
- package/tinymce-assets/skins/content/document/content.js +6 -1
- package/tinymce-assets/skins/content/document/content.min.css +4 -0
- package/tinymce-assets/skins/content/tinymce-5/content.css +4 -0
- package/tinymce-assets/skins/content/tinymce-5/content.js +6 -1
- package/tinymce-assets/skins/content/tinymce-5/content.min.css +4 -0
- package/tinymce-assets/skins/content/tinymce-5-dark/content.css +4 -0
- package/tinymce-assets/skins/content/tinymce-5-dark/content.js +6 -1
- package/tinymce-assets/skins/content/tinymce-5-dark/content.min.css +4 -0
- package/tinymce-assets/skins/content/writer/content.css +4 -0
- package/tinymce-assets/skins/content/writer/content.js +6 -1
- package/tinymce-assets/skins/content/writer/content.min.css +4 -0
- package/tinymce-assets/skins/ui/oxide/content.css +53 -148
- package/tinymce-assets/skins/ui/oxide/content.inline.css +53 -148
- package/tinymce-assets/skins/ui/oxide/content.inline.js +6 -1
- package/tinymce-assets/skins/ui/oxide/content.inline.min.css +5 -1
- package/tinymce-assets/skins/ui/oxide/content.js +6 -1
- package/tinymce-assets/skins/ui/oxide/content.min.css +5 -1
- package/tinymce-assets/skins/ui/oxide/skin.css +207 -1585
- package/tinymce-assets/skins/ui/oxide/skin.js +2 -1
- package/tinymce-assets/skins/ui/oxide/skin.min.css +1 -1
- package/tinymce-assets/skins/ui/oxide/skin.shadowdom.js +2 -1
- package/tinymce-assets/skins/ui/oxide-dark/content.css +46 -148
- package/tinymce-assets/skins/ui/oxide-dark/content.inline.css +53 -148
- package/tinymce-assets/skins/ui/oxide-dark/content.inline.js +6 -1
- package/tinymce-assets/skins/ui/oxide-dark/content.inline.min.css +5 -1
- package/tinymce-assets/skins/ui/oxide-dark/content.js +6 -1
- package/tinymce-assets/skins/ui/oxide-dark/content.min.css +5 -1
- package/tinymce-assets/skins/ui/oxide-dark/skin.css +219 -1597
- package/tinymce-assets/skins/ui/oxide-dark/skin.js +2 -1
- package/tinymce-assets/skins/ui/oxide-dark/skin.min.css +1 -1
- package/tinymce-assets/skins/ui/oxide-dark/skin.shadowdom.js +2 -1
- package/tinymce-assets/skins/ui/tinymce-5/content.css +53 -148
- package/tinymce-assets/skins/ui/tinymce-5/content.inline.css +53 -148
- package/tinymce-assets/skins/ui/tinymce-5/content.inline.js +6 -1
- package/tinymce-assets/skins/ui/tinymce-5/content.inline.min.css +5 -1
- package/tinymce-assets/skins/ui/tinymce-5/content.js +6 -1
- package/tinymce-assets/skins/ui/tinymce-5/content.min.css +5 -1
- package/tinymce-assets/skins/ui/tinymce-5/skin.css +194 -1597
- package/tinymce-assets/skins/ui/tinymce-5/skin.js +2 -1
- package/tinymce-assets/skins/ui/tinymce-5/skin.min.css +1 -1
- package/tinymce-assets/skins/ui/tinymce-5/skin.shadowdom.js +2 -1
- package/tinymce-assets/skins/ui/tinymce-5-dark/content.css +46 -148
- package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.css +53 -148
- package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.js +6 -1
- package/tinymce-assets/skins/ui/tinymce-5-dark/content.inline.min.css +5 -1
- package/tinymce-assets/skins/ui/tinymce-5-dark/content.js +6 -1
- package/tinymce-assets/skins/ui/tinymce-5-dark/content.min.css +5 -1
- package/tinymce-assets/skins/ui/tinymce-5-dark/skin.css +202 -1605
- package/tinymce-assets/skins/ui/tinymce-5-dark/skin.js +2 -1
- package/tinymce-assets/skins/ui/tinymce-5-dark/skin.min.css +1 -1
- package/tinymce-assets/skins/ui/tinymce-5-dark/skin.shadowdom.js +2 -1
- package/tinymce-assets/themes/silver/theme.js +28439 -32466
- package/tinymce-assets/themes/silver/theme.min.js +1 -1
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* TinyMCE version 6.8.6 (TBD)
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager");const e=t=>e=>typeof e===t,o=("string",t=>"string"===(t=>{const e=typeof t;return null===t?"null":"object"===e&&Array.isArray(t)?"array":"object"===e&&(o=n=t,(r=String).prototype.isPrototypeOf(o)||(null===(i=n.constructor)||void 0===i?void 0:i.name)===r.name)?"string":e;var o,n,r,i})(t));const n=e("boolean"),r=e("function"),i=t=>e=>e.options.get(t),s=i("quickbars_selection_toolbar"),a=i("quickbars_insert_toolbar"),l=i("quickbars_image_toolbar");let c=0;var u=tinymce.util.Tools.resolve("tinymce.util.Delay");const d=t=>{t.ui.registry.addButton("quickimage",{icon:"image",tooltip:"Insert image",onAction:()=>{(t=>new Promise((e=>{let o=!1;const n=document.createElement("input");n.type="file",n.accept="image/*",n.style.position="fixed",n.style.left="0",n.style.top="0",n.style.opacity="0.001",document.body.appendChild(n);const r=t=>{var r;o||(null===(r=n.parentNode)||void 0===r||r.removeChild(n),o=!0,e(t))},i=t=>{r(Array.prototype.slice.call(t.target.files))};n.addEventListener("input",i),n.addEventListener("change",i);const s=e=>{const n=()=>{r([])};o||("focusin"===e.type?u.setEditorTimeout(t,n,1e3):n()),t.off("focusin remove",s)};t.on("focusin remove",s),n.click()})))(t).then((e=>{if(e.length>0){const o=e[0];(t=>new Promise((e=>{const o=new FileReader;o.onloadend=()=>{e(o.result.split(",")[1])},o.readAsDataURL(t)})))(o).then((e=>{((t,e,o)=>{const n=t.editorUpload.blobCache,r=n.create((t=>{const e=(new Date).getTime(),o=Math.floor(1e9*Math.random());return c++,"mceu_"+o+c+String(e)})(),o,e);n.add(r),t.insertContent(t.dom.createHTML("img",{src:r.blobUri()}))})(t,e,o)}))}}))}}),t.ui.registry.addButton("quicktable",{icon:"table",tooltip:"Insert table",onAction:()=>{((t,e,o)=>{t.execCommand("mceInsertTable",!1,{rows:2,columns:2})})(t)}})},m=(!1,()=>false);class g{constructor(t,e){this.tag=t,this.value=e}static some(t){return new g(!0,t)}static none(){return g.singletonNone}fold(t,e){return this.tag?e(this.value):t()}isSome(){return this.tag}isNone(){return!this.tag}map(t){return this.tag?g.some(t(this.value)):g.none()}bind(t){return this.tag?t(this.value):g.none()}exists(t){return this.tag&&t(this.value)}forall(t){return!this.tag||t(this.value)}filter(t){return!this.tag||t(this.value)?this:g.none()}getOr(t){return this.tag?this.value:t}or(t){return this.tag?this:t}getOrThunk(t){return this.tag?this.value:t()}orThunk(t){return this.tag?this:t()}getOrDie(t){if(this.tag)return this.value;throw new Error(null!=t?t:"Called getOrDie on None")}static from(t){return null==t?g.none():g.some(t)}getOrNull(){return this.tag?this.value:null}getOrUndefined(){return this.value}each(t){this.tag&&t(this.value)}toArray(){return this.tag?[this.value]:[]}toString(){return this.tag?`some(${this.value})`:"none()"}}g.singletonNone=new g(!1),"undefined"!=typeof window?window:Function("return this;")();var h=(t,e,o,n,i)=>t(o,n)?g.some(o):r(i)&&i(o)?g.none():e(o,n,i);const b=t=>{if(null==t)throw new Error("Node cannot be null or undefined");return{dom:t}},p=b,v=(t,e)=>{const o=t.dom;if(1!==o.nodeType)return!1;{const t=o;if(void 0!==t.matches)return t.matches(e);if(void 0!==t.msMatchesSelector)return t.msMatchesSelector(e);if(void 0!==t.webkitMatchesSelector)return t.webkitMatchesSelector(e);if(void 0!==t.mozMatchesSelector)return t.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}},f=(t,e,o)=>{let n=t.dom;const i=r(o)?o:m;for(;n.parentNode;){n=n.parentNode;const t=p(n);if(e(t))return g.some(t);if(i(t))break}return g.none()},y=(t,e,o)=>f(t,(t=>v(t,e)),o),k=t=>{const e=a(t);e.length>0&&t.ui.registry.addContextToolbar("quickblock",{predicate:e=>{const o=p(e),n=t.schema.getTextBlockElements(),r=e=>e.dom===t.getBody();return!((t,e)=>{const o=t.dom;return!(!o||!o.hasAttribute)&&o.hasAttribute("data-mce-bogus")})(o)&&((t,e,o)=>h(((t,e)=>v(t,e)),y,t,'table,[data-mce-bogus="all"]',o))(o,0,r).fold((()=>((t,e,o)=>((t,e,o)=>h(((t,e)=>e(t)),f,t,e,o))(t,e,o).isSome())(o,(e=>e.dom.nodeName.toLowerCase()in n&&t.dom.isEmpty(e.dom)),r)),m)},items:e,position:"line",scope:"editor"})};t.add("quickbars",(t=>{(t=>{const e=t.options.register,r=t=>e=>{const r=n(e)||o(e);return r?n(e)?{value:e?t:"",valid:r}:{value:e.trim(),valid:r}:{valid:!1,message:"Must be a boolean or string."}},i="bold italic | quicklink h2 h3 blockquote";e("quickbars_selection_toolbar",{processor:r(i),default:i});const s="quickimage quicktable";e("quickbars_insert_toolbar",{processor:r(s),default:s});const a="alignleft aligncenter alignright";e("quickbars_image_toolbar",{processor:r(a),default:a})})(t),d(t),k(t),(t=>{const e=e=>t.dom.isEditable(e),o=t=>{const o="FIGURE"===t.nodeName&&/image/i.test(t.className),n="IMG"===t.nodeName||o,r=(t=>void 0!==t.dom.classList)(i=p(t))&&i.dom.classList.contains("mce-pagebreak");var i;return n&&e(t.parentElement)&&!r},n=l(t);n.length>0&&t.ui.registry.addContextToolbar("imageselection",{predicate:o,items:n,position:"node"});const r=s(t);r.length>0&&t.ui.registry.addContextToolbar("textselection",{predicate:n=>!o(n)&&!t.selection.isCollapsed()&&e(n),items:r,position:"selection",scope:"editor"})})(t)}))}();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TinyMCE version
|
|
2
|
+
* TinyMCE version 6.8.6 (TBD)
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
(function () {
|
|
@@ -7,130 +7,112 @@
|
|
|
7
7
|
|
|
8
8
|
var global$2 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
const isSimpleType = (type) => (value) => typeof value === type;
|
|
10
|
+
const isSimpleType = type => value => typeof value === type;
|
|
12
11
|
const isFunction = isSimpleType('function');
|
|
13
12
|
|
|
14
13
|
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
|
|
15
14
|
|
|
16
15
|
var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
|
17
16
|
|
|
18
|
-
const option =
|
|
19
|
-
const register$2 =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
});
|
|
28
|
-
registerOption('save_oncancelcallback', {
|
|
29
|
-
processor: 'function'
|
|
30
|
-
});
|
|
17
|
+
const option = name => editor => editor.options.get(name);
|
|
18
|
+
const register$2 = editor => {
|
|
19
|
+
const registerOption = editor.options.register;
|
|
20
|
+
registerOption('save_enablewhendirty', {
|
|
21
|
+
processor: 'boolean',
|
|
22
|
+
default: true
|
|
23
|
+
});
|
|
24
|
+
registerOption('save_onsavecallback', { processor: 'function' });
|
|
25
|
+
registerOption('save_oncancelcallback', { processor: 'function' });
|
|
31
26
|
};
|
|
32
27
|
const enableWhenDirty = option('save_enablewhendirty');
|
|
33
28
|
const getOnSaveCallback = option('save_onsavecallback');
|
|
34
29
|
const getOnCancelCallback = option('save_oncancelcallback');
|
|
35
30
|
|
|
36
31
|
const displayErrorMessage = (editor, message) => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
editor.notificationManager.open({
|
|
33
|
+
text: message,
|
|
34
|
+
type: 'error'
|
|
35
|
+
});
|
|
41
36
|
};
|
|
42
|
-
const save =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
displayErrorMessage(editor, 'Error: Form submit field collision.');
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
editor.nodeChanged();
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
displayErrorMessage(editor, 'Error: No form element found.');
|
|
37
|
+
const save = editor => {
|
|
38
|
+
const formObj = global$1.DOM.getParent(editor.id, 'form');
|
|
39
|
+
if (enableWhenDirty(editor) && !editor.isDirty()) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
editor.save();
|
|
43
|
+
const onSaveCallback = getOnSaveCallback(editor);
|
|
44
|
+
if (isFunction(onSaveCallback)) {
|
|
45
|
+
onSaveCallback.call(editor, editor);
|
|
46
|
+
editor.nodeChanged();
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (formObj) {
|
|
50
|
+
editor.setDirty(false);
|
|
51
|
+
if (!formObj.onsubmit || formObj.onsubmit()) {
|
|
52
|
+
if (typeof formObj.submit === 'function') {
|
|
53
|
+
formObj.submit();
|
|
54
|
+
} else {
|
|
55
|
+
displayErrorMessage(editor, 'Error: Form submit field collision.');
|
|
56
|
+
}
|
|
71
57
|
}
|
|
58
|
+
editor.nodeChanged();
|
|
59
|
+
} else {
|
|
60
|
+
displayErrorMessage(editor, 'Error: No form element found.');
|
|
61
|
+
}
|
|
72
62
|
};
|
|
73
|
-
const cancel =
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
// Reset the editor content back to the initial state
|
|
82
|
-
editor.resetContent(h);
|
|
63
|
+
const cancel = editor => {
|
|
64
|
+
const h = global.trim(editor.startContent);
|
|
65
|
+
const onCancelCallback = getOnCancelCallback(editor);
|
|
66
|
+
if (isFunction(onCancelCallback)) {
|
|
67
|
+
onCancelCallback.call(editor, editor);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
editor.resetContent(h);
|
|
83
71
|
};
|
|
84
72
|
|
|
85
|
-
const register$1 =
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
73
|
+
const register$1 = editor => {
|
|
74
|
+
editor.addCommand('mceSave', () => {
|
|
75
|
+
save(editor);
|
|
76
|
+
});
|
|
77
|
+
editor.addCommand('mceCancel', () => {
|
|
78
|
+
cancel(editor);
|
|
79
|
+
});
|
|
92
80
|
};
|
|
93
81
|
|
|
94
|
-
const stateToggle =
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
82
|
+
const stateToggle = editor => api => {
|
|
83
|
+
const handler = () => {
|
|
84
|
+
api.setEnabled(!enableWhenDirty(editor) || editor.isDirty());
|
|
85
|
+
};
|
|
86
|
+
handler();
|
|
87
|
+
editor.on('NodeChange dirty', handler);
|
|
88
|
+
return () => editor.off('NodeChange dirty', handler);
|
|
101
89
|
};
|
|
102
|
-
const register =
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
editor.addShortcut('Meta+S', '', 'mceSave');
|
|
90
|
+
const register = editor => {
|
|
91
|
+
editor.ui.registry.addButton('save', {
|
|
92
|
+
icon: 'save',
|
|
93
|
+
tooltip: 'Save',
|
|
94
|
+
enabled: false,
|
|
95
|
+
onAction: () => editor.execCommand('mceSave'),
|
|
96
|
+
onSetup: stateToggle(editor)
|
|
97
|
+
});
|
|
98
|
+
editor.ui.registry.addButton('cancel', {
|
|
99
|
+
icon: 'cancel',
|
|
100
|
+
tooltip: 'Cancel',
|
|
101
|
+
enabled: false,
|
|
102
|
+
onAction: () => editor.execCommand('mceCancel'),
|
|
103
|
+
onSetup: stateToggle(editor)
|
|
104
|
+
});
|
|
105
|
+
editor.addShortcut('Meta+S', '', 'mceSave');
|
|
119
106
|
};
|
|
120
107
|
|
|
121
108
|
var Plugin = () => {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
109
|
+
global$2.add('save', editor => {
|
|
110
|
+
register$2(editor);
|
|
111
|
+
register(editor);
|
|
112
|
+
register$1(editor);
|
|
113
|
+
});
|
|
127
114
|
};
|
|
128
115
|
|
|
129
116
|
Plugin();
|
|
130
|
-
/** *****
|
|
131
|
-
* DO NOT EXPORT ANYTHING
|
|
132
|
-
*
|
|
133
|
-
* IF YOU DO ROLLUP WILL LEAVE A GLOBAL ON THE PAGE
|
|
134
|
-
*******/
|
|
135
117
|
|
|
136
118
|
})();
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* TinyMCE version 6.8.6 (TBD)
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const n=("function",e=>"function"==typeof e);var o=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),t=tinymce.util.Tools.resolve("tinymce.util.Tools");const a=e=>n=>n.options.get(e),c=a("save_enablewhendirty"),i=a("save_onsavecallback"),s=a("save_oncancelcallback"),r=(e,n)=>{e.notificationManager.open({text:n,type:"error"})},l=e=>n=>{const o=()=>{n.setEnabled(!c(e)||e.isDirty())};return o(),e.on("NodeChange dirty",o),()=>e.off("NodeChange dirty",o)};e.add("save",(e=>{(e=>{const n=e.options.register;n("save_enablewhendirty",{processor:"boolean",default:!0}),n("save_onsavecallback",{processor:"function"}),n("save_oncancelcallback",{processor:"function"})})(e),(e=>{e.ui.registry.addButton("save",{icon:"save",tooltip:"Save",enabled:!1,onAction:()=>e.execCommand("mceSave"),onSetup:l(e)}),e.ui.registry.addButton("cancel",{icon:"cancel",tooltip:"Cancel",enabled:!1,onAction:()=>e.execCommand("mceCancel"),onSetup:l(e)}),e.addShortcut("Meta+S","","mceSave")})(e),(e=>{e.addCommand("mceSave",(()=>{(e=>{const t=o.DOM.getParent(e.id,"form");if(c(e)&&!e.isDirty())return;e.save();const a=i(e);if(n(a))return a.call(e,e),void e.nodeChanged();t?(e.setDirty(!1),t.onsubmit&&!t.onsubmit()||("function"==typeof t.submit?t.submit():r(e,"Error: Form submit field collision.")),e.nodeChanged()):r(e,"Error: No form element found.")})(e)})),e.addCommand("mceCancel",(()=>{(e=>{const o=t.trim(e.startContent),a=s(e);n(a)?a.call(e,e):e.resetContent(o)})(e)}))})(e)}))}();
|