[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/media/system/js/fields/ -> joomla-field-user-es5.min.js (source)

   1  !function(){"use strict";function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function e(t){return(e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function n(t,e){return(n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function i(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function o(t,e,r){return(o=i()?Reflect.construct:function(t,e,i){var o=[null];o.push.apply(o,e);var r=new(Function.bind.apply(t,o));return i&&n(r,i.prototype),r}).apply(null,arguments)}function r(t){var i="function"==typeof Map?new Map:void 0;return(r=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==i){if(i.has(t))return i.get(t);i.set(t,u)}function u(){return o(t,arguments,e(this).constructor)}return u.prototype=Object.create(t.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),n(u,t)})(t)}function u(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}!function(e,i){var o=function(e){var o,r;function s(){var t;return(t=e.call(this)||this).onUserSelect="",t.onchangeStr="",t.buttonClick=t.buttonClick.bind(u(t)),t.iframeLoad=t.iframeLoad.bind(u(t)),t.modalClose=t.modalClose.bind(u(t)),t.setValue=t.setValue.bind(u(t)),t}r=e,(o=s).prototype=Object.create(r.prototype),o.prototype.constructor=o,n(o,r);var a,l,c,h=s.prototype;return h.connectedCallback=function(){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.modal&&window.bootstrap&&window.bootstrap.Modal&&!window.bootstrap.Modal.getInstance(this.modal)&&i.initialiseModal(this.modal,{isJoomla:!0}),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)))},h.disconnectedCallback=function(){this.onchangeStr&&this.input&&this.input.removeEventListener("change",this.onUserSelect),this.buttonSelect&&this.buttonSelect.removeEventListener("click",this),this.modal&&this.modal.removeEventListener("hide",this)},h.buttonClick=function(t){var e=t.target;this.setValue(e.getAttribute("data-user-value"),e.getAttribute("data-user-name")),this.modalClose()},h.iframeLoad=function(){var t=this,e=this.iframeEl.contentWindow.document;[].slice.call(e.querySelectorAll(".button-select")).forEach((function(e){e.addEventListener("click",t.buttonClick)}))},h.modalOpen=function(){this.removeIframe();var t=document.createElement("iframe");t.setAttribute("name","field-user-modal"),t.src=this.url.replace("{field-user-id}",this.input.getAttribute("id")),t.setAttribute("width",this.modalWidth),t.setAttribute("height",this.modalHeight),this.modalBody.appendChild(t),this.modal.open(),this.iframeEl=this.modalBody.querySelector("iframe"),this.iframeEl.addEventListener("load",this.iframeLoad)},h.modalClose=function(){i.Modal.getCurrent().close(),this.modalBody.innerHTML=""},h.removeIframe=function(){this.modalBody.innerHTML=""},h.setValue=function(t,e){this.input.setAttribute("value",t),this.inputName.setAttribute("value",e||t),this.input.dispatchEvent(new Event("change")),this.dispatchEvent(new CustomEvent("change",{detail:{value:t,name:e},bubbles:!0}))},a=s,c=[{key:"observedAttributes",get:function(){return["url","modal","modal-width","modal-height","input","input-name","button-select"]}}],(l=[{key:"url",get:function(){return this.getAttribute("url")},set:function(t){this.setAttribute("url",t)}},{key:"modalClass",get:function(){return this.getAttribute("modal")},set:function(t){this.setAttribute("modal",t)}},{key:"modalWidth",get:function(){return this.getAttribute("modal-width")},set:function(t){this.setAttribute("modal-width",t)}},{key:"modalHeight",get:function(){return this.getAttribute("modal-height")},set:function(t){this.setAttribute("modal-height",t)}},{key:"inputId",get:function(){return this.getAttribute("input")},set:function(t){this.setAttribute("input",t)}},{key:"inputNameClass",get:function(){return this.getAttribute("input-name")},set:function(t){this.setAttribute("input-name",t)}},{key:"buttonSelectClass",get:function(){return this.getAttribute("button-select")},set:function(t){this.setAttribute("button-select",t)}}])&&t(a.prototype,l),c&&t(a,c),Object.defineProperty(a,"prototype",{writable:!1}),s}(r(HTMLElement));e.define("joomla-field-user",o)}(customElements,Joomla)}();


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer