CoreFiles by mySites.guru
associations-edit.es6.min.js1 lines, 2,635 bytes, from Joomla_4.0.0-alpha11-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha10
md5
7f78a48939f8fccf2204aa08bcf577ed
sha1
a04b840d11d3b66b8f0140cc0120139a5f8f2d2a
sha256
55c11a297438a0127f3dc5200db953e242f949ce5aaf23deb53e3b6e24487d3d
Joomla=window.Joomla||{},((a,b)=>{'use strict';a.hideAssociation=(a,c)=>{const d=[].slice.call(b.querySelectorAll("#associations .control-group"));d.forEach(b=>{const d=b.querySelector(".control-label label");if(d){const e=d.getAttribute("for");e.replace(/_name$/,"")==="".concat(a,"_associations_").concat(c.replace("-","_"))&&(b.style.display="none")}})},a.showAssociationMessage=()=>{const c=[].slice.call(b.querySelectorAll("#associations .control-group")),d=b.getElementById("associations");if(d){const c=b.createElement("joomla-alert");c.innerHTML=a.JText._("JGLOBAL_ASSOC_NOT_POSSIBLE"),d.insertAdjacentElement("afterbegin",c)}c.forEach(a=>{a.style.display="none"})},a.injectAssociations=(b,c)=>{let d;b.success?(0!==b.data.length&&[].slice.call(Object.keys(b.data)).forEach(a=>{d=c+a.replace("-","_"),window[d](b.data[a].id,b.data[a].title,b.data[a].catid,null,null,a)}),b.message&&a.renderMessages({notice:[b.message]})):a.renderMessages({warning:[a.JText._("JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED")]})},a.propagateAssociation=(c,d)=>{const e=b.getElementById("".concat(c,"_id")).value,f=b.getElementById("jform_language"),g=f.options[f.selectedIndex].value,h={task:"ajax.fetchAssociations",format:"json",assocId:e,excludeLang:g};h[a.getOptions("csrf.token","")]=1;const i=Object.keys(h).reduce((b,a)=>(b.push("".concat(a,"=").concat(encodeURIComponent(h[a]))),b),[]).join("&"),j="".concat(b.forms.adminForm.action,"&").concat(i);return a.request({url:j,method:"GET",data:JSON.stringify(h),headers:{"Content-Type":"application/json"},onSuccess:b=>{a.injectAssociations(JSON.parse(b),d)},onError:()=>{a.renderMessages({warning:[a.JText._("JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED")]})}}),!1},b.addEventListener("DOMContentLoaded",()=>{const c=a.getOptions("system.associations.edit"),d=c.formControl||"jform",e=b.getElementById("".concat(d,"_language"));1===parseInt(c.hidden,10)?a.showAssociationMessage():e&&a.hideAssociation(d,e.value),e&&e.addEventListener("change",c=>{a.removeMessages();let e=!1;const f=[].slice.call(b.querySelectorAll("#associations .control-group"));f.forEach(a=>{const c=a.querySelector(".control-label label").getAttribute("for"),f=c.replace("_name","").replace("jform_associations_","");a.style.display="block",e||""===b.getElementById("".concat(d,"_associations_").concat(f,"_name")).value||(e=!0);const g=b.getElementById("".concat(d,"_associations_").concat(f,"_clear"));g.onclick?g.onclick():g.click&&g.click()}),e&&a.renderMessages({warning:[a.JText._("JGLOBAL_ASSOCIATIONS_RESET_WARNING")]});const g=c.target.value;"*"===g?a.showAssociationMessage():a.hideAssociation(d,g)})})})(Joomla,document);

The same content is in 2 releases, Joomla 4.0.0-alpha11 to 4.0.0-alpha12. See them all, or every version of this file.