CoreFiles by mySites.guru
joomla-toolbar-button-es5.min.js1 lines, 3,968 bytes, from Joomla_4.3.0-beta2-Beta-Full_Package.zip
Raw History Compare with 4.3.0-beta1
md5
7ac157a5c03ad587dbdfaad2974f8b43
sha1
eba3e66c7e5f53baa6f117b161c27d04357e1b9b
sha256
0ce0a331b9163c0d9172fdd9390f79055881e613b55aff2a7d3b6448815cc734
!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,(r=o.key,i=void 0,"symbol"==typeof(i=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e||"default");if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(r,"string"))?i:String(i)),o)}var r,i}function e(t){return e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},e(t)}function n(t,e){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},n(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.bind():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},r.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)},i(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)))}();

The same content is in 4 releases, Joomla 4.3.0-alpha3 to 4.3.0-beta3. See them all, or every version of this file.