Current File : /home/pacjaorg/www/kmm/media/com_templates/js/admin-templates-default-es5.min.js |
(function(){"use strict";/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/(function(){document.addEventListener("DOMContentLoaded",function(){var s=[].concat(document.querySelectorAll(".folder-url, .component-folder-url, .plugin-folder-url, .layout-folder-url")),f=[].concat(document.querySelectorAll(".folder ul, .component-folder ul, .plugin-folder ul, .layout-folder ul")),v=[].concat(document.querySelectorAll(".show > ul")),c=[].concat(document.querySelectorAll("#fileModal .folder-url")),n=[].concat(document.querySelectorAll("#folderModal .folder-url"));f.forEach(function(e){e.classList.add("hidden")}),v.forEach(function(e){e.classList.remove("hidden")}),s.forEach(function(e){e.addEventListener("click",function(t){t.preventDefault();var a=t.currentTarget.parentNode.querySelector("ul");a&&(a.classList.contains("hidden")?a.classList.remove("hidden"):a.classList.add("hidden"))})}),c.forEach(function(e){e.addEventListener("click",function(t){t.preventDefault(),c.forEach(function(r){r.classList.remove("selected")}),t.currentTarget.classList.add("selected");var a=t.currentTarget.dataset.base==="media"?1:0;[].concat(document.querySelectorAll("#fileModal input.address")).forEach(function(r){r.value=t.currentTarget.getAttribute("data-id")}),[].concat(document.querySelectorAll('#fileModal input[name="isMedia"]')).forEach(function(r){r.value=a})})}),n.forEach(function(e){e.addEventListener("click",function(t){t.preventDefault(),n.forEach(function(r){r.classList.remove("selected")}),t.currentTarget.classList.add("selected");var a=t.currentTarget.dataset.base==="media"?1:0;[].concat(document.querySelectorAll("#folderModal input.address")).forEach(function(r){r.value=t.currentTarget.getAttribute("data-id")}),[].concat(document.querySelectorAll('#folderModal input[name="isMedia"]')).forEach(function(r){r.value=a})})});var m=document.querySelector("#treeholder .treeselect"),d=[].concat(m.querySelectorAll(".folder.show")),y=document.querySelector("p.lead.hidden.path");if(y){var o=document.querySelector("p.lead.hidden.path").innerText;o&&o.charAt(0)==="/"&&(o=o.slice(1),o=o.split("/"),o=o[o.length-1],d.forEach(function(e,t){if(e.querySelector("a").classList.add("active"),t===d.length-1){var a=e.querySelector("ul");[].concat(a.querySelectorAll("li")).forEach(function(r){var u=r.querySelector("a"),i=u.querySelector("span");i&&i.innerText.trim()&&u.classList.add("active")})}}))}var l=document.getElementById("image-crop");if(l){var g=document.getElementById("imageWidth").value,h=document.getElementById("imageHeight").value;new window.Cropper(l,{viewMode:1,scalable:!0,zoomable:!1,movable:!1,dragMode:"crop",cropBoxMovable:!0,cropBoxResizable:!0,autoCrop:!0,autoCropArea:1,background:!0,center:!0,minCanvasWidth:g,minCanvasHeight:h}),l.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})}})})()})();