1import { Controller } from "@hotwired/stimulus"; 2 3export default class extends Controller { 4 static targets = [ 5 "subscribeButton", 6 "confirmationMessage", 7 "finalizeButton", 8 "warning", 9 "acceptance", 10 "politics" 11 ]; 12 13 connect() { 14 // console.log("Newsletter controller connected"); 15 this.updateButtonState(); 16 } 17 18 // Maneja el envÃo del formulario 19 submit(event) { 20 this.finalizeButtonTarget.classList.add("d-none"); 21 this.confirmationMessageTarget.classList.remove("d-none"); 22 } 23 24 // Maneja el cambio de los checkboxes 25 toggle() { 26 this.updateButtonState(); 27 } 28 29 // Actualiza el estado del botón de finalizar 30 updateButtonState() { 31 const isAccepted = 32 this.acceptanceTarget.checked && this.politicsTarget.checked; 33 34 this.finalizeButtonTarget.disabled = !isAccepted; 35 this.warningTarget.classList.toggle("d-none", isAccepted); 36 } 37};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.