1import { Controller } from "@hotwired/stimulus" 2 3export default class extends Controller { 4 static targets = [ "text" ] 5 6 initialize() { 7 window.clipboardForSystemTestsToCheck = "" 8 } 9 10 copy() { 11 navigator.clipboard.writeText(this.text) 12 window.clipboardForSystemTestsToCheck = this.text 13 } 14 15 get text() { 16 return this.removeExclusions(this.textTarget).innerText?.trim() 17 } 18 19 removeExclusions(node) { 20 let clonedNode = node.cloneNode(true) 21 clonedNode.querySelectorAll('.clipboard-exclude').forEach(el => el.remove()) 22 return clonedNode 23 } 24};
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.