1import {Controller} from '@hotwired/stimulus'; 2 3/* stimulusFetch: 'lazy' */ 4export default class extends Controller { 5 static targets = [ 6 "expediteurRadio", 7 "expediteurActif", 8 "expediteurInactif", 9 "inputExpediteur", 10 'texte', 11 'counter' 12 ]; 13 14 connect() { 15 this.element.addEventListener('keypress', (event) => { 16 if (event.key === 'Enter') { 17 event.preventDefault(); 18 } 19 }) 20 } 21 22 toggleExpediteurInput() { 23 let isDefaultChecked = false; 24 25 this.expediteurRadioTargets.forEach((radio) => { 26 if (radio.checked && radio.value === 'default') { 27 isDefaultChecked = true; 28 } 29 }); 30 31 if (isDefaultChecked) { 32 this.expediteurActifTarget.classList.add('d-none'); 33 this.expediteurInactifTarget.classList.remove('d-none'); 34 this.inputExpediteurTarget.value = ''; // Clear the input 35 } else { 36 this.expediteurActifTarget.classList.remove('d-none'); 37 this.expediteurInactifTarget.classList.add('d-none'); 38 } 39 } 40 41 countCharacters(event) { 42 const length = event.target.value.length; 43 this.counterTarget.textContent = `${length} ${length > 1 ? 'caractères' : 'caractère'}`; 44 } 45}
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.