- md5
- 34730faa3cf7be069c248fc8d532299b
- sha1
- e487be8fc9fd0d43e148f8b8650810a39844e9a1
- sha256
- ceae1d39f60d8215fb579fcc7d582b0c02cfc731071df1421da0d60730d8e649
((a,b,c)=>{'use strict';c.SampleData={inProgress:!1},c.sampledataAjax=(a,d,f)=>{const e="index.php?option=com_ajax&format=json&group=sampledata&".concat(c.getOptions("csrf.token"),"=1"),g=c.getOptions("sample-data"),h=b.createElement("li");h.classList.add("sampledata-steps-".concat(a,"-").concat(f));const i=b.createElement("p");i.classList.add("loader-image"),i.classList.add("text-center");const j=b.createElement("img");j.setAttribute("src",g.icon),j.setAttribute("width",30),j.setAttribute("height",30),i.appendChild(j),h.appendChild(i),b.querySelector(".sampledata-progress-".concat(a," ul")).appendChild(h),c.request({url:"".concat(e,"&type=").concat(a,"&plugin=SampledataApplyStep").concat(f,"&step=").concat(f),method:"GET",perform:!0,onSuccess:e=>{const g=h.querySelector(".loader-image");g.parentNode.removeChild(g);let i={};try{i=JSON.parse(e)}catch(b){return c.renderMessages({error:[c.JText._("MOD_SAMPLEDATA_INVALID_RESPONSE")]},".sampledata-steps-".concat(a,"-").concat(f)),void(c.SampleData.inProgress=!1)}let j,k="";if(i.success&&i.data&&0<i.data.length){const e=b.querySelector(".sampledata-progress-".concat(a," .progress-bar"));if(i.data.forEach(b=>{null===b||(j=b.success,k=j?"bg-success":"bg-danger",j?c.renderMessages({message:[b.message]},".sampledata-steps-".concat(a,"-").concat(f)):c.renderMessages({error:[b.message]},".sampledata-steps-".concat(a,"-").concat(f)))}),e.innerText="".concat(f,"/").concat(d),e.style.width="".concat(100*(f/d),"%"),e.setAttribute("aria-valuemin",0),e.setAttribute("aria-valuemax",100),e.setAttribute("aria-valuenow",100*(f/d)),e.classList.add(k),j&&f<=d){const b=f+1;b<=d&&c.sampledataAjax(a,d,b)}}else c.renderMessages({error:[c.JText._("MOD_SAMPLEDATA_INVALID_RESPONSE")]},".sampledata-steps-".concat(a,"-").concat(f)),c.SampleData.inProgress=!1},onError:()=>{alert("Something went wrong! Please close and reopen the browser and try again!")}})},c.sampledataApply=d=>{const e=d.getAttribute("data-type"),f=d.getAttribute("data-steps");if(!c.SampleData.inProgress){if(d.getAttribute("data-processed"))return void alert(c.JText._("MOD_SAMPLEDATA_ITEM_ALREADY_PROCESSED"));if(!a.confirm(c.JText._("MOD_SAMPLEDATA_CONFIRM_START")))return!1;const g=[].slice.call(b.querySelectorAll(".sampledata-progress-".concat(e)));return g.forEach(a=>{a.classList.remove("d-none")}),d.getAttribute("data-processed",!0),c.SampleData.inProgress=!0,c.sampledataAjax(e,f,1),!1}};const d=()=>{const a=b.getElementById("sample-data-wrapper");if(a){const b=[].slice.call(a.querySelectorAll(".apply-sample-data"));b.forEach(a=>{a.addEventListener("click",a=>c.sampledataApply(a.target))})}b.removeEventListener("DOMContentLoaded",d)};b.addEventListener("DOMContentLoaded",d)})(window,document,window.Joomla);
No other release has this exact content. See every version of this file.