1import { Controller } from "@hotwired/stimulus" 2 3// Handles marking RFP responses as read when expanded 4// Connects to data-controller="rfp-response" 5export default class extends Controller { 6 static values = { 7 url: String, 8 read: { type: Boolean, default: false } 9 } 10 11 markRead() { 12 // Only mark read once 13 if (this.readValue) return 14 if (!this.urlValue) return 15 16 this.readValue = true 17 18 // Remove the "new" badge immediately for better UX 19 const newBadge = this.element.querySelector('[data-new-badge]') 20 if (newBadge) { 21 newBadge.remove() 22 } 23 24 // Call API to mark as read 25 fetch(this.urlValue, { 26 method: 'POST', 27 headers: { 28 'X-CSRF-Token': document.querySelector('meta[name="csrf-token"]')?.content, 29 'Accept': 'application/json' 30 } 31 }).catch(error => { 32 console.error('Failed to mark response as read:', error) 33 }) 34 } 35}
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.