Файловый менеджер - Редактировать - /home/kunzqhe/photostocker/wp-content/themes/themify-ultra/themify/js/admin/modules/lottie-library.min.js
Назад
let TF_LottieLibrary;((w,y,m)=>{"use strict";let v,N,C=new WeakMap,a;TF_LottieLibrary={run(e,t,s){return this.input=e,this.bg=m,this.nonce=s,this.labels=t,this.show(e.value)},async render(){if(!this.el){const a=y.click,l=w.createElement("button"),i=w.createElement("input"),n=w.createElement("div"),o=w.createElement("div"),r=w.createElement("div"),c=w.createElement("div"),d=w.createElement("a"),h=w.createElement("ul"),p=w.createElement("span"),f=w.createElement("div"),m=w.createElement("div"),g=w.createDocumentFragment(),u=[this.getJson()];this.el=w.createElement("div"),this.el.className="lightbox tf_hide",c.className="cat_wrap flex",d.href="javascript:;",d.tabIndex="-1",d.className="menu_icon flex tf_rel",h.className="menu tf_box tf_hidden tf_opacity tf_scrollbar",p.className="selected_cat",p.textContent=this.labels.all,i.type="search",i.className="search tf_box",i.required=!0,i.setAttribute("inputmode","search"),l.className="tf_close",r.className="menu_wrap flex tf_rel",f.className="container tf_scrollbar",f.style.display="none",m.className="pagination flex",(e=>{v=v||new IntersectionObserver((l,e)=>{for(let a=l.length-1;-1<a;--a){let t=l[a].target,s=C.get(t);if(1!=s){let e=s?.player||null;if(l[a].isIntersecting)if(t.style.contentVisibility="",e).1<=l[a].intersectionRatio?e.isPaused&&(e.show(),e.play()):e.isPaused||(e.pause(),e.hide());else{let e=new TF_Lottie(t.tfClass("lottie")[0],{type:"svg",actions:[{state:"none",path:t.dataset.id}]});C.set(t,1),e.run().then(()=>{if(!e.player||!TF_LottieLibrary.el)throw"";t.tfClass("tf_loader")[0].remove(),C.set(t,e),e.player.loop=!0,e.player.play()}).catch(()=>{C.delete(t,e),e.destroy(!0),t.remove()})}else t.style.contentVisibility="hidden",e&&!e.isPaused&&(e.pause(),e.hide())}}},{threshold:[0,.05,.1,.3,.5,.7,.8,.9,1],rootMargin:"150px 0px 150px 0px",root:e})})(f);let e=w.tfId("tf_lottie_root");if(e)e.style.display="none",e.shadowRoot.appendChild(this.el),await Promise.all(u);else{e=w.createElement("div");const _=w.createElement("div");e.id="tf_lottie_root",e.style.display="none",_.className="overlay tf_abs_t tf_opacity tf_w tf_h tf_opacity tf_hide",_.tfOn(a,e=>{e.stopPropagation(),this.close()},{passive:!0}),e.attachShadow({mode:"open"}).append(this.el,_),w.body.appendChild(e),u.push(y.loadCss(y.url+"css/base.min","tf_base-css",!1,this.el)),u.push(y.loadCss(y.url+"css/admin/lottie-library","tf_lottie-library",!1,this.el)),u.push(y.loadJs("https://cdnjs.cloudflare.com/ajax/libs/lottie-web/5.12.2/lottie.min.js",!!window.lottie,!1)),u.push(y.loadJs("lottie",!!window.TF_Lottie)),u.push(y.fonts(["ti-download","ti-file"])),await Promise.all(u),console.log(document,document.tfId("tf_svg")),this.el.before(document.tfId("tf_svg").cloneNode(!0)),y.loadJs(y.url+"js/admin/notification",!!window.TF_Notification)}const b=Object.keys(N);b.unshift("All");for(let t=0;t<b.length;++t){let e=w.createElement("li");0===t&&(e.dataset.all=1,e.classList.add("current")),e.textContent=b[t],g.appendChild(e)}n.className="bg_global bg_wrap tf_box",o.className="bg flex";for(let t=0,s=this.getBg();t<s.length;++t){let e=w.createElement("button");e.className=s[t],e.dataset.bg=t,e.type="button","white"===s[t]&&(e.className+=" selected_bg"),o.appendChild(e)}h.appendChild(g),d.appendChild(p),c.append(d,h),n.append(w.createTextNode(this.labels.bg),o,i),r.append(c,n),this.el.append(r,f,m,l),this.renderItems(),e.style.display="",l.tfOn(a,e=>{e.stopPropagation(),this.close()},{passive:!0}),m.tfOn(a,e=>{e.stopPropagation();let t=e.target.textContent;if(t&&"."!==t[0]){const s=this.el.tfClass("current")[0];this.renderItems(s.dataset.all?"":s.textContent,i.value,parseInt(t))}},{passive:!0}),o.tfOn(a,e=>{e.stopPropagation();const t=e.target;if(t&&t!==e.currentTarget){const l=t.dataset.bg,a=this.getBg(),i=this.getBg(l);for(let s=this.el.tfClass("bg"),a=s.length-1;-1<a;--a)for(let e=s[a].children,t=e.length-1;-1<t;--t)e[t].classList.toggle("selected_bg",l===e[t].dataset.bg);for(let e=this.el.tfClass("lottie"),s=e.length-1;-1<s;--s){let t=e[s].classList;for(let e=a.length;-1<e;--e)t.remove(a[e]);t.add(i)}this.bg=parseInt(l)}},{passive:!0}),f.tfOn(a,async e=>{e.stopPropagation();const s=e.target,a=s.closest(".lottie"),l=s.closest(".bg");if(s.closest(".dbtn")){const t=s.closest(".item"),i=t.dataset.id,n=await TF_Lottie.getJson(i),o=t.tfClass("title")[0].innerHTML.replaceAll(" ","-"),r=w.createElement("a"),c=new Blob([JSON.stringify(n)],{type:"application/json"});r.href=URL.createObjectURL(c),r.download=o+"-"+i,r.click()}else if(a)try{const d=this.input,h=a.closest(".item");d.value=await this.confirm(h.dataset.id,h.tfClass("title")[0].innerHTML),await this.close(),y.triggerEvent(d,"change")}catch(e){}else if(l&&l!==s){const a=l.closest(".item").tfClass("lottie")[0];for(let e=l.children,t=e.length-1;-1<t;--t)e[t].classList.toggle("selected_bg",s===e[t]),a.classList.remove(this.getBg(e[t].dataset.bg));a.classList.add(this.getBg(s.dataset.bg))}},{passive:!0}),h.tfOn(a,e=>{e.stopPropagation();const t=e.target,s=e.currentTarget;if(t.parentNode===s){const a=s.tfClass("current")[0],l=t.textContent;a===t&&!i.value||(i.value="",a.classList.remove("current"),t.classList.add("current"),this.el.tfClass("selected_cat")[0].textContent=l,this.renderItems(t.dataset.all?"":l))}},{passive:!0});let t,s;i.tfOn("input",e=>{e.stopPropagation(),t&&cancelAnimationFrame(t),s&&clearTimeout(s),s=setTimeout(()=>{t=requestAnimationFrame(()=>{t=null;const e=this.el.tfClass("current")[0];this.renderItems(e.dataset.all?"":e.textContent,i.value.trim())})},100)},{passive:!0}),f.style.display=""}},getBg(e){const t=["white","grey","black","red","green","blue"];return e!==m?t[e]:t},renderItems(e,i,t){t=t||1;const s=navigator.hardwareConcurrency,a=y.isTouch||!s||s<16?32:16<=s?48:40,l=(t-1)*a,n=this.el.tfClass("container")[0],o=this.el.tfClass("pagination")[0],h=w.createDocumentFragment(),r=new Set,c=e?[e]:Object.keys(N);let p=[];i=i&&i.toLowerCase(),n.style.scrollBehavior="auto",n.scrollTop=0,n.style.scrollBehavior="";for(let l=0;l<c.length;++l)for(let a in N[c[l]])if(!r.has(a)){r.add(a);let e=N[c[l]][a],t=e,s;if("string"!=typeof e&&(t=e.n,s=e.bg),!i||t.toLowerCase().includes(i)){let e={id:a,n:t};s!==m&&(e.bg=parseInt(s)),p.push(e)}}r.clear();const d=p.length,f=this.getBg();p=p.slice(l,l+a);for(let d=0;d<p.length;++d){let e=w.createElement("div"),t=w.createElement("div"),s=w.createElement("div"),a=w.createElement("div"),l=w.createElement("div"),i=w.createElement("div"),n=w.createElement("div"),o=w.createElement("button"),r=p[d],c=(this.bg!==m?this:r).bg;t.className="tf_loader",s.className="lottie flex tf_w tf_h ",s.className+=c!==m?this.getBg(c):"white",a.className="bg_wrap tf_box tf_w",l.className="bg flex";for(let t=0;t<f.length;++t){let e=w.createElement("button");e.className=f[t],e.dataset.bg=t,e.type="button",(c===t||c===m&&"white"===f[t])&&(e.className+=" selected_bg"),l.appendChild(e)}i.textContent=r.n,i.className="title tf_overflow tf_box tf_w tf_h tf_mw",26<r.n.length&&(i.title=r.n),n.className="download flex tf_abs_t",o.className="dbtn",o.title="Download",o.type="button",o.appendChild(this.getIcon("ti-download")),e.dataset.id=r.id,e.className="item tf_box",s.appendChild(t),a.append(w.createTextNode(this.labels.bg),l),n.appendChild(o),e.append(s,a,i,n),h.appendChild(e),v.observe(e)}p=null;for(let t=n.children,s=t.length-1;-1<s;--s){let e=C.get(t[s]);e&&(C.delete(e),1!=e)&&e.destroy(!0),v.unobserve(t[s]),t[s].remove()}n.appendChild(h),o.replaceChildren(this.getPagination(d,t,a))},getPagination(c,d,h){const p=w.createDocumentFragment();if(h<c){const f=Math.ceil(c/h),m=e=>{const t=w.createElement("span");return(t.textContent=e)===d&&(t.className="selected_page"),t},g=e=>{let t=" ... ";return 0===e?t="":1===e?t=" ":e<=10?t=" . ":e<=100&&(t=" .. "),w.createTextNode(t)};let e=1,t=d,s=1,a=d,l=4,i=4,n=w.createDocumentFragment(),o=w.createDocumentFragment(),r=1;while(1)if(l>=i?(n.append(g(s-e),m(s)),e=s,s+=r,--l):(o.prepend(m(a),g(t-a)),t=a,a-=r,--i),0===i&&(r*=10,s=(s+=r-1)-s%r,a-=a%r,l=i=3),s>a){if(p.append(n,g(t-e),o),t>d||f<=d)break;e=d,t=a=f,s=d+1,l=3,i=4,r=1}}return p},destroy(){const s=this.el.tfClass("item");for(let t=s.length-1;-1<t;--t){let e=C.get(s[t]);e&&(1!=e&&e.destroy(!0),C.delete(e))}v.disconnect(),this.el.remove(),C=new WeakMap,y.isTouch?N=null:a=setTimeout(()=>{N=a=null},6e4),v=this.el=this.input=this.bg=this.labels=this.nonce=null},show(s){return new Promise(async e=>{this.el||await this.render(s),a&&(clearTimeout(a),a=null);const t=this.el.getRootNode().querySelector(".overlay");t.classList.remove("tf_hide"),this.el.classList.remove("tf_hide"),requestAnimationFrame(()=>{this.el.tfOn("transitionend",e,{passive:!0,once:!0}),t.classList.remove("tf_opacity"),setTimeout(()=>{this.el.classList.add("show")},10)})})},confirm(h,p){return new Promise((t,s)=>{const a=w.createElement("div"),e=w.createElement("div"),l=w.createElement("div"),i=w.createElement("div"),n=w.createElement("button"),o=w.createElement("button"),r=w.createElement("button"),c=y.click,d=e=>{a.remove(),i.remove(),e?t(e):s()};e.className="msg",e.textContent=this.labels.msg,o.type=n.type=r.type="button",o.textContent=this.labels.upload_btn,r.textContent=this.labels.external_btn,n.className="tf_close",l.className="confirm_buttons flex",a.tfOn(c,async e=>{e.stopPropagation();let t=e.target,s="";if(!n.contains(t))if(t===o)s=await this.upload(h,p);else{if(t!==r)return;s=h}d(s)},{passive:!0}).className="confirm flex tf_abs_c tf_textc tf_box",i.tfOn(c,e=>{e.stopPropagation(),d("")},{passive:!0}).className="overlay confirm_overlay tf_abs_t tf_w tf_h",l.append(o,r),a.append(e,l,n),this.el.after(a,i)})},close(){return new Promise(t=>{this.el.getRootNode().querySelector(".overlay").tfOn("transitionend",function(){this.classList.add("tf_hide"),this.classList.remove("tf_opacity")},{passive:!0,once:!0}).classList.add("tf_opacity"),this.el.tfOn("transitionend",e=>{e.currentTarget.classList.add("tf_hide"),this.destroy(),t()},{passive:!0,once:!0}).classList.remove("show")})},getIcon(e,t){e="tf-"+e.trim().replace(" ","-");const s="http://www.w3.org/2000/svg",a=w.createElementNS(s,"use"),l=w.createElementNS(s,"svg");let i="tf_fa "+e;return t&&(i+=" "+t),l.setAttribute("class",i),a.setAttributeNS(null,"href","#"+e),l.appendChild(a),l},async upload(e,t){await TF_Notification.show("info",this.labels.upload_msg.replaceAll("%title%",t));const s=await TF_Lottie.getJson(e),a={action:"themify_upload_json",file:e,title:t||"",nonce:this.nonce,data:JSON.stringify(s)};let l;try{if(!(l=await y.fetch(a)).success)throw""}catch(e){try{if(a.data=new Blob([a.data],{type:"text/plain"}),!(l=await y.fetch(a)).success)throw l.data}catch(e){throw await TF_Notification.showHide("error",this.labels.upload_fail.replaceAll("%msg%",e)),e}}return await TF_Notification.showHide("done","",1e3),l.data},async getJson(){N=N||await y.fetch("","json",{credentials:"omit",method:"GET",mode:"cors"},"https://themify.org/public-api/lottie/index.json")}}})(window.top.document,Themify,void 0);
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка