PageSourceSearch

https://www.kumagayacci.or.jp/renewal/wp-content/plugins/my-snow-monkey/assets/js/industry-search.js?ver=7.0.6

js kumagayacci.or.jp collected 2026-10-05 17:46:07 UTC 2,274 bytes, 68 lines download raw bytes

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.