1import { Controller } from "@hotwired/stimulus"; 2 3/** 4 * ã¢ãã¿ã¼ã³ã³ããã¼ã©ã¼ 5 * ã¦ã¼ã¶ã¼ã®ã¢ãã¿ã¼ç»åã®ã¢ãããã¼ãã¨ãã¬ãã¥ã¼ã管çãã 6 */ 7export default class extends Controller { 8 // ã¿ã¼ã²ããã®å®ç¾© 9 static targets = ["fileInput", "previewImage"]; 10 11 /** 12 * ãã¡ã¤ã«é¸æãã¤ã¢ãã°ãéã 13 * ç»åã®ã¢ãããã¼ããããªã¬ã¼ãã 14 */ 15 openFileDialog() { 16 this.fileInputTarget.click(); 17 } 18 19 /** 20 * ç»åãã¬ãã¥ã¼ã表示ãã 21 * 鏿ããããã¡ã¤ã«ãç»åã§ãããã¨ã確èªãããã¬ãã¥ã¼ãæ´æ°ãã 22 */ 23 displayPreview() { 24 const file = this.fileInputTarget.files[0]; 25 26 if (file && file.type.startsWith("image/")) { 27 const reader = new FileReader(); 28 29 reader.onload = (event) => { 30 this.previewImageTarget.src = event.target.result; 31 }; 32 33 reader.readAsDataURL(file); 34 } else { 35 this.fileInputTarget.value = ""; // ãã¡ã¤ã«ããªã»ãã 36 } 37 } 38};
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.