1const form = document.getElementById("industry_search_form"); 2const parentSelect = document.getElementById("industry_parent"); 3const childSelect = document.getElementById("industry_child"); 4 5if (form && parentSelect && childSelect && typeof childTermsArray !== "undefined") { 6 7 /* ------------------ 8 åã¿ã¼ã ãã£ã«ã¿ã¼ 9 ------------------ */ 10 function filterChildren(reset = true) { 11 const selectedOption = parentSelect.options[parentSelect.selectedIndex]; 12 const parentID = selectedOption.dataset.termid || null; 13 14 // ã¾ãåã»ã¬ã¯ãã空ã«ãã 15 childSelect.innerHTML = '<option value="">è·ç¨®ã鏿</option>'; 16 17 // 該å½ããåã¿ã¼ã ã ã追å 18 childTermsArray.forEach(optionData => { 19 if (!parentID || optionData.parent == parentID) { 20 const opt = document.createElement("option"); 21 opt.value = optionData.url; 22 opt.textContent = optionData.name; 23 opt.dataset.parent = optionData.parent; 24 25 // åæè¡¨ç¤ºæã¯ç¾å¨ã®URLã¨ä¸è´ããåã¿ã¼ã ãé¸æç¶æ ã«ãã 26 if (!reset && typeof currentTermUrl !== "undefined" && optionData.url === currentTermUrl) { 27 opt.selected = true; 28 } 29 30 childSelect.appendChild(opt); 31 } 32 }); 33 34 // è¦ªå¤æ´æã ããè·ç¨®ã鏿ãã«æ»ã 35 if (reset) { 36 childSelect.value = ""; 37 } 38 } 39 40 /* ------------------ 41 親ã¿ã¼ã 夿´ 42 ------------------ */ 43 parentSelect.addEventListener("change", function () { 44 filterChildren(true); 45 }); 46 47 /* ------------------ 48 åæè¡¨ç¤º 49 ------------------ */ 50 document.addEventListener("DOMContentLoaded", function () { 51 filterChildren(false); 52 }); 53 54 /* ------------------ 55 æ¤ç´¢ãã¿ã³ã§é·ç§» 56 ------------------ */ 57 form.addEventListener("submit", function (e) { 58 e.preventDefault(); 59 const childURL = childSelect.value; 60 const parentURL = parentSelect.value; 61 62 if (childURL) { 63 location.href = childURL; 64 } else if (parentURL) { 65 location.href = parentURL; 66 } 67 }); 68}
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.