PageSourceSearch

https://www.tapmarche.jp/contents/js/Project.common.js?var=release_20260622

js tapmarche.jp collected 2026-10-05 04:03:24 UTC 10,240 bytes, 288 lines download raw bytes

1/* 初期フォーカス無効化 */
2isInitFocus = false;
3var startPos = 0;
4var winScrollTop = 0;
5
6
7/* scrollUp full options*/
8$(function () {
9    $.scrollUp({
10        scrollName: 'scrollUp',
11        topDistance: '10', // トップからどれだけの高さで表示させるか(px)
12        topSpeed: 300, // トップへ戻るスピード (ms)
13        animation: 'fade', // Fade, slide, noneの中から選択
14        animationInSpeed: 300, // ボタンが現れるスピード (ms)
15        animationOutSpeed: 300, // ボタンが消えるスピード (ms)
16        scrollText: 'ページの先頭へ', // テキスト表示させるときの文字
17        scrollImg: true, // イメージを表示させるときはtrueにします
18        activeOverlay: false // トップからの距離を指定した色の線で表示してくれます。(例)activeOverlay: '#00FFFF'
19    });
20});
21
22/* ページ内スクロール */
23 $(function() {
24 $(".scroll").click(function(event){
25  event.preventDefault();
26
27  var url = this.href;
28
29  var parts = url.split("#");
30  var target = parts[1];
31
32  var target_offset = $("#"+target).offset();
33  var target_top = target_offset.top;
34
35  $('html, body').animate({scrollTop:target_top}, 1000);
36  });
37 });
38
39/* フォントサイズ切替 */
40$(function(){
41    $("#textsize a").textresizer({
42        target: "#contents",
43        type: "fontSize",
44        sizes: ["14px", "16px", "18px", "20px"],
45        selectedIndex: 1
46    });
47});
48
49/* 全体のプレースホルダーの表示非表示を制御 */
50function cleanPlaceholder() {
51    if (window.navigator.userAgent.toLowerCase().indexOf('msie') !== -1) {
52        var inputElements = $('input');
53        inputElements.each(function(idx) {
54            if ($(this).attr("placeholder")) {
55                $(this).triggerHandler("change");
56            }
57        });
58    }
59}
60
61
62function openPriceSimulation() {
63    var height = window.parent.screen.availHeight - 100;
64    var url = getUrlWithContextPath("PriceSimulation.jsp", "");
65    var parameter = "";
66    var setting = "";
67    var focus = "";
68    var win = openRefSelectWindow(url, 1000, height, parameter, setting, focus, true);
69}
70
71/* 動画ポップアップ */
72function openMovieHitachinoLager() {
73    var url = getUrlWithContextPath("s/tra_hitachino_lager/", "");
74    var parameter = "";
75    var setting = "";
76    var focus = "";
77    var win = openRefSelectWindow(url, 900, 600, parameter, setting, focus, true);
78}
79
80function getWaitTime() {
81    return 500;
82}
83
84/**
85 * ミニカートボタンに対し、クリックされた際に実行されるイベント処理です。(商品詳細モーダル)
86 * @param element 呼び出し項目
87 */
88function onclickCartButton(element) {
89    var cartButton = $(element + ' a');
90    var url = cartButton.attr('href');
91    if (!cartButton.hasClass('disabled')) {
92        cartButton.addClass('disabled');
93        cartButton.css('opacity', '0.6');
94        setTimeout(function() {
95            window.location.href = url;
96            return true;
97        }, getWaitTime());
98    }
99    return false;
100}
101
102/* パスワードを表示するボタン */
103function ChangePwd() {
104    var pwEmt = $('.pwd');
105    var changeType;
106    if ($('#pwdDispButton').prop('checked')) {
107        changeType = 'text';
108    } else {
109        changeType = 'password';
110    }
111
112    for(var i=0; i<$(pwEmt).size(); i++) {
113        var id = $(pwEmt[i]).attr('id');
114        document.getElementById(id).type = changeType;
115        $(pwEmt[i]).attr('autocomplete', 'off');
116    }
117}
118
119/**
120 * バッチ実行のリアルタイム参照ログを表示します。
121 * @param batchId バッチID
122 */
123function loadBatchLog(batchId) {
124    var paramBatchId = batchId;
125    var paramNowSeq = getElementValue("nowSeq");
126    var paramLogEnd = getElementValue("logEnd");
127    var resultsStatus;
128    var errorMessage;
129    if (isNullorUndefinedorEmpty(paramLogEnd) || paramLogEnd == "1") {
130        // 実行中でないのでロードしない
131        return;
132    }
133
134    if (!isNullorUndefined(paramBatchId)) {
135        var paramBatchExecuteId = getElementValue("batchExecuteId");
136        $('#logArea_innerId').append('<div class=\"loadingImg" id="loadingImg">');
137        var timerId = setInterval(function() {
138            scrollHeight = $(document).height();
139            scrollPosition = $(window).height() + $(window).scrollTop();
140            $.ajaxSetup({ cache: false });
141            $.getJSON("jp/eltex/afw/eg/batch/frontif/bean/ajax/AjaxBatchRealtimeReferenceBean.json", {"batchId":paramBatchId, "nowSeq":paramNowSeq, "batchExecuteId":paramBatchExecuteId}, function(info) {
142                if (isNullorUndefined(info)) {
143                    return;
144                }
145                $('#logArea_innerId').append(info.contents);
146                if (scrollHeight - scrollPosition <= 100) {
147                    // スクロールの位置が下部に来た場合
148                    // ログ出力に追従させる
149                    $('html,body').animate({scrollTop:$('#logArea_innerId').offset().top+$('#logArea_innerId').height()},'slow');
150                }
151
152                if (!isNullorUndefinedorEmpty(info.nowSeq)) {
153                    paramNowSeq = info.nowSeq;
154                }
155
156                if (info.logEnd == true) {
157                    clearInterval(timerId);
158                    $("#loadingImg").attr('style','display:none;');
159                }
160            });
161        }, 3000);
162    }
163}
164
165/**
166 * LPやフリーページからカートに商品を追加する
167 * @param salesGoodsCode 販売商品コード
168 * @param orderNum 注文数量
169 * @param regulalryInterval 定期間隔
170 * @param page フリーページ番号
171 */
172function addCart(salesGoodsCode,orderNum,regularlyInterval) {
173/**
174 * 使い方
175 * <a href="#" onclick="addCart('$販売商品コード$','$数量$','$定期間隔$');">カートに入れる</a>
176 */
177    var page = getValue("page");
178    location.href=getUrlWithContextPath("GoodsAddCartMulti.jsp?a=addCart&salesGoodsCode="+salesGoodsCode+"&orderNum="+orderNum+"&regularlyInterval="+regularlyInterval+"&page="+page);
179}
180
181/**
182 * LPやフリーページからカートに商品を追加する。数量はID指定のselectboxから取得。
183 * @param salesGoodsCode 販売商品コード
184 * @param orderNum 注文数量
185 * @param page フリーページ番号
186 */
187function addCartFromId(salesGoodsCode,id) {
188    /**
189    * 使い方
190    * <a href="#" onclick="addCartFromId('$販売商品コード$','$id名$');">カートに入れる</a>
191    *
192    * 数量はselectboxで記述。<select name="goods" id="orderNum">...
193    * 例)addCartFromId('$商品コード$','orderNum')
194    */
195    //ID指定の場合はjqueryで取得
196    var orderNum = $('#'+id).val();
197    addCart(salesGoodsCode,orderNum,"");
198}
199
200/**
201 * LPやフリーページからカートに商品を追加する。form内の全要素を追加する。
202 */
203function addCartAll() {
204    /**
205    *
206    * 数量はselectbox or hiddenで記述。data-codeには販売商品コードを指定する。data-intervalには定期間隔を指定する。
207    * classにはaddCartを指定する。<select name="DN002" id="addCartId" class="addCart2">
208    */
209    var page = getValue("page");
210    var salesGoodsCodeList = "";
211    var orderNumList = "";
212    var regularlyIntervalList = "";
213    //class名にaddCartが入っているinputを拾ってループする
214    $('.addCart').each(function() {
215            //選択された注文数量を取得
216            var orderNum =$(this).val();
217            //inputのname=販売商品コードとして処理する
218            var salesGoodsCode =$(this).data("code");
219            var regularlyInterval =$(this).data("interval");
220            console.log(salesGoodsCode + ',' + orderNum + ',' + regularlyInterval);
221
222            //セットで値がある時のみで、0じゃないとき
223            if(salesGoodsCode != '' && orderNum != '' && orderNum != '0') {
224                if(salesGoodsCodeList == '') {
225                    salesGoodsCodeList = "salesGoodsCode="+salesGoodsCode;
226                } else {
227                    salesGoodsCodeList += ","+salesGoodsCode;
228                }
229                if(orderNumList == '') {
230                    orderNumList = "orderNum="+orderNum;
231                } else {
232                    orderNumList += ","+orderNum;
233                }
234                if(regularlyIntervalList == '') {
235                    regularlyIntervalList = "regularlyInterval="+regularlyInterval;
236                } else {
237                    regularlyIntervalList += ","+regularlyInterval;
238                }
239            }
240    });
241
242    if(salesGoodsCodeList != '' && orderNumList != '') {
243            location.href=getUrlWithContextPath("GoodsAddCartMulti.jsp?a=addCart&"+encodeURI(salesGoodsCodeList) + "&"+encodeURI(orderNumList) + "&"+encodeURI(regularlyIntervalList) + "&page="+page);
244    }
245}
246
247
248/**
249* パスワードの復元処理削除
250*/
251$(function() {
252    const targetList = [
253        // 処理対象画面IDリスト
254        'MemberModify',
255        'MemberNetRegister',
256        'PasswordChange',
257        'ReminderPasswordModInput',
258    ];
259    // 表示している画面のID
260    const screenId = $('#screenId').val();
261    if (targetList.includes(screenId)) {
262        // 全input[type:password]に対して処理
263        $('input[type="password"]').each((index, e) => {
264            // 発火させる
265            var interval = autoCompleteBlock(e);
266            // フォーカスが当たった時点でストップ
267            $(e).on('focus', () => {
268                clearInterval(interval);
269            });
270        });
271    }
272})
273
274/**
275* 自動補完ブロック機能
276*/
277function autoCompleteBlock(e) {
278    var counter = 0;
279    var interval = setInterval(() => {
280        counter++;
281        $(e).val('');
282        if (counter > 200) {
283            // 回数上限に達したら停止
284            clearInterval(interval);
285        }
286    }, 10, e, counter);
287    return interval;
288}

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.