PageSourceSearch

https://www.chef-colle.com/shared/js/link/index.js

js chef-colle.com collected 2026-10-04 11:38:04 UTC 1,079 bytes, 47 lines download raw bytes

1/**
2 * @module リンク
3 */
4
5const data = {
6  initialized: {},
7};
8
9/**
10 * BOX全体のリンク処理
11 *
12 * @param {Object} [options] - オプション
13 * @param {string} [options.event] - イベントタイプ
14 * @param {string} [options.targetSelector] - 対象となる要素のセレクタ
15 */
16export const setEventBox = function (options = {}) {
17  if (data.initialized.setEventBox) {
18    return;
19  }
20
21  data.initialized.setEventBox = true;
22
23  const settings = {
24    event: 'click',
25    targetSelector: '.js-box-link,.js-box-blank',
26    ...options,
27  };
28
29  $(document).on(settings.event, settings.targetSelector, (e) => {
30    const target = $(e.target);
31    if (!(target.closest('a,label,button,input').length)) {
32      if (!(target.parents().hasClass('unLink'))) {
33        const obj = $(e.currentTarget);
34        if (obj.hasClass('js-box-blank')) {
35          window.open(obj.attr('data-url'), '_blank');
36        } else {
37          window.location = obj.attr('data-url');
38        }
39        return false;
40      }
41    }
42
43    return true;
44  });
45};
46
47export default setEventBox;

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.