Файловый менеджер - Редактировать - /home/kunzqhe/photostocker/wp-content/themes/themify-ultra/themify/js/admin/modules/find-replace.min.js
Назад
let TF_Replace;((w,e)=>{"use strict";let s=null,u=0,d=100,p;const _=new Map,g=()=>w.loadJs(w.url+"js/admin/notification",!!e.TF_Notification),y=async(t,e,a,i)=>{const o=_.get(e);if(o)return o;const n=await w.fetch({action:"tb_get_ajax_builder_posts",page:e,nonce:t});if(n.success)return _.set(e,n.data),!i&&e+1<=a&&y(t,e+1,a,1),n.data;throw n.data},l=(a,i,o)=>{for(let e in o)if("element_id"!==e&&"mod_name"!==e&&!0!==o[e]&&"px"!==o[e]&&"%"!==o[e]&&o[e]&&isNaN(o[e]))if(Array.isArray(o[e])||"object"==typeof o[e])l(a,i,o[e]);else if("string"==typeof o[e]){let t=o[e].toString().trim();t.includes(a)&&(s=!0,o[e]=t.replaceAll(a,i))}return o},T=async(a,i,o,t)=>{u+=o.length,await g();const n=[];await TF_Notification.show("info",m(p.searching,a,o,u,t),1200);for(let e=o.length-1;-1<e;--e){s=!1;let t=l(a,i,o[e].data);!0===s&&n.push({data:t,title:o[e].title,id:o[e].id})}return n},a=t=>(t.preventDefault(),t.returnValue="Are you sure"),r=a=>{const i=[];for(let e in a){let t=a[e].title||a[e];i.push(t)}return i.join(", ")},m=(e,t,a,i,o)=>{const n={posts:a?r(a):"",total:o,count:i,find:t};for(let t in n)void 0!==n[t]&&(e=e.replaceAll("%"+t+"%",n[t]));return e=140<e.length?e.slice(0,140)+"...":e},N=async e=>{try{if("/"!==e[0]&&"/"!==e[1]){if(0!==e.indexOf("http"))throw"";"http://"!==e&&"https://"!==e&&new URL(e)}}catch(t){throw p.wrong_url.replaceAll("%url%",e)}},b=(i,o)=>new Promise((e,a)=>{setTimeout(()=>{const t={action:"tb_save_ajax_builder_mutiple_posts",nonce:o,data:i};w.fetch(t).then(t=>{if(!t.success)return a(t.data);e(t)}).catch(a)},d)});TF_Replace=async(n,i,s)=>{await g();try{e.tfOff("beforeunload",a).tfOn("beforeunload",a),u=0,_.clear();const t=await y(s,1,0),o=t.pages,l=t.total;if(p=t.labels,n===i)throw p.same_url;await Promise.all([N(n),N(i)]);const r=await T(n,i,t.posts,l);for(let a=2;a<=o;++a)try{let t=await y(s,a,o),e=await T(n,i,t.posts,l);r.push(...e)}catch(t){}if(0<r.length){12<r.length&&(d=150),await TF_Notification.show("info",m(p.found,n,r,r.length,l),3e3);const c=[],f=[],h=r.length;let i=!1,o=0;while(0<r.length){let a=r.splice(0,5),i={},o={};for(let e=a.length-1;-1<e;--e){let t=a[e].id;i[t]=a[e].data,o[t]=a[e].title}c.push(i),f.push(o)}for(let e=0,t=c.length;e<t;e++){o+=Object.keys(f[e]).length,await TF_Notification.show("info",m(p.saving,n,f[e],o,h));let a;try{if(!(a=await b(c[e],s)).success)throw a.data}catch(t){try{if(!(a=await b(new Blob([JSON.stringify(c[e])],{type:"application/json"}),s)).success)throw a.data}catch(t){await TF_Notification.showHide("error",t,2e3)}}if(a&&a.data){a=a.data;let e=[];for(let t in a)1!=a[t]?e.push(a[t]):i=!0;0<e.length&&await TF_Notification.showHide("error",m(p.no_found,n,e,e.length,l),4e3)}}!0===i&&await w.fetch({action:"themify_regenerate_css_files_ajax",nonce:s}),await TF_Notification.showHide("done",p.done)}else await TF_Notification.showHide("warning",m(p.no_found,n),3e3)}catch(t){await TF_Notification.showHide("error",t)}e.tfOff("beforeunload",a)}})(Themify,window);
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка