PageSourceSearch

https://www.larocheposay.co.kr/js/common_dev.js?v=05131010202606

js larocheposay.co.kr collected 2026-10-06 13:06:30 UTC 17,667 bytes, 473 lines download raw bytes

1var comApp = comApp || {};
2
3// console.log('comApp in js : ', comApp);
4
5comApp.calender = (function($) {
6    var target, startInput, endInput, callBack;
7    var init = function(iTarget, cb) {
8
9        $.datepicker.setDefaults({
10            closeText: '닫기',
11            currentText: '오늘',
12            prevText: '이전 달',
13            nextText: '다음 달',
14            monthNames: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
15            monthNamesShort: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
16            dayNames: ['일', '월', '화', '수', '목', '금', '토'],
17            dayNamesShort: ['일', '월', '화', '수', '목', '금', '토'],
18            dayNamesMin: ['일', '월', '화', '수', '목', '금', '토'],
19            weekHeader: '주',
20            yearSuffix: '년',
21            dateFormat: 'yy-mm-dd',
22            showMonthAfterYear : true
23        });
24
25        target = $(iTarget);
26        callBack = cb;
27
28        startInput = $("input[name=" + target.data("start") + "]");
29        if (target.data("mobile") != true) {
30            startInput.datepicker();
31            startInput.datepicker("option", "onSelect", function(dateText, inst) {
32                changeDate();
33            });
34        }
35        endInput = $("input[name=" + target.data("end") + "]");
36        if (target.data("mobile") != true) {
37            endInput.datepicker();
38            endInput.datepicker("option", "onSelect", function(dateText, inst) {
39                changeDate();
40            });
41        }
42        if (target.data("mobile") == true) {
43            target.on("change", monthEvent);
44            target.children().eq(0).prop("selected", true);
45            target.change();
46        } else {
47            target.children().on("click", monthEvent);
48            target.children().eq(0).click();
49        }
50
51        if (target.data("first") == "true") {
52            target.children().eq(0).click();
53        }
54        if (target.data("mobile") != true) {
55            if (startInput.val() != "" || endInput.val() != "") {
56                changeDate();
57            }
58        }
59
60    }, formatDate = function(year, month, day) {
61        var d = new Date(year, month, day), month = '' + (d.getMonth() + 1), day = '' + d.getDate(), year = d.getFullYear();
62
63        if (month.length < 2) {
64            month = '0' + month;
65        }
66        if (day.length < 2) {
67            day = '0' + day;
68        }
69        return [ year, month, day ].join('-');
70    }, changeDate = function() {
71        startInput.datepicker("option", "maxDate", endInput.val());
72        endInput.datepicker("option", "minDate", startInput.val())
73    }, monthEvent = function() {
74        var nowDate = new Date();
75        target.children().removeClass("on");
76        $(this).addClass("on");
77        var index = 0;
78        if (target.data("mobile") == true) {
79            index = $(this).val();
80        } else {
81            index = $(this).index();
82        }
83
84        if (index == 0) {
85            endInput.val(formatDate(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate()));
86            nowDate.setMonth(nowDate.getMonth() - 1);
87            startInput.val(formatDate(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate()));
88        } else if (index == 1) {
89            endInput.val(formatDate(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate()));
90            nowDate.setMonth(nowDate.getMonth() - 3);
91            startInput.val(formatDate(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate()));
92        } else if (index == 2) {
93            endInput.val(formatDate(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate()));
94            nowDate.setMonth(nowDate.getMonth() - 6);
95            startInput.val(formatDate(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate()));
96        } else if (index == 3) {
97            endInput.val(formatDate(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate()));
98            nowDate.setMonth(nowDate.getMonth() - 12);
99            startInput.val(formatDate(nowDate.getFullYear(), nowDate.getMonth(), nowDate.getDate()));
100        }
101        if (target.data("mobile") != true) {
102            changeDate();
103        }
104        if (typeof callBack === "function") {
105            callBack();
106        }
107    }
108    return {
109        init : init
110    }
111}(jQuery));
112
113function bannerLink(seq, url, linkType) {
114    $.ajax({
115        data : {
116            seq : seq,
117            hitType : linkType
118        },
119        type : 'post',
120        url : "/inc/hitUpdate.do",
121        dataType : 'json',
122    }).done(function(result) {
123        if (url != "" && typeof url != undefined) {
124            if (typeof linkType != undefined) {
125                if (linkType == "_self") {
126                    location.href = url;
127                } else {
128                    window.open(url);
129                }
130            } else {
131                location.href = url;
132            }
133        }
134    });
135
136}
137function formatDate(dateTime, joinChar) {
138    var d = new Date(dateTime), month = '' + (d.getMonth() + 1), day = '' + d.getDate(), year = d.getFullYear();
139
140    if (month.length < 2) {
141        month = '0' + month;
142    }
143    if (day.length < 2) {
144        day = '0' + day;
145    }
146    if (joinChar != null && joinChar != undefined) {
147        return [ year, month, day ].join(joinChar);
148    } else {
149        return [ year, month, day ].join('.');
150    }
151}
152function prdtViewLink(seq, type, useYn, mSeq, src) {
153    var returnUrl = '';
154    if (location.href.indexOf('/m/') >= 0) {
155        returnUrl = '/m';
156    }
157
158    var targetBlank = false;
159    if (location.href.indexOf('/shopping/') >= 0 || location.href.indexOf('/order/') >= 0 || location.href.indexOf('/cart/') >= 0) {
160        targetBlank = true;
161    }
162
163    if ('PT' == type) {
164        if (useYn != 'Y') {
165            alert('판매하지 않은 제품입니다.');
166            return;
167        } else {
168            returnUrl = returnUrl + '/product/view/' + seq + '.do';
169            if (mSeq != null) {
170                var position = Number(mSeq);
171                triggerProductClickGtm(seq, returnUrl, targetBlank, position, src);
172            } else {
173                if (targetBlank) {
174                    window.open(returnUrl);
175                } else {
176                    location.href = returnUrl;
177                }
178            }
179        }
180    } else if ('BT' == type) {
181        if (useYn != 'Y') {
182            alert('판매하지 않은 제품입니다.');
183            return;
184        } else {
185            returnUrl = returnUrl + '/product/view/' + seq + '.do';
186
187            console.log(targetBlank);
188            console.log(returnUrl);
189
190            if (mSeq != null) {
191                var position = Number(mSeq);
192                triggerProductClickGtm(seq, returnUrl, targetBlank, position, src);
193            } else {
194                if (targetBlank) {
195                    window.open(returnUrl);
196                } else {
197                    location.href = returnUrl;
198                }
199            }
200        }
201    } else {
202        if (type == 'GT') {
203            returnUrl = '#gift';
204        } else if (type == 'MT') {
205            if (mSeq == undefined || mSeq == '') {
206                alert('관련 상세 정보가 없습니다.');
207                return;
208            } else {
209                returnUrl = returnUrl + '/product/view/' + mSeq + '.do?mile=' + seq;
210            }
211        }
212
213        if (targetBlank) {
214            window.open(returnUrl);
215        } else {
216            location.href = returnUrl;
217        }
218    }
219}
220
221function triggerProductClickGtm(prdtSeq, returnUrl, targetBlank, position, src) {
222    $.ajax({
223        type : 'post',
224        url : '/ajax/product/view/' + prdtSeq + '.do',
225        dataType : 'json',
226        success : function (xhr) {
227            if (xhr.result == 'OK') {
228                var prdtType = xhr.data.prdtType;
229                if (prdtType == 'PT' || prdtType == 'BT') {
230                	console.log('@@@@')
231                    var name = (xhr.data.lineNmEn + ' ' + xhr.data.prdtNmEn);
232                    var prdtPrice = Number(xhr.data.prdtPrice);
233                    var brand = xhr.data.lineNmEn;
234                    var category = (xhr.data.fullCateNm ? (xhr.data.fullCateNm).replace(/>/gi, '/') : undefined);
235                    var cate1 = $('#productView').find('input[name="cateNm1"]').val();
236                    var cate2 = $('#productView').find('input[name="cateNm2"]').val();
237                    var cate3 = $('#productView').find('input[name="cateNm3"]').val();
238                    var list = (cate1 + '/' + cate2 + '/' + cate3);
239
240                    var hotItemDealTitle = '공식몰 단독혜택/신규회원첫혜택';
241                    var tmpStartDate = new Date('2021/07/22 15:00:01');
242                    var tmpEndDate = new Date('2021/08/08 23:59:59');
243                    var today = Date.now();
244                    if (today >= tmpStartDate && today <= tmpEndDate) {
245                        hotItemDealTitle = '공식몰 단독혜택/클리어런스 세일';
246                    }
247
248                    if ($('#contents').hasClass('dev_main')) {
249                        list = '메인/BEST SELLER';
250                    } else if ($('#contents').hasClass('dev_best')) {
251                        list = '공식몰 단독혜택/베스트';
252                    } else if ($('#contents').hasClass('dev_single')) {
253                        list = '공식몰 단독혜택/단독구성';
254                    } else if ($('#contents').hasClass('dev_new')) {
255                        list = hotItemDealTitle;
256                    }
257
258                    if (src) {
259                        list = src;
260                    }
261
262                    var product = {
263                        list : list,
264                        id : (prdtSeq + ''),
265                        brand : brand,
266                        name : name,
267                        price : prdtPrice,
268                        category : category,
269                        position : position
270                    };
271
272                    LARO.TagManager.productClick(product);
273                    console.log(product);
274                    LARO.GA4TagManager.productClick(product);
275
276                    if (targetBlank) {
277                        window.open(returnUrl);
278                    } else {
279                        location.href = returnUrl;
280                    }
281                }
282            }
283        },
284        error : function(result, status, error) {
285            console.log(error);
286        }
287    });
288}
289
290function hashSearch(word) {
291    if (word.trim() != "") {
292        var returnUrl = "";
293        if (location.href.indexOf("/m/") >= 0) {
294            returnUrl = "/m/product/search.do";
295        } else {
296            returnUrl = "/product/search.do";
297        }
298        $("body").append("<form id='hashForm' method='POST' action='" + returnUrl + "' ><input type='hidden' value='" + word + "' name='topSearchKeyword'/></form>");
299        $("#hashForm").submit();
300    }
301}
302function reviewWrite(ordDetSeq, prdtSeq, brdCate, prdtNm) {
303
304    var returnUrl = '';
305    if (location.href.indexOf('/m/') >= 0) {
306        returnUrl = '/m/review/write.do';
307    } else {
308        returnUrl = '/review/write.do';
309    }
310
311    if (arguments[0] && arguments[1] && arguments[2]) {
312
313        LARO.GA4TagManager.writeReview(prdtNm, prdtSeq,"mypage");
314
315        $('body').append(
316                "<form id='hashForm' method='POST' action='" + returnUrl + "' ><input type='hidden' value='" + ordDetSeq + "' name='ordNum'/><input type='hidden' value='" + prdtSeq
317                        + "' name='prdtSeq'/><input type='hidden' value='" + brdCate + "' name='brdCate'></form>");
318        $('#hashForm').submit();
319    } else {
320        location.href = '/myPage/myPrdtReviewList.do';
321    }
322}
323function oneDayFunction(cookieId) {
324    setCookie(cookieId, "Y", 1);
325}
326
327function setCookie(c_name, value, exdays) {
328    var exdate = new Date();
329    exdate.setDate(exdate.getDate() + exdays);
330    var c_value = escape(value) + "; path=/" + ((exdays == null) ? "" : "; expires=" + exdate.toGMTString());
331    document.cookie = c_name + "=" + c_value + "; SameSite=None; Secure";
332}
333
334function setCookieExpireByTime(c_name, value, times) {
335    var now = new Date();
336    var time = now.getTime();
337    time += times;
338    now.setTime(time);
339    var c_value = escape(value) + "; path=/; expires=" + now.toGMTString() + "; SameSite=None; Secure";
340    document.cookie = c_name + "=" + c_value;
341}
342
343function getCookie(c_name) {
344    var i, x, y, ARRcookies = document.cookie.split(";");
345    for (i = 0; i < ARRcookies.length; i++) {
346        x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("="));
347        y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1);
348        x = x.replace(/^\s+|\s+$/g, "");
349        if (x == c_name) {
350            return unescape(y);
351        }
352    }
353}
354
355function getPageTypeForInsider() {
356    var pageType = 'Content';
357
358    var pathname = window.location.pathname;
359    if (pathname == '/main.do' || pathname == '/m/main.do') {
360        pageType = 'Home';
361    } else if (pathname == '/cart/cart.do' || pathname == '/m/cart/cart.do') {
362        pageType = 'Basket';
363    } else if (pathname == '/order/orderFin.do' || pathname == '/m/order/orderFin.do') {
364        pageType = 'Confirmation';
365    } else if (pathname.indexOf('/product/list') > -1) {
366        pageType = 'Category';
367    } else if (pathname.indexOf('/product/view') > -1) {
368        pageType = 'Product';
369    } else if (pathname.indexOf('/product/search') > -1) {
370        pageType = 'Search';
371    }
372
373    return pageType;
374}
375
376var LARO_CAPTCHA = {
377    RANDOM_NO : null,
378    changeCaptcha : function(captchaName, reload) {
379        this.RANDOM_NO = Math.random();
380        var reqKey = '';
381        var reqType = '';
382        if (captchaName == 'LOGCAPLRPINCHA') {
383            reqKey = $('#j_username').val();
384            reqType = '1';
385        } else if (captchaName == 'EDIMEMCAPINFOCHA') {
386            reqKey = '_SESS_MBR_ID_';
387            reqType = '2';
388        } else if (captchaName == 'CNCAPMOCHANEW') {
389            reqKey = btoa($('#newMobile').val());
390            reqType = '3';
391        } else if (captchaName == 'CACONPTCHSULTA') {
392            reqKey = '_SESS_MBR_ID_';
393            reqType = '4';
394        }
395        $('#catpcha').html('<img src="/new/captcha/' + reqType + '/' + reqKey + '.do"/>');
396        $('.catpcha_wrap').show();
397        sessionStorage.setItem(captchaName, 'true');
398    },
399    audioCaptcha : function(type, captchName) {
400        var kor = (type > 0) ? "lan=kor&" : "";
401        $.ajax({
402            url : '/captcha/audio.do',
403            type : 'POST',
404            dataType : 'text',
405            data : 'rand=' + Math.random() + '&ans=y&captchaName=' + captchName,
406            async : false,
407            success : function(resp) {
408                var uAgent = navigator.userAgent;
409                var soundUrl = '/captcha/audio.do?' + kor + 'rand=' + Math.random() + '&ans=' + resp + '&captchaName=' + captchName;
410                if (uAgent.indexOf('Trident') > -1 || uAgent.indexOf('MSIE') > -1) {
411                    this.capchaPlayer(soundUrl + '&agent=msie');
412                } else if (!!document.createElement('audio').canPlayType) {
413                    try {
414                        new Audio(soundUrl).play();
415                    } catch (e) {
416                        this.capchaPlayer(soundUrl);
417                    }
418                } else
419                    window.open(soundUrl, '', 'width=1,height=1');
420            }
421        });
422    },
423    capchaPlayer : function(src) {
424        $('#audiocatpch').html(' <bgsound src="' + src + '">');
425    },
426    validate : function(captchaName) {
427        var result = false;
428        if (sessionStorage.getItem(captchaName) != 'true') {
429            result = true;
430            return result;
431        }
432
433        if (!$('#answer').val()) {
434            alert('이미지에 보이는 숫자 또는 스피커를 통해 들리는 숫자를 입력해 주세요.');
435            result = false;
436            return result;
437        }
438
439        $.ajax({
440            url : '/captcha/captchaSubmit.jsp',
441            type : 'POST',
442            dataType : 'text',
443            data : 'answer=' + $('#answer').val(),
444            async : false,
445            success : function(resp) {
446                if (resp == 1) {
447                    result = true;
448                    return true;
449                } else {
450                    alert('자동 등록 방지를 위한 문자를 잘못 입력했습니다.');
451                    LARO_CAPTCHA.changeCaptcha(captchaName, false);
452                    $('#answer').val('');
453                    result = false;
454                    return false;
455                }
456            },
457            error : function(response, status, error) {
458                return false;
459            }
460        });
461
462        return result;
463    },
464    cleanCaptcha : function() {
465        $('#answer').val('');
466        sessionStorage.clear();
467        $('.catpcha_wrap').hide();
468    }
469};
470
471function decodeUriComponentWithSpace(component) {
472    return decodeURIComponent(component.replace(/\+/g, '%20'))
473}

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.