1var shopShowCase = function(){ 2 var code; 3 var $list_wrap; 4 var $org_html; 5 var old_item_cnt = 0; 6 var change_timer = setTimeout(function(){},1); 7 var current_window_width; 8 var option = { 9 'type' : 'slide', 10 'code' : '', 11 'margin' : 15, 12 'width' : 200 13 }; 14 var mobile_section; 15 var extend_section; 16 var timesale_interval; 17 var init = function(data){ 18 19 option = $.extend(option,data); 20 code = option.code; 21 $list_wrap = $('#container_'+code); 22 23 if ($list_wrap.length === 0) { 24 return; 25 } 26 27 var $section_obj = $list_wrap.closest('div[doz_type=section]'); 28 mobile_section = $section_obj.attr('doz_mobile_section') == 'Y'; 29 extend_section = $section_obj.attr('doz_extend') == 'Y'; 30 current_window_width = $(window).width(); 31 $org_html = $list_wrap.clone(false); 32 $list_wrap.css('visibility','hidden'); 33 $list_wrap.imagesLoaded() 34 .always(function(){ 35 clearTimeout(change_timer); 36 change_timer = setTimeout(function(){ 37 shopListResize(); 38 }, 100); 39 }); 40 var windowWidth = $(window).width(); 41 $(window).off('resize.'+code).on('resize.'+code,function(){ 42 43 if ($(window).width() != windowWidth) windowWidth = $(window).width(); 44 else return; 45 46 clearTimeout(change_timer); 47 change_timer = setTimeout(function(){ 48 shopListResize(); 49 },200); 50 51 }); 52 53 $('body').off('gridChange.'+code).on('gridChange.'+code,function(){ 54 $(window).trigger('showcase_width.'+code); 55 }); 56 setTimesale(); 57 }; 58 59 var runSlide = function(item_cnt){ 60 var window_width = $(window).width(); 61 old_item_cnt = item_cnt; 62 if(mobile_section){ 63 var mobile_cnt = option.line_cnt; 64 }else{ 65 var mobile_cnt = option.mobile_line_cnt; 66 if(option.mobile_line_cnt == 0){ 67 var mobile_cnt = 1; 68 } 69 } 70 var pc_cnt = item_cnt; 71 if(option.show_paging == 'Y'){ 72 switch(option.paging_style_type){ 73 case 'st00': 74 switch(option.paging_default_style_type){ 75 case 'st00': 76 $list_wrap.toggleClass('paging_type_dot paging_type_dot01', true); 77 break; 78 case 'st01': 79 $list_wrap.toggleClass('paging_type_dot paging_type_dot02', true); 80 break; 81 } 82 break; 83 case 'st01': 84 $list_wrap.toggleClass('paging_type_big_dot', true); 85 break; 86 case 'st02': 87 $list_wrap.toggleClass('paging_type_line', true); 88 break; 89 case 'st03': 90 switch(option.paging_active_style_type){ 91 case 'st00': 92 $list_wrap.toggleClass('paging_type_count paging_type_count01', true); 93 break; 94 case 'st01': 95 $list_wrap.toggleClass('paging_type_count paging_type_count02', true); 96 break; 97 case 'st02': 98 $list_wrap.toggleClass('paging_type_count paging_type_count03', true); 99 break; 100 } 101 break; 102 } 103 } 104 105 if(option.show_next_prev == 'Y'){ 106 $list_wrap.toggleClass('custom_nav nav_type_'+option.nav_style_type); 107 switch(option.nav_style_type){ 108 case 'st00': 109 switch(option.nav_type_angle){ 110 case 'normal': 111 break; 112 case 'round': 113 $list_wrap.toggleClass('nav_round'); 114 break; 115 case 'square': 116 $list_wrap.toggleClass('nav_square'); 117 break; 118 } 119 break; 120 case 'st01': 121 switch(option.nav_type_arrow){ 122 case 'normal': 123 break; 124 case 'round': 125 $list_wrap.toggleClass('nav_round'); 126 break; 127 case 'square': 128 $list_wrap.toggleClass('nav_square'); 129 break; 130 } 131 break; 132 case 'st02': 133 switch(option.nav_type_long_arrow){ 134 case 'normal': 135 break; 136 case 'round': 137 $list_wrap.toggleClass('nav_round'); 138 break; 139 case 'square': 140 $list_wrap.toggleClass('nav_square'); 141 break; 142 } 143 break; 144 case 'st03': 145 switch(option.nav_type_caret){ 146 case 'normal': 147 break; 148 case 'round': 149 $list_wrap.toggleClass('nav_round'); 150 break; 151 case 'square': 152 $list_wrap.toggleClass('nav_square'); 153 break; 154 } 155 break; 156 case 'st04': 157 $list_wrap.toggleClass('nav_text'); 158 break; 159 } 160 } 161 162 163 var stagePadding = 0; 164 var is_extend_grid = $list_wrap.closest('div[class="inside"]').length === 0; 165 166 if ( option.sub_type == 'b' ) { 167 $list_wrap.closest('._item_container').css('overflow', 'hidden'); 168 if ( is_extend_grid ) { // 그리ë íì¥ì 169 stagePadding = 100; 170 } else { 171 stagePadding = 60; 172 } 173 } 174 175 // 모ë°ì¼ ëë°ì´ì¤ ë·°ì¼ ê²½ì° & ì¹ì íì¥ì¼ ë, 모ë°ì¼ padding ì²ë¦¬ 176 if (isMobileDeviceView() && is_extend_grid) { 177 stagePadding = option.sub_type == 'b' ? 40 : 0; 178 } 179 180 $list_wrap.owlCarousel({ 181 'navText' : ["", ""], 182 'slideBy':(option.slide_by == 'Y' && (option.sub_type == 'a' || option.sub_type == 'b' )) ? 1 : pc_cnt, 183 'responsive':{ 184 0:{ 185 'items': mobile_cnt, 186 'stagePadding': option.sub_type == 'b' ? 40 : 0, 187 'slideBy':(option.slide_by == 'Y' && (option.sub_type == 'a' || option.sub_type == 'b' )) ? 1 : mobile_cnt, 188 'lazyLoadEager': mobile_cnt 189 }, 190 991:{ 191 'items':pc_cnt, 192 'stagePadding': option.sub_type == 'b' ? stagePadding : 0, 193 'slideBy':(option.slide_by == 'Y' && (option.sub_type == 'a' || option.sub_type == 'b' )) ? 1 : pc_cnt, 194 'lazyLoadEager': pc_cnt 195 } 196 }, 197 'lazyLoad': true, 198 'nav' : option.show_next_prev =='Y', 199 'autoplay' : option.auto_change=='Y', 200 'dots' : option.show_paging=='Y', 201 'loop' : $list_wrap.find('._shop_item').length > 1 ? option.effect_loop=='Y' : false, 202 'smartSpeed' : option.effect_time*1000, 203 'autoplayTimeout' : option.effect_wait == 0 ? 50 : option.effect_wait*1000 204 }); 205 }; 206 207 var shopListResize = function(){ 208 if(option.type == 'slide' && typeof $list_wrap.data('owlCarousel') != 'undefined'){ 209 $list_wrap.data('owlCarousel',false); 210 $list_wrap.empty(); 211 $list_wrap.off(); 212 $list_wrap.unbind(); 213 $.each($org_html.find('._shop_item'),function(e,$_item){ 214 $list_wrap.append($_item); 215 }); 216 $org_html = $list_wrap.clone(false); 217 setTimesale(); 218 } 219 $list_wrap.imagesLoaded() 220 .always(function(){ 221 var window_width =$(window).width(); 222 if($('body').hasClass('device_type_m')) 223 window_width = 370; 224 if(window_width <= 768) 225 option.margin = 7.5; 226 $list_wrap.css({'margin':'0 -'+option.margin+'px'}); 227 option.width = option.width < 1 ? 200 : option.width; 228 229 function getTrueFloatSize(element) { 230 const width = parseFloat(window.getComputedStyle(element).width) 231 const height = parseFloat(window.getComputedStyle(element).height) 232 return {width, height}; 233 } 234 var inner_width = getTrueFloatSize($list_wrap[0]).width; 235 var item_cnt = option.line_cnt; 236 if(extend_section && option.extend_cnt != 'Y') // ì¹ì íì¥ì´ë©´ì ê°¯ì ì ì§ê° ìëë©´ 237 item_cnt = Math.floor(inner_width/option.width); 238 239 240 var width = Math.floor(inner_width / item_cnt); 241 var item_thumbs_width = $('._shop_item .item-thumbs').width(); 242 var item_detail_max_width = width - 35 - item_thumbs_width; 243 244 if(window_width <= 768 && !mobile_section){ 245 item_cnt = option.mobile_line_cnt; 246 if (option.mobile_line_cnt == 0){ 247 item_cnt = 2; 248 } 249 } 250 if(option.type == 'slide'){ 251 runSlide(item_cnt); 252 $list_wrap.find('._shop_item').css({'width':'100%','padding':'0 0'+option.margin+'px'}); 253 }else{ 254 if(option.sub_type == 'b'){ 255 if(window_width > 991){ 256 $list_wrap.find('._shop_item').css({'max-width':width,}); 257 $list_wrap.find('._shop_item .item-detail').css({'max-width' : item_detail_max_width,}); 258 }else{ 259 $list_wrap.find('._shop_item').css({'max-width': '100%',}); 260 $list_wrap.find('._shop_item .item-detail').css({'max-width' : '100%',}); 261 } 262 } 263 } 264 265 $list_wrap.css('visibility','visible'); 266 shopListHeight(); 267 }); 268 }; 269 270 271 var shopListHeight = async function(){ 272 // ê°ì íì ìí ì¹´ë를 ëì¼ ëì´ë¡ ì ë ¬í기 ìí´ min-height 를 ì¬ì© 273 // height 를 ì¬ì©íë©´ 컨í ì¸ ê° í ìµë ëì´ë³´ë¤ í° ê²½ì° ì리ë 문ì ê° ìì´ min-height ë¡ ë³ê²½ 274 $list_wrap.find('._shop_item').css('min-height', ''); 275 var be = 0; 276 var ar = []; 277 278 await $list_wrap.find('img._org_img').lazyload({ 279 /* ìí ìì¸íì´ì§ lazy load ì ì©, 기본 /img/no-image.png ë íë²ë§ ë¶ë¬ì´ */ 280 threshold : 100, 281 effect : "fadeIn", 282 effect_speed : 50, // fadeIn ìê° ë¨ì¶(기본 400msâ50ms) 283 appear: function () { 284 // lazyload fadeIn effectë¡ ì¶ê°ë inline style ì ê±° 285 if ($(this).css('opacity')) { 286 $(this).css('opacity', ''); 287 } 288 }, 289 load: function () { 290 // IMOPS-13564: lazyload ë´ë¶ìì load ì½ë°±ì fadeIn í¸ì¶ ì§í(ì ëë©ì´ì ì¤)ì ì¤íëë¯ë¡ 291 // promise().done()ì¼ë¡ ì ëë©ì´ì ìë£ ìì ì ì¸ë¼ì¸ opacity 를 ì ê±°íë¤. 292 // (IMOPS-11088 ì appear ì½ë°±ì fadeIn ìì ì ì¤íëì´ ì¸ë¼ì¸ opacity ìì¡´ì ë§ì§ 못íì) 293 $(this).promise().done(function () { 294 $(this).css('opacity', ''); 295 }); 296 } 297 }); 298 299 // list ì§ì´ íì ì CSS grid(align-items:stretch)ë¡ ê°ì í ì¹´ë를 ëì¼ ëì´ë¡ 300 // ìë ì ë ¬íë¯ë¡ JS min-height 주ì ì´ ë¶íìíë¤. ì¤íë ¤ ì´ë¯¸ì§ ì§ì° ë¡ë© ì´ì 301 // ìì ì ëì´ë¥¼ 측ì íë©´ í ëì´ë¥¼ ì못 ê³ì°í´ ì¤ì íì´ì§ì ëìì¸ëª¨ëì ìí
302 // ê°ê²©ì´ ë¬ë¼ì§ë¯ë¡, list íì ì ì ë ¬ì CSS ì ììíë¤. (slide íì ë§ JS ì ì§) 303 // (IMOPS-13992) 304 if (option.type === 'list') { 305 return; 306 } 307 308 await $list_wrap.find('._shop_item').each(function(){ 309 if(be == $(this).position().top){ 310 ar.push($(this)); 311 }else{ 312 var height = 0; 313 var interval = 0; 314 $.each(ar, function(e, $o){ 315 var o_height = window.getComputedStyle($o.get(0), null).height; 316 o_height = parseFloat(o_height.replace("px", "")); 317 if(o_height > height) 318 height = Math.ceil(o_height); 319 }); 320 $.each(ar, function(e, $o){ 321 $o.css('min-height', (height + interval) + 'px'); 322 }); 323 ar = []; 324 ar.push($(this)); 325 be = $(this).position().top; 326 } 327 }); 328 }; 329 330 var setPeriodSetting = function(code){ 331 $.ajax({ 332 type : 'GET', 333 data : {'code' : code}, 334 url : ('/ajax/shop/get_period_setting.cm'), 335 dataType : 'json', 336 cache : true, 337 success : function(res){ 338 if(res.msg == 'SUCCESS'){ 339 if ( $list_wrap.find('._shop_item').length > 1 ) { 340 var prod_period_discount_info = res.prod_period_discount_info; 341 if(prod_period_discount_info.length > 0){ 342 prod_period_discount_info.forEach(function(obj){ 343 $list_wrap.find('.item_pay_detail_' + obj.prod_code).html(obj.html); 344 if(option.type == 'slide'){ 345 $org_html.find('.item_pay_detail_' + obj.prod_code).html(obj.html); 346 } 347 if(obj.is_timesale == 'true' && obj.is_instant_sale == 'false'){ 348 if($list_wrap.find('._shop_item').length > 1){//ë±ì§, ë¨ì ê¸°ê° , ê°ê²© 349 //ê° ì¸í 350 $list_wrap.find('._timesale_badge_' + obj.prod_code).show(); 351 $list_wrap.find('._doz_timesale_' + obj.prod_code).show(); 352 if(option.type == 'slide'){ 353 $org_html.find('._timesale_badge_' + obj.prod_code).show(); 354 $org_html.find('._doz_timesale_' + obj.prod_code).show(); 355 } 356 } 357 }else{ 358 $list_wrap.find('._timesale_badge_' + obj.prod_code).hide(); 359 $list_wrap.find('._doz_timesale_' + obj.prod_code).hide(); 360 if(option.type == 'slide'){ 361 $org_html.find('._timesale_badge_' + obj.prod_code).hide(); 362 $org_html.find('._doz_timesale_' + obj.prod_code).hide(); 363 } 364 } 365 setTimesale(); 366 }); 367 } 368 } 369 }else{ 370 alert(res.msg); 371 } 372 }, 373 error : function(res){ 374 return false; 375 } 376 377 }); 378 }; 379 380 var setTimesale = function(){ 381 var $doz_timesale_wrap = $list_wrap.find('._doz_timesale_wrap'); 382 if($doz_timesale_wrap.length > 0){ 383 $doz_timesale_wrap.each(function(){ 384 var $that = $(this); 385 var $doz_timesale = $that.find('._doz_timesale'); 386 var date_now = Date.now(); 387 var remain_ms = ($doz_timesale.attr('data-end-time') * 1000) - date_now; 388 if(remain_ms > 0){ 389 var remain_d = Math.floor(remain_ms / 86400000); 390 var remain_h = Math.floor((remain_ms % 86400000) / 3600000); 391 var remain_m = Math.floor((remain_ms % 3600000) / 60000); 392 var remain_s = Math.floor((remain_ms % 60000) / 1000); 393 394 var remain_hh = remain_h < 10 ? '0' + remain_h : '' + remain_h; 395 var remain_mm = remain_m < 10 ? '0' + remain_m : '' + remain_m; 396 var remain_ss = remain_s < 10 ? '0' + remain_s : '' + remain_s; 397 if(remain_d >= 1){ 398 $doz_timesale.text(getLocalizeString('ì¤ëª _ì¢ ë£ê¹ì§n1ì¼n2ìn3ë¶n4ì´ë¨ì', [remain_d, remain_hh, remain_mm, remain_ss], 'ì¢ ë£ê¹ì§ %1ì¼ %2:%3:%4')); 399 }else{ 400 $doz_timesale.text(getLocalizeString('ì¤ëª _ì¢ ë¥ê¹ì§n1ìn2ë¶n3ì´ë¨ì', [remain_hh, remain_mm, remain_ss], 'ì¢ ë£ê¹ì§ %1:%2:%3 ë¨ì')); 401 } 402 date_now = date_now + 1000; 403 404 window.addEventListener('resize', function(){ 405 clearInterval(timesale_interval); 406 }); 407 // 리ì¬ì´ì¦ì¼ë ì¸í°ë² ì£¼ê¸°ê° ì¤ì²©ëë 문ì ê° ìì. ê·¸ëì 리ì¬ì´ì¦ì¼ ë 기존 interval ì¤ì ëì´ ìë 걸 ì´ê¸°í 408 timesale_interval = setInterval(function(){ 409 var remain_ms = ($doz_timesale.attr('data-end-time') * 1000) - date_now; 410 if(remain_ms > 0){ 411 var remain_d = Math.floor(remain_ms / 86400000); 412 var remain_h = Math.floor((remain_ms % 86400000) / 3600000); 413 var remain_m = Math.floor((remain_ms % 3600000) / 60000); 414 var remain_s = Math.floor((remain_ms % 60000) / 1000); 415 416 var remain_hh = remain_h < 10 ? '0' + remain_h : '' + remain_h; 417 var remain_mm = remain_m < 10 ? '0' + remain_m : '' + remain_m; 418 var remain_ss = remain_s < 10 ? '0' + remain_s : '' + remain_s; 419 if(remain_d >= 1){ 420 $doz_timesale.text(getLocalizeString('ì¤ëª _ì¢ ë£ê¹ì§n1ì¼n2ìn3ë¶n4ì´ë¨ì', [remain_d, remain_hh, remain_mm, remain_ss], 'ì¢ ë£ê¹ì§ %1ì¼ %2:%3:%4')); 421 }else{ 422 $doz_timesale.text(getLocalizeString('ì¤ëª _ì¢ ë¥ê¹ì§n1ìn2ë¶n3ì´ë¨ì', [remain_hh, remain_mm, remain_ss], 'ì¢ ë£ê¹ì§ %1:%2:%3 ë¨ì')); 423 } 424 date_now = date_now + 1000; 425 }else{ 426 /* íìì¸ì¼ ì¢ ë£ */ 427 clearInterval(timesale_interval); 428 $that.remove(); 429 } 430 }, 1000); 431 }else{ 432 $that.remove(); 433 } 434 }); 435 } 436 }; 437 438 var isMobileDeviceView = function() { 439 return $('body').hasClass('device_type_m'); 440 } 441 442 return { 443 'init' : function(d){ 444 init(d); 445 }, 446 'shopListHeight' : function(){ 447 shopListHeight(); 448 }, 449 'setPeriodSetting' : function(code){ 450 setPeriodSetting(code); 451 } 452 }; 453};
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.