芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/www/media/mod_quickicon/js/quickicon.min.js
if(!Joomla)throw new Error("Joomla API was not properly initialized");Array.from(document.querySelectorAll(".quickicon")).forEach((t=>{const e=t.querySelector(".quickicon-amount");e&&e.dataset.url&&Joomla.request({url:e.dataset.url,method:"GET",onSuccess:a=>{let r;try{r=JSON.parse(a)}catch(e){t.classList.add("error")}if(Object.prototype.hasOwnProperty.call(r,"data")){const a=t.querySelector(".quickicon-name"),o=document.createElement("span");t.classList.add(r.data>0?"warning":"success"),r.data.name&&a&&(o.textContent=r.data.name,a.replaceChild(o,a.firstChild)),e.textContent=`${r.data.amount}`;const c=t.querySelector(".quickicon-sr-desc");r.data.sronly&&c&&(c.textContent=r.data.sronly)}else t.classList.add("error")},onError:()=>{t.classList.add("error")}})}));