bludit/bl-plugins/tinymce/tinymce/plugins/media/plugin.min.js

9 lines
17 KiB
JavaScript
Raw Normal View History

2019-04-23 19:05:23 +02:00
/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*
2020-06-07 14:41:53 +02:00
* Version: 5.3.1 (2020-05-27)
2019-04-23 19:05:23 +02:00
*/
2020-05-26 17:10:21 +02:00
!function(){"use strict";var e,t,r,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),p=function(){return(p=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},a=function(e){return function(){return e}},o=a(!1),c=a(!0),i=function(){return u},u=(e=function(e){return e.isNone()},{fold:function(e,t){return e()},is:o,isSome:o,isNone:c,getOr:r=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:a(null),getOrUndefined:a(undefined),or:r,orThunk:t,map:i,each:function(){},bind:i,exists:o,forall:c,filter:i,equals:e,equals_:e,toArray:function(){return[]},toString:a("none()")}),s=function(r){var e=a(r),t=function(){return i},n=function(e){return e(r)},i={fold:function(e,t){return t(r)},is:function(e){return r===e},isSome:c,isNone:o,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return s(e(r))},each:function(e){e(r)},bind:n,exists:n,forall:n,filter:function(e){return e(r)?i:u},toArray:function(){return[r]},toString:function(){return"some("+r+")"},equals:function(e){return e.is(r)},equals_:function(e,t){return e.fold(o,function(e){return t(r,e)})}};return i},l={some:s,none:i,from:function(e){return null===e||e===undefined?u:s(e)}},m=function(n){return function(e){return r=typeof(t=e),(null===t?"null":"object"==r&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==r&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":r)===n;var t,r}},d=m("string"),h=m("object"),g=m("array"),v=Array.prototype.push,f=function(e,t){for(var r=0,n=e.length;r<n;r++){t(e[r],r)}},w=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},b=Object.keys,y=Object.hasOwnProperty,x=function(e,t){return j(e,t)?l.from(e[t]):l.none()},j=function(e,t){return y.call(e,t)},O=function(e){return e.getParam("media_scripts")},S=tinymce.util.Tools.resolve("tinymce.util.Tools"),_=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),k=tinymce.util.Tools.resolve("tinymce.html.SaxParser"),A=function(e,t){if(e)for(var r=0;r<e.length;r++)if(-1!==t.indexOf(e[r].filter))return e[r]},T=_.DOM,C=function(e){return e.replace(/px$/,"")},P=function(o,e){var c=w(!1),u={};return k({validate:!1,allow_conditional_comments:!0,start:function(e,t){if(!c.get())if(j(t.map,"data-ephox-embed-iri"))c.set(!0),i=(n=t).map.style,a=i?T.parseStyle(i):{},u={type:"ephox-embed-iri",source:n.map["data-ephox-embed-iri"],altsource:"",poster:"",width:x(a,"max-width").map(C).getOr(""),height:x(a,"max-height").map(C).getOr("")};else{if(u.source||"param"!==e||(u.source=t.map.movie),"iframe"!==e&&"object"!==e&&"embed"!==e&&"video"!==e&&"audio"!==e||(u.type||(u.type=e),u=S.extend(t.map,u)),"script"===e){var r=A(o,t.map.src);if(!r)return;u={type:"script",source:t.map.src,width:String(r.width),height:String(r.height)}}"source"===e&&(u.source?u.altsource||(u.altsource=t.map.src):u.source=t.map.src),"img"!==e||u.poster||(u.poster=t.map.src)}var n,i,a}}).parse(e),u.source=u.source||u.src||u.data,u.altsource=u.altsource||"",u.poster=u.poster||"",u},D=function(e){var t={mp3:"audio/mpeg",m4a:"audio/x-m4a",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"}[e.toLowerCase().split(".").pop()];return t||""},$=tinymce.util.Tools.resolve("tinymce.html.Schema"),F=tinymce.util.Tools.resolve("tinymce.html.Writer"),M=_.DOM,z=function(e){return/^[0-9.]+$/.test(e)?e+"px":e},N=function(a,e){!function(e,t){for(var r=b(e),n=0,i=r.length;n<i;n++){var a=r[n];t(e[a],a)}}(e,function(e,t){var r=""+e;if(a.map[t])for(var n=a.length;n--;){var i=a[n];i.name===t&&(r?(a.map[t]=r,i.value=r):(delete a.map[t],a.splice(n,1)))}else r&&(a.push({name:t,value:r}),a.map[t]=r)})},U=["source","altsource"],E=function(e,c,u){var s,l=F(),m=w(!1),d=0;return k({validate:!1,allow_conditional_comments:!0,comment:function(e){l.comment(e)},cdata:func