CoreFiles by mySites.guru
joomla-toolbar-button.min.js1 lines, 1,770 bytes, from Joomla_4.0.0-alpha9-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha8
md5
3ae337c03d6da1b025b690263aa65609
sha1
8af8d6db6fcc3fabbd7b2dbef25a6f4118a43d53
sha256
03f44e352b28098fe720eeab7f55724cdd11c580813e6695c5559930d3bd2e23
"use strict";window.customElements.define("joomla-toolbar-button",class extends HTMLElement{get task(){return this.getAttribute("task")}get listSelection(){return this.hasAttribute("list-selection")}get form(){return this.getAttribute("form")}get formValidation(){return this.hasAttribute("form-validation")}get confirmMessage(){return this.getAttribute("confirm-message")}constructor(){if(super(),!Joomla)throw new Error("Joomla API is not properly initiated");this.onChange=this.onChange.bind(this),this.addEventListener("click",a=>this.executeTask(a))}connectedCallback(){this.buttonElement=this.querySelector("button, a");const a=this.form||"adminForm";if(this.formElement=document.getElementById(a),this.disabled=!1,this.listSelection&&this.setDisabled(!0),this.listSelection){if(!this.formElement)throw new Error(`The form "${a}" is required to perform the task, but the form was not found on the page.`);this.formElement.boxchecked.addEventListener("change",this.onChange)}}disconnectedCallback(){this.formElement.boxchecked&&this.formElement.boxchecked.removeEventListener("change",this.onChange),this.removeEventListener("click")}onChange(a){this.setDisabled(1>a.target.value)}setDisabled(a){this.disabled=!!a,this.disabled?this.setAttribute("disabled",!0):this.removeAttribute("disabled"),this.buttonElement&&(this.disabled?"BUTTON"===this.buttonElement.nodeName?this.buttonElement.setAttribute("disabled",!0):this.buttonElement.classList.add("disabled"):"BUTTON"===this.buttonElement.nodeName?this.buttonElement.removeAttribute("disabled"):this.buttonElement.classList.remove("disabled"))}executeTask(){return!this.disabled&&(!this.confirmMessage||confirm(this.confirmMessage))&&(this.task&&Joomla.submitbutton(this.task,this.form,this.formValidation),!0)}});

The same content is in 3 releases, Joomla 4.0.0-alpha8 to 4.0.0-alpha10. See them all, or every version of this file.