/** * 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.9.2 (2021-09-08) */ !function(){"use strict";function i(e){var t=e;return{get:function(){return t},set:function(e){t=e}}}function _(e){return e.getParam("fullpage_hide_in_source_view")}function b(e){return e.getParam("fullpage_default_encoding")}function k(e){return e.getParam("fullpage_default_font_family")}function x(e){return e.getParam("fullpage_default_font_size")}function C(e,t){return n({validate:!1,root_name:"#document"},e.schema).parse(t,{format:"xhtml"})}function c(u,m){u.addCommand("mceFullPageProperties",function(){var l,i,o,e,t,n,r,a,c,s;function d(e,t){return e.attr(t)||""}t=l=u,n=(i=m).get(),c=C(t,n),(s={}).fontface=k(t),s.fontsize=x(t),7===(r=c.firstChild).type&&(s.xml_pi=!0,(a=/encoding="([^"]+)"/.exec(r.value))&&(s.docencoding=a[1])),(r=c.getAll("#doctype")[0])&&(s.doctype=""),(r=c.getAll("title")[0])&&r.firstChild&&(s.title=r.firstChild.value),w.each(c.getAll("meta"),function(e){var t,n=e.attr("name"),l=e.attr("http-equiv");n?s[n.toLowerCase()]=e.attr("content"):"Content-Type"===l&&(t=/charset\s*=\s*(.*)\s*/gi.exec(e.attr("content")))&&(s.docencoding=t[1])}),(r=c.getAll("html")[0])&&(s.langcode=d(r,"lang")||d(r,"xml:lang")),s.stylesheets=[],w.each(c.getAll("link"),function(e){"stylesheet"===e.attr("rel")&&s.stylesheets.push(e.attr("href"))}),(r=c.getAll("body")[0])&&(s.langdir=d(r,"dir"),s.style=d(r,"style"),s.visited_color=d(r,"vlink"),s.link_color=d(r,"link"),s.active_color=d(r,"alink")),o=s,e=g(g({},{title:"",keywords:"",description:"",robots:"",author:"",docencoding:""}),o),l.windowManager.open({title:"Metadata and Document Properties",size:"normal",body:{type:"panel",items:[{name:"title",type:"input",label:"Title"},{name:"keywords",type:"input",label:"Keywords"},{name:"description",type:"input",label:"Description"},{name:"robots",type:"input",label:"Robots"},{name:"author",type:"input",label:"Author"},{name:"docencoding",type:"input",label:"Encoding"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:e,onSubmit:function(e){var t=e.getData(),n=function(e,o,t){function n(e,t,n){e.attr(t,n||void 0)}function r(e){s.firstChild?s.insert(e,s.firstChild):s.append(e)}var a,l,i=e.dom,c=C(e,t),s=c.getAll("head")[0];s||(a=c.getAll("html")[0],s=new f("head",1),a.firstChild?a.insert(s,a.firstChild,!0):a.append(s)),a=c.firstChild,o.xml_pi?(l='version="1.0"',o.docencoding&&(l+=' encoding="'+o.docencoding+'"'),7!==a.type&&(a=new f("xml",7),c.insert(a,c.firstChild,!0)),a.value=l):a&&7===a.type&&a.remove(),a=c.getAll("#doctype")[0],o.doctype?(a||(a=new f("#doctype",10),o.xml_pi?c.insert(a,c.firstChild):r(a)),a.value=o.doctype.substring(9,o.doctype.length-1)):a&&a.remove(),a=null,w.each(c.getAll("meta"),function(e){"Content-Type"===e.attr("http-equiv")&&(a=e)}),o.docencoding?(a||((a=new f("meta",1)).attr("http-equiv","Content-Type"),a.shortEnded=!0,r(a)),a.attr("content","text/html; charset="+o.docencoding)):a&&a.remove(),a=c.getAll("title")[0],o.title?(a?a.empty():r(a=new f("title",1)),a.append(new f("#text",3)).value=o.title):a&&a.remove(),w.each("keywords,description,author,copyright,robots".split(","),function(e){for(var t,n=c.getAll("meta"),l=o[e],i=0;i"))}(l,w.extend(o,t),i.get());i.set(n),e.close()}})})}function A(e){return e.replace(/<\/?[A-Z]+/g,function(e){return e.toLowerCase()})}function s(e,t,n,l){var i,o,r,a,c,s,d,u,m,g,f,p,h,y="",v=e.dom;l.selection||(a=e.getParam("protect"),c=l.content,w.each(a,function(e){c=c.replace(e,function(e){return"\x3c!--mce:protected "+escape(e)+"--\x3e"})}),r=c,"raw"===l.format&&t.get()||l.source_view&&_(e)||(-1!==(i=(r=(r=0!==r.length||l.source_view?r:w.trim(t.get())+"\n"+w.trim(r)+"\n"+w.trim(n.get())).replace(/<(\/?)BODY/gi,"<$1body")).indexOf("",i),t.set(A(r.substring(0,i+1))),-1===(o=r.indexOf("\n'),p+=g.getParam("fullpage_default_doctype",""),p+="\n\n\n",(f=g.getParam("fullpage_default_title"))&&(p+=""+f+"\n"),(f=b(g))&&(p+='\n'),(f=k(g))&&(h+="font-family: "+f+";"),(f=x(g))&&(h+="font-size: "+f+";"),(f=g.getParam("fullpage_default_text_color"))&&(h+="color: "+f+";"),p+="\n\n")),n.set("\n\n")),s=C(e,t.get()),P(s.getAll("style"),function(e){e.firstChild&&(y+=e.firstChild.value)}),(d=s.getAll("body")[0])&&v.setAttribs(e.getBody(),{style:d.attr("style")||"",dir:d.attr("dir")||"",vLink:d.attr("vlink")||"",link:d.attr("link")||"",aLink:d.attr("alink")||""}),v.remove("fullpage_styles"),u=e.getDoc().getElementsByTagName("head")[0],y&&v.add(u,"style",{id:"fullpage_styles"}).appendChild(document.createTextNode(y)),m={},w.each(u.getElementsByTagName("link"),function(e){"stylesheet"===e.rel&&e.getAttribute("data-mce-fullpage")&&(m[e.href]=e)}),w.each(s.getAll("link"),function(e){var t=e.attr("href");if(!t)return!0;m[t]||"stylesheet"!==e.attr("rel")||v.add(u,"link",{rel:"stylesheet",text:"text/css",href:t,"data-mce-fullpage":"1"}),delete m[t]}),w.each(m,function(e){e.parentNode.removeChild(e)})))}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),g=function(){return(g=Object.assign||function(e){for(var t,n=1,l=arguments.length;n/g,function(e,t){return unescape(t)}))})})}();