/** * 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/ * * Version: 5.4.2 (2020-08-17) */ !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(){},o=function(e){return function(){return e}};var n,r,a,u=o(!1),i=o(!0),p=tinymce.util.Tools.resolve("tinymce.util.Tools"),c=tinymce.util.Tools.resolve("tinymce.util.XHR"),l=function(e){return e.getParam("template_mdate_classes","mdate")},s=function(e){return e.getParam("template_replace_values")},f=function(e){return e.getParam("template_mdate_format",e.translate("%Y-%m-%d"))},m=function(e,t){if((e=""+e).length":">","&":"&","'":"'"},A=function(e){return e.replace(/["'<>&]/g,function(e){return(D(t=C,n=e)?S.from(t[n]):S.none()).getOr(e);var t,n})},N=function(l,t){var e=function(e){return function(e,t){for(var n=e.length,r=new Array(n),a=0;a")){var n="";p.each(t.contentCSS,function(e){n+=''});var r=-1===(l=(i=t).getParam("body_class","","string")).indexOf("=")?l:(c=i).getParam("body_class","","hash")[c.id]||"",a=t.dom.encode,o=t.getBody().dir,u=o?' dir="'+a(o)+'"':"";e=""+n+'"+e+""}var i,c,l;return v(e,t.getParam("template_preview_replace_values"))}(l,n),a=[{type:"selectbox",name:"template",label:"Templates",items:u},{type:"htmlpanel",html:'

'+A(t.value.description)+"

"},{label:"Preview",type:"iframe",name:"preview",sandboxed:!1}],o={template:t.text,preview:r};e.unblock(),e.redial(i(a,o)),e.focus("template")},t=l.windowManager.open(i([],{template:"",preview:""}));t.block("Loading..."),m(o[0]).then(function(e){c(t,o[0],e)})["catch"](function(){c(t,o[0],""),t.disable("save"),f(t)})})},H=function(t){return function(e){N(t,e)}};!function k(){e.add("template",function(e){var t,r;(t=e).ui.registry.addButton("template",{icon:"template",tooltip:"Insert template",onAction:g(t,H(t))}),t.ui.registry.addMenuItem("template",{icon:"template",text:"Insert template...",onAction:g(t,H(t))}),M(e),(r=e).on("PreProcess",function(e){var t=r.dom,n=f(r);p.each(t.select("div",e.node),function(e){t.hasClass(e,"mceTmpl")&&(p.each(t.select("*",e),function(e){t.hasClass(e,l(r).replace(/\s+/g,"|"))&&(e.innerHTML=d(r,n))}),h(r,e))})})})}()}();