芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/.trash/media.2/com_associations/js/associations-edit.min.js
Joomla=window.Joomla||{},((e,s)=>{e.hideAssociation=(e,t)=>{[].slice.call(s.querySelectorAll("#associations .control-group")).forEach((s=>{const o=s.querySelector(".control-label label");if(o){o.getAttribute("for").replace(new RegExp("_name$"),"")===`${e}_associations_${t.replace("-","_")}`&&s.classList.add("hidden")}}))},e.showAssociationMessage=()=>{const t=[].slice.call(s.querySelectorAll("#associations .control-group")),o=s.getElementById("associations");if(o){const t=s.createElement("joomla-alert");t.innerText=e.Text._("JGLOBAL_ASSOC_NOT_POSSIBLE"),o.insertAdjacentElement("afterbegin",t)}t.forEach((e=>{e.classList.add("hidden")}))},e.injectAssociations=(s,t)=>{let o;s.success?(0!==s.data.length&&[].slice.call(Object.keys(s.data)).forEach((e=>{o=t+e.replace("-","_"),window[o](s.data[e].id,s.data[e].title,s.data[e].catid,null,null,e)})),s.message&&e.renderMessages({notice:[s.message]})):e.renderMessages({warning:[e.Text._("JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED")]})},e.propagateAssociation=(t,o)=>{const a=s.getElementById(`${t}_id`).value,n=s.getElementById("jform_language"),c={task:"ajax.fetchAssociations",format:"json",assocId:a,excludeLang:n.options[n.selectedIndex].value};c[e.getOptions("csrf.token","")]=1;const i=Object.keys(c).reduce(((e,s)=>(e.push(`${s}=${encodeURIComponent(c[s])}`),e)),[]).join("&"),l=`${s.forms.adminForm.action}&${i}`;return e.request({url:l,method:"GET",data:JSON.stringify(c),headers:{"Content-Type":"application/json"},onSuccess:s=>{e.injectAssociations(JSON.parse(s),o)},onError:()=>{e.renderMessages({warning:[e.Text._("JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED")]})}}),!1},s.addEventListener("DOMContentLoaded",(()=>{const t=e.getOptions("system.associations.edit"),o=t.formControl||"jform",a=s.getElementById(`${o}_language`);1===parseInt(t.hidden,10)?e.showAssociationMessage():a&&e.hideAssociation(o,a.value),a&&a.addEventListener("change",(({target:t})=>{e.removeMessages();let a=!1;[].slice.call(s.querySelectorAll("#associations .control-group")).forEach((e=>{const t=e.querySelector(".control-label label").getAttribute("for").replace("_name","").replace("jform_associations_","");e.classList.remove("hidden"),a||""===s.getElementById(`${o}_associations_${t}_id`).value||(a=!0);const n=s.getElementById(`${o}_associations_${t}_clear`);n.onclick?n.onclick():n.click&&n.click()})),a&&e.renderMessages({warning:[e.Text._("JGLOBAL_ASSOCIATIONS_RESET_WARNING")]});const n=t.value;"*"===n?e.showAssociationMessage():e.hideAssociation(o,n)}))}))})(Joomla,document);