CoreFiles by mySites.guru
joomla-field-user.min.js1 lines, 2,979 bytes, from Joomla_4.0.0-beta1-Beta-Full_Package.zip
Raw History Compare with 3.9.0-beta4
md5
6ddf10a038a9d8ccb8814622b03d61c0
sha1
4ae63c6763e8ee46185114741fb20e5f5628429a
sha256
d8d9a366bc0fb905f3688d96c7e290b2a530f9941c94f6cb986ad7270fcf9e9d
"use strict";(()=>{class a extends HTMLElement{constructor(){super(),this.onUserSelect="",this.onchangeStr="",this.buttonClick=this.buttonClick.bind(this),this.iframeLoad=this.iframeLoad.bind(this)}static get observedAttributes(){return["url","modal-class","modal-width","modal-height","input","input-name","button-select"]}get url(){return this.getAttribute("url")}set url(a){this.setAttribute("url",a)}get modalClass(){return this.getAttribute("modal")}set modalClass(a){this.setAttribute("modal",a)}get modalWidth(){return this.getAttribute("modal-width")}set modalWidth(a){this.setAttribute("modal-width",a)}get modalHeight(){return this.getAttribute("modal-height")}set modalHeight(a){this.setAttribute("modal-height",a)}get inputId(){return this.getAttribute("input")}set inputId(a){this.setAttribute("input",a)}get inputNameClass(){return this.getAttribute("input-name")}set inputNameClass(a){this.setAttribute("input-name",a)}get buttonSelectClass(){return this.getAttribute("button-select")}set buttonSelectClass(a){this.setAttribute("button-select",a)}connectedCallback(){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)),this.onchangeStr=this.input.getAttribute("data-onchange"),this.onchangeStr&&(this.onUserSelect=new Function(this.onchangeStr),this.input.addEventListener("change",this.onUserSelect)))}disconnectedCallback(){this.onchangeStr&&this.input&&this.input.removeEventListener("change",this.onUserSelect),this.buttonSelect&&this.buttonSelect.removeEventListener("click",this),this.modal&&this.modal.removeEventListener("hide",this)}buttonClick({target:a}){this.setValue(a.getAttribute("data-user-value"),a.getAttribute("data-user-name")),this.modalClose()}iframeLoad(){const a=this.iframeEl.contentWindow.document,b=[].slice.call(a.querySelectorAll(".button-select"));b.forEach(a=>{a.addEventListener("click",this.buttonClick)})}modalOpen(){this.removeIframe();const a=document.createElement("iframe");a.setAttribute("name","field-user-modal"),a.src=this.url.replace("{field-user-id}",this.input.getAttribute("id")),a.setAttribute("width",this.modalWidth),a.setAttribute("height",this.modalHeight),this.modalBody.appendChild(a),this.modal.open(),this.iframeEl=this.modalBody.querySelector("iframe"),this.iframeEl.addEventListener("load",this.iframeLoad)}modalClose(){Joomla.Modal.getCurrent().close(),this.modalBody.innerHTML=""}removeIframe(){this.modalBody.innerHTML=""}setValue(a,b){this.input.setAttribute("value",a),this.inputName.setAttribute("value",b||a)}}customElements.define("joomla-field-user",a)})();

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