@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,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";var e,t,n,r,i,o,u,a,s,c,l=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},f=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=tinymce.util.Tools.resolve("tinymce.util.Tools"),h=function(t){return!(null===(e=t)||e===undefined);var e},m=function(t){return typeof t===e},g=function(){},v=function(t){return function(){return t}},p=v(!(e="function")),y=v(!0),w=function(){return b},b=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:p,isSome:p,isNone:y,getOr:r=function(t){return t},getOrThunk:n=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:v(null),getOrUndefined:v(undefined),or:r,orThunk:n,map:w,each:g,bind:w,exists:p,forall:y,filter:w,equals:t,equals_:t,toArray:function(){return[]},toString:v("none()")}),I=function(n){var t=v(n),e=function(){return o},r=function(t){return t(n)},o={fold:function(t,e){return e(n)},is:function(t){return n===t},isSome:y,isNone:p,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(t){return I(t(n))},each:function(t){t(n)},bind:r,exists:r,forall:r,filter:function(t){return t(n)?o:b},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(t){return t.is(n)},equals_:function(t,e){return t.fold(p,function(t){return e(n,t)})}};return o},T={some:I,none:w,from:function(t){return null===t||t===undefined?b:I(t)}},_=function(t,e){return A(document.createElement("canvas"),t,e)},R=function(t){var e=_(t.width,t.height);return U(e).drawImage(t,0,0),e},U=function(t){return t.getContext("2d")},A=function(t,e,n){return t.width=e,t.height=n,t},x=window.Promise?window.Promise:(i=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],c(t,a(M,this),a(L,this))},o=window,u=i.immediateFn||"function"==typeof o.setImmediate&&o.setImmediate||function(t){return setTimeout(t,1)},a=function(n,r){return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return n.apply(r,t)}},s=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},c=function(t,e,n){var r=!1;try{t(function(t){r||(r=!0,e(t))},function(t){r||(r=!0,n(t))})}catch(o){if(r)return;r=!0,n(o)}},i.prototype["catch"]=function(t){return this.then(null,t)},i.prototype.then=function(n,r){var o=this;return new i(function(t,e){E.call(o,new k(n,r,t,e))})},i.all=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var c=Array.prototype.slice.call(1===t.length&&s(t[0])?t[0]:t);return new i(function(o,i){if(0===c.length)return o([]);for(var u=c.length,a=function(e,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void n.call(t,function(t){a(e,t)},i)}c[e]=t,0==--u&&o(c)}catch(r){i(r)}},t=0;t<c.length;t++)a(t,c[t])})},i.resolve=function(e){return e&&"object"==typeof e&&e.constructor===i?e:new i(function(t){t(e)})},i.reject=function(n){return new i(function(t,e){e(n)})},i.race=function(o){return new i(function(t,e){for(var n=0,r=o;n<r.length;n++)r[n].then(t,e)})},i);function E(r){var o=this;null!==this._state?u(function(){var t,e=o._state?r.onFulfilled:r.onRejected;if(null!==e){try{t=e(o._value)}catch(n){return void r.reject(n)}r.resolve(t)}else(o._state?r.resolve:r.reject)(o._value)}):this._deferreds.push(r)}function M(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var e=t.then;if("function"==typeof e)return void c(a(e,t),a(M,this),a(L,this))}this._state=!0,this._value=t,j.call(this)}catch(n){L.call(this,n)}}function L(t){this._state=!1,this._value=t,j.call(this)}function j(){for(var t=0,e=this._deferreds;t<e.length;t++){var n=e[t];E.call(this,n)}this._deferreds=[]}function k(t,e,n,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r}var C=function(a){return new x(function(t,e){var n=URL.createObjectURL(a),r=new Image,o=function(){r.removeEventListener("load",i),r.removeEventListener("error",u)},i=function(){o(),t(r)},u=function(){o(),e("Unable to load data of type "+a.type+": "+n)};r.addEventListener("load",i),r.addEventListener("error",u),r.src=n,r.complete&&setTimeout(i,0)})},O=function(r){return new x(function(t,n){var e=new XMLHttpRequest;e.open("GET",r,!0),e.responseType="blob",e.onload=function(){200===this.status&&t(this.response)},e.onerror=function(){var t,e=this;n(0===this.status?((t=new Error("No access to download image")).code=18,t.name="SecurityError",t):new Error("Error "+e.status+" downloading image"))},e.send()})},P=function(n){return new x(function(t,e){(function(t){var e=t.split(","),n=/data:([^;]+)/.exec(e[0]);if(!n)return T.none();for(var r=n[1],o=e[1],i=atob(o),u=i.length,a=Math.ceil(u/1024),c=new Array(a),s=0;s<a;++s){for(var f=1024*s,l=Math.min(1024+f,u),d=new Array(l-f),m=f,h=0;m<l;++h,++m)d[h]=i[m].charCodeAt(0);c[s]=new Uint8Array(d)}return T.some(new Blob(c,{type:r}))})(n).fold(function(){e("uri is not base64: "+n)},t)})},S=function(t,r,o){return r=r||"image/png",m(HTMLCanvasElement.prototype.toBlob)?new x(function(e,n){t.toBlob(function(t){t?e(t):n()},r,o)}):P(t.toDataURL(r,o))},B=function(t){return C(t).then(function(t){N(t);var e,n,r=_((n=t).naturalWidth||n.width,(e=t).naturalHeight||e.height);return U(r).drawImage(t,0,0),r})},N=function(t){URL.revokeObjectURL(t.src)},D=C,F=function(t){return(0===(e=t.src).indexOf("data:")?P:O)(e);var e},H=function(t,e){return function(t,e,n){for(var r=0,o=t.length;r<o;r++){var i=t[r];if(e(i,r))return T.some(i);if(n(i,r))break}return T.none()}(t,e,p)},q=function(t,e,n){var r=e.type,o=v(r),i=v(n),u=function(r,o){return t.then(function(t){return n=o,e=(e=r)||"image/png",t.toDataURL(e,n);var e,n})};return{getType:o,toBlob:function(){return x.resolve(e)},toDataURL:i,toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(e,n){return t.then(function(t){return S(t,e,n)})},toAdjustedDataURL:u,toAdjustedBase64:function(t,e){return u(t,e).then(function(t){return t.split(",")[1]})},toCanvas:function(){return t.then(R)}}},z=function(e){return n=e,new x(function(t){var e=new FileReader;e.onloadend=function(){t(e.result)},e.readAsDataURL(n)}).then(function(t){return q(B(e),e,t)});var n},$=function(e,t){return S(e,t).then(function(t){return q(x.resolve(e),t,e.toDataURL())})},G=function(t,e){void 0===e&&(e=2);var n=Math.pow(10,e),r=Math.round(t*n);return Math.ceil(r/n)},J=function(t,e,n){var r=(n<0?360+n:n)*Math.PI/180,o=t.width,i=t.height,u=Math.sin(r),a=Math.cos(r),c=G(Math.abs(o*a)+Math.abs(i*u)),s=G(Math.abs(o*u)+Math.abs(i*a)),f=_(c,s),l=U(f);return l.translate(c/2,s/2),l.rotate(r),l.drawImage(t,-o/2,-i/2),$(f,e)},K=function(t,e,n){var r=_(t.width,t.height),o=U(r);return"v"===n?(o.scale(1,-1),o.drawImage(t,0,-r.height)):(o.scale(-1,1),o.drawImage(t,-r.width,0)),$(r,e)},V=function(t,e){return r=e,(n=t).toCanvas().then(function(t){return K(t,n.getType(),r)});var n,r},W=function(t,e){return r=e,(n=t).toCanvas().then(function(t){return J(t,n.getType(),r)});var n,r},X=Object.keys,Q=function(e,r,o){return void 0===o&&(o=!1),new x(function(t){var n=new XMLHttpRequest;n.onreadystatechange=function(){4===n.readyState&&t({status:n.status,blob:n.response})},n.open("GET",e,!0),n.withCredentials=o,function(t,e){for(var n=X(t),r=0,o=n.length;r<o;r++){var i=n[r];e(t[i],i)}}(r,function(t,e){n.setRequestHeader(e,t)}),n.responseType="blob",n.send()})},Y=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],Z=[{type:"not_found",message:"Failed to load image."},{type:"key_missing",message:"The request did not include an api key."},{type:"key_not_found",message:"The provided api key could not be found."},{type:"domain_not_trusted",message:"The api key is not valid for the request origins."}],tt=function(t,e){var n,r,o=(n=function(t,e){return h(t)?t[e]:undefined},r=t,function(t,e){for(var n=0,r=t.length;n<r;n++)e(t[n],n)}(e,function(t){r=n(r,t)}),r);return T.from(o)},et=function(t){var e,n=(e=t,"ImageProxy HTTP error: "+H(Y,function(t){return e===t.code}).fold(v("Unknown ImageProxy error"),function(t){return t.message}));return x.reject(n)},nt=function(e){return H(Z,function(t){return t.type===e}).fold(v("Unknown service error"),function(t){return t.message})},rt=function(t){return"ImageProxy Service error: "+function(t){try{return T.some(JSON.parse(t))}catch(e){return T.none()}}(t).bind(function(t){return tt(t,["error","type"]).map(nt)}).getOr("Invalid JSON in service error message")},ot=function(t){return r=t,new x(function(t,e){var n=new FileReader;n.onload=function(){t(n.result)},n.onerror=function(t){e(t)},n.readAsText(r)}).then(function(t){var e=rt(t);return x.reject(e)});var r},it=function(t){return t<200||300<=t},ut=function(t,e){var n,r,o,i={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":e};return Q((r=e,o=-1===(n=t).indexOf("?")?"?":"&",/[?&]apiKey=/.test(n)?n:n+o+"apiKey="+encodeURIComponent(r)),i).then(function(t){return it(t.status)?(e=t.status,n=t.blob,r=e,"application/json"!==(null==(o=n)?void 0:o.type)||400!==r&&403!==r&&404!==r&&500!==r?et(e):ot(n)):x.resolve(t.blob);var e,n,r,o})},at=function(t,e,n){return void 0===n&&(n=!1),e?ut(t,e):Q(t,{},n).then(function(t){return it(t.status)?et(t.status):x.resolve(t.blob)})},ct=z,st=function(t){if(null===t||t===undefined)throw new Error("Node cannot be null or undefined");return{dom:t}},ft={fromHtml:function(t,e){var n=(e||document).createElement("div");if(n.innerHTML=t,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",t),new Error("HTML must have a single root node");return st(n.childNodes[0])},fromTag:function(t,e){var n=(e||document).createElement(t);return st(n)},fromText:function(t,e){var n=(e||document).createTextNode(t);return st(n)},fromDom:st,fromPoint:function(t,e,n){return T.from(t.dom.elementFromPoint(e,n)).map(st)}},lt=("undefined"!=typeof window||Function("return this;")(),function(t,e){return n=function(t){return function(t,e){var n=t.dom;if(1!==n.nodeType)return!1;var r=n;if(r.matches!==undefined)return r.matches(e);if(r.msMatchesSelector!==undefined)return r.msMatchesSelector(e);if(r.webkitMatchesSelector!==undefined)return r.webkitMatchesSelector(e);if(r.mozMatchesSelector!==undefined)return r.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}(t,e)},H(t.dom.childNodes,function(t){return n(ft.fromDom(t))}).map(ft.fromDom);var n}),dt=tinymce.util.Tools.resolve("tinymce.util.Delay"),mt=tinymce.util.Tools.resolve("tinymce.util.Promise"),ht=tinymce.util.Tools.resolve("tinymce.util.URI"),gt=function(t){return t.getParam("imagetools_proxy")},vt=function(t){var e=function(t){return/^[0-9\.]+px$/.test(t)},n=t.style.width,r=t.style.height;return n||r?e(n)&&e(r)?{w:parseInt(n,10),h:parseInt(r,10)}:null:(n=t.width,r=t.height,n&&r?{w:parseInt(n,10),h:parseInt(r,10)}:null)},pt=function(t){return{w:t.naturalWidth,h:t.naturalHeight}},yt=0,wt=function(t){return lt(ft.fromDom(t),"img")},bt=function(t,e){return t.dom.is(e,"figure")},It=function(t,e){return t.dom.is(e,"img:not([data-mce-object],[data-mce-placeholder])")},Tt=function(e,t){var n=function(t){return It(e,t)&&(At(e,t)||xt(e,t)||h(gt(e)))};return bt(e,t)?wt(t).bind(function(t){return n(t.dom)?T.some(t.dom):T.none()}):n(t)?T.some(t):T.none()},_t=function(t,e){t.notificationManager.open({text:e,type:"error"})},Rt=function(t){var e=t.selection.getNode(),n=t.dom.getParent(e,"figure.image");return null!==n&&bt(t,n)?wt(n):It(t,e)?T.some(ft.fromDom(e)):T.none()},Ut=function(t,e,n){var r=e.match(/(?:\/|^)(([^\/\?]+)\.(?:[a-z0-9.]+))(?:\?|$)/i);return h(r)?t.dom.encode(r[n]):null},At=function(t,e){var n=e.src;return 0===n.indexOf("data:")||0===n.indexOf("blob:")||new ht(n).host===t.documentBaseURI.host},xt=function(t,e){return-1!==d.inArray(t.getParam("imagetools_cors_hosts",[],"string[]"),new ht(e.src).host)},Et=function(t,e){if(xt(t,e))return at(e.src,null,(n=t,r=e,-1!==d.inArray(n.getParam("imagetools_credentials_hosts",[],"string[]"),new ht(r.src).host)));var n,r,o;if(At(t,e))return F(e);var i=gt(t),u=i+(-1===i.indexOf("?")?"?":"&")+"url="+encodeURIComponent(e.src),a=(o=t).getParam("api_key",o.getParam("imagetools_api_key","","string"),"string");return at(u,a,!1)},Mt=function(t,e){return n=t,T.from(n.getParam("imagetools_fetch_image",null,"function")).fold(function(){return Et(t,e)},function(t){return t(e)});var n},Lt=function(t,e){var n=t.editorUpload.blobCache.getByUri(e.src);return n?mt.resolve(n.blob()):Mt(t,e)},jt=function(t){dt.clearTimeout(t.get())},kt=function(a,c,s,f,l,d,m){return s.toBlob().then(function(t){var e,n,o,r=a.editorUpload.blobCache,i=d.src,u=c.type===t.type;return a.getParam("images_reuse_filename",!1,"boolean")&&(o=r.getByUri(i),n=h(o)?(i=o.uri(),e=o.name(),o.filename()):(e=Ut(a,i,2),Ut(a,i,1))),o=r.create({id:"imagetools"+yt++,blob:t,base64:s.toBase64(),uri:i,name:e,filename:u?n:undefined}),r.add(o),a.undoManager.transact(function(){var r=function(){var t,e,n;a.$(d).off("load",r),a.nodeChanged(),f?a.editorUpload.uploadImagesAuto():(jt(l),t=a,e=l,n=dt.setEditorTimeout(t,function(){t.editorUpload.uploadImagesAuto()},t.getParam("images_upload_timeout",3e4,"number")),e.set(n))};a.$(d).on("load",r),m&&a.$(d).attr({width:m.w,height:m.h}),a.$(d).attr({src:o.blobUri()}).removeAttr("data-mce-src")}),o})},Ct=function(r,o,t,i){return function(){return Rt(r).fold(function(){_t(r,"Could not find selected image")},function(n){return r._scanForImages().then(function(){return Lt(r,n.dom)}).then(function(e){return ct(e).then(t).then(function(t){return kt(r,e,t,!1,o,n.dom,i)})})["catch"](function(t){_t(r,t)})})}},Ot=function(e,n,r){return function(){var t=Rt(e).fold(function(){return null},function(t){var e=vt(t.dom);return e?{w:e.h,h:e.w}:null});return Ct(e,n,function(t){return W(t,r)},t)()}},Pt=function(t,e,n){return function(){return Ct(t,e,function(t){return V(t,n)})()}},St=function(e,n,u,a,c){return D(c).then(function(t){var e,n,r,o,i=pt(t);return a.w===i.w&&a.h===i.h||vt(u)&&(e=u,(n=i)&&(r=e.style.width,o=e.style.height,(r||o)&&(e.style.width=n.w+"px",e.style.height=n.h+"px",e.removeAttribute("data-mce-style")),r=e.width,o=e.height,(r||o)&&(e.setAttribute("width",String(n.w)),e.setAttribute("height",String(n.h))))),URL.revokeObjectURL(t.src),c}).then(ct).then(function(t){return kt(e,c,t,!0,n,u)})},Bt=function(i,u){return function(){var r=Rt(i),o=r.map(function(t){return pt(t.dom)});r.each(function(e){Tt(i,e.dom).each(function(t){Lt(i,e.dom).then(function(t){var e,n={blob:e=t,url:URL.createObjectURL(e)};i.windowManager.open({title:"Edit Image",size:"large",body:{type:"panel",items:[{type:"imagetools",name:"imagetools",label:"Edit Image",currentState:n}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0,disabled:!0}],onSubmit:function(t){var n=t.getData().imagetools.blob;r.each(function(e){o.each(function(t){St(i,u,e.dom,t,n)})}),t.close()},onCancel:g,onAction:function(t,e){switch(e.name){case"save-state":e.value?t.enable("save"):t.disable("save");break;case"disable":t.disable("save"),t.disable("cancel");break;case"enable":t.enable("cancel")}}})})})})}};f.add("imagetools",function(t){var n,e,r,o,i,u,a,c,s=l(0),f=l(null);n=t,e=s,d.each({mceImageRotateLeft:Ot(n,e,-90),mceImageRotateRight:Ot(n,e,90),mceImageFlipVertical:Pt(n,e,"v"),mceImageFlipHorizontal:Pt(n,e,"h"),mceEditImage:Bt(n,e)},function(t,e){n.addCommand(e,t)}),o=function(t){return function(){return r.execCommand(t)}},(r=t).ui.registry.addButton("rotateleft",{tooltip:"Rotate counterclockwise",icon:"rotate-left",onAction:o("mceImageRotateLeft")}),r.ui.registry.addButton("rotateright",{tooltip:"Rotate clockwise",icon:"rotate-right",onAction:o("mceImageRotateRight")}),r.ui.registry.addButton("flipv",{tooltip:"Flip vertically",icon:"flip-vertically",onAction:o("mceImageFlipVertical")}),r.ui.registry.addButton("fliph",{tooltip:"Flip horizontally",icon:"flip-horizontally",onAction:o("mceImageFlipHorizontal")}),r.ui.registry.addButton("editimage",{tooltip:"Edit image",icon:"edit-image",onAction:o("mceEditImage"),onSetup:function(e){var t=function(){var t=Rt(r).forall(function(t){return Tt(r,t.dom).isNone()});e.setDisabled(t)};return r.on("NodeChange",t),function(){r.off("NodeChange",t)}}}),r.ui.registry.addButton("imageoptions",{tooltip:"Image options",icon:"image",onAction:o("mceImage")}),r.ui.registry.addContextMenu("imagetools",{update:function(t){return Tt(r,t).fold(function(){return[]},function(t){return[{text:"Edit image",icon:"edit-image",onAction:o("mceEditImage")}]})}}),(i=t).ui.registry.addContextToolbar("imagetools",{items:i.getParam("imagetools_toolbar","rotateleft rotateright flipv fliph editimage imageoptions"),predicate:function(t){return Tt(i,t).isSome()},position:"node",scope:"node"}),a=s,c=f,(u=t).on("NodeChange",function(t){var e=c.get(),n=Tt(u,t.element);e&&!n.exists(function(t){return e.src===t.src})&&(jt(a),u.editorUpload.uploadImagesAuto(),c.set(null)),n.each(c.set)})})}();
|
|
9
|
+
!function(){"use strict";function c(e){var t=e;return{get:function(){return t},set:function(e){t=e}}}function h(e){return null!=e}function r(){}function i(e){return function(){return e}}function e(e){return e}function t(){return d}function s(e){return n=typeof(t=e),"array"==(null===t?"null":"object"==n&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":n);var t,n}var n,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),f=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=function(e){return typeof e===n},u=i(!(n="function")),l=i(!0),d={fold:function(e,t){return e()},isSome:u,isNone:l,getOr:e,getOrThunk:m,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:e,orThunk:m,map:t,each:r,bind:t,exists:u,forall:l,filter:function(){return d},toArray:function(){return[]},toString:i("none()")};function m(e){return e()}var g=function(n){function e(){return o}function t(e){return e(n)}var r=i(n),o={fold:function(e,t){return t(n)},isSome:l,isNone:u,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return g(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?o:d},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},p={some:g,none:t,from:function(e){return null==e?d:g(e)}},v={},y={exports:v};function w(e,t){return U(document.createElement("canvas"),e,t)}function b(e){var t=w(e.width,e.height);return R(t).drawImage(e,0,0),t}function _(u){return new I(function(e,t){function n(){o.removeEventListener("load",i),o.removeEventListener("error",a)}var r=URL.createObjectURL(u),o=new Image,i=function(){n(),e(o)},a=function(){n(),t("Unable to load data of type "+u.type+": "+r)};o.addEventListener("load",i),o.addEventListener("error",a),o.src=r,o.complete&&setTimeout(i,0)})}function E(e,r,o){return r=r||"image/png",a(HTMLCanvasElement.prototype.toBlob)?new I(function(t,n){e.toBlob(function(e){e?t(e):n()},r,o)}):j(e.toDataURL(r,o))}function T(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)}function x(e,t){return function(e,t,n){for(var r=0,o=e.length;r<o;r++){var i=e[r];if(t(i,r))return p.some(i);if(n(i,r))break}return p.none()}(e,t,u)}!function(){var e=this,t=function(){var e,t,n,r={exports:{}};function o(){}function i(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],l(e,this)}function a(n,r){for(;3===n._state;)n=n._value;0!==n._state?(n._handled=!0,i._immediateFn(function(){var e,t=1===n._state?r.onFulfilled:r.onRejected;if(null!==t){try{e=t(n._value)}catch(e){return void c(r.promise,e)}u(r.promise,e)}else(1===n._state?u:c)(r.promise,n._value)})):n._deferreds.push(r)}function u(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void l((r=n,o=e,function(){r.apply(o,arguments)}),t)}t._state=1,t._value=e,s(t)}catch(e){c(t,e)}var r,o}function c(e,t){e._state=2,e._value=t,s(e)}function s(e){2===e._state&&0===e._deferreds.length&&i._immediateFn(function(){e._handled||i._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)a(e,e._deferreds[t]);e._deferreds=null}function f(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function l(e,t){var n=!1;try{e(function(e){n||(n=!0,u(t,e))},function(e){n||(n=!0,c(t,e))})}catch(e){if(n)return;n=!0,c(t,e)}}e=r,t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=setTimeout,i.prototype.catch=function(e){return this.then(null,e)},i.prototype.then=function(e,t){var n=new this.constructor(o);return a(this,new f(e,t,n)),n},i.all=function(e){var u=Array.prototype.slice.call(e);return new i(function(o,i){if(0===u.length)return o([]);for(var a=u.length,e=0;e<u.length;e++)!function t(n,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var r=e.then;if("function"==typeof r)return r.call(e,function(e){t(n,e)},i),0}u[n]=e,0==--a&&o(u)}catch(e){i(e)}}(e,u[e])})},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i(function(e){e(t)})},i.reject=function(n){return new i(function(e,t){t(n)})},i.race=function(o){return new i(function(e,t){for(var n=0,r=o.length;n<r;n++)o[n].then(e,t)})},i._immediateFn="function"==typeof setImmediate?function(e){setImmediate(e)}:function(e){n(e,0)},i._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},i._setImmediateFn=function(e){i._immediateFn=e},i._setUnhandledRejectionFn=function(e){i._unhandledRejectionFn=e},e.exports?e.exports=i:t.Promise||(t.Promise=i);var d=r.exports;return{boltExport:("undefined"!=typeof window?window:Function("return this;")()).Promise||d}};"object"==typeof v&&void 0!==y?y.exports=t():(e="undefined"!=typeof globalThis?globalThis:e||self).EphoxContactWrapper=t()}();var I=y.exports.boltExport,R=function(e){return e.getContext("2d")},U=function(e,t,n){return e.width=t,e.height=n,e},A=function(r){return new I(function(e,t){var n=new XMLHttpRequest;n.open("GET",r,!0),n.responseType="blob",n.onload=function(){200===this.status&&e(this.response)},n.onerror=function(){var e;t(0===this.status?((e=new Error("No access to download image")).code=18,e.name="SecurityError",e):new Error("Error "+this.status+" downloading image"))},n.send()})},j=function(h){return new I(function(e,t){!function(){var e=h.split(","),t=/data:([^;]+)/.exec(e[0]);if(!t)return p.none();for(var n=t[1],r=e[1],o=atob(r),i=o.length,a=Math.ceil(i/1024),u=new Array(a),c=0;c<a;++c){for(var s=1024*c,f=Math.min(1024+s,i),l=new Array(f-s),d=s,m=0;d<f;++m,++d)l[m]=o[d].charCodeAt(0);u[c]=new Uint8Array(l)}return p.some(new Blob(u,{type:n}))}().fold(function(){t("uri is not base64: "+h)},e)})},S=function(e){URL.revokeObjectURL(e.src)},M=_,P=Array.prototype.indexOf,O=Object.keys;function L(e,t,n){function r(t,n){return e.then(function(e){return e.toDataURL(t||"image/png",n)})}return{getType:i(t.type),toBlob:function(){return I.resolve(t)},toDataURL:i(n),toBase64:function(){return n.split(",")[1]},toAdjustedBlob:function(t,n){return e.then(function(e){return E(e,t,n)})},toAdjustedDataURL:r,toAdjustedBase64:function(e,t){return r(e,t).then(function(e){return e.split(",")[1]})},toCanvas:function(){return e.then(b)}}}function k(t,e){return E(t,e).then(function(e){return L(I.resolve(t),e,t.toDataURL())})}function C(e,t){void 0===t&&(t=2);var n=Math.pow(10,t),r=Math.round(e*n);return Math.ceil(r/n)}function F(t,n,r){return void 0===r&&(r=!1),new I(function(e){var a=new XMLHttpRequest;a.onreadystatechange=function(){4===a.readyState&&e({status:a.status,blob:a.response})},a.open("GET",t,!0),a.withCredentials=r,function(e){for(var t,n=O(e),r=0,o=n.length;r<o;r++){var i=n[r];t=e[i],a.setRequestHeader(i,t)}}(n),a.responseType="blob",a.send()})}function B(e){var t,n=(t=e,"ImageProxy HTTP error: "+x(J,function(e){return t===e.code}).fold(i("Unknown ImageProxy error"),function(e){return e.message}));return I.reject(n)}function N(t){return x(K,function(e){return e.type===t}).fold(i("Unknown service error"),function(e){return e.message})}function D(e){return"ImageProxy Service error: "+function(e){try{return p.some(JSON.parse(e))}catch(e){return p.none()}}(e).bind(function(e){return n=function(e,t){return h(e)?e[t]:void 0},r=e,T(["error","type"],function(e,t){r=n(r,e)}),t=r,p.from(t).map(N);var n,r,t}).getOr("Invalid JSON in service error message")}function H(e){return e<200||300<=e}function z(e,t){var n,r,o,i={"Content-Type":"application/json;charset=UTF-8","tiny-api-key":t};return F((r=t,o=-1===(n=e).indexOf("?")?"?":"&",/[?&]apiKey=/.test(n)?n:n+o+"apiKey="+encodeURIComponent(r)),i).then(function(e){return H(e.status)?(t=e.status,"application/json"!==(null==(n=e.blob)?void 0:n.type)||400!==t&&403!==t&&404!==t&&500!==t?B(t):(r=n,new I(function(e,t){var n=new FileReader;n.onload=function(){e(n.result)},n.onerror=function(e){t(e)},n.readAsText(r)}).then(function(e){var t=D(e);return I.reject(t)}))):I.resolve(e.blob);var r,t,n})}function q(e,t,n){return void 0===n&&(n=!1),t?z(e,t):F(e,{},n).then(function(e){return H(e.status)?B(e.status):I.resolve(e.blob)})}function W(t){return n=t,new I(function(e){var t=new FileReader;t.onloadend=function(){e(t.result)},t.readAsDataURL(n)}).then(function(e){return L(_(t).then(function(e){S(e);var t=w(e.naturalWidth||e.width,e.naturalHeight||e.height);return R(t).drawImage(e,0,0),t}),t,e)});var n}!function(a){if(!s(a))throw new Error("cases must be an array");if(0===a.length)throw new Error("there must be at least one case");var u=[],n={};T(a,function(e,r){var t=O(e);if(1!==t.length)throw new Error("one and only one name per case");var i=t[0],o=e[i];if(void 0!==n[i])throw new Error("duplicate key detected:"+i);if("cata"===i)throw new Error("cannot have a case named cata (sorry)");if(!s(o))throw new Error("case arguments must be an array");u.push(i),n[i]=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=n.length;if(t!==o.length)throw new Error("Wrong number of arguments to case "+i+". Expected "+o.length+" ("+o+"), got "+t);return{fold:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(e.length!==a.length)throw new Error("Wrong number of arguments to fold. Expected "+a.length+", got "+e.length);return e[r].apply(null,n)},match:function(e){var o=O(e);if(u.length!==o.length)throw new Error("Wrong number of arguments to match. Expected: "+u.join(",")+"\nActual: "+o.join(","));if(!function(e){for(var t,n=0,r=e.length;n<r;++n)if(!0!==(t=e[n],function(e,t){return-1<P.call(e,t)}(o,t)))return;return 1}(u))throw new Error("Not all branches were specified when using match. Specified: "+o.join(", ")+"\nRequired: "+u.join(", "));return e[i].apply(null,n)},log:function(e){console.log(e,{constructors:u,constructor:i,params:n})}}}})}([{bothErrors:["error1","error2"]},{firstError:["error1","value2"]},{secondError:["value1","error2"]},{bothValues:["value1","value2"]}]);function $(e){if(null==e)throw new Error("Node cannot be null or undefined");return{dom:e}}var V=function(e,t,n){var r=(n<0?360+n:n)*Math.PI/180,o=e.width,i=e.height,a=Math.sin(r),u=Math.cos(r),c=C(Math.abs(o*u)+Math.abs(i*a)),s=C(Math.abs(o*a)+Math.abs(i*u)),f=w(c,s),l=R(f);return l.translate(c/2,s/2),l.rotate(r),l.drawImage(e,-o/2,-i/2),k(f,t)},G=function(e,t,n){var r=w(e.width,e.height),o=R(r);return"v"===n?(o.scale(1,-1),o.drawImage(e,0,-r.height)):(o.scale(-1,1),o.drawImage(e,-r.width,0)),k(r,t)},J=[{code:404,message:"Could not find Image Proxy"},{code:403,message:"Rejected request"},{code:0,message:"Incorrect Image Proxy URL"}],K=[{type:"not_found",message:"Failed to load image."},{type:"key_missing",message:"The request did not include an api key."},{type:"key_not_found",message:"The provided api key could not be found."},{type:"domain_not_trusted",message:"The api key is not valid for the request origins."}],X={fromHtml:function(e,t){var n=(t||document).createElement("div");if(n.innerHTML=e,!n.hasChildNodes()||1<n.childNodes.length)throw console.error("HTML does not have a single root node",e),new Error("HTML must have a single root node");return $(n.childNodes[0])},fromTag:function(e,t){var n=(t||document).createElement(e);return $(n)},fromText:function(e,t){var n=(t||document).createTextNode(e);return $(n)},fromDom:$,fromPoint:function(e,t,n){return p.from(e.dom.elementFromPoint(t,n)).map($)}};function Q(e){return e.getParam("imagetools_proxy")}function Y(e){function t(e){return/^[0-9\.]+px$/.test(e)}var n=e.style.width,r=e.style.height;return n||r?t(n)&&t(r)?{w:parseInt(n,10),h:parseInt(r,10)}:null:(n=e.width,r=e.height,n&&r?{w:parseInt(n,10),h:parseInt(r,10)}:null)}function Z(e){return{w:e.naturalWidth,h:e.naturalHeight}}function ee(e){return t=X.fromDom(e),n="img",r=function(r){return function(e){var t=r.dom;if(1!==t.nodeType)return!1;var n=t;if(void 0!==n.matches)return n.matches(e);if(void 0!==n.msMatchesSelector)return n.msMatchesSelector(e);if(void 0!==n.webkitMatchesSelector)return n.webkitMatchesSelector(e);if(void 0!==n.mozMatchesSelector)return n.mozMatchesSelector(e);throw new Error("Browser lacks native selectors")}(n)},x(t.dom.childNodes,function(e){return r(X.fromDom(e))}).map(X.fromDom);var t,n,r}function te(e,t){return e.dom.is(t,"figure")}function ne(e,t){return e.dom.is(t,"img:not([data-mce-object],[data-mce-placeholder])")}function re(t,e){function n(e){return ne(t,e)&&(be(t,e)||_e(t,e)||h(Q(t)))}return te(t,e)?ee(e).bind(function(e){return n(e.dom)?p.some(e.dom):p.none()}):n(e)?p.some(e):p.none()}function oe(e,t){e.notificationManager.open({text:t,type:"error"})}function ie(e){var t=e.selection.getNode(),n=e.dom.getParent(t,"figure.image");return null!==n&&te(e,n)?ee(n):ne(e,t)?p.some(X.fromDom(t)):p.none()}function ae(e,t,n){var r=t.match(/(?:\/|^)(([^\/\?]+)\.(?:[a-z0-9.]+))(?:\?|$)/i);return h(r)?e.dom.encode(r[n]):null}function ue(e,t){if(_e(e,t))return q(t.src,null,(n=t,-1!==f.inArray(e.getParam("imagetools_credentials_hosts",[],"string[]"),new ye(n.src).host)));var n,r;if(be(e,t))return(0===(r=t.src).indexOf("data:")?j:A)(r);var o=Q(e);return q(o+(-1===o.indexOf("?")?"?":"&")+"url="+encodeURIComponent(t.src),e.getParam("api_key",e.getParam("imagetools_api_key","","string"),"string"),!1)}function ce(e,t){var n,r,o=e.editorUpload.blobCache.getByUri(t.src);return o?ve.resolve(o.blob()):(n=e,r=t,p.from(n.getParam("imagetools_fetch_image",null,"function")).fold(function(){return ue(n,r)},function(e){return e(r)}))}function se(e){pe.clearTimeout(e.get())}function fe(u,c,s,f,l,d,m){return s.toBlob().then(function(e){var t,n,o,r=u.editorUpload.blobCache,i=d.src,a=c.type===e.type;return u.getParam("images_reuse_filename",!1,"boolean")&&(n=h(o=r.getByUri(i))?(i=o.uri(),t=o.name(),o.filename()):(t=ae(u,i,2),ae(u,i,1))),o=r.create({id:"imagetools"+we++,blob:e,base64:s.toBase64(),uri:i,name:t,filename:a?n:void 0}),r.add(o),u.undoManager.transact(function(){var r=function(){var e,t,n;u.$(d).off("load",r),u.nodeChanged(),f?u.editorUpload.uploadImagesAuto():(se(l),e=u,t=l,n=pe.setEditorTimeout(e,function(){e.editorUpload.uploadImagesAuto()},e.getParam("images_upload_timeout",3e4,"number")),t.set(n))};u.$(d).on("load",r),m&&u.$(d).attr({width:m.w,height:m.h}),u.$(d).attr({src:o.blobUri()}).removeAttr("data-mce-src")}),o})}function le(r,o,e,i){return function(){return ie(r).fold(function(){oe(r,"Could not find selected image")},function(n){return r._scanForImages().then(function(){return ce(r,n.dom)}).then(function(t){return W(t).then(e).then(function(e){return fe(r,t,e,!1,o,n.dom,i)})}).catch(function(e){oe(r,e)})})}}function de(t,n,r){return function(){var e=ie(t).map(function(e){var t=Y(e.dom);return t?{w:t.h,h:t.w}:null}).getOrNull();return le(t,n,function(e){return n=r,(t=e).toCanvas().then(function(e){return V(e,t.getType(),n)});var t,n},e)()}}function me(e,t,r){return function(){return le(e,t,function(e){return n=r,(t=e).toCanvas().then(function(e){return G(e,t.getType(),n)});var t,n})()}}function he(s,f){return function(){var n=ie(s),i=n.map(function(e){return Z(e.dom)});n.each(function(t){re(s,t.dom).each(function(e){ce(s,t.dom).then(function(e){var t={blob:e,url:URL.createObjectURL(e)};s.windowManager.open({title:"Edit Image",size:"large",body:{type:"panel",items:[{type:"imagetools",name:"imagetools",label:"Edit Image",currentState:t}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0,disabled:!0}],onSubmit:function(e){var o=e.getData().imagetools.blob;n.each(function(r){i.each(function(e){var t,n,a,u,c;t=s,n=f,a=r.dom,u=e,M(c=o).then(function(e){var t,n,r,o,i=Z(e);return u.w===i.w&&u.h===i.h||Y(a)&&(t=a,(n=i)&&(r=t.style.width,o=t.style.height,(r||o)&&(t.style.width=n.w+"px",t.style.height=n.h+"px",t.removeAttribute("data-mce-style")),r=t.width,o=t.height,(r||o)&&(t.setAttribute("width",String(n.w)),t.setAttribute("height",String(n.h))))),URL.revokeObjectURL(e.src),c}).then(W).then(function(e){return fe(t,c,e,!0,n,a)})})}),e.close()},onCancel:r,onAction:function(e,t){switch(t.name){case"save-state":t.value?e.enable("save"):e.disable("save");break;case"disable":e.disable("save"),e.disable("cancel");break;case"enable":e.enable("cancel")}}})})})})}}function ge(t){function n(e){return function(){return t.execCommand(e)}}function e(){return ie(t).exists(function(e){return re(t,e.dom).isSome()})}function r(t){function i(e){return t.setDisabled(!e)}return i(e()),o=o.concat([i]),function(){o=function(e){for(var t=[],n=0,r=e.length;n<r;n++){var o=e[n];o!==i&&t.push(o)}return t}(o)}}var o=[];t.on("NodeChange",function(){var t=e();T(o,function(e){return e(t)})}),t.ui.registry.addButton("rotateleft",{tooltip:"Rotate counterclockwise",icon:"rotate-left",onAction:n("mceImageRotateLeft"),onSetup:r}),t.ui.registry.addButton("rotateright",{tooltip:"Rotate clockwise",icon:"rotate-right",onAction:n("mceImageRotateRight"),onSetup:r}),t.ui.registry.addButton("flipv",{tooltip:"Flip vertically",icon:"flip-vertically",onAction:n("mceImageFlipVertical"),onSetup:r}),t.ui.registry.addButton("fliph",{tooltip:"Flip horizontally",icon:"flip-horizontally",onAction:n("mceImageFlipHorizontal"),onSetup:r}),t.ui.registry.addButton("editimage",{tooltip:"Edit image",icon:"edit-image",onAction:n("mceEditImage"),onSetup:r}),t.ui.registry.addButton("imageoptions",{tooltip:"Image options",icon:"image",onAction:n("mceImage")}),t.ui.registry.addContextMenu("imagetools",{update:function(e){return re(t,e).map(function(e){return{text:"Edit image",icon:"edit-image",onAction:n("mceEditImage")}}).toArray()}})}"undefined"!=typeof window||Function("return this;")();var pe=tinymce.util.Tools.resolve("tinymce.util.Delay"),ve=tinymce.util.Tools.resolve("tinymce.util.Promise"),ye=tinymce.util.Tools.resolve("tinymce.util.URI"),we=0,be=function(e,t){var n=t.src;return 0===n.indexOf("data:")||0===n.indexOf("blob:")||new ye(n).host===e.documentBaseURI.host},_e=function(e,t){return-1!==f.inArray(e.getParam("imagetools_cors_hosts",[],"string[]"),new ye(t.src).host)};o.add("imagetools",function(e){var t,r,o,i,n=c(0),a=c(null),u=e;f.each({mceImageRotateLeft:de(u,n,-90),mceImageRotateRight:de(u,n,90),mceImageFlipVertical:me(u,n,"v"),mceImageFlipHorizontal:me(u,n,"h"),mceEditImage:he(u,n)},function(e,t){u.addCommand(t,e)}),ge(e),(t=e).ui.registry.addContextToolbar("imagetools",{items:t.getParam("imagetools_toolbar","rotateleft rotateright flipv fliph editimage imageoptions"),predicate:function(e){return re(t,e).isSome()},position:"node",scope:"node"}),o=n,i=a,(r=e).on("NodeChange",function(e){var t=i.get(),n=re(r,e.element);t&&!n.exists(function(e){return t.src===e.src})&&(se(o),r.editorUpload.uploadImagesAuto(),i.set(null)),n.each(i.set)})})}();
|
|
@@ -4,20 +4,40 @@
|
|
|
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$4 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var typeOf = function (x) {
|
|
15
|
+
var t = typeof x;
|
|
16
|
+
if (x === null) {
|
|
17
|
+
return 'null';
|
|
18
|
+
} else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
|
|
19
|
+
return 'array';
|
|
20
|
+
} else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
|
|
21
|
+
return 'string';
|
|
22
|
+
} else {
|
|
23
|
+
return t;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
var isType = function (type) {
|
|
27
|
+
return function (value) {
|
|
28
|
+
return typeOf(value) === type;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
var isString = isType('string');
|
|
32
|
+
var isArray = isType('array');
|
|
33
|
+
|
|
34
|
+
var global$3 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
|
|
15
35
|
|
|
16
36
|
var global$2 = tinymce.util.Tools.resolve('tinymce.EditorManager');
|
|
17
37
|
|
|
18
|
-
var global$
|
|
38
|
+
var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
|
|
19
39
|
|
|
20
|
-
var global
|
|
40
|
+
var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
|
21
41
|
|
|
22
42
|
var shouldMergeClasses = function (editor) {
|
|
23
43
|
return editor.getParam('importcss_merge_classes');
|
|
@@ -48,25 +68,6 @@
|
|
|
48
68
|
return editor.getParam('skin_url');
|
|
49
69
|
};
|
|
50
70
|
|
|
51
|
-
var typeOf = function (x) {
|
|
52
|
-
var t = typeof x;
|
|
53
|
-
if (x === null) {
|
|
54
|
-
return 'null';
|
|
55
|
-
} else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) {
|
|
56
|
-
return 'array';
|
|
57
|
-
} else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) {
|
|
58
|
-
return 'string';
|
|
59
|
-
} else {
|
|
60
|
-
return t;
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
var isType = function (type) {
|
|
64
|
-
return function (value) {
|
|
65
|
-
return typeOf(value) === type;
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
var isArray = isType('array');
|
|
69
|
-
|
|
70
71
|
var nativePush = Array.prototype.push;
|
|
71
72
|
var map = function (xs, f) {
|
|
72
73
|
var len = xs.length;
|
|
@@ -123,9 +124,10 @@
|
|
|
123
124
|
};
|
|
124
125
|
};
|
|
125
126
|
|
|
127
|
+
var internalEditorStyle = /^\.(?:ephox|tiny-pageembed|mce)(?:[.-]+\w+)+$/;
|
|
126
128
|
var removeCacheSuffix = function (url) {
|
|
127
|
-
var cacheSuffix = global$
|
|
128
|
-
if (
|
|
129
|
+
var cacheSuffix = global$1.cacheSuffix;
|
|
130
|
+
if (isString(url)) {
|
|
129
131
|
url = url.replace('?' + cacheSuffix, '').replace('&' + cacheSuffix, '');
|
|
130
132
|
}
|
|
131
133
|
return url;
|
|
@@ -141,7 +143,7 @@
|
|
|
141
143
|
return false;
|
|
142
144
|
};
|
|
143
145
|
var compileFilter = function (filter) {
|
|
144
|
-
if (
|
|
146
|
+
if (isString(filter)) {
|
|
145
147
|
return function (value) {
|
|
146
148
|
return value.indexOf(filter) !== -1;
|
|
147
149
|
};
|
|
@@ -159,31 +161,32 @@
|
|
|
159
161
|
return rule.selectorText;
|
|
160
162
|
};
|
|
161
163
|
var getSelectors = function (editor, doc, fileFilter) {
|
|
162
|
-
var selectors = []
|
|
164
|
+
var selectors = [];
|
|
165
|
+
var contentCSSUrls = {};
|
|
163
166
|
var append = function (styleSheet, imported) {
|
|
164
167
|
var href = styleSheet.href, rules;
|
|
165
168
|
href = removeCacheSuffix(href);
|
|
166
169
|
if (!href || !fileFilter(href, imported) || isSkinContentCss(editor, href)) {
|
|
167
170
|
return;
|
|
168
171
|
}
|
|
169
|
-
global
|
|
172
|
+
global.each(styleSheet.imports, function (styleSheet) {
|
|
170
173
|
append(styleSheet, true);
|
|
171
174
|
});
|
|
172
175
|
try {
|
|
173
176
|
rules = styleSheet.cssRules || styleSheet.rules;
|
|
174
177
|
} catch (e) {
|
|
175
178
|
}
|
|
176
|
-
global
|
|
179
|
+
global.each(rules, function (cssRule) {
|
|
177
180
|
if (isCssImportRule(cssRule)) {
|
|
178
181
|
append(cssRule.styleSheet, true);
|
|
179
182
|
} else if (isCssPageRule(cssRule)) {
|
|
180
|
-
global
|
|
181
|
-
selectors.push(global
|
|
183
|
+
global.each(cssRule.selectorText.split(','), function (selector) {
|
|
184
|
+
selectors.push(global.trim(selector));
|
|
182
185
|
});
|
|
183
186
|
}
|
|
184
187
|
});
|
|
185
188
|
};
|
|
186
|
-
global
|
|
189
|
+
global.each(editor.contentCSS, function (url) {
|
|
187
190
|
contentCSSUrls[url] = true;
|
|
188
191
|
});
|
|
189
192
|
if (!fileFilter) {
|
|
@@ -192,7 +195,7 @@
|
|
|
192
195
|
};
|
|
193
196
|
}
|
|
194
197
|
try {
|
|
195
|
-
global
|
|
198
|
+
global.each(doc.styleSheets, function (styleSheet) {
|
|
196
199
|
append(styleSheet);
|
|
197
200
|
});
|
|
198
201
|
} catch (e) {
|
|
@@ -207,7 +210,7 @@
|
|
|
207
210
|
}
|
|
208
211
|
var elementName = selector[1];
|
|
209
212
|
var classes = selector[2].substr(1).split('.').join(' ');
|
|
210
|
-
var inlineSelectorElements = global
|
|
213
|
+
var inlineSelectorElements = global.makeMap('a,img');
|
|
211
214
|
if (selector[1]) {
|
|
212
215
|
format = { title: selectorText };
|
|
213
216
|
if (editor.schema.getTextBlockElements()[elementName]) {
|
|
@@ -232,20 +235,16 @@
|
|
|
232
235
|
return format;
|
|
233
236
|
};
|
|
234
237
|
var getGroupsBySelector = function (groups, selector) {
|
|
235
|
-
return global
|
|
238
|
+
return global.grep(groups, function (group) {
|
|
236
239
|
return !group.filter || group.filter(selector);
|
|
237
240
|
});
|
|
238
241
|
};
|
|
239
242
|
var compileUserDefinedGroups = function (groups) {
|
|
240
|
-
return global
|
|
241
|
-
return global
|
|
243
|
+
return global.map(groups, function (group) {
|
|
244
|
+
return global.extend({}, group, {
|
|
242
245
|
original: group,
|
|
243
246
|
selectors: {},
|
|
244
|
-
filter: compileFilter(group.filter)
|
|
245
|
-
item: {
|
|
246
|
-
text: group.title,
|
|
247
|
-
menu: []
|
|
248
|
-
}
|
|
247
|
+
filter: compileFilter(group.filter)
|
|
249
248
|
});
|
|
250
249
|
});
|
|
251
250
|
};
|
|
@@ -276,7 +275,7 @@
|
|
|
276
275
|
return selectorConverter.call(plugin, selector, group);
|
|
277
276
|
};
|
|
278
277
|
var setup = function (editor) {
|
|
279
|
-
editor.on('init', function (
|
|
278
|
+
editor.on('init', function () {
|
|
280
279
|
var model = generate();
|
|
281
280
|
var globallyUniqueSelectors = {};
|
|
282
281
|
var selectorFilter = compileFilter(getSelectorFilter(editor));
|
|
@@ -286,22 +285,22 @@
|
|
|
286
285
|
markUniqueSelector(editor, selector, group, globallyUniqueSelectors);
|
|
287
286
|
var format = convertSelectorToFormat(editor, editor.plugins.importcss, selector, group);
|
|
288
287
|
if (format) {
|
|
289
|
-
var formatName = format.name || global$
|
|
288
|
+
var formatName = format.name || global$3.DOM.uniqueId();
|
|
290
289
|
editor.formatter.register(formatName, format);
|
|
291
|
-
return
|
|
290
|
+
return {
|
|
292
291
|
title: format.title,
|
|
293
292
|
format: formatName
|
|
294
|
-
}
|
|
293
|
+
};
|
|
295
294
|
}
|
|
296
295
|
}
|
|
297
296
|
return null;
|
|
298
297
|
};
|
|
299
|
-
global
|
|
300
|
-
if (
|
|
298
|
+
global.each(getSelectors(editor, editor.getDoc(), compileFilter(getFileFilter(editor))), function (selector) {
|
|
299
|
+
if (!internalEditorStyle.test(selector)) {
|
|
301
300
|
if (!selectorFilter || selectorFilter(selector)) {
|
|
302
301
|
var selectorGroups = getGroupsBySelector(groups, selector);
|
|
303
302
|
if (selectorGroups.length > 0) {
|
|
304
|
-
global
|
|
303
|
+
global.each(selectorGroups, function (group) {
|
|
305
304
|
var menuItem = processSelector(selector, group);
|
|
306
305
|
if (menuItem) {
|
|
307
306
|
model.addItemToGroup(group.title, menuItem);
|
|
@@ -332,7 +331,7 @@
|
|
|
332
331
|
};
|
|
333
332
|
|
|
334
333
|
function Plugin () {
|
|
335
|
-
global.add('importcss', function (editor) {
|
|
334
|
+
global$4.add('importcss', function (editor) {
|
|
336
335
|
setup(editor);
|
|
337
336
|
return get(editor);
|
|
338
337
|
});
|
|
@@ -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 t(n){return function(t){return r=typeof(e=t),(null===e?"null":"object"==r&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==r&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":r)===n;var e,r}}function y(t){return t.getParam("importcss_selector_converter")}function u(e){return l(e)?function(t){return-1!==t.indexOf(e)}:e instanceof RegExp?function(t){return e.test(t)}:e}function h(t,e){var r,n=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(e);if(n){var o=n[1],i=n[2].substr(1).split(".").join(" "),c=x.makeMap("a,img");return n[1]?(r={title:e},t.schema.getTextBlockElements()[o]?r.block=o:t.schema.getBlockElements()[o]||c[o.toLowerCase()]?r.selector=o:r.inline=o):n[2]&&(r={inline:"span",title:e.substr(1),classes:i}),!1!==t.getParam("importcss_merge_classes")?r.classes=i:r.attributes={class:i},r}}function d(t,e){return null===e||!1!==t.getParam("importcss_exclusive")}function r(v){v.on("init",function(){function o(t,e){if(f=t,p=g,!(d(v,m=e)?f in p:f in m.selectors)){a=t,l=g,d(v,u=e)?l[a]=!0:u.selectors[a]=!0;var r=(i=(o=v).plugins.importcss,c=t,((s=e)&&s.selector_converter?s.selector_converter:y(o)?y(o):function(){return h(o,c)}).call(i,c,s));if(r){var n=r.name||_.DOM.uniqueId();return v.formatter.register(n,r),{title:r.title,format:n}}}var o,i,c,s,a,u,l,f,m,p;return null}var e,r,n,t,i=(e=[],r=[],n={},{addItemToGroup:function(t,e){n[t]?n[t].push(e):(r.push(t),n[t]=[e])},addItem:function(t){e.push(t)},toFormats:function(){return function(t){for(var e=[],r=0,n=t.length;r<n;++r){if(!f(t[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+t);P.apply(e,t[r])}return e}(function(t,e){for(var r=t.length,n=new Array(r),o=0;o<r;o++){var i=t[o];n[o]=e(i,o)}return n}(r,function(t){var e=n[t];return 0===e.length?[]:[{title:t,items:e}]})).concat(e)}}),g={},c=u(v.getParam("importcss_selector_filter")),s=(t=v.getParam("importcss_groups"),x.map(t,function(t){return x.extend({},t,{original:t,selectors:{},filter:u(t.filter)})}));x.each(function(c,t,s){var a=[],r={},u=function(t,e){var r,n,o=n=t.href,i=p.cacheSuffix;if((n=o=l(o)?o.replace("?"+i,"").replace("&"+i,""):o)&&s(n,e)&&!function(t,e){var r,n=!1!==(r=t.getParam("skin"))&&(r||"oxide");if(n){var o=t.getParam("skin_url"),i=o?t.documentBaseURI.toAbsolute(o):m.baseURL+"/skins/ui/"+n,c=m.baseURL+"/skins/content/";return e===i+"/content"+(t.inline?".inline":"")+".min.css"||-1!==e.indexOf(c)}}(c,n)){x.each(t.imports,function(t){u(t,!0)});try{r=t.cssRules||t.rules}catch(t){}x.each(r,function(t){t.styleSheet?u(t.styleSheet,!0):t.selectorText&&x.each(t.selectorText.split(","),function(t){a.push(x.trim(t))})})}};x.each(c.contentCSS,function(t){r[t]=!0}),s=s||function(t,e){return e||r[t]};try{x.each(t.styleSheets,function(t){u(t)})}catch(t){}return a}(v,v.getDoc(),u(v.getParam("importcss_file_filter"))),function(r){var t,e,n;T.test(r)||c&&!c(r)||(n=r,0<(t=x.grep(s,function(t){return!t.filter||t.filter(n)})).length?x.each(t,function(t){var e=o(r,t);e&&i.addItemToGroup(t.title,e)}):(e=o(r,null))&&i.addItem(e))});var a=i.toFormats();v.fire("addStyleModifications",{items:a,replace:!v.getParam("importcss_append")})})}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=t("string"),f=t("array"),_=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),m=tinymce.util.Tools.resolve("tinymce.EditorManager"),p=tinymce.util.Tools.resolve("tinymce.Env"),x=tinymce.util.Tools.resolve("tinymce.util.Tools"),P=Array.prototype.push,T=/^\.(?:ephox|tiny-pageembed|mce)(?:[.-]+\w+)+$/;e.add("importcss",function(t){return r(t),e=t,{convertSelectorToFormat:function(t){return h(e,t)}};var e})}();
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
* For LGPL see License.txt in the project root for license information.
|
|
5
5
|
* For commercial licenses see https://www.tiny.cloud/
|
|
6
6
|
*
|
|
7
|
-
* Version: 5.
|
|
7
|
+
* Version: 5.10.3 (2022-02-09)
|
|
8
8
|
*/
|
|
9
9
|
(function () {
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
12
|
+
var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
13
13
|
|
|
14
14
|
var getDateFormat = function (editor) {
|
|
15
15
|
return editor.getParam('insertdatetime_dateformat', editor.translate('%Y-%m-%d'));
|
|
@@ -47,7 +47,9 @@
|
|
|
47
47
|
return value;
|
|
48
48
|
};
|
|
49
49
|
var getDateTime = function (editor, fmt, date) {
|
|
50
|
-
|
|
50
|
+
if (date === void 0) {
|
|
51
|
+
date = new Date();
|
|
52
|
+
}
|
|
51
53
|
fmt = fmt.replace('%D', '%m/%d/%Y');
|
|
52
54
|
fmt = fmt.replace('%r', '%I:%M:%S %p');
|
|
53
55
|
fmt = fmt.replace('%Y', '' + date.getFullYear());
|
|
@@ -93,12 +95,12 @@
|
|
|
93
95
|
}
|
|
94
96
|
};
|
|
95
97
|
|
|
96
|
-
var register = function (editor) {
|
|
97
|
-
editor.addCommand('mceInsertDate', function () {
|
|
98
|
-
insertDateTime(editor, getDateFormat(editor));
|
|
98
|
+
var register$1 = function (editor) {
|
|
99
|
+
editor.addCommand('mceInsertDate', function (_ui, value) {
|
|
100
|
+
insertDateTime(editor, value !== null && value !== void 0 ? value : getDateFormat(editor));
|
|
99
101
|
});
|
|
100
|
-
editor.addCommand('mceInsertTime', function () {
|
|
101
|
-
insertDateTime(editor, getTimeFormat(editor));
|
|
102
|
+
editor.addCommand('mceInsertTime', function (_ui, value) {
|
|
103
|
+
insertDateTime(editor, value !== null && value !== void 0 ? value : getTimeFormat(editor));
|
|
102
104
|
});
|
|
103
105
|
};
|
|
104
106
|
|
|
@@ -116,11 +118,14 @@
|
|
|
116
118
|
};
|
|
117
119
|
};
|
|
118
120
|
|
|
119
|
-
var global
|
|
121
|
+
var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
|
120
122
|
|
|
121
|
-
var register
|
|
123
|
+
var register = function (editor) {
|
|
122
124
|
var formats = getFormats(editor);
|
|
123
125
|
var defaultFormat = Cell(getDefaultDateTime(editor));
|
|
126
|
+
var insertDateTime = function (format) {
|
|
127
|
+
return editor.execCommand('mceInsertDate', false, format);
|
|
128
|
+
};
|
|
124
129
|
editor.ui.registry.addSplitButton('insertdatetime', {
|
|
125
130
|
icon: 'insert-time',
|
|
126
131
|
tooltip: 'Insert date/time',
|
|
@@ -128,7 +133,7 @@
|
|
|
128
133
|
return value === defaultFormat.get();
|
|
129
134
|
},
|
|
130
135
|
fetch: function (done) {
|
|
131
|
-
done(global
|
|
136
|
+
done(global.map(formats, function (format) {
|
|
132
137
|
return {
|
|
133
138
|
type: 'choiceitem',
|
|
134
139
|
text: getDateTime(editor, format),
|
|
@@ -137,24 +142,24 @@
|
|
|
137
142
|
}));
|
|
138
143
|
},
|
|
139
144
|
onAction: function (_api) {
|
|
140
|
-
insertDateTime(
|
|
145
|
+
insertDateTime(defaultFormat.get());
|
|
141
146
|
},
|
|
142
147
|
onItemAction: function (_api, value) {
|
|
143
148
|
defaultFormat.set(value);
|
|
144
|
-
insertDateTime(
|
|
149
|
+
insertDateTime(value);
|
|
145
150
|
}
|
|
146
151
|
});
|
|
147
152
|
var makeMenuItemHandler = function (format) {
|
|
148
153
|
return function () {
|
|
149
154
|
defaultFormat.set(format);
|
|
150
|
-
insertDateTime(
|
|
155
|
+
insertDateTime(format);
|
|
151
156
|
};
|
|
152
157
|
};
|
|
153
158
|
editor.ui.registry.addNestedMenuItem('insertdatetime', {
|
|
154
159
|
icon: 'insert-time',
|
|
155
160
|
text: 'Date/time',
|
|
156
161
|
getSubmenuItems: function () {
|
|
157
|
-
return global
|
|
162
|
+
return global.map(formats, function (format) {
|
|
158
163
|
return {
|
|
159
164
|
type: 'menuitem',
|
|
160
165
|
text: getDateTime(editor, format),
|
|
@@ -166,9 +171,9 @@
|
|
|
166
171
|
};
|
|
167
172
|
|
|
168
173
|
function Plugin () {
|
|
169
|
-
global.add('insertdatetime', function (editor) {
|
|
170
|
-
register(editor);
|
|
174
|
+
global$1.add('insertdatetime', function (editor) {
|
|
171
175
|
register$1(editor);
|
|
176
|
+
register(editor);
|
|
172
177
|
});
|
|
173
178
|
}
|
|
174
179
|
|
|
@@ -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 l(e){return e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S"))}function s(e){return e.getParam("insertdatetime_formats",["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"])}function r(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e}function d(e,t,n){return void 0===n&&(n=new Date),(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+n.getFullYear())).replace("%y",""+n.getYear())).replace("%m",r(n.getMonth()+1,2))).replace("%d",r(n.getDate(),2))).replace("%H",""+r(n.getHours(),2))).replace("%M",""+r(n.getMinutes(),2))).replace("%S",""+r(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(u[n.getMonth()]))).replace("%b",""+e.translate(o[n.getMonth()]))).replace("%A",""+e.translate(i[n.getDay()]))).replace("%a",""+e.translate(a[n.getDay()]))).replace("%%","%")}function p(e,t){var n,r,a,i,o,u;e.getParam("insertdatetime_element",!1)?(n=d(e,t),r=/%[HMSIp]/.test(t)?d(e,"%Y-%m-%dT%H:%M"):d(e,"%Y-%m-%d"),(a=e.dom.getParent(e.selection.getStart(),"time"))?(o=a,u=(i=e).dom.create("time",{datetime:r},n),o.parentNode.insertBefore(u,o),i.dom.remove(o),i.selection.select(u,!0),i.selection.collapse(!1)):e.insertContent('<time datetime="'+r+'">'+n+"</time>")):e.insertContent(d(e,t))}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),i="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),o="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),u="January February March April May June July August September October November December".split(" "),g=tinymce.util.Tools.resolve("tinymce.util.Tools");e.add("insertdatetime",function(e){var n,r,t,a,i,o,u,c;function m(e){return r.execCommand("mceInsertDate",!1,e)}(n=e).addCommand("mceInsertDate",function(e,t){p(n,null!=t?t:n.getParam("insertdatetime_dateformat",n.translate("%Y-%m-%d")))}),n.addCommand("mceInsertTime",function(e,t){p(n,null!=t?t:l(n))}),u=s(r=e),t=0<(o=s(i=r)).length?o[0]:l(i),a=t,c={get:function(){return a},set:function(e){a=e}},r.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",select:function(e){return e===c.get()},fetch:function(e){e(g.map(u,function(e){return{type:"choiceitem",text:d(r,e),value:e}}))},onAction:function(e){m(c.get())},onItemAction:function(e,t){c.set(t),m(t)}}),r.ui.registry.addNestedMenuItem("insertdatetime",{icon:"insert-time",text:"Date/time",getSubmenuItems:function(){return g.map(u,function(e){return{type:"menuitem",text:d(r,e),onAction:(t=e,function(){c.set(t),m(t)})};var t})}})})}();
|
|
@@ -4,14 +4,14 @@
|
|
|
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 global
|
|
14
|
+
var global = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
|
15
15
|
|
|
16
16
|
var getFontSizeFormats = function (editor) {
|
|
17
17
|
return editor.getParam('fontsize_formats');
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
var overrideFormats = function (editor) {
|
|
36
|
-
var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table', fontSizes = global
|
|
36
|
+
var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table', fontSizes = global.explode(getFontSizeStyleValues(editor)), schema = editor.schema;
|
|
37
37
|
editor.formatter.register({
|
|
38
38
|
alignleft: {
|
|
39
39
|
selector: alignElements,
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
toggle: false,
|
|
136
136
|
attributes: {
|
|
137
137
|
size: function (vars) {
|
|
138
|
-
return String(global
|
|
138
|
+
return String(global.inArray(fontSizes, vars.value) + 1);
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
},
|
|
@@ -154,13 +154,13 @@
|
|
|
154
154
|
clear_child_styles: true
|
|
155
155
|
}
|
|
156
156
|
});
|
|
157
|
-
global
|
|
157
|
+
global.each('b,i,u,strike'.split(','), function (name) {
|
|
158
158
|
schema.addValidElements(name + '[*]');
|
|
159
159
|
});
|
|
160
160
|
if (!schema.getElementRule('font')) {
|
|
161
161
|
schema.addValidElements('font[face|size|color|style]');
|
|
162
162
|
}
|
|
163
|
-
global
|
|
163
|
+
global.each(alignElements.split(','), function (name) {
|
|
164
164
|
var rule = schema.getElementRule(name);
|
|
165
165
|
if (rule) {
|
|
166
166
|
if (!rule.attributes.align) {
|
|
@@ -189,7 +189,7 @@
|
|
|
189
189
|
};
|
|
190
190
|
|
|
191
191
|
function Plugin () {
|
|
192
|
-
global.add('legacyoutput', function (editor) {
|
|
192
|
+
global$1.add('legacyoutput', function (editor) {
|
|
193
193
|
setup(editor);
|
|
194
194
|
});
|
|
195
195
|
}
|
|
@@ -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";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Tools"),
|
|
9
|
+
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Tools");e.add("legacyoutput",function(e){var s,t;(t=s=e).settings.inline_styles=!1,t.getParam("fontsize_formats")||(t.settings.fontsize_formats="8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7"),t.getParam("font_formats")||(t.settings.font_formats="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats"),s.on("PreInit",function(){var e=s,t="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table",i=l.explode(e.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large")),a=e.schema;e.formatter.register({alignleft:{selector:t,attributes:{align:"left"}},aligncenter:{selector:t,attributes:{align:"center"}},alignright:{selector:t,attributes:{align:"right"}},alignjustify:{selector:t,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all",preserve_attributes:["class","style"]},{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all",preserve_attributes:["class","style"]},{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",toggle:!1,attributes:{face:"%value"}},fontsize:{inline:"font",toggle:!1,attributes:{size:function(e){return String(l.inArray(i,e.value)+1)}}},forecolor:{inline:"font",attributes:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0}}),l.each("b,i,u,strike".split(","),function(e){a.addValidElements(e+"[*]")}),a.getElementRule("font")||a.addValidElements("font[face|size|color|style]"),l.each(t.split(","),function(e){var t=a.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))})})})}();
|