Файловый менеджер - Редактировать - /home/kunzqhe/photostocker/wp-content/themes/themify-ultra/themify/themify-icon-picker/assets/script.min.js
Назад
let Themify_Icons;((g,v)=>{"use strict";let _;const y=new Map,b=g.isTouch?"pointerdown":"click",w=document.currentScript.src.replace("script.","styles.").replace(".js",".css"),C="http://www.w3.org/2000/svg",t=new Set;Themify_Icons={el:null,input:null,init(){v.tfOn(b,e=>{const t=e.target.closest(".themify_fa_toggle");t&&(e.preventDefault(),e.stopPropagation(),this.input=t.hasAttribute("data-target")?e.currentTarget.querySelector(t.getAttribute("data-target")):t.previousElementSibling,this.show(this.input.value))})},renderForm(m){return new Promise((e,t)=>{if(null===this.el){const s=v.createElement("div"),l=v.createElement("h3"),n=v.createElement("input"),a=v.createElement("button"),i=v.createElement("button"),o=v.createElement("div"),r=v.createElement("div"),c=v.createElement("div"),d=v.createElement("div"),p=v.createDocumentFragment(),h=v.createDocumentFragment(),f=v.createElement("div"),u=[];this.el=v.createElement("div"),this.el.className="lightbox tf_hide",s.className="top flex",l.className="title",l.textContent=tfIconPicker.title,n.type="text",n.className="search tf_box",n.required=!0,n.setAttribute("inputmode","search"),n.setAttribute("pattern",".*\\S.*"),n.placeholder=tfIconPicker.search,i.className="tf_close",a.type=i.type="button",a.className="clear tf_close",o.className="menu_wrap flex tf_rel",r.className="menu flex",c.className="container tf_overflow tf_scrollbar",d.className="overlay tf_abs_t tf_opacity tf_w tf_h tf_opacity tf_hide",f.id="tf_icons_root",f.style.display="none",f.attachShadow({mode:"open"}).append(this.el,d),(e=>{_=_||new IntersectionObserver((u,m)=>{let g=v.createDocumentFragment(),t=Themify_Icons.el.getRootNode(),e=t.querySelector("#svg"),_=[];for(let f=u.length-1;-1<f;--f)if(!0===u[f].isIntersecting){m.unobserve(u[f].target);let e=v.createElementNS(C,"use"),t=v.createElementNS(C,"svg"),s=v.createElementNS(C,"symbol"),l=v.createElementNS(C,"path"),n=u[f].target,a=n.dataset.icon,i=n.closest(".group").id,o=n.closest("section").dataset.id,r="tf-"+y.get(i).getFullIcon(a,o).replaceAll(" ","-"),c=n.dataset.w,d=n.dataset.vw,p=n.dataset.vh,h="0 0 ";h=(h+=void 0!==d&&""!==d?d:"32")+" "+(void 0!==p&&""!==p?p:"32"),s.id=r,s.setAttributeNS(null,"viewBox",h),l.setAttributeNS(null,"d",n.dataset.p),s.appendChild(l),g.appendChild(s),c&&_.push("."+r+"{width:"+c+"em}"),t.setAttribute("class",r),e.setAttributeNS(null,"href","#"+r),t.appendChild(e),n.append(t,v.createTextNode(a)),n.removeAttribute("data-p"),n.removeAttribute("data-w"),n.removeAttribute("data-vw")}if(0<_.length){let e=t.querySelector("#icon_style");null===e&&((e=v.createElement("style")).id="icon_style"),e.textContent+=_.join(""),t.prepend(e)}if(null===e){const s=v.createElementNS(C,"defs");(e=v.createElementNS(C,"svg")).id="svg",e.appendChild(s),t.prepend(e)}e.firstChild.appendChild(g)},{threshold:.2,root:e})})(c);for(let[l,n]of y){let e=v.createElement("label"),t=v.createElement("input"),s=v.createElement("div");t.type="radio",t.name="icon-font-group",t.value=l,s.className="group",e.className="flex",s.id=l,s.style.display="none",m!==l&&m||(m=m||!0,t.checked=!0,u.push(this.getGroup(l))),e.append(t,v.createTextNode(n.getTitle())),p.appendChild(e),h.appendChild(s)}r.appendChild(p),c.appendChild(h),c.tfOn(b,e=>{const t=e.target.closest("button");t&&(e.stopPropagation(),t.closest(".cat_menu")?(this.clearSearch(),this.filter(t)):t.dataset.icon&&(this.setIcon(t.dataset.icon,t.closest("section").dataset.id,t.closest(".group").id),this.close()))},{passive:!0}),i.tfOn(b,e=>{e.stopPropagation(),this.close()},{passive:!0}),d.tfOn(b,e=>{e.stopPropagation(),this.close()},{passive:!0}),a.tfOn(b,e=>{e.stopPropagation(),this.clearSearch()},{passive:!0}),r.tfOn("change",e=>{e.stopPropagation(),this.getGroup(e.target.value)},{passive:!0}),n.tfOn("input",e=>{e.stopPropagation(),this.filter(this.el.querySelector("#"+this.el.querySelector("input:checked").value+" .cat_menu .selected")),this.search(e.currentTarget.value)},{passive:!0}),s.append(l,i),o.append(r,n,a),this.el.append(s,o,c),u.push(g.loadCss(g.url+"css/base.min","tf_base-css",!1,this.el)),u.push(g.loadCss(w,null,!1,this.el)),v.body.appendChild(f),Promise.all(u).then(()=>{f.style.display="",e()}).catch(t)}else m?(this.el.querySelector('[value="'+m+'"]').checked=!0,this.getGroup(m).then(e).catch(t)):e()})},show(s){const l=null===this.el;let n;if(s)for(let[e,t]of y)if(t.isValid(s)){n=e;break}return l&&this.showLoader(),new Promise((t,e)=>{this.renderForm(n).then(()=>{const e=this.el.getRootNode().querySelector(".overlay");for(let e=this.el.tfClass("selected"),t=e.length-1;-1<t;--t)e[t].classList.remove("selected");e.classList.remove("tf_hide"),this.el.classList.remove("tf_hide"),requestAnimationFrame(()=>{this.el.tfOn("transitionend",()=>{if(s){let e=(s=this.el.querySelector("#"+n+' [data-icon="'+y.get(n).getSelectedIcon(s)+'"]')).closest(".group").tfClass("cat_menu")[0],t=10;e&&(t+=e.getBoundingClientRect().height),this.scrollTo(s,t),s.classList.add("selected")}t()},{passive:!0,once:!0}),e.classList.remove("tf_opacity"),setTimeout(()=>{this.el.classList.add("show")},10),l&&this.showLoader("done")})}).catch(e)})},getGroup(s){let e=Promise.resolve();return t.has(s)||(this.showLoader(),e=g.fetch({action:"tf_icon_get_by_type",type:s}).then(e=>{t.add(s),this.el.querySelector("#"+s).appendChild(y.get(s).createList(e))}).finally(()=>{this.showLoader("done")})),e.then(()=>{const t=this.el.tfClass("group");for(let e=t.length-1;-1<e;--e)t[e].style.display=s===t[e].id?"":"none"}),e},close(){return new Promise(e=>{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",function(){this.classList.add("tf_hide"),this.input=null,e()},{passive:!0,once:!0}).classList.remove("show")})},filter(s){if(s){const l=s.dataset.id,n=s.classList.contains("selected"),a=s.closest(".group");for(let t=a.tfTag("section"),s=0,e=t.length;s<e;++s){let e=t[s].classList;t[s].tfOn("transitionend",function(){this.classList.toggle("tf_hide",this.classList.contains("tf_opacity"))},{passive:!0,once:!0}),!n&&t[s].dataset.id!==l&&e.contains("tf_opacity")||(e.remove("tf_hide"),setTimeout(()=>{e.toggle("tf_opacity",!n&&t[s].dataset.id!==l)},10))}for(let e=s.parentNode.children,t=e.length-1;-1<t;--t)e[t].classList.toggle("selected",!n&&e[t]===s)}},clearSearch(){this.el.tfClass("search")[0].value="",this.search("")},search(e){const n=e.trim(),a=this.el.tfTag("section");for(let e=0,t=a.length;e<t;++e){let s=a[e].tfTag("button"),l=!1;for(let e=s.length,t=0;t<e;++t)0===s[t].dataset.icon.indexOf(n)?(l=!0,s[t].style.display=""):s[t].style.display="none";a[e].style.display=!1===l?"none":""}},showLoader(e="show"){if("undefined"!=typeof tb_app)return tb_app.Spinner.showLoader(e);let t=v.tfClass("tf_loader")[0];t||(this.setCss(),(t=v.createElement("div")).className="tf_loader tf_hide tf_abs_c",v.body.appendChild(t));const s=t.classList;"error"===e?s.add("tf_loader_error"):(s.remove("tf_loader_error"),s.toggle("tf_hide","show"!==e))},setCss(){let e="tf_select_icons_st",t=v.tfId(e);t||((t=v.createElement("style")).id=e,t.textContent=".tf_loader{width:62px;height:62px;background-color:rgba(0,0,0,.6);border-radius:50%;position:fixed;z-index:99999999;pointer-events:none;contain:strict}.tf_loader:before{border-color:transparent;border-top-color:#fff;border-width:5px}",v.body.appendChild(t))},setIcon(e,t,s,l){l=l||v;let n=this.el.getRootNode(),a=l.getElementById("tf_svg"),i=y.get(s).getFullIcon(e,t).trim(),o="tf-"+i.replaceAll(" ","-"),r=l.tfClass("tb_iframe")[0];if(this.input.value=i,!a){const c=l.createElementNS(C,"defs");(a=l.createElementNS(C,"svg")).id="tf_svg",a.appendChild(c),l.head.appendChild(a)}if(!a.querySelector("#"+o)){const d=n.querySelector("symbol#"+o).cloneNode(!0),p=n.querySelector("#icon_style");if(p){let s;for(let e=p.sheet.cssRules,t=e.length-1;-1<t;--t)if(e[t].selectorText==="."+o){s=".tf_fa"+e[t].cssText;break}if(s){let e=l.getElementById("tf_fonts_style");null===e&&((e=l.createElement("style")).id="tf_fonts_style",a.after(e)),e.textContent&&-1!==e.textContent.indexOf(o)||(e.textContent+=s)}}a.firstChild.appendChild(d)}r&&r.contentDocument&&this.setIcon(e,t,s,r.contentDocument),g.triggerEvent(this.input,"change")},scrollTo(e){e.scrollIntoView();const t=this.el.tfClass("tf_scrollbar")[0];t.scrollTop-=parseInt(t.offsetHeight/2)}};class e{constructor(e){y.set(e,this)}clearSearch(e){const t=e.closest(".tb_tab").tfClass("tb_layout_search")[0];t.value="",g.triggerEvent(t,"input")}getTitle(){return tfIconPicker.group[this.id]}getList(e){return e=e||this.id,g.fetch({action:"tf_icon_get_by_type",type:e})}createList(e){const o=e.cats,r=e.icons,c=v.createDocumentFragment();if(r&&void 0===r.EMPTY){let i=0;if(o){const l=Object.keys(o);if(1<(i=l.length)){const t=v.createElement("div"),n=v.createDocumentFragment();for(let s=0,e=i;s<e;++s){let e=v.createElement("button"),t=v.createElement("span");e.setAttribute("data-id",l[s]),e.type="button",t.textContent=o[l[s]],e.appendChild(t),n.appendChild(e)}t.className="cat_menu flex",t.appendChild(n),c.appendChild(t)}}for(let a in r){let e=v.createElement("section"),t=v.createElement("h2"),s=v.createElement("div"),l=v.createDocumentFragment(),n=r[a];1<i&&e.setAttribute("data-id",a),s.className="icons",t.className="cat_title tf_textc",t.textContent=o[a];for(let s in n){let e=n[s],t=v.createElement("button");t.className="flex tf_overflow tf_box",t.type="button",t.setAttribute("data-icon",s),e.p?(t.setAttribute("data-p",e.p),""!==e.vw&&void 0!==e.vw&&t.setAttribute("data-vw",e.vw),""!==e.vh&&void 0!==e.vh&&t.setAttribute("data-vh",e.vh),e.w&&t.setAttribute("data-w",e.w)):t.setAttribute("data-p",e),_.observe(t),l.appendChild(t)}s.appendChild(l),e.append(t,s),c.appendChild(e)}}else if(r){const s=v.createElement("div");s.className="empty",s.innerHTML=r.EMPTY,c.appendChild(s)}return c}isValid(e){return 0===e.indexOf(this.id+"-")}getSelectedIcon(e){return e.replace(this.id+"-","")}getFullIcon(e,t){return this.id+"-"+e}}new class extends e{constructor(){super("ti"),this.id="ti"}},new class extends e{constructor(){super("fa"),this.id="fa"}isValid(e){return 0===e.indexOf(this.id+"-")||0===e.indexOf(this.id+" ")||-1!==["fas ","far ","fab "].indexOf(e.substr(0,4))}getSelectedIcon(e){return 0===(e=e.replace("fas ","").replace("far ","").replace("fab ","")).indexOf(this.id+" ")?e.replace(this.id+" ",""):super.getSelectedIcon(e)}getFullIcon(e,t){return t+" "+e}},new class extends e{constructor(){const e="fontello";super(e),this.id=e}isValid(e){return"fontello-"===e.substr(0,9)||"icon-"===e.substr(0,5)||"tf_fontello-"===e.substr(0,12)}getSelectedIcon(e){return"fontello-"===e.substr(0,9)?e.replace("fontello-",""):"icon-"===e.substr(0,5)?e.replace("icon-",""):"fontello-"===e.substr(0,12)?e.replace("tf_fontello-",""):super.getSelectedIcon(e)}},new class extends e{constructor(){super("la"),this.id="la"}},Themify_Icons.init()})(Themify,window.top.document);
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка