mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-12 09:40:45 +01:00
1 line
14 KiB
JavaScript
1 line
14 KiB
JavaScript
|
!function(){"use strict";var o,e=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=Object.prototype.hasOwnProperty,g=(o=function(e,t){return t},function(){for(var e=new Array(arguments.length),t=0;t<e.length;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Can't merge zero objects");for(var r={},i=0;i<e.length;i++){var n=e[i];for(var a in n)c.call(n,a)&&(r[a]=o(r[a],n[a]))}return r}),w=tinymce.util.Tools.resolve("tinymce.util.Tools"),b=function(e){return e.getParam("media_scripts")},v=function(e){return e.getParam("audio_template_callback")},y=function(e){return e.getParam("video_template_callback")},a=function(e){return e.getParam("media_live_embeds",!0)},t=function(e){return e.getParam("media_filter_html",!0)},s=function(e){return e.getParam("media_url_resolver")},x=function(e){return e.getParam("media_alt_source",!0)},j=function(e){return e.getParam("media_poster",!0)},C=function(e){return e.getParam("media_dimensions",!0)},m=tinymce.util.Tools.resolve("tinymce.html.SaxParser"),r=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),_=function(e,t){if(e)for(var r=0;r<e.length;r++)if(-1!==t.indexOf(e[r].filter))return e[r]},i=function(t){return function(e){return e?e.style[t].replace(/px$/,""):""}},n=function(i){return function(e,t){var r;e&&(e.style[i]=/^[0-9.]+$/.test(r=t)?r+"px":r)}},M={getMaxWidth:i("maxWidth"),getMaxHeight:i("maxHeight"),setMaxWidth:n("maxWidth"),setMaxHeight:n("maxHeight")},u=r.DOM,l=function(e){return u.getAttrib(e,"data-ephox-embed-iri")},A=function(e,t){return c=t,s=u.createFragment(c),""!==l(s.firstChild)?(a=t,o=u.createFragment(a).firstChild,{type:"ephox-embed-iri",source1:l(o),source2:"",poster:"",width:M.getMaxWidth(o),height:M.getMaxHeight(o)}):(i=e,r=t,m({validate:(n={},!1),allow_conditional_comments:!0,special:"script,noscript",start:function(e,t){if(n.source1||"param"!==e||(n.source1=t.map.movie),"iframe"!==e&&"object"!==e&&"embed"!==e&&"video"!==e&&"audio"!==e||(n.type||(n.type=e),n=w.extend(t.map,n)),"script"===e){var r=_(i,t.map.src);if(!r)return;n={type:"script",source1:t.map.src,width:r.width,height:r.height}}"source"===e&&(n.source1?n.source2||(n.source2=t.map.src):n.source1=t.map.src),"img"!==e||n.poster||(n.poster=t.map.src)}}).parse(r),n.source1=n.source1||n.src||n.data,n.source2=n.source2||"",n.poster=n.poster||"",n);var i,r,n,a,o,c,s},d=tinymce.util.Tools.resolve("tinymce.util.Promise"),F=function(e){var t={mp3:"audio/mpeg",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",swf:"application/x-shockwave-flash"}[e.toLowerCase().split(".").pop()];return t||""},h=tinymce.util.Tools.resolve("tinymce.html.Writer"),p=tinymce.util.Tools.resolve("tinymce.html.Schema"),f=r.DOM,P=function(e,t){var r,i,n,a;for(r in t)if(n=""+t[r],e.map[r])for(i=e.length;i--;)(a=e[i]).name===r&&(n?(e.map[r]=n,a.value=n):(delete e.map[r],e.splice(i,1)));else n&&(e.push({name:r,value:n}),e.map[r]=n)},k=function(e,t){var r,i,n=f.createFragment(e).firstChild;return M.setMaxWidth(n,t.width),M.setMaxHeight(n,t.height),r=n.outerHTML,i=h(),m(i).parse(r),i.getContent()},$=function(e,t,r){return u=e,l=f.createFragment(u),""!==f.getAttrib(l.firstChild,"data-ephox-embed-iri")?k(e,t):(i=e,n=t,a=r,c=h(),m({validate:!1,allow_conditional_comments:!(s=0),special:"script,noscript",comment:function(e){c.comment(e)},cdata:function(e){c.cdata(e)},text:function(e,t){c.text(e,t)},start:function(e,t,r){switch(e){case"video":case"object":case"embed":case"img":case"iframe":n.height!==undefined&&n.width!==undefined&&P(t,{width:n.width,height:n.height})}if(a)switch(e){case"video":P(t,{poster:n.poster,src:""}),n.source2&&P(t,{src:""});break;case"iframe":P(t,{src:n.source1});break;case"source":if(++s<=2&&(P(t,{src:n["source"+s],type:n["source"+s+"mime"]}),!n["source"+s]))return;break;case"img":if(!n.poster)return;o=!0}c.start(e,t,r)},end:function(e){if("video"===e&&a)for(var t=1;t<=2;t++)if(n["source"+t]){var r=[];r.map={},s<t&&(P(r,{src:n["source"+t],type:n["source"+t+"mime"]}),c.start("source",r,!0))}if(n.poster&&"object"===e&&a&&!o){var i=[];i.map={},P(i,{src:n.poster,width:n.width,height:n.height}),c.start(
|