PageSourceSearch

https://maonline.jp/assets/client/tob_news_search-2b22ccfd.js

js maonline.jp collected 2026-10-02 07:42:16 UTC 2,041 bytes, 61 lines download raw bytes

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.