[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/media/system/js/ -> joomla-toolbar-button-es5.min.js (source)

   1  !function(){"use strict";function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}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 o(){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 r(t,e,i){return(r=o()?Reflect.construct:function(t,e,o){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return o&&n(i,o.prototype),i}).apply(null,arguments)}function i(t){var o="function"==typeof Map?new Map:void 0;return(i=function(t){if(null===t||(i=t,-1===Function.toString.call(i).indexOf("[native code]")))return t;var i;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==o){if(o.has(t))return o.get(t);o.set(t,s)}function s(){return r(t,arguments,e(this).constructor)}return s.prototype=Object.create(t.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}),n(s,t)})(t)}function s(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}window.customElements.define("joomla-toolbar-button",function(e){var o,r;function i(){var t;if(t=e.call(this)||this,!Joomla)throw new Error("Joomla API is not properly initiated");return t.onChange=t.onChange.bind(s(t)),t.executeTask=t.executeTask.bind(s(t)),t}r=e,(o=i).prototype=Object.create(r.prototype),o.prototype.constructor=o,n(o,r);var u,c,a,l=i.prototype;return l.connectedCallback=function(){this.buttonElement=this.querySelector("button, a"),this.buttonElement.addEventListener("click",this.executeTask);var t=this.form||"adminForm";if(this.formElement=document.getElementById(t),this.disabled=!1,this.listSelection&&this.setDisabled(!0),this.listSelection){if(!this.formElement)throw new Error('The form "'+t+'" is required to perform the task, but the form was not found on the page.');this.formElement.boxchecked.addEventListener("change",this.onChange)}},l.disconnectedCallback=function(){this.formElement.boxchecked&&this.formElement.boxchecked.removeEventListener("change",this.onChange),this.buttonElement.removeEventListener("click",this.executeTask)},l.onChange=function(t){var e=t.target;this.setDisabled(e.value<1)},l.setDisabled=function(t){this.disabled=!!t,this.buttonElement&&(this.disabled?"BUTTON"===this.buttonElement.nodeName?this.buttonElement.disabled=!0:this.buttonElement.classList.add("disabled"):"BUTTON"===this.buttonElement.nodeName?this.buttonElement.disabled=!1:this.buttonElement.classList.remove("disabled"))},l.executeTask=function(){return!this.disabled&&(!(this.confirmMessage&&!confirm(this.confirmMessage))&&(this.task&&Joomla.submitbutton(this.task,this.form,this.formValidation),!0))},u=i,(c=[{key:"task",get:function(){return this.getAttribute("task")}},{key:"listSelection",get:function(){return this.hasAttribute("list-selection")}},{key:"form",get:function(){return this.getAttribute("form")}},{key:"formValidation",get:function(){return this.hasAttribute("form-validation")}},{key:"confirmMessage",get:function(){return this.getAttribute("confirm-message")}}])&&t(u.prototype,c),a&&t(u,a),Object.defineProperty(u,"prototype",{writable:!1}),i}(i(HTMLElement)))}();


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