- md5
- 5e6d553338f1f48bfcceef0a243da0f5
- sha1
- f6de67999321dc9696122ede46345d39357c9c89
- sha256
- d567b1ebf93bcd5b57806ea748f8219b439efd3d9d4921d9cbefdaa2da671a2f
"use strict";((a,b)=>{class c extends HTMLElement{constructor(){if(super(),!b)throw new Error("Joomla API is not properly initiated");if(!this.getAttribute("data-uri"))throw new Error("No valid url for validation")}connectedCallback(){const a=[].slice.call(document.querySelectorAll("[data-onchange-task]"));a&&a.forEach(a=>{a.addEventListener("change",a=>{a.preventDefault();const b=a.target.getAttribute("data-onchange-task");"permissions.apply"==b&&this.sendPermissions(a)})})}sendPermissions(a){const c=a.target,d=document.getElementById("icon_"+c.id);d.removeAttribute("class"),d.setAttribute("class","fa fa-spinner fa-spin");let e="not",f=this.getUrlParam("component"),g=this.getUrlParam("extension"),h=this.getUrlParam("option"),i=this.getUrlParam("view"),j=f,k=c.value,l="";document.getElementById("jform_context")&&(l=document.getElementById("jform_context").value,l=l.split(".")[0]),"com_config"==h&&!1==f&&!1==g?e="root.1":!1==g&&"component"==i?e=f:l?(e="group"==i?l+".fieldgroup."+this.getUrlParam("id"):l+".field."+this.getUrlParam("id"),j=document.getElementById("jform_title").value):!1!=g&&!1!=i?(e=g+"."+i+"."+this.getUrlParam("id"),j=document.getElementById("jform_title").value):!1==g&&!1!=i&&(e=h+"."+i+"."+this.getUrlParam("id"),j=document.getElementById("jform_title").value);const m=c.id.replace("jform_rules_",""),n=m.lastIndexOf("_"),o={comp:e,action:m.substring(0,n),rule:m.substring(n+1),value:k,title:j};b.removeMessages(),b.request({url:this.getAttribute("data-uri"),method:"POST",data:JSON.stringify(o),perform:!0,headers:{"Content-Type":"application/json"},onSuccess:a=>{try{a=JSON.parse(a)}catch(a){console.log(a)}if(d.removeAttribute("class"),a.data&&!0===a.data.result){d.setAttribute("class","fa fa-check");const b=c.parentNode.parentNode.nextElementSibling.querySelector("span");b.removeAttribute("class"),b.setAttribute("class",a.data["class"]),b.innerHTML=a.data.text}"object"==typeof a.messages&&null!==a.messages&&(b.renderMessages(a.messages),a.data&&!0===a.data.result?d.setAttribute("class","fa fa-check"):d.setAttribute("class","fa fa-times"))},onError:()=>{d.removeAttribute("style"),b.renderMessages(b.ajaxErrorsMessages(jqXHR,textStatus,error)),d.setAttribute("class","fa fa-times")}})}getUrlParam(a){const b=window.location.search.substring(1),c=b.split("&");for(let b,d=0;d<c.length;d+=1)if(b=c[d].split("="),b[0]==a)return b[1];return!1}}a.define("joomla-field-permissions",c)})(customElements,Joomla);
No other release has this exact content. See every version of this file.