PageSourceSearch

https://www.ec-store.net/js/sws/usr/pc_searchform_keyword.js

js ec-store.net collected 2026-09-25 18:38:51 UTC 3,105 bytes, 85 lines download raw bytes

1var ecblib = ecblib || {};
2ecblib.customize = ecblib.customize || {};
3ecblib.customize.searchform_keyword = ecblib.customize.searchform_keyword || {};
4
5jQuery(document).ready(function () {
6    var _searchform_keyword = ecblib.customize.searchform_keyword;
7
8    if (jQuery("#search_keyword").length != 0){
9        var keyword = jQuery("#search_keyword").val();
10        jQuery("input[name='q']").val(keyword);
11    }
12
13    // 2025/08/29 js修正箇所開始
14    // ①「セットアップ」のチェックボックスを追加
15    var $setupLi = jQuery('<li></li>');
16    var $checkbox = jQuery('<input>', {
17      type: 'checkbox',
18      value: 'setup',
19      id: 'category_setup' 
20    });
21    var $label = jQuery('<label>', {
22      for: 'category_setup',
23      text: 'セットアップ' 
24    });
25    // liにinputとlabelを追加
26    $setupLi.append($checkbox).append($label);
27 
28    // 「その他」チェックボックスの<li>を探す
29    var $otherLi = jQuery('#category_9').closest('li');
30 
31    if ($otherLi.length) {
32      // 「その他」の上に挿入
33      $setupLi.insertBefore($otherLi);
34    } else {
35      // なければリストの最後に追加
36      var $categoryList = jQuery('.block-search-param--category-list');
37      $categoryList.append($setupLi);
38    }
39 
40    // ②画面表示時の「セットアップ」チェックボックスのチェック有無制御
41    jQuery(function($){
42 
43      var qParam = new URLSearchParams(window.location.search).get('q');
44 
45      if (qParam) {
46        var words = qParam.split(/[\s]+/);
47        // urlパラメータのqに「セットアップ」を含む場合はチェックをつける
48        if (words.indexOf('セットアップ') !== -1) {
49          $('#category_setup').prop('checked', true);
50          //BJL:すべて(ALL)にはチェックを入れない
51          $('#category_').prop('checked', false);
52        }
53      }
54    });
55    // 2025/08/29 js修正箇所終了
56
57
58    jQuery("#frmSearch").submit(function(){
59        jQuery("#search_keyword").val(jQuery("#keyword").val());
60        
61        // 2025/08/29 js修正箇所開始
62        // ③検索ボタン押下時、検索パラメータに「セットアップ」を追加、削除
63       var $setupCheckbox = jQuery('#category_setup');
64       var $keywordInput = jQuery(this).find('input[name="q"]');
65       var currentVal = $keywordInput.val().trim();
66
67       var words = currentVal.length > 0 ? currentVal.split(/\s+/) : [];
68
69       if ($setupCheckbox.prop('checked')) {
70         // チェックあり → 「セットアップ」がなければ追加
71         if (words.indexOf('セットアップ') === -1) {
72           words.push('セットアップ');
73         }
74       } else {
75         // チェックなし → 「セットアップ」を削除
76         words = words.filter(function(word) {
77           return word !== 'セットアップ';
78         });
79       }
80       $keywordInput.val(words.join(' '));
81       // 2025/08/29 js修正箇所終了
82        
83    });
84
85});

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.