1import { Controller } from '@hotwired/stimulus'; 2// ë³´ì ì´ìë¡ clipboard apië sslììë§ ìëë©ëë¤. 3//https://developer.mozilla.org/en-US/docs/Web/API/Navigator/clipboard 4 5/** 6 * @domain DOM ì í¸ 7 * @concern í´ë¦½ë³´ë ë³µì¬ 8 * @description Clipboard APIë¡ ì§ì í í ì¤í¸ë¥¼ í´ë¦½ë³´ëì ë³µì¬íê³ , ì±ê³µ/ì¤í¨ ë©ìì§ë¥¼ status íê¹(ìì¼ë©´ alert)ì¼ë¡ ì린ë¤. ë 문구ë ì¬ì´í¸ ì¸ì´ë¡ ë²ìí´ì¼ íë¯ë¡ ë·°ê° ë긴ë¤. (HTTPS íê²½ììë§ ëì) 9 */ 10export default class extends Controller { 11 static targets = ['status']; 12 13 static values = { 14 successMessage: { 15 type: String, 16 default: '', 17 }, 18 errorMessage: { 19 type: String, 20 default: '', 21 }, 22 content: { 23 type: String, 24 default: '', 25 }, 26 }; 27 28 async copy(event) { 29 event.preventDefault(); 30 try { 31 await window.navigator.clipboard.writeText(this.contentValue); 32 this.notify(this.successMessageValue); 33 } catch (error) { 34 this.notify(this.errorMessageValue); 35 } 36 } 37 38 // status íê¹ìë ë¹ ë¬¸êµ¬ë ì¨ì, ìì ì¤í¨ ë¬¸êµ¬ê° ë¨ì§ ìê² íë¤. 39 notify(message) { 40 if (this.hasStatusTarget) this.statusTarget.textContent = message; 41 else if (message) alert(message); 42 } 43}
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.