芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/testcors.sdektun.com/media/com_menus/js/admin-item-edit-es5.min.js
!function(){"use strict";!function(e){e.submitbutton=function(t,n){if("item.setType"===t||"item.setMenuType"===t){if("item.setType"===t)[].slice.call(document.querySelectorAll('#item-form input[name="jform[type]"]')).forEach((function(e){e.value=n})),document.getElementById("fieldtype").value="type";else[].slice.call(document.querySelectorAll('#item-form input[name="jform[menutype]"]')).forEach((function(e){e.value=n}));e.submitform("item.setType",document.getElementById("item-form"))}else if("item.cancel"===t||document.formvalidator.isValid(document.getElementById("item-form")))e.submitform(t,document.getElementById("item-form"));else{[].slice.call(document.querySelectorAll("#item-form .modal-value.invalid")).forEach((function(e){var t=e.getAttribute("id").split("").reverse().join(""),n=t.indexOf("_"),o=t.substr(n).split("").reverse().join("")+"name";document.getElementById(o).classList.add("invalid")}))}};if(!e||"function"!=typeof e.request)throw new Error("core.js was not properly initialised");var t=document.getElementById("jform_menutype");t&&t.addEventListener("change",(function(t){var n=t.target.value;e.request({url:"index.php?option=com_menus&task=item.getParentItem&menutype="+n,headers:{"Content-Type":"application/json"},onSuccess:function(e){var t=JSON.parse(e);[].slice.call(document.querySelectorAll("#jform_parent_id option")).forEach((function(e){"1"!==e.value&&e.parentNode.removeChild(e)})),t.forEach((function(e){var t=document.createElement("option");t.innerText=e.title,t.id=e.id,document.getElementById("jform_parent_id").appendChild(t)}));var n=document.createEvent("HTMLEvents");n.initEvent("change",!0,!1),document.getElementById("jform_parent_id").dispatchEvent(n)},onError:function(t){e.renderMessages(e.ajaxErrorsMessages(t))}})})),document.getElementById("item-form").addEventListener("submit",(function(){document.getElementById("jform_params_login_redirect_url")&&document.getElementById("jform_params_logout_redirect_url")&&(document.getElementById("jform_params_login_redirect_url").closest(".control-group").classList.contains("hidden")||(document.getElementById("jform_params_login_redirect_menuitem_id").value=""),document.getElementById("jform_params_login_redirect_menuitem_name").closest(".control-group").classList.contains("hidden")||(document.getElementById("jform_params_login_redirect_url").value=""),document.getElementById("jform_params_logout_redirect_url").closest(".control-group").classList.contains("hidden")||(document.getElementById("jform_params_logout_redirect_menuitem_id").value=""),document.getElementById("jform_params_logout_redirect_menuitem_id").closest(".control-group").classList.contains("hidden")||(document.getElementById("jform_params_logout_redirect_url").value=""))}))}(Joomla)}();