1import { Controller } from '@hotwired/stimulus' 2 3export default class extends Controller { 4 toggleRead (event) { 5 event.preventDefault() 6 const link = event.currentTarget 7 const row = link.closest('.discussion_row') 8 if (!row) return 9 10 fetch(link.href, { 11 method: 'PATCH', 12 headers: { 13 'X-CSRF-Token': document.querySelector('meta[name="csrf-token"]').content, 14 'X-Requested-With': 'XMLHttpRequest', 15 Accept: 'text/html' 16 } 17 }).then(response => response.text()) 18 .then(html => { 19 row.outerHTML = html 20 }) 21 } 22};
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.