Файловый менеджер - Редактировать - /home/kunzqhe/photostocker/wp-content/themes/themify-ultra/themify/themify-builder/js/editor/themify-builder-page.min.js
Назад
let ThemifyBuilderPage;((_,w,v)=>{"use strict";const n={credentials:"omit",method:"GET",mode:"cors"},m=new IntersectionObserver((i,r)=>{for(let n=i.length-1;-1<n;--n)if(!0===i[n].isIntersecting){r.unobserve(i[n].target);let e=i[n].target,t=new Image(300,348),s=w.createElement("div"),l=e.tfTag("img")[0],a=l.dataset.src;s.className="tf_loader tf_abs_c",t.decoding="async",t.src=a,t.title=t.alt=l.alt,e.appendChild(s),t.decode().catch(()=>{}).finally(()=>{l.replaceWith(t),s.remove()})}},{threshold:.1});ThemifyBuilderPage={el:null,layoutsList(){return _.fetch("",null,n,v.paths.predesigned.url)},publish(e){return e.set("nonce",v.nonce),e.set("action","tb_builder_page_publish"),_.fetch(e).then(e=>{if(!e.success)throw e.error;window.location=e.data})},getIcon(e){const t="http://www.w3.org/2000/svg",s=w.createElementNS(t,"use"),l=w.createElementNS(t,"svg");return e="tf-"+e.trim().replace(" ","-"),l.setAttribute("class","tf_fa "+e),s.setAttributeNS(null,"href","#"+e),l.appendChild(s),l},renderLayouts(n){const e=w.createElement("canvas").toDataURL("image/webp").includes("data:image/webp"),i=e?"webp":"png",r="https://via.placeholder.com/300x348."+i+"?text=",o=new Set,c=v.i18n.preview,d=this.getIcon("ti-search"),h=w.createDocumentFragment(),p=w.createDocumentFragment(),t=w.createElement("li");t.textContent=v.i18n.all,p.appendChild(t),n.unshift({slug:"blank",title:v.i18n.blank});for(let a=0,e=n.length;a<e;++a){let e=w.createElement("li"),t=w.createElement("div"),s=w.createElement("div"),l=new Image(300,348);if(n[a].category&&(e.dataset.category=n[a].category),e.dataset.slug=n[a].slug,t.className="thumb tf_rel",l.loading="lazy",l.decoding="async",l.src="blank"===n[a].slug?_.builder_url+"img/blank-layout."+i:r+encodeURI(n[a].title),l.alt=l.title=n[a].title,n[a].thumbnail&&(l.dataset.src=n[a].thumbnail,m.observe(t)),s.className="title",s.textContent=n[a].title,void 0!==n[a].url){let e=w.createElement("a");e.className="link tf_box",e.href=n[a].url,e.target="_blank",e.title=c,e.appendChild(d.cloneNode(!0)),t.appendChild(e)}if(t.appendChild(l),e.append(t,s),h.appendChild(e),n[a].category){let s=n[a].category.toString().split(",");for(let t=0,e=s.length;t<e;++t)if(""!==s[t]&&!o.has(s[t])){let e=w.createElement("li");e.textContent=s[t],p.appendChild(e),o.add(s[t])}}}return{items:h,cats:p}},dropDown(){return _.fetch({action:"tb_builder_page_dropdown",nonce:v.nonce},"html")},render(e,t){const s=w.createElement("form"),l=w.createElement("div"),a=w.createElement("button"),n=w.createElement("button"),i=w.createElement("span"),r=w.createElement("div"),o=w.createElement("input"),c=w.createElement("div"),d=w.createElement("div"),h=w.createElement("div"),p=w.createElement("button"),m=w.createElement("ul"),f=w.createElement("input"),u=w.createElement("div"),g=w.createElement("ul"),y=this.renderLayouts(e),b=_.click;s.method="POST",s.className="tf_h",l.className="top",u.className="wrapper tf_scrollbar tf_overflow tf_box",a.type="submit",p.type=n.type="button",a.className="submit",n.className="tf_close",f.type=o.type="text",r.className="header",o.className="post_title",o.name="post_title",o.required=!0,c.className="parent",d.className="sticky",h.className="category tf_rel",p.className="filter_label tf_rel",m.className="filter tf_scrollbar tf_abs_t tf_overflow tf_opacity tf_box",f.className="search",g.className="content",i.textContent=v.i18n.cancel,a.textContent=v.i18n.publish,p.textContent=v.i18n.all,o.placeholder=v.i18n.title,f.placeholder=v.i18n.search,n.appendChild(i),s.tfOn("submit",e=>{e.preventDefault(),this.submit(e.currentTarget)}),f.tfOn("input",e=>{this.filter(m.firstElementChild),this.search(e.currentTarget.value)},{passive:!0}),m.tfOn(b,e=>{"LI"===e.target.tagName&&(this.clearSearch(e.target),this.filter(e.target))},{passive:!0}),n.tfOn(b,e=>{this.close()},{passive:!0}),g.tfOn(b,e=>{const t=e.target.closest("li");t&&this.select(t)},{passive:!0}),l.append(n,a),c.appendChild(t),r.append(o,c),m.appendChild(y.cats),h.append(p,m),d.append(h,f),g.appendChild(y.items),u.append(r,d,g),s.append(l,u),this.el.classList.add("tf_abs_c","tf_overflow","tf_box"),this.el.appendChild(s),setTimeout(()=>{o.focus()},30)},submit(e){const a=new FormData(e),t=a.get("post_title");if(t){let l=this.el.tfClass("selected")[0];if(l=l&&l.dataset.slug,this.showLoader(),l&&"blank"!==l){const s=v.paths.predesigned.single.replace("{SLUG}",l);_.fetch("",null,n,s).then(e=>{const t={builder_data:e},s=e=>{a.set("layout",JSON.stringify(e)),this.publish(a).finally(()=>{this.showLoader("hide"),this.close()})};JSON.stringify(e).includes("global_styles")?_.fetch("",null,n,v.paths.predesigned.single.replace("{SLUG}",l+"-gs")).then(e=>{t.used_gs=e}).finally(()=>{s(t)}):s(t)}).catch(()=>{this.showLoader("hide"),alert(v.i18n.layout_error.replace("{FILE}",s))})}else this.publish(a).finally(()=>{this.showLoader("hide"),this.close()})}},showLoader(e="show"){this.el.getRootNode().querySelector(".spinner").style.display="show"===e?"":"none"},show(){this.el.style.setProperty("transform","translate(-50%, 100%)"),this.el.style.display="",setTimeout(()=>{this.el.style.setProperty("transform","")},20)},close(){this.el.tfOn("transitionend",function(){this.style.display="none"},{passive:!0,once:!0}).style.setProperty("transform","translate(-50%, 100%)")},filter(t){if(!t.classList.contains("current")){const l=this.el.tfClass("content")[0].children,e=t.classList.contains("all"),s=t.parentNode,a=t.textContent,n=s.children;for(let s=l.length-1;-1<s;--s){let t=e;if(!t){let e=l[s].getAttribute("data-category");e&&(t=a===e||e.includes(a))}l[s].style.display=t?"":"none"}for(let e=n.length-1;-1<e;--e)n[e].classList.toggle("current",n[e]===t);s.parentNode.tfClass("filter_label")[0].textContent=a}},search(t){t=t.trim().toUpperCase();const s=this.el.tfClass("title");for(let e=s.length-1;-1<e;--e)s[e].parentNode.style.display=""===t||0===s[e].textContent.toUpperCase().indexOf(t)?"":"none"},clearSearch(){const e=this.el.tfClass("search")[0];e.value="",_.triggerEvent(e,"input")},select(e){const t=this.el.tfClass("selected")[0];t&&t.classList.remove("selected"),e.classList.add("selected")},async run(e){if(!this.el){this.el=e;const t=await Promise.all([this.layoutsList(),this.dropDown(),_.fonts("ti-search")]),s=this.el.getRootNode();s.prepend(s.host.ownerDocument.getElementById("tf_svg").cloneNode(!0)),this.render(t[0],t[1]),this.showLoader("hide")}this.el.style.display&&this.show()}}})(Themify,document,tbBuilderPage);
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка