芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/chocholayucatan.gob.mx/media/com_menus/js/admin-item-edit.min.js
(e=>{e.submitbutton=(t,o)=>{if("item.setType"===t||"item.setMenuType"===t){if("item.setType"===t){[].slice.call(document.querySelectorAll('#item-form input[name="jform[type]"]')).forEach((e=>{e.value=o})),document.getElementById("fieldtype").value="type"}else{[].slice.call(document.querySelectorAll('#item-form input[name="jform[menutype]"]')).forEach((e=>{e.value=o}))}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((e=>{const t=e.getAttribute("id").split("").reverse().join(""),o=t.indexOf("_"),n=`${t.substr(o).split("").reverse().join("")}name`;document.getElementById(n).classList.add("invalid")}))}};const t=({target:t})=>{const o=t.value;e.request({url:`index.php?option=com_menus&task=item.getParentItem&menutype=${o}`,headers:{"Content-Type":"application/json"},onSuccess(e){const t=JSON.parse(e);[].slice.call(document.querySelectorAll("#jform_parent_id option")).forEach((e=>{"1"!==e.value&&e.parentNode.removeChild(e)})),t.forEach((e=>{const t=document.createElement("option");t.innerText=e.title,t.id=e.id,document.getElementById("jform_parent_id").appendChild(t)}));const o=document.createEvent("HTMLEvents");o.initEvent("change",!0,!1),document.getElementById("jform_parent_id").dispatchEvent(o)},onError:t=>{e.renderMessages(e.ajaxErrorsMessages(t))}})};if(!e||"function"!=typeof e.request)throw new Error("core.js was not properly initialised");const o=document.getElementById("jform_menutype");o&&o.addEventListener("change",t),document.getElementById("item-form").addEventListener("submit",(()=>{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);