Файловый менеджер - Редактировать - /home/kunzqhe/photostocker/wp-content/themes/themify-ultra/themify/js/admin/import/import-images.min.js
Назад
let TF_ImportImages;((F,N,P,I)=>{"use strict";TF_ImportImages={downloaded:new Map,_getImage(a,i){return new Promise((t,e)=>{setTimeout(()=>{this._download(a).then(t).catch(e)},i)})},async _download(t){const e=this.downloaded.get(t);if(e!==I)return e;if(!t.includes("themify.me")&&!t.includes("themify.org"))return 1;try{return await F.fetch("","blob",{credentials:"omit",method:"GET",mode:"cors"},t)}catch(t){return 404!==t.status&&1}},async _batchDownload(i,l){const e=()=>{const a=[];for(let t=0,e=i.length;t<e;++t)a.push(this._getImage(i[t],l));return Promise.all(a)};let a;try{a=await e()}catch(t){try{a=await e()}catch(t){a=Array(i.length).fill(1)}}return a},async _batchUpload(a,i){let l;try{l=await this._upload(a,i)}catch(t){try{l=await this._upload(a,i)}catch(t){try{let e=a.getAll("blob");for(let t=e.length-1;-1<t;--t)delete e[t].blob;a.set("blob",e),l=await this._upload(a,i)}catch(t){}}}return l},_upload(t,i){return new Promise((e,a)=>{setTimeout(()=>{F.fetch(t).then(t=>{t&&t.success?e(t):a(t.data)}).catch(a)},i)})},init(T,v,A,D,k){return new Promise(async t=>{Array.isArray(T)||(T=[...T]);let s=!0,r=0,n=!1,c=!1;D=D||2,k=k||"themify_upload_image",await F.loadJs(F.url+"js/admin/notification",!!P.TF_Notification);const d=T.length,h=A.download_images?A.download_images.replaceAll("%to%",d):"",f=A.upload_images?A.upload_images.replaceAll("%to%",d):"",m=A.download_fail||"",w=A.upload_fail||"",e=A.custom_data||"",a=A.stop_webp||"",p=new Map,u=12<d?150:100,i=[],g=a=>{const i=[];for(let e=0,t=a.length;e<t;++e){let t=("string"==typeof a[e]?a[e]:a[e].url).trim();t.includes("themes/ultra-agency-2/")&&(t=t.replace("/themes/ultra-agency-2/files/","/themes/ultra-agency2/files/")),i.push(t)}return i},y=a=>{for(let e=(a=g(a)).length-1;-1<e;--e)this._download(a[e]).then(t=>{this.downloaded.set(a[e],t)})},l=t=>(t.preventDefault(),t.returnValue="Are you sure"),o=()=>{s="visible"===P.document.visibilityState},_=(o,s)=>{const r=new FormData,n={},c=g(o),d=new Set;for(let l=s.length-1;-1<l;--l)if(o[l]!==I){let t=o[l],e="string"==typeof t,a=c[l],i=s[l];!1!==i&&"skip"!==i?(r.set(l,i),!(n[l]={thumb:a})==e&&(t.id&&(n[l].post_id=t.id),t.term_id&&(n[l].term_id=t.term_id),t.data)&&(n[l].data=t.data)):(d.add(a),p.set(a,!1))}return r.set("action",k),r.set("nonce",v),r.set("postData",JSON.stringify(n)),e&&r.set("save_id",e),a&&r.set("stop_webp",1),{formData:r,skip:d}},b=(a,i)=>{a&&a.success||a?a.data&&(a=a.data):a="";const l=new Map;for(let e=i.length-1;-1<e;--e){let t=this.downloaded.get(i[e]);if(!1!==t&&"skip"!==t&&this.downloaded.delete(i[e]),!1!==t&&"skip"!==t&&a&&a[i[e]]&&a[i[e]].id)p.set(i[e],a[i[e]]);else{p.set(i[e],!1);let t=a&&a[i[e]]?a[i[e]]:"";l.set(i[e],t)}}return l};P.tfOn("beforeunload",l).document.tfOn("visibilitychange",o,{passive:!0}),T=((t,e)=>{const a=[];while(0<t.length)a.push(t.splice(0,e));return a})(T,D),wp&&wp.heartbeat&&wp.heartbeat.interval(120),i[0]=new Promise(async t=>{for(let t=0,e=T.length;t<e;++t)try{let a=[],i=g(T[t]),l=!1;r+=i.length;for(let e=i.length-1;-1<e;--e){let t=p.get(i[e]);if(!t){l=!0;break}a[e]=t}if(!0===l){if(!(n=!1)===s){r>d&&(r=d);let t=N.createDocumentFragment(),e=N.createElement("div"),a=N.createElement("div");a.className="img_wrap",e.className="msg_text",e.innerHTML=h.replaceAll("%from%",r);for(let e=i.length-1;-1<e;--e){let t=new Image(50,50);t.className="tf_box",t.decoding="async",t.src=i[e];try{await t.decode()}catch(t){}a.appendChild(t)}t.append(e,a),await TF_Notification.show("info",t)}if(T[t+1]!==I)try{y(T[t+1])}catch(t){}try{a=await this._batchDownload(i,u)}catch(t){}}let o=_(T[t],a);if(!0===s&&0<o.skip.size){let t=[...o.skip].join(", ");await TF_Notification.showHide("error",m.replaceAll("%post%",t),2e3)}if(!0===l&&0<a.length){delete o.skip;let e;if(!0===s&&""!==f){let t=TF_Notification.el.shadowRoot.querySelector(".msg_text");t&&(r>d&&(r=d),t.innerHTML=f.replaceAll("%from%",r))}try{n=!0,await new Promise(t=>{setTimeout(async()=>{e=await this._batchUpload(o.formData,u),t()},!0===c?1e3:10)})}catch(t){}let a=b(e,i);if(!0===s&&0<a.size)for(let[t,e]of a)await TF_Notification.showHide("error",w.replaceAll("%post%",t).replaceAll("%msg%",e),2e3)}}catch(t){}t()}),1<T.length&&(i[1]=new Promise(async t=>{for(let o=T.length-1;-1<o;--o)try{let i=[],e=!1,l=g(T[o]);for(let t=l.length-1;-1<t;--t)if(!p.has(l[t])){e=!0;break}if(!0===e){if(c=!1,T[o-1]!==I)try{y(T[o-1])}catch(t){}try{i=await this._batchDownload(l,u)}catch(t){}c=!0,await new Promise(a=>{setTimeout(async()=>{let t=_(T[o],i),e;if(0<i.length){try{e=await this._batchUpload(t.formData,u)}catch(t){}b(e,l)}r+=l.length,a()},!0===n?1300:10)})}}catch(t){}t()})),this.downloaded.clear(),P.tfOff("beforeunload",l).document.tfOff("visibilitychange",o,{passive:!0}),await Promise.all(i),t(p)})}}})(Themify,document,window.top,void 0);
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка