PageSourceSearch

https://bikeindex.org/assets/controllers/org/register_settings_con…53a1119201101b42d1aeae25807fa58dba24b57e.js

js bikeindex.org collected 2026-10-01 10:24:28 UTC 858 bytes, 30 lines download raw bytes

1import { Controller } from '@hotwired/stimulus'
2
3// Connects to data-controller='org--register-settings'
4// The old view bypasses these settings; each shows what it does instead (data-old-view-checked)
5export default class extends Controller {
6  static targets = ['oldView', 'oldViewShown']
7
8  connect () {
9    this.apply()
10  }
11
12  apply () {
13    const off = this.oldViewTarget.checked
14    this.oldViewShownTargets.forEach(box => {
15      this.showOldView(box, off)
16      box.disabled = off
17    })
18  }
19
20  // Remembers what it was set to, for when the old view is unchecked
21  showOldView (box, off) {
22    if (off) {
23      box.dataset.chosen ??= box.checked
24      box.checked = box.dataset.oldViewChecked === 'true'
25    } else if (box.dataset.chosen !== undefined) {
26      box.checked = box.dataset.chosen === 'true'
27      delete box.dataset.chosen
28    }
29  }
30};

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.