1// placeholder 2$(function() { 3 function loginPlaceholder(){ 4 if ($('.xans-member-login').val() != undefined) { 5 var loginId = $('#member_id').parent().attr('title'); 6 $('#member_id').attr('placeholder', loginId); 7 $('#member_passwd').attr('placeholder', 'í¨ì¤ìë'); 8 } 9 } 10 loginPlaceholder(); 11}); 12 13// keyboard 14$('.keyboard button').on('click', function(){ 15 if($(this).hasClass('selected')==true){ 16 $('.keyboard .btnKey').removeClass('selected'); 17 $('.view div').hide(); 18 } 19 else{ 20 $('.keyboard .btnKey').removeClass('selected'); 21 $('.view div').hide(); 22 $(this).addClass('selected'); 23 var key=$(this).attr('title'); 24 $(this).parent().next().children('.'+key+'').show(); 25 } 26}); 27 28// toggle 29$('.ec-base-tab').each(function(){ 30 var selected = $(this).find('> ul > li.selected > a'); 31}); 32 33$('body').on('click', '.ec-base-tab a', function(e){ 34 var _target = $(this).attr('href'); 35 if (_target == '#member') { 36 $('#member_login_module_id').show();
37 $('#order_history_nologin_id').hide(); 38 } else { 39 $('#member_login_module_id').hide(); 40 $('#order_history_nologin_id').show(); 41 } 42 e.preventDefault(); 43}); 44/** 45 * hasClass 46 */ 47function hasClass(element, className){ 48 return (' ' + element.className + ' ').indexOf(' ' + className+ ' ') > -1; 49}; 50 51/** 52 * toggle 53 */ 54function toggleClassAll(element, handler, className){ 55 var _handler = document.querySelector(handler); 56 document.querySelectorAll(handler).forEach(function(item){ 57 item.addEventListener('click', function(){ 58 var _element = item.parentNode; 59 if ( hasClass( _element, className ) ) { 60 _element.classList.remove( className ); 61 } else { 62 _element.classList.add( className ); 63 } 64 }) 65 }) 66}; 67 68/** 69 * findElements 70 */ 71function findElements(element, findElement){ 72 var resultElements = []; 73 document.querySelectorAll(element).forEach(function(item){ 74 var findElementList = item.querySelectorAll(findElement); 75 findElementList = Array.prototype.slice.call(findElementList); 76 resultElements = resultElements.concat(findElementList); 77 }) 78 return resultElements; 79}; 80 81/** 82 * setAttributeAl 83 */ 84function setAttributeAll(elements, name, value){ 85 elements.forEach(function(item){ 86 item.setAttribute(name, value); 87 }) 88}; 89 90/** 91 * ìí ì¬ë¤ì¼ ë¡ëëì§ ìì ê²½ì°, ê¸°ë³¸ê° ì¤ì 92 */ 93function setDefaultImage(element) { 94 document.querySelectorAll(element).forEach(function(item){ 95 var $img = new Image(); 96 $img.onerror = function () { 97 item.src="//img.echosting.cafe24.com/thumb/img_product_big.gif"; 98 } 99 $img.src = item.src; 100 }); 101}; 102 103/** 104 * tooltip 105 */ 106function setTooltipEvent(){ 107 var input = findElements('.eTooltip', 'input'); 108 input.forEach(function(item){ 109 item.addEventListener('focusin', function(event){ 110 var targetName = returnTargetName(event.target); 111 targetName.nextElementSibling.style.display = 'block' 112 }); 113 item.addEventListener('focusout', function(event){ 114 var targetName = returnTargetName(event.target); 115 targetName.nextElementSibling.style.display = 'none' 116 }); 117 }); 118} 119 120/** 121 * tooltip input focus 122 */ 123function returnTargetName(_this){ 124 var ePlacename = _this.parentElement.getAttribute("class"); 125 var targetName; 126 if(ePlacename == "ePlaceholder"){ //ePlaceholder supported 127 targetName = _this.parentElement; 128 }else{ 129 targetName = _this; 130 } 131 return targetName; 132} 133 134/** 135 * window load 136 */ 137window.addEventListener('load', function(){ 138 if (document.querySelector('.thumbnail')){ 139 setDefaultImage('.thumbnail img'); 140 } 141 if (document.querySelector('.eTooltip')){ 142 setAttributeAll(findElements('.eTooltip', '.btnClose'),'tabIndex','-1'); 143 setTooltipEvent(); 144 } 145 if (document.querySelector('div.eToggle')){ 146 toggleClassAll(false, 'div.eToggle .title', 'selected'); 147 } 148}); 149//window popup script 150function winPop(url) { 151 window.open(url, "popup", "width=300,height=300,left=10,top=10,resizable=no,scrollbars=no"); 152} 153/** 154 * document.location.href split 155 * return array Param 156 */ 157function getQueryString(sKey) 158{ 159 var sQueryString = document.location.search.substring(1); 160 var aParam = {}; 161 162 if (sQueryString) { 163 var aFields = sQueryString.split("&"); 164 var aField = []; 165 for(var i=0; i<aFields.length; i++){ 166 aField = aFields[i].split('='); 167 aParam[aField[0]] = aField[1]; 168 } 169 } 170 171 aParam.page = aParam.page ? aParam.page : 1; 172 return sKey ? aParam[sKey] : aParam; 173}; 174 175/** 176 * 구매ë²í¼ 177*/ 178var globalBuyBtnScrollFunc = function() { 179 // 구매ë²í¼ ê´ë ¨ë³ì 180 var sFixId = $('#orderFixItem').length > 0 ? 'orderFixItem' : 'fixedActionButton', 181 $area = $('#orderFixArea'), 182 $item = $('#' + sFixId + '').not($area); 183 184 $(window).scroll(function(){ 185 try { 186 // 구매ë²í¼ ê´ë ¨ë³ì
187 var iCurrentHeightPos = $(this).scrollTop() + $(this).height(), 188 iButtonHeightPos = $item.offset().top; 189 190 if (iCurrentHeightPos > iButtonHeightPos || iButtonHeightPos < $(this).scrollTop() + $item.height()) { 191 if (iButtonHeightPos < $(this).scrollTop() - $item.height()) { 192 $area.fadeIn('fast'); 193 } else { 194 $area.hide(); 195 } 196 } else { 197 $area.fadeIn('fast'); 198 } 199 } catch(e) { } 200 }); 201}; 202 203$(function(){ 204 // tab 205 $.eTab = function(ul) { 206 $(ul).find('a').on('click', function() { 207 var _li = $(this).parent('li').addClass('selected').siblings().removeClass('selected'), 208 _target = $(this).attr('href'), 209 _siblings = '.' + $(_target).attr('class'); 210 $(_target).show().siblings(_siblings).hide(); 211 return false 212 }); 213 } 214 if ( window.call_eTab ) { 215 call_eTab(); 216 }; 217 globalBuyBtnScrollFunc(); 218}); 219(function($){ 220 $.fn.extend({ 221 center: function() { 222 this.each(function() { 223 var 224 $this = $(this), 225 $w = $(window); 226 $this.css({ 227 position: "absolute", 228 top: ~~(($w.height() - $this.outerHeight()) / 2) + $w.scrollTop() + "px", 229 left: ~~(($w.width() - $this.outerWidth()) / 2) + $w.scrollLeft() + "px" 230 }); 231 }); 232 return this; 233 } 234 }); 235 $(function() { 236 var $container = function(){/* 237 <div id="modalContainer"> 238 <iframe id="modalContent" scroll="0" scrolling="no" frameBorder="0"></iframe> 239 </div>'); 240 */}.toString().slice(14,-3); 241 $('body') 242 .append($('<div id="modalBackpanel"></div>')) 243 .append($($container)); 244 function closeModal () { 245 $('#modalContainer').hide(); 246 $('#modalBackpanel').hide(); 247 } 248 $('#modalBackpanel').on('click', closeModal); 249 zoom = function ($piProductNo, $piCategoryNo, $piDisplayGroup) { 250 var $url = '/product/image_zoom.html?product_no=' + $piProductNo + '&cate_no=' + $piCategoryNo + '&display_group=' + $piDisplayGroup; 251 $('#modalContent').attr('src', $url); 252 $('#modalContent').on("load",function(){ 253 $(".header .close",this.contentWindow.document.body).on("click", closeModal); 254 }); 255 $('#modalBackpanel').css({width:$("body").width(),height:$("body").height(),opacity:.4}).show(); 256 $('#modalContainer').center().show(); 257 } 258 }); 259})(jQuery); 260$(function () { 261 console.log("cate.js"); 262 263 var methods = { 264 aSubCategory: {}, 265 266 getParam: function (sUrl, sKey) { 267 var aUrl = sUrl.split("?"), 268 sQueryString = aUrl[1], 269 aParam = {}; 270 if (sQueryString) { 271 sQueryString.split("&").forEach(function (field) { 272 var pair = field.split("="); 273 aParam[pair[0]] = pair[1]; 274 }); 275 } 276 return sKey ? aParam[sKey] : aParam; 277 }, 278 279 getParamSeo: function (sUrl) { 280 var aUrl = sUrl.split("/"), 281 len = aUrl.length - 2; 282 return aUrl[len] || null; 283 }, 284 285 show: function (liNode, iCateNo) { 286 var items = this.aSubCategory[iCateNo]; 287 if (!items) return; 288 289 var html = ["<ul>"]; 290 items.forEach(function (item) { 291 html.push('<li><a href="' + item.link_product_list + '">' + item.name + "</a></li>"); 292 }); 293 html.push("</ul>"); 294 295 $(liNode).find(".sub-category").remove(); 296 $('<div class="sub-category"></div>').appendTo(liNode).html(html.join("")); 297 }, 298 299 get: function () { 300 var self = this; 301 $.ajax({ 302 url: "/exec/front/Product/SubCategory", 303 dataType: "json", 304 success: function (aData) { 305 if (!aData) return; 306 307 aData.forEach(function (item) { 308 var parent = item.parent_cate_no; 309 if (!self.aSubCategory[parent]) self.aSubCategory[parent] = []; 310 self.aSubCategory[parent].push(item); 311 }); 312
313 Object.keys(self.aSubCategory).forEach(function (parentCateNo) { 314 $(".xans-layout-category li").each(function () { 315 var href = $(this).find("a").attr("href") || "", 316 cateNo1 = self.getParam(href, "cate_no"), 317 cateNo2 = self.getParamSeo(href), 318 cateNo = Number(cateNo1 || cateNo2); 319 320 if (cateNo === Number(parentCateNo)) { 321 self.show(this, cateNo); 322 } 323 }); 324 }); 325 }, 326 }); 327 }, 328 }; 329 330 methods.get(); 331 332 // â ëë¡ë¤ì´ ììì ë³ì ì¸í (SHOP/BRIDAL ë± ê° ë©ë´ hover ì ì ì©) 333 function setDropLeft($li) { 334 var $a = $li.children("a").first(); 335 if (!$a.length) return; 336 337 var rect = $a[0].getBoundingClientRect(); 338 var padL = parseFloat(getComputedStyle($a[0]).paddingLeft) || 0; 339 340 // í ì¤í¸ ììì ê¸°ì¤ 341 var left = rect.left + padL; 342 343 document.documentElement.style.setProperty("--gnb-drop-left", left + "px"); 344 } 345 346 $(".gnb > li.hasSubMenu").on("mouseenter", function () { 347 setDropLeft($(this)); 348 }); 349 350 $(window).on("resize", function () { 351 var $open = $(".gnb > li.hasSubMenu.subOpen").first(); 352 if ($open.length) setDropLeft($open); 353 }); 354}); 355
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.