@tabler/core
Version:
Premium and Open Source dashboard template with responsive and high quality UI.
7 lines • 1.92 kB
JavaScript
/**
* HugeRTE version 1.0.9 (2025-03-15)
* Copyright (c) 2022 Ephox Corporation DBA Tiny Technologies, Inc.
* Copyright (c) 2024 HugeRTE contributors
* Licensed under the MIT license (https://github.com/hugerte/hugerte/blob/main/LICENSE.TXT)
*/
!function(){"use strict";var e=hugerte.util.Tools.resolve("hugerte.PluginManager"),t=hugerte.util.Tools.resolve("hugerte.Env"),o=hugerte.util.Tools.resolve("hugerte.util.Tools");const n=e=>t=>t.options.get(e),s=n("content_style"),i=n("content_css_cors"),r=n("body_class"),l=n("body_id");e.add("preview",(e=>{(e=>{e.addCommand("mcePreview",(()=>{(e=>{const n=(e=>{var n;let a="";const c=e.dom.encode,d=null!==(n=s(e))&&void 0!==n?n:"";a+='<base href="'+c(e.documentBaseURI.getURI())+'">';const m=i(e)?' crossorigin="anonymous"':"";o.each(e.contentCSS,(t=>{a+='<link type="text/css" rel="stylesheet" href="'+c(e.documentBaseURI.toAbsolute(t))+'"'+m+">"})),d&&(a+='<style type="text/css">'+d+"</style>");const u=l(e),v=r(e),y='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A" && !('+(t.os.isMacOS()||t.os.isiOS()?"e.metaKey":"e.ctrlKey && !e.altKey")+")) {e.preventDefault();}}}, false);<\/script> ",p=e.getBody().dir,g=p?' dir="'+c(p)+'"':"";return"<!DOCTYPE html><html><head>"+a+'</head><body id="'+c(u)+'" class="mce-content-body '+c(v)+'"'+g+">"+e.getContent()+y+"</body></html>"})(e);e.windowManager.open({title:"Preview",size:"large",body:{type:"panel",items:[{name:"preview",type:"iframe",sandboxed:!0,transparent:!1}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{preview:n}}).focus("close")})(e)}))})(e),(e=>{const t=()=>e.execCommand("mcePreview");e.ui.registry.addButton("preview",{icon:"preview",tooltip:"Preview",onAction:t}),e.ui.registry.addMenuItem("preview",{icon:"preview",text:"Preview",onAction:t})})(e)}))}();