Current File : /home/pacjaorg/public_html/km/media/com_modules/js/admin-module-edit.min.js |
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/Joomla=window.Joomla||{},(e=>{e.submitbutton=d=>{if(d==="module.cancel"||document.formvalidator.isValid(document.getElementById("module-form"))){e.submitform(d,document.getElementById("module-form"));const t=e.getOptions("module-edit");if(window.self!==window.top){if(window.parent.viewLevels){const o=document.getElementById("jform_position").value,r=document.getElementById("jform_title").value,i=document.querySelector("#jform_assignment").value,c=document.querySelector("#jform_published").value,u=document.querySelector("#jform_access").value,s=window.parent.document.getElementById(`menus-${t.itemId}`),n=window.parent.document.getElementById(`tr-${t.itemId}`),l=window.parent.document.getElementById(`status-${t.itemId}`);window.parent.inMenus=[],window.parent.numMenus=[].slice.call(document.querySelectorAll('input[name="jform[assigned][]"]')).length,[].slice.call(document.querySelectorAll('input[name="jform[assigned][]"]')).forEach(a=>{i>0&&a.checked&&window.parent.inMenus.push(parseInt(a.value,10)),i<0&&(a.checked||window.parent.inMenus.push(parseInt(a.value,10)))}),i==="-"&&(s.innerHTML=e.sanitizeHtml(`<span class="badge bg-danger">${e.Text._("JNO")}</span>`),(!n.classList.contains("no")||n.classList.length===0)&&n.classList.add("no")),parseInt(i,10)===0&&(s.innerHTML=e.sanitizeHtml(`<span class="badge bg-info">${e.Text._("JALL")}</span>`),n.classList.contains("no")&&n.classList.remove("no")),parseInt(i,10)>0&&(window.parent.inMenus.indexOf(window.parent.menuId)>=0&&(window.parent.numMenus===window.parent.inMenus.length?(s.innerHTML=e.sanitizeHtml(`<span class="badge bg-info">${e.Text._("JALL")}</span>`),(n.classList.contains("no")||n.classList.length===0)&&n.classList.remove("no")):(s.innerHTML=e.sanitizeHtml(`<span class="badge bg-success">${e.Text._("JYES")}</span>`),n.classList.contains("no")&&n.classList.remove("no"))),window.parent.inMenus.indexOf(window.parent.menuId)<0&&(s.innerHTML=e.sanitizeHtml(`<span class="badge bg-danger">${e.Text._("JNO")}</span>`),n.classList.contains("no")||n.classList.add("no"))),parseInt(i,10)<0&&(window.parent.inMenus.indexOf(window.parent.menuId)>=0&&(window.parent.numMenus===window.parent.inMenus.length?(s.innerHTML=e.sanitizeHtml(`<span class="badge bg-info">${e.Text._("JALL")}</span>`),n.classList.contains("no")&&n.classList.remove("no")):(s.innerHTML=e.sanitizeHtml(`<span class="badge bg-success">${e.Text._("JYES")}</span>`),n.classList.contains("no")&&n.classList.remove("no"))),window.parent.inMenus.indexOf(window.parent.menuId)<0&&(s.innerHTML=e.sanitizeHtml(`<span class="badge bg-danger">${e.Text._("JNO")}</span>`),(!n.classList.contains("no")||n.classList.length===0)&&n.classList.add("no"))),parseInt(c,10)===1&&(l.innerHTML=e.sanitizeHtml(`<span class="badge bg-success">${e.Text._("JYES")}</span>`),n.classList.contains("unpublished")&&n.classList.remove("unpublished")),parseInt(c,10)===0&&(l.innerHTML=e.sanitizeHtml(`<span class="badge bg-danger">${e.Text._("JNO")}</span>`),(!n.classList.contains("unpublished")||n.classList.length===0)&&n.classList.add("unpublished")),parseInt(c,10)===-2&&(l.innerHTML=e.sanitizeHtml(`<span class="badge bg-secondary">${e.Text._("JTRASHED")}</span>`),(!n.classList.contains("unpublished")||n.classList.length===0)&&n.classList.add("unpublished")),document.formvalidator.isValid(document.getElementById("module-form"))&&(window.parent.document.querySelector(`#title-${t.itemId}`).innerText=r,window.parent.document.querySelector(`#position-${t.itemId}`).innerText=o,window.parent.document.querySelector(`#access-${t.itemId}`).innerHTML=e.sanitizeHtml(window.parent.viewLevels[u]))}d!=="module.apply"&&window.parent.Joomla.Modal.getCurrent().close()}}}})(Joomla);