1// TOBéå ±æ¤ç´¢ãã©ã¼ã ã®ãã§ãã¯ããã¯ã¹/ã©ã¸ãªãã¿ã³å¶å¾¡ 2// ERBããæ¸¡ããããã¼ã¿: window.tobNewsSearchData = { templateId: "..." } 3 4function initializeTobNewsSearch() { 5 if (!window.tobNewsSearchData) { 6 console.error('TOB News Search: window.tobNewsSearchData is not defined'); 7 return; 8 } 9 10 const { templateId } = window.tobNewsSearchData; 11 const container = document.getElementById(templateId); 12 13 if (!container) { 14 console.error(`TOB News Search: Container with id ${templateId} not found`); 15 return; 16 } 17 18 // TOBã©ã¸ãªãã¿ã³ã®å¶å¾¡ï¼ãã°ã«æ©è½ä»ãï¼ 19 const tobChecked = container.querySelector('input[name=tob]:checked'); 20 let nowchecked = tobChecked ? tobChecked.value : null; 21 22 container.querySelectorAll('input[name=tob]').forEach((input) => { 23 input.addEventListener('click', function() { 24 if (input.value === nowchecked) { 25 input.checked = false; 26 nowchecked = null; 27 } else { 28 nowchecked = input.value; 29 } 30 }); 31 }); 32 33 // å®äºæ¡ä»¶ãã§ãã¯ããã¯ã¹ã®å¶å¾¡ï¼ãã°ã«æ©è½ä»ãï¼ 34 const doneChecked = container.querySelector('input[name=done]:checked'); 35 let donechecked = doneChecked ? doneChecked.value : null; 36 37 container.querySelectorAll('input[name=done]').forEach((input) => { 38 input.addEventListener('click', function() { 39 if (input.value === donechecked) { 40 input.checked = false; 41 donechecked = null; 42 } else { 43 donechecked = input.value; 44 } 45 }); 46 }); 47 48 // ã©ãã«ã¯ãªãã¯ã§ã®ãã§ãã¯ããã¯ã¹/ã©ã¸ãªãã¿ã³æä½ 49 container.querySelectorAll('label[for=tob_hostile_0], label[for=tob_mbo_1], label[for=done_0]').forEach((label) => { 50 label.addEventListener('click', function() { 51 const previousElement = label.previousElementSibling; 52 if (previousElement) { 53 previousElement.click(); 54 } 55 }); 56 }); 57} 58 59document.addEventListener('DOMContentLoaded', function() { 60 initializeTobNewsSearch(); 61});
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.