1 line
925 B
JavaScript
1 line
925 B
JavaScript
(()=>{function e(t,n,r,o){var a=new XMLHttpRequest;a.open("PATCH","".concat(t,"/admin/shaare/").concat(n[r],"/update-thumbnail")),a.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),a.responseType="json",a.onload=function(){if(200!==a.status)alert("An error occurred. Return code: ".concat(a.status));else{var c=a.response;r+=1,o.progressBar.style.width="".concat(100*r/n.length,"%"),o.current.innerHTML=r,o.title.innerHTML=c.title,!1!==c.thumbnail&&(o.thumbnail.innerHTML='<img src="'.concat(t,"/").concat(c.thumbnail,'">')),r<n.length&&e(t,n,r,o)}},a.send()}e(document.querySelector('input[name="js_base_path"]').value,document.getElementsByName("ids")[0].value.split(","),0,{progressBar:document.querySelector(".progressbar > div"),current:document.querySelector(".progress-current"),thumbnail:document.querySelector(".thumbnail-placeholder"),title:document.querySelector(".thumbnail-link-title")})})(); |