1import { Controller } from "@hotwired/stimulus" 2import { CookieSet } from "lib/cookie_data" 3 4export default class extends Controller { 5 connect() { 6 this.opened = new CookieSet("courseTree") 7 this.wireUp() 8 this.setState() 9 } 10 11 wireUp() { 12 const labels = Array.from(this.element.querySelectorAll("li > label")) 13 labels.forEach(label => { 14 label.addEventListener("click", e => { 15 const li = e.currentTarget.parentElement 16 this.opened.toggle(li.id) 17 }) 18 }) 19 } 20 21 setState() { 22 this.opened.asArray().map(id => { 23 this.element.querySelector(`#${id} > [type=checkbox]`).checked = true 24 }) 25 } 26} 27;
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.