PageSourceSearch

https://www.chef-colle.com/shared/pc/js/search/common.js?tm1jlv

js chef-colle.com collected 2026-10-04 11:37:59 UTC 3,145 bytes, 112 lines download raw bytes

1import { redirect as searchRedirect } from '../../../js/api/search/index.js';
2import { initialize as initializeBudget } from '../../../js/api/search/budget.js';
3import { initialize as initializePerson } from '../../../js/api/search/person.js';
4import { initialize as initializeSync } from '../../../js/checkbox/sync.js';
5import { setEventBox } from '../../../js/link/index.js';
6import { initialize as initializeArea } from './component/area.js';
7import { initialize as initializeCalendar } from './component/calendar.js';
8
9var ChefColle = typeof window.ChefColle === 'undefined' ? {} : window.ChefColle; // eslint-disable-line
10
11$(() => {
12  /**
13   * コンストラクタ
14   */
15  ChefColle.PcSearchCommon = function () {
16    const self = this;
17
18    self.selector = {
19      searchButton: '.js-search-btn',
20    };
21
22    const form = $('.js-search-form');
23    self.obj = {
24      form,
25      formDetail: $('.js-search-detail-form'),
26      favorite: new ChefColle.PcCommonFavoriteFunction(),
27      sortSelect: $('#sortSelect'),
28      search: {
29        area: form.find('.js-area-box'),
30        calendar: form.find('.js-delivery-date-box'),
31        budget: form.find('.js-budget-box'),
32        person: form.find('.js-person-box'),
33      },
34    };
35
36    this.data = {
37      // [3096] 調査用 - カレンダーの初期表示制御フラグ
38      isDateInitializeOpen: 0,
39    };
40  };
41
42  /**
43   * 検索条件要素を取得
44   *
45   * @returns {Element[]} 対象要素
46   */
47  ChefColle.PcSearchCommon.prototype.getSearchElements = function () {
48    const self = this;
49    return [
50      self.obj.form,
51      self.obj.formDetail,
52      $('.js-result-header'),
53    ];
54  };
55  /**
56   * 並び順のその他を変更
57   *
58   * @param {Event} e イベント
59   */
60  ChefColle.PcSearchCommon.prototype.changeSortSelect = function (e) {
61    const self = this;
62    e.preventDefault();
63    searchRedirect(self.getSearchElements());
64  };
65
66  /**
67   * 適用ボタン押下時
68   *
69   * @param {Event} e イベント
70   */
71  ChefColle.PcSearchCommon.prototype.clickSearchApply = function (e) {
72    const self = this;
73    e.preventDefault();
74    searchRedirect(self.getSearchElements());
75  };
76
77  /**
78   * initialize
79   */
80  ChefColle.PcSearchCommon.prototype.initialize = function () {
81    const self = this;
82
83    self.obj.favorite.initialize();
84
85    self.obj.sortSelect.on('change', self.changeSortSelect.bind(self));
86    $(document).on('click', self.selector.searchButton, self.clickSearchApply.bind(self));
87
88    setEventBox();
89    initializeArea({
90      object: self.obj.search.area,
91    });
92    initializeCalendar({
93      object: self.obj.search.calendar,
94      initializeShow: self.data.isDateInitializeOpen && self.obj.form.data('currentPage') === 1,
95      fnClear: self.data.isDateInitializeOpen ? () => {
96        self.obj.searchButton.trigger('click');
97      } : undefined,
98    });
99    initializeBudget({
100      object: self.obj.search.budget,
101    });
102    initializePerson({
103      object: self.obj.search.person,
104    });
105    initializeSync({
106      object: self.obj.formDetail,
107    });
108  };
109
110  const obj = new ChefColle.PcSearchCommon();
111  obj.initialize();
112});

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.