Files
sean 0e8a8b3028
Some checks are pending
deploy-testing / deploy (push) Waiting to run
Initial testing snapshot
2026-11-17 16:15:01 -05:00

1 line
1.1 KiB
JavaScript

tinymce.PluginManager.add("preview",function(b){var a=b.settings;b.addCommand("mcePreview",function(){b.windowManager.open({title:"Preview",width:parseInt(b.getParam("plugin_preview_width","650"),10),height:parseInt(b.getParam("plugin_preview_height","500"),10),html:'<iframe src="javascript:\'\'" frameborder="0"></iframe>',buttons:{text:"Close",onclick:function(){this.parent().parent().close()}},onPostRender:function(){var g,d=this.getEl("body").firstChild.contentWindow.document,c="";tinymce.each(b.contentCSS,function(h){c+='<link type="text/css" rel="stylesheet" href="../../../../../admin/editors/tinymce/plugins/preview/'+b.documentBaseURI.toAbsolute(h)+'">'});var e=a.body_id||"tinymce";-1!=e.indexOf("=")&&(e=b.getParam("body_id","","hash"),e=e[b.id]||e);var f=a.body_class||"";-1!=f.indexOf("=")&&(f=b.getParam("body_class","","hash"),f=f[b.id]||""),g="<!DOCTYPE html><html><head>"+c+'</head><body id="'+e+'" class="mce-content-body '+f+'">'+b.getContent()+"</body></html>",d.open(),d.write(g),d.close()}})}),b.addButton("preview",{title:"Preview",cmd:"mcePreview"}),b.addMenuItem("preview",{text:"Preview",cmd:"mcePreview",context:"view"})});