/** * 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.0.4 (2019-04-23) */ !function(){"use strict";var e,t,n,r,a,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(e){return function(){return e}},i=u(!1),c=u(!0),p=tinymce.util.Tools.resolve("tinymce.util.Tools"),m=tinymce.util.Tools.resolve("tinymce.util.XHR"),l=function(e){return e.getParam("template_cdate_classes","cdate")},s=function(e){return e.getParam("template_mdate_classes","mdate")},f=function(e){return e.getParam("template_selected_content_classes","selcontent")},d=function(e){return e.getParam("template_preview_replace_values")},g=function(e){return e.getParam("template_replace_values")},y=function(e){return e.templates},h=function(e){return e.getParam("template_cdate_format",e.translate("%Y-%m-%d"))},v=function(e){return e.getParam("template_mdate_format",e.translate("%Y-%m-%d"))},b=function(e,t){if((e=""+e).length":">","&":"&","'":"'"},E=function(e){return e.replace(/["'<>&]/g,function(e){return(t=F,n=e,q(t,n)?J.from(t[n]):J.none()).getOr(e);var t,n})},R=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=t.settings.body_class||"";-1!==r.indexOf("=")&&(r=(r=t.getParam("body_class","","hash"))[t.id]||""),e=""+n+''+e+""}return x(e,d(t))}(l,n),a=[{type:"selectbox",name:"template",label:"Templates",items:u},{type:"htmlpanel",html:'

'+E(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..."),f(o[0]).then(function(e){c(t,o[0],e)})})},z=function(t){return function(e){R(t,e)}},B=function(e){e.ui.registry.addButton("template",{icon:"template",tooltip:"Insert template",onAction:S(e.settings,z(e))}),e.ui.registry.addMenuItem("template",{icon:"template",text:"Insert template...",onAction:S(e.settings,z(e))})};o.add("template",function(e){B(e),w(e),D(e)}),function U(){}}();