1import { Controller } from "@hotwired/stimulus"; 2 3export default class SearchController extends Controller { 4 static targets = ["clearButton", "inputSearch"]; 5 searching(event) { 6 const value = event.target.value.trim(); 7 8 if (value.length > 0) { 9 this.clearButtonTarget.classList.remove("hidden"); 10 } else { 11 this.clearButtonTarget.classList.add("hidden"); 12 } 13 14 clearTimeout(this.timeout); 15 this.timeout = setTimeout(() => { 16 this.element.requestSubmit(); 17 }, 500); 18 } 19 removeClearButton() { 20 this.clearButtonTarget.classList.add("hidden"); 21 } 22}
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.