/** * 비동기식 데이터 - 장바구니 금액 */ CAPP_ASYNC_METHODS.aDatasetList.push('Basketprice'); CAPP_ASYNC_METHODS.Basketprice = { __sBasketPrice: null, __$target: $('#xans_myshop_basket_price'), isUse: function() { if (this.__$target.length > 0) { return true; } return false; }, restoreCache: function() { var sCookieName = 'basketprice_' + EC_SDE_SHOP_NUM; var re = new RegExp('(?:^| |;)' + sCookieName + '=([^;]+)'); var aCookieValue = document.cookie.match(re); if (aCookieValue) { this.__sBasketPrice = decodeURIComponent((aCookieValue[1]+ '').replace(/\+/g, '%20')); return true; } return false; }, setData: function(sData) { this.__sBasketPrice = sData; }, execute: function() { this.__$target.html(this.__sBasketPrice); } }; /** * 비동기식 데이터 - 쿠폰 갯수 */ CAPP_ASYNC_METHODS.aDatasetList.push('Couponcnt'); CAPP_ASYNC_METHODS.Couponcnt = { __iCouponCount: null, __$target: $('.xans-layout-myshopcouponcount'), __$target2: $('#xans_myshop_coupon_cnt'), __$target3: CAPP_ASYNC_METHODS.$xansMyshopMain.find('.xans_myshop_main_coupon_cnt'), __$target4: $('#xans_myshop_bankbook_coupon_cnt'), isUse: function() { if (CAPP_ASYNC_METHODS.IS_LOGIN === true) { if (this.__$target.length > 0) { return true; } if (this.__$target2.length > 0) { return true; } if (this.__$target3.length > 0) { return true; } if (this.__$target4.length > 0) { return true; } } return false; }, restoreCache: function() { var sCookieName = 'couponcount_' + EC_SDE_SHOP_NUM; var re = new RegExp('(?:^| |;)' + sCookieName + '=([^;]+)'); var aCookieValue = document.cookie.match(re); if (aCookieValue) { this.__iCouponCount = parseInt(aCookieValue[1], 10); return true; } return false; }, setData: function(sData) { this.__iCouponCount = Number(sData); }, execute: function() { this.__$target.html(this.__iCouponCount); if (SHOP.getLanguage() === 'ko_KR') { this.__$target2.html(this.__iCouponCount + '개'); } else { this.__$target2.html(this.__iCouponCount); } this.__$target3.html(this.__iCouponCount); this.__$target4.html(this.__iCouponCount); } }; /** * 비동기식 데이터 - 적립금 */ CAPP_ASYNC_METHODS.aDatasetList.push('Mileage'); CAPP_ASYNC_METHODS.Mileage = { __sMileage: null, __sUsedMileage: null, __sTotalMileage: null, __sUnavailMileage: null, __sReturnedMileage: null, __$target: $('#xans_myshop_mileage'), __$target2: $('#xans_myshop_bankbook_avail_mileage, #xans_myshop_summary_avail_mileage'), __$target3: $('#xans_myshop_bankbook_used_mileage, #xans_myshop_summary_used_mileage'), __$target4: $('#xans_myshop_bankbook_total_mileage, #xans_myshop_summary_total_mileage'), __$target5: $('#xans_myshop_summary_unavail_mileage'), __$target6: $('#xans_myshop_summary_returned_mileage'), __$target7: $('#xans_myshop_avail_mileage'), isUse: function() { if (CAPP_ASYNC_METHODS.IS_LOGIN === true) { if (this.__$target.length > 0) { return true; } if (this.__$target2.length > 0) { return true; } if (this.__$target3.length > 0) { return true; } if (this.__$target4.length > 0) { return true; } if (this.__$target5.length > 0) { return true; } if (this.__$target6.length > 0) { return true; } if (this.__$target7.length > 0) { return true; } } return false; }, setData: function(aData) { this.__sMileage = aData['avail_mileage']; this.__sUsedMileage = aData['used_mileage']; this.__sTotalMileage = aData['total_mileage']; this.__sUnavailMileage = aData['unavail_mileage']; this.__sReturnedMileage = aData['returned_mileage']; }, execute: function() { this.__$target.html(this.__sMileage); this.__$target2.html(this.__sMileage); this.__$target3.html(this.__sUsedMileage); this.__$target4.html(this.__sTotalMileage); this.__$target5.html(this.__sUnavailMileage); this.__$target6.html(this.__sReturnedMileage); this.__$target7.html(this.__sMileage); } }; /** * 비동기식 데이터 - 예치금 */ CAPP_ASYNC_METHODS.aDatasetList.push('Deposit'); CAPP_ASYNC_METHODS.Deposit = { __sDeposit: null, __sAllDeposit: null, __sUsedDeposit: null, __sRefundWaitDeposit: null, __sMemberTotalDeposit: null, __$target: $('#xans_myshop_deposit'), __$target2: $('#xans_myshop_bankbook_deposit'), __$target3: $('#xans_myshop_summary_deposit'), __$target4: $('#xans_myshop_summary_all_deposit'), __$target5: $('#xans_myshop_summary_used_deposit'), __$target6: $('#xans_myshop_summary_refund_wait_deposit'), __$target7: $('#xans_myshop_total_deposit'), isUse: function() { if (CAPP_ASYNC_METHODS.IS_LOGIN === true) { if (this.__$target.length > 0) { return true; } if (this.__$target2.length > 0) { return true; } if (this.__$target3.length > 0) { return true; } if (this.__$target4.length > 0) { return true; } if (this.__$target5.length > 0) { return true; } if (this.__$target6.length > 0) { return true; } if (this.__$target7.length > 0) { return true; } } return false; }, setData: function(aData) { this.__sDeposit = aData['total_deposit']; this.__sAllDeposit = aData['all_deposit']; this.__sUsedDeposit = aData['used_deposit']; this.__sRefundWaitDeposit = aData['deposit_refund_wait']; this.__sMemberTotalDeposit = aData['member_total_deposit']; }, execute: function() { this.__$target.html(this.__sDeposit); this.__$target2.html(this.__sDeposit); this.__$target3.html(this.__sDeposit); this.__$target4.html(this.__sAllDeposit); this.__$target5.html(this.__sUsedDeposit); this.__$target6.html(this.__sRefundWaitDeposit); this.__$target7.html(this.__sMemberTotalDeposit); } }; /** * 비동기식 데이터 - 관심상품 갯수 */ CAPP_ASYNC_METHODS.aDatasetList.push('Wishcount'); CAPP_ASYNC_METHODS.Wishcount = { __iWishCount: null, __$target: $('#xans_myshop_interest_prd_cnt'), __$target2: CAPP_ASYNC_METHODS.$xansMyshopMain.find('.xans_myshop_main_interest_prd_cnt'), isUse: function() { if (this.__$target.length > 0) { return true; } if (this.__$target2.length > 0) { return true; } return false; }, restoreCache: function() { var sCookieName = 'wishcount_' + EC_SDE_SHOP_NUM; var re = new RegExp('(?:^| |;)' + sCookieName + '=([^;]+)'); var aCookieValue = document.cookie.match(re); if (aCookieValue) { this.__iWishCount = parseInt(aCookieValue[1], 10); return true; } return false; }, setData: function(sData) { this.__iWishCount = Number(sData); }, execute: function() { if (SHOP.getLanguage() === 'ko_KR') { this.__$target.html(this.__iWishCount + '개'); } else { this.__$target.html(this.__iWishCount); } this.__$target2.html(this.__iWishCount); } }; /** * 비동기식 데이터 - 최근 본 상품 */ CAPP_ASYNC_METHODS.aDatasetList.push('recent'); CAPP_ASYNC_METHODS.recent = { STORAGE_KEY: 'localRecentProduct' + EC_SDE_SHOP_NUM, __$target: $('.xans-layout-productrecent'), __aData: null, isUse: function() { this.__$target.hide(); if (this.__$target.find('.xans-record-').length > 0) { return true; } return false; }, restoreCache: function() { this.__aData = []; var iTotalCount = CAPP_ASYNC_METHODS.RecentTotalCount.getData(); if (iTotalCount == 0) { // 총 갯수가 없는 경우 복구할 것이 없으므로 복구한 것으로 리턴 return true; } var sAdultImage = ''; if (window.sessionStorage === undefined) { return false; } var sSessionStorageData = window.sessionStorage.getItem(this.STORAGE_KEY); if (sSessionStorageData === null) { return false; } var iViewCount = CAPP_ASYNC_METHODS.recentViewConfig.getViewCount(); this.__aData = []; var aStorageData = $.parseJSON(sSessionStorageData); var iCount = 1; var bDispRecent = true; for (var iKey in aStorageData) { var sProductImgSrc = aStorageData[iKey].sImgSrc; if (isFinite(iKey) === false) { continue; } var aDataTmp = []; aDataTmp.recent_img = getImageUrl(sProductImgSrc); aDataTmp.name = aStorageData[iKey].sProductName; aDataTmp.disp_recent = true; aDataTmp.is_adult_product = aStorageData[iKey].isAdultProduct; aDataTmp.link_product_detail = aStorageData[iKey].link_product_detail; //aDataTmp.param = '?product_no=' + aStorageData[iKey].iProductNo + '&cate_no=' + aStorageData[iKey].iCateNum + '&display_group=' + aStorageData[iKey].iDisplayGroup; aDataTmp.param = filterXssUrlParameter(aStorageData[iKey].sParam); if ( iViewCount < iCount ) { bDispRecent = false; } aDataTmp.disp_recent = bDispRecent; iCount++; this.__aData.push(aDataTmp); } return true; /** * get SessionStorage image url * @param sNewImgUrl DB에 저장되어 있는 tiny값 */ function getImageUrl(sImgUrl) { if ( typeof(sImgUrl) === 'undefined' || sImgUrl === null) { return; } var sNewImgUrl = ''; if ( sImgUrl.indexOf('http://') >= 0 || sImgUrl.indexOf('https://') >= 0 || sImgUrl.substr(0, 2) === '//') { sNewImgUrl = sImgUrl; } else { sNewImgUrl = '/web/product/tiny/' + sImgUrl; } return sNewImgUrl; } /** * 파라미터 URL에서 XSS 공격 관련 파라미터를 필터링합니다. ECHOSTING-162977 * @param string sParam 파라미터 * @return string 필터링된 파라미터 */ function filterXssUrlParameter(sParam) { sParam = sParam || ''; var sPrefix = ''; if (sParam.substr(0, 1) === '?') { sPrefix = '?'; sParam = sParam.substr(1); } var aParam = {}; var aParamList = (sParam).split('&'); $.each(aParamList, function() { var aMatch = this.match(/^([^=]+)=(.*)$/); if (aMatch) { aParam[aMatch[1]] = aMatch[2]; } }); return sPrefix + $.param(aParam); } }, setData: function(aData) { this.__aData = aData; // 쿠키엔 있지만 sessionStorage에 없는 데이터 복구 if (window.sessionStorage) { var oNewStorageData = []; for ( var i = 0 ; i < aData.length ; i++) { if (aData[i].bNewProduct !== true) { continue; } var aNewStorageData = { 'iProductNo': aData[i].product_no, 'sProductName': aData[i].name, 'sImgSrc': aData[i].recent_img, 'sParam': aData[i].param, 'link_product_detail': aData[i].link_product_detail }; oNewStorageData.push(aNewStorageData); } if ( oNewStorageData.length > 0 ) { sessionStorage.setItem(this.STORAGE_KEY , $.toJSON(oNewStorageData)); } } }, execute: function() { var sAdult19Warning = CAPP_ASYNC_METHODS.recentViewConfig.getAdult19Warning(); var aData = this.__aData; var aNodes = this.__$target.find('.xans-record-'); var iRecordCnt = aNodes.length; var iAddedElementCount = 0; var aNodesParent = $(aNodes[0]).parent(); for ( var i = 0 ; i < aData.length ; i++) { if (!aNodes[i]) { $(aNodes[iRecordCnt - 1]).clone().appendTo(aNodesParent); iAddedElementCount++; } } if (iAddedElementCount > 0) { aNodes = this.__$target.find('.xans-record-'); } if (aData.length > 0) { this.__$target.show(); } for ( var i = 0 ; i < aData.length ; i++) { assignVariables(aNodes[i], aData[i]); } // 종료 카운트 지정 if (aData.length < aNodes.length) { iLength = aData.length; deleteNode(); } recentBntInit(this.__$target); /** * 패치되지 않은 노드를 제거 */ function deleteNode() { for ( var i = iLength ; i < aNodes.length ; i++) { $(aNodes[i]).remove(); } } /** * oTarget 엘레먼트에 aData의 변수를 어싸인합니다. * @param Element oTarget 변수를 어싸인할 엘레먼트 * @param array aData 변수 데이터 */ function assignVariables(oTarget, aData) { var recentImage = aData.recent_img; if (sAdult19Warning === 'T' && CAPP_ASYNC_METHODS.member.getMemberIsAdult() === 'F' && aData.is_adult_product === 'T') { recentImage = CAPP_ASYNC_METHODS.recentViewConfig.getAdult19BaseImage(); }; var $oTarget = $(oTarget); var sHtml = $oTarget.html(); sHtml = sHtml.replace('about:blank', recentImage) .replace('##param##', aData.param) .replace('##name##',aData.name) .replace('##link_product_detail##', aData.link_product_detail); $oTarget.html(sHtml); if (aData.disp_recent === true) { $oTarget.removeClass('displaynone'); } } function recentBntInit($target) { // 화면에 뿌려진 갯수 var iDisplayCount = 0; // 보여지는 style var sDisplay = ''; var iIdx = 0; // var iDisplayNoneIdx = 0; var nodes = $target.find('.xans-record-').each(function() { sDisplay = $(this).css('display'); if (sDisplay != 'none') { iDisplayCount++; } else { if (iDisplayNoneIdx == 0) { iDisplayNoneIdx = iIdx; } } iIdx++; }); var iRecentCount = nodes.length; var bBtnActive = iDisplayCount > 0; $('.xans-layout-productrecent .prev').unbind('click').click(function() { if (bBtnActive !== true) return; var iFirstNode = iDisplayNoneIdx - iDisplayCount; if (iFirstNode == 0 || iDisplayCount == iRecentCount) { alert(__('최근 본 첫번째 상품입니다.')); return; } else { iDisplayNoneIdx--; $(nodes[iDisplayNoneIdx]).hide(); $(nodes[iFirstNode - 1]).removeClass('displaynone'); $(nodes[iFirstNode - 1]).fadeIn('fast'); } }).css( { cursor : 'pointer' }); $('.xans-layout-productrecent .next').unbind('click').click(function() { if (bBtnActive !== true) return; if ( (iRecentCount ) == iDisplayNoneIdx || iDisplayCount == iRecentCount) { alert(__('최근 본 마지막 상품입니다.')); } else { $(nodes[iDisplayNoneIdx]).fadeIn('fast'); $(nodes[iDisplayNoneIdx]).removeClass('displaynone'); $(nodes[ (iDisplayNoneIdx - iDisplayCount)]).hide(); iDisplayNoneIdx++; } }).css( { cursor : 'pointer' }); } } }; /** * 비동기식 데이터 - 최근본상품 총 갯수 */ CAPP_ASYNC_METHODS.aDatasetList.push('RecentTotalCount'); CAPP_ASYNC_METHODS.RecentTotalCount = { __iRecentCount: null, __$target: CAPP_ASYNC_METHODS.$xansMyshopMain.find('.xans_myshop_main_recent_cnt'), isUse: function() { if (this.__$target.length > 0) { return true; } return false; }, restoreCache: function() { var sCookieName = 'recent_plist'; if (EC_SDE_SHOP_NUM > 1) { sCookieName = 'recent_plist' + EC_SDE_SHOP_NUM; } var re = new RegExp('(?:^| |;)' + sCookieName + '=([^;]+)'); var aCookieValue = document.cookie.match(re); if (aCookieValue) { this.__iRecentCount = decodeURI(aCookieValue[1]).split('|').length; } else { this.__iRecentCount = 0; } }, execute: function() { this.__$target.html(this.__iRecentCount); }, getData: function() { if (this.__iRecentCount === null) { // this.isUse값이 false라서 복구되지 않았는데 이 값이 필요한 경우 복구 this.restoreCache(); } return this.__iRecentCount; } }; /** * 비동기식 데이터 - 주문정보 */ CAPP_ASYNC_METHODS.aDatasetList.push('Order'); CAPP_ASYNC_METHODS.Order = { __iOrderCount: null, __iOrderTotalPrice: null, __iGradeIncreaseValue: null, __$target: $('#xans_myshop_bankbook_order_count'), __$target2: $('#xans_myshop_bankbook_order_price'), __$target3: $('#xans_myshop_bankbook_grade_increase_value'), isUse: function() { if (CAPP_ASYNC_METHODS.IS_LOGIN === true) { if (this.__$target.length > 0) { return true; } if (this.__$target2.length > 0) { return true; } if (this.__$target3.length > 0) { return true; } } return false; }, setData: function(aData) { this.__iOrderCount = aData['total_order_count']; this.__iOrderTotalPrice = aData['total_order_price']; this.__iGradeIncreaseValue = Number(aData['grade_increase_value']); }, execute: function() { this.__$target.html(this.__iOrderCount); this.__$target2.html(this.__iOrderTotalPrice); this.__$target3.html(this.__iGradeIncreaseValue); } }; /** * 비동기식 데이터 - Benefit */ CAPP_ASYNC_METHODS.aDatasetList.push('Benefit'); CAPP_ASYNC_METHODS.Benefit = { __aBenefit: null, __$target: $('.xans-myshop-asyncbenefit'), isUse: function() { if (CAPP_ASYNC_METHODS.IS_LOGIN === true) { if (this.__$target.length > 0) { return true; } } return false; }, setData: function(aData) { this.__aBenefit = aData; }, execute: function() { var aFilter = ['group_image_tag', 'group_icon_tag', 'display_no_benefit', 'display_with_all', 'display_mobile_use_dc', 'display_mobile_use_mileage']; var __aData = this.__aBenefit; // 그룹이미지 $('.myshop_benefit_group_image_tag').attr({alt: __aData['group_name'], src: __aData['group_image']}); // 그룹아이콘 $('.myshop_benefit_group_icon_tag').attr({alt: __aData['group_name'], src: __aData['group_icon']}); if (__aData['display_no_benefit'] === true) { $('.myshop_benefit_display_no_benefit').removeClass('displaynone').show(); } if (__aData['display_with_all'] === true) { $('.myshop_benefit_display_with_all').removeClass('displaynone').show(); } if (__aData['display_mobile_use_dc'] === true) { $('.myshop_benefit_display_mobile_use_dc').removeClass('displaynone').show(); } if (__aData['display_mobile_use_mileage'] === true) { $('.myshop_benefit_display_mobile_use_mileage').removeClass('displaynone').show(); } $.each(__aData, function(key, val) { if ($.inArray(key, aFilter) === -1) { $('.myshop_benefit_' + key).html(val); } }); } }; /** * 비동기식 데이터 - 비동기장바구니 레이어 */ CAPP_ASYNC_METHODS.aDatasetList.push('BasketLayer'); CAPP_ASYNC_METHODS.BasketLayer = { __sBasketLayerHtml: null, __$target: $('#ec_async_basket_layer_container'), isUse: function() { if (this.__$target.length > 0) { return true; } return false; }, execute: function() { $.ajax({ url: '/order/async_basket_layer.html?__popupPage=T', async: false, success: function(data) { var sBasketLayerHtml = data; var sBasketLayerStyle = ''; var sBasketLayerBody = ''; sBasketLayerHtml = sBasketLayerHtml.replace(//gi,''); // 스크립트 제거 sBasketLayerHtml = sBasketLayerHtml.replace(//gi,''); // 옵티마이져 제거 var regexStyle = //; // Style 추출 if (regexStyle.exec(sBasketLayerHtml) != null) sBasketLayerStyle = regexStyle.exec(sBasketLayerHtml)[0]; var regexBody = /([\s\S]*?)<\/body>/; // Body 추출 if (regexBody.exec(sBasketLayerHtml) != null) sBasketLayerBody = regexBody.exec(sBasketLayerHtml)[1]; CAPP_ASYNC_METHODS.BasketLayer.__sBasketLayerHtml = sBasketLayerStyle + sBasketLayerBody; } }); this.__$target.html(this.__sBasketLayerHtml); } }; /** * 비동기식 데이터 - Benefit */ CAPP_ASYNC_METHODS.aDatasetList.push('Grade'); CAPP_ASYNC_METHODS.Grade = { __aGrade: null, __$target: $('.xans-myshop-asyncbenefit'), isUse: function() { if (CAPP_ASYNC_METHODS.IS_LOGIN === true) { if (this.__$target.length > 0) { return true; } } return false; }, setData: function(aData) { this.__aGrade = aData; }, execute: function() { var __aData = this.__aGrade; var aFilter = ['bChangeMaxTypePrice', 'bChangeMaxTypePriceAndCount', 'bChangeMaxTypePriceOrCount', 'bChangeMaxTypeCount']; var aMaxDisplayJson = { "bChangeMaxTypePrice": [ {"sId": "sChangeMaxTypePriceArea"} ], "bChangeMaxTypePriceAndCount": [ {"sId": "sChangeMaxTypePriceAndCountArea"} ], "bChangeMaxTypePriceOrCount": [ {"sId": "sChangeMaxTypePriceOrCountArea"} ], "bChangeMaxTypeCount": [ {"sId": "sChangeMaxTypeCountArea"} ] }; if ($('.sNextGroupIconArea').length > 0) { if (__aData['bDisplayNextGroupIcon'] === true) { $('.sNextGroupIconArea').removeClass('displaynone').show(); $('.myshop_benefit_next_group_icon_tag').attr({alt: __aData['sNextGrade'], src: __aData['sNextGroupIcon']}); } else { $('.sNextGroupIconArea').addClass('displaynone'); } } var sIsAutoGradeDisplay = "F"; $.each(__aData, function(key, val) { if ($.inArray(key, aFilter) === -1) { return true; } if (val === true) { if ($('#'+aMaxDisplayJson[key][0].sId).length > 0) { $('#' + aMaxDisplayJson[key][0].sId).removeClass('displaynone').show(); } sIsAutoGradeDisplay = "T"; } }); if (sIsAutoGradeDisplay == "T" && $('#sGradeAutoDisplayArea .sAutoGradeDisplay').length > 0) { $('#sGradeAutoDisplayArea .sAutoGradeDisplay').addClass('displaynone'); } $.each(__aData, function(key, val) { if ($.inArray(key, aFilter) === -1) { if ($('.xans-member-var-' + key).length > 0) { $('.xans-member-var-' + key).html(val); } } }); } }; /** * 비동기식 데이터 - 비동기장바구니 레이어 */ CAPP_ASYNC_METHODS.aDatasetList.push('MobileMutiPopup'); CAPP_ASYNC_METHODS.MobileMutiPopup = { __$target: $('div[class^="ec-async-multi-popup-layer-container"]'), isUse: function() { if (this.__$target.length > 0) { return true; } return false; }, execute: function() { for (var i=0; i < this.__$target.length ; i++) { $.ajax({ url: '/exec/front/popup/AjaxMultiPopup?index='+i, data : EC_ASYNC_MULTI_POPUP_OPTION[i], dataType: "json", success : function (oResult) { switch (oResult.code) { case '0000' : if (oResult.data.length < 1) { break; } $('.ec-async-multi-popup-layer-container-' + oResult.data.html_index).html(oResult.data.html_text); if (oResult.data.type == 'P') { BANNER_POPUP_OPEN.setPopupSetting(); BANNER_POPUP_OPEN.setPopupWidth(); BANNER_POPUP_OPEN.setPopupClose(); } else { /** * 이중 스크롤 방지 클래스 추가(비동기) * */ $('body').addClass('eMobilePopup'); $('body').width('100%'); BANNER_POPUP_OPEN.setFullPopupSetting(); BANNER_POPUP_OPEN.setFullPopupClose(); } break; default : break; } }, error : function () { } }); } } }; /** * 비동기식 데이터 - 좋아요 상품 갯수 */ CAPP_ASYNC_METHODS.aDatasetList.push('MyLikeProductCount'); CAPP_ASYNC_METHODS.MyLikeProductCount = { __iMyLikeCount: null, __$target: $('#xans_myshop_like_prd_cnt'), isUse: function() { if (this.__$target.length > 0 && SHOP.getLanguage() === 'ko_KR') { return true; } return false; }, setData: function(sData) { this.__iMyLikeCount = Number(sData); }, execute: function() { if (SHOP.getLanguage() === 'ko_KR') { this.__$target.html(this.__iMyLikeCount + '개'); } } }; /** * 라이브 링콘 on/off이미지 */ CAPP_ASYNC_METHODS.aDatasetList.push('Livelinkon'); CAPP_ASYNC_METHODS.Livelinkon = { __$target: $('#ec_livelinkon_campain_on'), __$target2: $('#ec_livelinkon_campain_off'), isUse: function() { if (this.__$target.length > 0 && this.__$target2.length > 0) { return true; } return false; }, execute: function() { var sCampaignid = ''; if (EC_ASYNC_LIVELINKON_ID != undefined) { sCampaignid = EC_ASYNC_LIVELINKON_ID } $.ajax({ url: '/exec/front/Livelinkon/Campaignajax?campaign_id='+sCampaignid, async: false, success: function(data) { if (data == 'on') { CAPP_ASYNC_METHODS.Livelinkon.__$target.removeClass('displaynone').show(); CAPP_ASYNC_METHODS.Livelinkon.__$target2.removeClass('displaynone').hide(); } else if (data == 'off') { CAPP_ASYNC_METHODS.Livelinkon.__$target.removeClass('displaynone').hide(); CAPP_ASYNC_METHODS.Livelinkon.__$target2.removeClass('displaynone').show(); } else { CAPP_ASYNC_METHODS.Livelinkon.__$target.removeClass('displaynone').hide(); CAPP_ASYNC_METHODS.Livelinkon.__$target2.removeClass('displaynone').hide(); } } }); } }; /** * 비동기식 데이터 - 마이쇼핑 > 주문 카운트 (주문 건수 / CS건수 / 예전주문) */ CAPP_ASYNC_METHODS.aDatasetList.push('OrderHistoryCount'); CAPP_ASYNC_METHODS.OrderHistoryCount = { __sTotalOrder: null, __sTotalOrderCs: null, __sTotalOrderOld: null, __$target: $('#ec_myshop_total_orders'), __$target2: $('#ec_myshop_total_orders_cs'), __$target3: $('#ec_myshop_total_orders_old'), isUse: function() { if (CAPP_ASYNC_METHODS.IS_LOGIN === true) { if (this.__$target.length > 0) { return true; } if (this.__$target2.length > 0) { return true; } if (this.__$target3.length > 0) { return true; } } return false; }, setData: function(aData) { this.__sTotalOrder = aData['total_orders']; this.__sTotalOrderCs = aData['total_orders_cs']; this.__sTotalOrderOld = aData['total_orders_old']; }, execute: function() { this.__$target.html(this.__sTotalOrder); this.__$target2.html(this.__sTotalOrderCs); this.__$target3.html(this.__sTotalOrderOld); } }; $(document).ready(function() { CAPP_ASYNC_METHODS.init(); }); $('.cate > li').mouseover(function () { var cateIndex = $(this).index() + 1; $('.cate > li .sub'+cateIndex).slideDown(); $('.cate > li .sub').not('.cate > li .sub'+cateIndex).stop(true,true).slideUp(); }); $('.cate').mouseleave(function () { $('.cate > li .sub').stop(true,true).slideUp(); }); var side_num = 0; $('.sideWrap .sideBtn').click(function(){ if(side_num == 0){ $('.sideWrap').stop().animate({'right':'0'},500); $('.sideBg').stop().fadeIn(500); $('.sideWrap .sideBtn img:nth-of-type(1)').animate({'left':'50px','opacity':'0'},500); $('.sideWrap .sideBtn img:nth-of-type(2)').animate({'left':'0','opacity':'1'},500); side_num = 1; }else{ $('.sideWrap').stop().animate({'right':'-300px'},500); $('.sideBg').stop().fadeOut(500); $('.sideWrap .sideBtn img:nth-of-type(2)').animate({'left':'50px','opacity':'0'},500); $('.sideWrap .sideBtn img:nth-of-type(1)').animate({'left':'0','opacity':'1'},500); side_num = 0; } }); /** * 움직이는 배너 Jquery Plug-in * @author cafe24 */ (function($){ $.fn.floatBanner = function(options) { options = $.extend({}, $.fn.floatBanner.defaults , options); return this.each(function() { var aPosition = $(this).position(); var jbOffset = $(this).offset(); var node = this; $(window).scroll(function() { var _top = $(document).scrollTop(); _top = (aPosition.top < _top) ? _top : aPosition.top; setTimeout(function () { var newinit = $(document).scrollTop(); if ( newinit > jbOffset.top ) { _top -= jbOffset.top; var container_height = $("#wrap").height(); var quick_height = $(node).height(); var cul = container_height - quick_height; if(_top > cul){ _top = cul; } }else { _top = 0; } $(node).stop().animate({top: _top}, options.animate); }, options.delay); }); }); }; $.fn.floatBanner.defaults = { 'animate' : 500, 'delay' : 500 }; })(jQuery); /** * 문서 구동후 시작 */ $(document).ready(function(){ $('#banner:visible, #quick:visible').floatBanner(); //placeholder $(".ePlaceholder input, .ePlaceholder textarea").each(function(i){ var placeholderName = $(this).parents().attr('title'); $(this).attr("placeholder", placeholderName); }); /* placeholder ie8, ie9 */ $.fn.extend({ placeholder : function() { //IE 8 버전에는 hasPlaceholderSupport() 값이 false를 리턴 if (hasPlaceholderSupport() === true) { return this; } //hasPlaceholderSupport() 값이 false 일 경우 아래 코드를 실행 return this.each(function(){ var findThis = $(this); var sPlaceholder = findThis.attr('placeholder'); if ( ! sPlaceholder) { return; } findThis.wrap('