PageSourceSearch

https://www.nishikawa1566.com//js/sys/sys.js

js nishikawa1566.com collected 2026-09-24 18:14:24 UTC 3,610 bytes, 99 lines download raw bytes

1// 名前空間を定義
2var ecblib = ecblib || {};
3ecblib.sys = ecblib.sys || {};
4
5(function() {
6    // ローカル用の名前空間
7    var _sys = ecblib.sys;
8
9    /*!
10     * JavaScriptが有効である場合、要素を非表示状態から表示状態(block)に変更します。
11     */
12    jQuery(document).ready(function() {
13        jQuery(".js-creditcard-js-available").each(function() {
14            this.classList.remove('hidden');
15            if (getComputedStyle(this).display === 'none') {
16                jQuery(this).show();
17            }
18        });
19    });
20
21    /**
22     * jqObj HTML要素キャッシュ
23     */
24    const $htmlObj = $("html");
25
26    /*!
27     * 現在のブラウザ判定による画面モードをHTMLタグのカスタムデータ属性 data-browse-mode から取得します。なお、値が S である場合のみスマートフォンと判定されます。
28     */
29    _sys.isModeSmartPhone = function() {
30        return $htmlObj.data("browse-mode") == "S";
31    };
32
33    /**
34     * 現在のブラウザ判定による画面モードをHTMLタグのカスタムデータ属性 data-responsive-mode から取得します。
35     * なお、値が T である場合のみレスポンシブモードと判定されます。
36     */
37    _sys.isModeResponsiveView = function(){
38        return $htmlObj.data("responsive-mode") === "T";
39    };
40
41    /*!
42     * アプリケーションルートをmetaタグから読み取ります。
43     */
44    _sys.wwwroot = jQuery("meta[name='wwwroot']").attr('content');
45
46    _sys.escapeHtml = function escapeHtml(value) {
47        if (typeof value !== 'string') {
48            return value;
49        }
50        return value.replace(/[&'`"<>]/g, function(match) {
51            return {
52                '&': '&amp;',
53                "'": '&#x27;',
54                '`': '&#x60;',
55                '"': '&quot;',
56                '<': '&lt;',
57                '>': '&gt;',
58            }[match];
59        });
60    };
61
62    _sys.render = function render(template, keyValues) {
63        if (typeof keyValues !== 'object' || keyValues === null) { return template; }
64        return template.replace(/\$\{(.*?)\}|\#\{(.*?)\}/g, function(match, capt1, capt2) {
65            var key = capt1 ? capt1 : capt2;
66            if (Object.prototype.hasOwnProperty.call(keyValues, key)) {
67                var value = keyValues[key];
68                if (typeof value !== 'string') return '';
69                return match[0] === '$' ? _sys.escapeHtml(value) : value;
70            } else {
71                return match;
72            }
73        });
74    };
75
76    const matchMedia = window.matchMedia('(min-width: 769px)');
77
78    /**
79     * 既定のブレークポイントが設定されたMatchMediaオブジェクトを取得します。
80     */
81    _sys.getDefaultMatchMedia = function () {
82        return matchMedia;
83    };
84
85    /**
86     * ウィンドウの幅がブレークポイントを超えた/下回った場合に発火する処理を登録します。
87     * コールバック関数に渡されるの引数によって超えた/下回ったを識別できます。
88     */
89    _sys.addMatchMediaEventListener = function (callbackFunc) {
90        matchMedia.addEventListener('change', callbackFunc);
91    };
92
93    /**
94     * ecblib.sys.addMatchMediaEventListener関数で登録した処理を削除します。
95     */
96    _sys.removeMatchMediaEventListener = function (callbackFunc) {
97        matchMedia.removeEventListener('change', callbackFunc);
98    };
99})();

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.