1// noinspection JSUnresolvedReference 2 3document.addEventListener('DOMContentLoaded', function () { 4 const buttons = document.querySelectorAll('.btn-select-destination'); 5 const hiddenInput = document.getElementById('destinationCode'); // hidden ã®è¦ç´ 6 const displayArea = document.getElementById('searchDestination'); // ãã¼ã ã®è¡¨ç¤ºé¨å 7 8 // ä¿åãããå¤ãé¸æç¶æ ã«ãã 9 const savedKey = getCookie('selectedDestinationKey'); 10 const savedValue = getCookie('selectedDestinationValue'); 11 12 if (savedKey && savedValue) { 13 // hidden ã«å¤ãã»ãã 14 hiddenInput.value = savedKey; 15 16 // ãã¼ã ã®è¡¨ç¤ºé¨åã«ã»ãã 17 displayArea.value = savedValue; 18 19 // ãã¿ã³ã®é¸æç¶æ ãæ´æ° 20 buttons.forEach(button => { 21 if (button.getAttribute('data-key') === savedKey) { 22 button.classList.add('active'); // é¸æç¶æ ã®ã¯ã©ã¹ã追å 23 } 24 }); 25 } 26 27 // ãã¿ã³ãã¯ãªãã¯ããéã®å¦ç 28 buttons.forEach(button => { 29 button.addEventListener('click', function () { 30 const key = this.getAttribute('data-key'); 31 const value = this.getAttribute('data-value'); 32 33 // ã¯ããã¼ã«ä¿å 34 setCookie('selectedDestinationKey', key); 35 setCookie('selectedDestinationValue', value); 36 37 // hidden ã«å¤ãã»ãã 38 hiddenInput.value = key; 39 40 // ãã¼ã ã®è¡¨ç¤ºé¨åãæ´æ° 41 displayArea.value = value; 42 43 // ãã¿ã³ã®é¸æç¶æ ãæ´æ° 44 buttons.forEach(btn => btn.classList.remove('active')); // å ¨ã¦ã®é¸æç¶æ ããªã»ãã 45 this.classList.add('active'); // 鏿ããããã¿ã³ã«ã¯ã©ã¹ã追å 46 47 // ã¢ã¼ãã«ãéãã 48 const modalInstance = bootstrap.Modal.getInstance(document.getElementById('search_arrival')); 49 if (modalInstance) { 50 modalInstance.hide(); 51 } 52 }); 53 }); 54});
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.