/** * 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.12 (2019-07-18) */ !function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(e){return function(){return e}};var n,r,a,o,u,c=t(!1),i=t(!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},v=function(e){return e.getParam("template_cdate_format",e.translate("%Y-%m-%d"))},h=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=B,n=e,F(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]||"");var a=t.dom.encode,o=t.getBody().dir,u=o?' dir="'+a(o)+'"':"";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(c(a,o)),e.focus("template")},t=l.windowManager.open(c([],{template:"",preview:""}));t.block("Loading..."),f(o[0]).then(function(e){i(t,o[0],e)})})},z=function(t){return function(e){R(t,e)}},U=function(e){e.ui.registry.addButton("template",{icon:"template",tooltip:"Insert template",onAction:_(e.settings,z(e))}),e.ui.registry.addMenuItem("template",{icon:"template",text:"Insert template...",onAction:_(e.settings,z(e))})};!function W(){e.add("template",function(e){U(e),w(e),D(e)})}()}();