1// app/typescript/controllers/clipboard_controller.ts 2import { Controller } from "@hotwired/stimulus"; 3 4class clipboard_controller_default extends Controller { 5 connect() {} 6 copy() { 7 const value = this.element.dataset.value; 8 var tempInput = document.createElement("input"); 9 tempInput.style = "position: absolute; left: -1000px; top: -1000px"; 10 tempInput.value = value ?? ""; 11 document.body.appendChild(tempInput); 12 tempInput.select(); 13 document.execCommand("copy"); 14 document.body.removeChild(tempInput); 15 const oldValue = this.element.innerHTML; 16 this.element.innerHTML = "Copied!"; 17 const self = this; 18 setTimeout(function() { 19 self.element.innerHTML = oldValue; 20 }, 1000); 21 } 22} 23export { 24 clipboard_controller_default as default 25};
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.