CoreFiles by mySites.guru
joomla-field-user.min.js1 lines, 2,574 bytes, from Joomla_4.0.0-alpha5-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha3
md5
456afee2562e71f55dc4b1dd4e5652f8
sha1
608051c434e5992dbb2039f933564cbd99c641aa
sha256
c619b363412ddabfba153b7c081c2818f8df930bc6768f203eb4c05d5c30f6d6
(t=>{t.define("joomla-field-user",class extends HTMLElement{static get observedAttributes(){return["url","modal-class","modal-width","modal-height","input","input-name","button-select"]}get url(){return this.getAttribute("url")}set url(t){this.setAttribute("url",t)}get modalClass(){return this.getAttribute("modal")}set modalClass(t){this.setAttribute("modal",t)}get modalWidth(){return this.getAttribute("modal-width")}set modalWidth(t){this.setAttribute("modal-width",t)}get modalHeight(){return this.getAttribute("modal-height")}set modalHeight(t){this.setAttribute("modal-height",t)}get inputId(){return this.getAttribute("input")}set inputId(t){this.setAttribute("input",t)}get inputNameClass(){return this.getAttribute("input-name")}set inputNameClass(t){this.setAttribute("input-name",t)}get buttonSelectClass(){return this.getAttribute("button-select")}set buttonSelectClass(t){this.setAttribute("button-select",t)}connectedCallback(){if(this.modal=this.querySelector(this.modalClass),this.modalBody=this.querySelector(".modal-body"),this.input=this.querySelector(this.inputId),this.inputName=this.querySelector(this.inputNameClass),this.buttonSelect=this.querySelector(this.buttonSelectClass),this.modalClose=this.modalClose.bind(this),this.setValue=this.setValue.bind(this),this.buttonSelect){this.buttonSelect.addEventListener("click",this.modalOpen.bind(this)),this.modal.addEventListener("hide",this.removeIframe.bind(this));const t=this.input.getAttribute("data-onchange");let e;t&&(e=new Function(t),this.input.addEventListener("change",e.bind(this.input)))}}disconnectedCallback(){this.buttonSelect.removeEventListener("click",this),this.modal.removeEventListener("hide",this)}modalOpen(){const t=this;this.removeIframe();const e=document.createElement("iframe");e.setAttribute("name","field-user-modal"),e.src=this.url.replace("{field-user-id}",this.input.getAttribute("id")),e.setAttribute("width",this.modalWidth),e.setAttribute("height",this.modalHeight),this.modalBody.appendChild(e),this.modal.open();const i=this.modalBody.querySelector("iframe");i.addEventListener("load",()=>{const e=i.contentWindow.document;[].slice.call(e.querySelectorAll(".button-select")).forEach(e=>{e.addEventListener("click",e=>{t.setValue(e.target.getAttribute("data-user-value"),e.target.getAttribute("data-user-name")),t.modalClose()})})})}modalClose(){Joomla.Modal.getCurrent().close(),this.modalBody.innerHTML=""}removeIframe(){this.modalBody.innerHTML=""}setValue(t,e){this.input.setAttribute("value",t),this.inputName.setAttribute("value",e||t)}})})(customElements);

No other release has this exact content. See every version of this file.