芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/.trash/media.2/com_templates/js/admin-templates-default.min.js
document.addEventListener("DOMContentLoaded",(()=>{const e=[].slice.call(document.querySelectorAll(".folder-url, .component-folder-url, .plugin-folder-url, .layout-folder-url")),l=[].slice.call(document.querySelectorAll(".folder ul, .component-folder ul, .plugin-folder ul, .layout-folder ul")),t=[].slice.call(document.querySelectorAll(".show > ul")),r=[].slice.call(document.querySelectorAll("#fileModal .folder-url")),c=[].slice.call(document.querySelectorAll("#folderModal .folder-url"));l.forEach((e=>{e.classList.add("hidden")})),t.forEach((e=>{e.classList.remove("hidden")})),e.forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault();const l=e.currentTarget.parentNode.querySelector("ul");l.classList.contains("hidden")?l.classList.remove("hidden"):l.classList.add("hidden")}))})),r.forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),r.forEach((e=>{e.classList.remove("selected")})),e.currentTarget.classList.add("selected"),[].slice.call(document.querySelectorAll("#fileModal input.address")).forEach((l=>{l.value=e.currentTarget.getAttribute("data-id")}))}))})),c.forEach((e=>{e.addEventListener("click",(e=>{e.preventDefault(),c.forEach((e=>{e.classList.remove("selected")})),e.currentTarget.classList.add("selected"),[].slice.call(document.querySelectorAll("#folderModal input.address")).forEach((l=>{l.value=e.currentTarget.getAttribute("data-id")}))}))}));const d=document.querySelector("#treeholder .treeselect"),o=[].slice.call(d.querySelectorAll(".folder.show"));if(document.querySelector("p.lead.hidden.path")){let e=document.querySelector("p.lead.hidden.path").innerText;e&&"/"===e.charAt(0)&&(e=e.slice(1),e=e.split("/"),e=e[e.length-1],o.forEach(((e,l)=>{if(e.querySelector("a").classList.add("active"),l===o.length-1){const l=e.querySelector("ul");[].slice.call(l.querySelectorAll("li")).forEach((e=>{const l=e.querySelector("a"),t=l.querySelector("span");t&&t.innerText.trim()&&l.classList.add("active")}))}})))}const a=document.getElementById("image-crop");if(a){const e=document.getElementById("imageWidth").value,l=document.getElementById("imageHeight").value;new window.Cropper(a,{viewMode:1,scalable:!0,zoomable:!1,movable:!1,dragMode:"crop",cropBoxMovable:!0,cropBoxResizable:!0,autoCrop:!0,autoCropArea:1,background:!0,center:!0,minCanvasWidth:e,minCanvasHeight:l}),a.addEventListener("crop",(e=>{document.getElementById("x").value=e.detail.x,document.getElementById("y").value=e.detail.y,document.getElementById("w").value=e.detail.width,document.getElementById("h").value=e.detail.height}))}}));