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