1import { Controller } from "@hotwired/stimulus"; 2 3export default class extends Controller { 4 5 static get targets() { 6 return ['password', 'passwordConfirmation', 'submitButton'] 7 } 8 9 connect() { 10 this.input(); 11 } 12 13 input() { 14 this.passwordTarget.value = this.passwordTarget.value.trim(); 15 this.passwordConfirmationTarget.value = this.passwordConfirmationTarget.value.trim(); 16 if (this.passwordTarget.value && this.passwordConfirmationTarget.value) { 17 this.submitButtonTarget.removeAttribute('disabled'); 18 } else { 19 this.submitButtonTarget.setAttribute('disabled', 'disabled'); 20 } 21 } 22 23 togglePasswordVisibility() { 24 const passwordInput = this.passwordTarget; 25 if (passwordInput.type === 'password') { 26 passwordInput.type = 'text'; 27 } else { 28 passwordInput.type = 'password'; 29 } 30 } 31}
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.