PageSourceSearch

https://smartsignpro.ai/assets/controllers/device_manager_controll…792e82dc54720d52bdb8ce817b28011e73b52114.js

js smartsignpro.ai collected 2026-10-02 00:42:27 UTC 1,400 bytes, 48 lines download raw bytes

1import { Controller } from "@hotwired/stimulus"
2
3export default class extends Controller {
4  static targets = ["activateForm", "screenSelect", "editForm"]
5
6  showActivateForm() {
7    this.activateFormTarget.classList.remove("hidden")
8  }
9
10  hideActivateForm() {
11    this.activateFormTarget.classList.add("hidden")
12  }
13
14  toggleEdit(event) {
15    const id = event.currentTarget.dataset.deviceId
16    const form = this.editFormTargets.find((el) => el.dataset.deviceId === id)
17    if (!form) return
18
19    form.classList.toggle("hidden")
20  }
21
22  cancelEdit(event) {
23    const id = event.currentTarget.dataset.deviceId
24    const form = this.editFormTargets.find((el) => el.dataset.deviceId === id)
25    if (!form) return
26
27    form.classList.add("hidden")
28  }
29
30  updateScreens(event) {
31    const locationId = parseInt(event.target.value)
32    const selects = this.screenSelectTargets
33
34    selects.forEach(select => {
35      const screensData = JSON.parse(select.dataset.locationScreens || "[]")
36      const screens = screensData.find(item => item[0] === locationId)
37      const screenList = screens ? screens[1] : []
38
39      select.innerHTML = '<option value="">Select screen...</option>'
40      screenList.forEach(screen => {
41        const option = document.createElement("option")
42        option.value = screen.id
43        option.textContent = screen.name
44        select.appendChild(option)
45      })
46    })
47  }
48};

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.