PageSourceSearch

https://cosmobase.ru/assets/controllers/search_component_controlle…feb2fd6a6f53dbef0b914e277fbb56d866b18d7c.js

js cosmobase.ru collected 2026-10-02 03:38:37 UTC 748 bytes, 24 lines download raw bytes

1import { Controller } from "@hotwired/stimulus"
2
3export default class extends Controller {
4  static targets = ['results', 'input', 'componentIdInput'];
5  static values = {url: String}
6
7  findResults(event) {
8    const searchTerm = encodeURIComponent(event.target.value);
9    const urlWithSearchTerm = this.urlValue.replace(/_0_component/g, searchTerm);
10    this.resultsTarget.classList.remove("hidden")
11    this.resultsTarget.src = urlWithSearchTerm;
12  }
13
14  selectComponent(event) {
15    this.componentIdInputTarget.value = event.currentTarget.dataset.componentId
16    this.inputTarget.value = event.currentTarget.dataset.componentName
17
18    this.resultsTarget.classList.add("hidden")
19  }
20
21  clearInput(event) {
22    this.inputTarget.value = ""
23  }
24};

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.