1import { Controller } from '@hotwired/stimulus'; 2 3export default class extends Controller { 4 static values = { 5 text: String, 6 successMessage: { type: String, default: 'ã³ãã¼ãã¾ãã' }, 7 errorMessage: { type: String, default: 'ã³ãã¼ã«å¤±æãã¾ãã' } 8 } 9 10 copy(event) { 11 if (!this.textValue) return; 12 13 const target = event.currentTarget; 14 navigator.clipboard.writeText(this.textValue).then(() => { 15 if (this.element) { 16 this.dispatch('show', { 17 target: target, 18 detail: { text: this.successMessageValue }, 19 prefix: 'toast' 20 }); 21 } 22 }).catch(err => { 23 console.error('Copy failed: ', err); 24 if (this.element) { 25 this.dispatch('show', { 26 target: target, 27 detail: { text: this.errorMessageValue }, 28 prefix: 'toast' 29 }); 30 } 31 }); 32 } 33}
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.