1/* 2 KT.com version 1.0 3 4 Copyright â 2017 kt corp. All rights reserved. 5 6 This is a proprietary software of kt corp, and you may not use this file except in 7 compliance with license agreement with kt corp. Any redistribution or use of this 8 software, with or without modification shall be strictly prohibited without prior written 9 approval of kt corp, and the copyright notice above does not evidence any actual or 10 intended publication of such software. 11*/ 12 13$j = jQuery.noConflict(), $=$j; 14 15var cfmSearchRecommendResult = {}; //ì¶ì²ê²ìì´ 16var cfmSearchAreaHtml = { 17 18 //ë§í¬ì ë³´ 19 linkInfo: function(mode, type, traget, item){ 20 var linkType = '_self'; 21 var titleName = 'KT-ê°ì¸_ê³µíµ'; 22 var urlInfo = search_URL +'/?c=OLE000000&r=10&ch=USR000'; 23 var statInfo = '^KT-ê°ì¸_ê³µíµ^GNB^ê²ìë ì´ì´^'; 24 25 if(kt_common.pageType() == 'shop'){ //Shop 26 statInfo = '^KT-ê°ì¸_ê³µíµ^GNB^Shop^ê²ìë ì´ì´^'; 27 urlInfo = search_URL +'/?c=SHO000000'; 28 } 29 30 if(traget != null){ 31 traget.on('click', function(){ 32 var keyword = ''; 33 if(type == 'popular'){ 34 var statInfoType = 'ì¸ê¸°ê²ìì´^'; 35 if(kt_common.pageType() == 'shop' && $j('.kt_popkeyword').hasClass('active')){ //Shop&KTì¸ê¸°ê²ìì´ 36 statInfoType += 'KT^'; 37 }else if(kt_common.pageType() != 'shop' && $j('.shop_popkeyword').hasClass('active')){ //ë·ì»´&Shopì¸ê¸°ê²ìì´ 38 statInfoType += 'Shop^'; 39 } 40 41 keyword = $j(this).attr('keyword'); 42 urlInfo = urlInfo +'&q='+ encodeURIComponent(keyword); 43 statInfo = statInfo + statInfoType + $j(this).find('.num').text() +'ì^'+ keyword; 44 }else if(type == 'autowords'){ 45 keyword = $j(this).attr('keyword'); 46 urlInfo = urlInfo +'&q='+ encodeURIComponent(keyword); 47 statInfo = statInfo + 'ìëìì±^'+ keyword; 48 }else if(type == 'autoconts'){ 49 keyword = $j(this).attr('keyword'); 50 urlInfo = ''; 51 statInfo = statInfo + 'ì´ë¯¸ì§^'+ keyword; 52 }else if(type == 'words'){ 53 urlInfo = ''; 54 statInfo = statInfo + 'ë©ë´ë°ë¡ê°ê¸°^'+ item.MENUNAME; 55 }else if(type == 'special'){ 56 urlInfo = ''; 57 statInfo = statInfo + '기íì ^'+ item.TITLE; 58 }else if(type == 'related'){ 59 urlInfo = ''; 60 statInfo = statInfo + 'ì°ê´ìí^'+ item.RELATE_TITLE; 61 } 62 63 kt_common.link(urlInfo, linkType, titleName, statInfo); 64 if(urlInfo != '') return false; 65 }); 66 }else{ 67 if(type == 'search'){ 68 urlInfo = urlInfo +'&q='+ encodeURIComponent(item.keyword); 69 statInfo = statInfo + item.keyword +'^ê²ìë²í¼'; 70 }else if(type == 'click'){ 71 urlInfo = ''; 72 statInfo = statInfo + 'ê²ìíë'; 73 }else if(type == 'clear'){ 74 urlInfo = ''; 75 statInfo = statInfo + 'ê²ìì´ë¦¬ì ë²í¼'; 76 }else if(type == 'close'){ 77 urlInfo = ''; 78 statInfo = statInfo + 'ë«ê¸°ë²í¼'; 79 } 80 81 kt_common.link(urlInfo, linkType, titleName, statInfo); 82 } 83 }, 84 85 //ê²ìì´ íì´ë¼ì´í 86 replaceKeyword: function(keyword, resultValue){ 87 var replaceWord = ''; 88 cfmKeyword = keyword.replace(/\s/g,''); // 공백 ì ê±° 89 90 for (var i = 0 ; i < cfmKeyword.length ; i ++ ) { 91 var charStr = cfmKeyword.substr(i,1); 92 // ì ê·ì ìì ( 93 if (i === 0) replaceWord = '('; 94 if (cfmSearchAreaHtml.isSpecialChar(charStr)) { 95 // ì ê·ìì 기본 í¹ì문ìì¼ê²½ì° ì¼ë°ë¬¸ìë¡ ì¹íí기 ìí´ \ ë¶ì¬ì¤ 96 replaceWord += '\\' + charStr + '\\s*'; 97 } else { 98 replaceWord += charStr + '\\s*'; 99 } 100 // ì ê·ì ë ) 101 if ( i === cfmKeyword.length-1 ) replaceWord += ')'; 102 } 103 104 var regex = new RegExp(replaceWord,'gi'); 105 var repText = resultValue.replace(regex, '<em>$1</em>'); 106 107 return repText; 108 }, 109 110 //í¹ì문ì ì²´í¬ 111 isSpecialChar: function(str){ 112 var spChr = ['.','*','+','?','\\','^','$','[',']','(',')','{','}','|']; 113 var rtnVal = false;
114 115 $j(spChr).each(function(k,v){ 116 if (str === v) rtnVal = true; 117 }); 118 119 return rtnVal; 120 }, 121 122 //íµí©ê²ì-ê²ìì´ ì²´í¬ 123 searchWordCheck: function(str){ 124 var result = str; 125 /* ê²ìapi(rdi.kt.com) url ê²ìì´ -> íë¼ë¯¸í° ê²ìì´ë¡ ë³ê²½ì¼ë¡ í´ê²°-2ì°¨ 126 if(str != ''){ 127 var regEx = new RegExp('[\#\%\;\.\/\?]', 'g'); //ì¤ë¥ëë í¹ì문ì ì ê±° 128 result = result.replace(regEx, ''); 129 } 130 */ 131 return result; 132 }, 133 134 //íµí©ê²ì-ì¶ì²ê²ìì´ callback 135 callbackSearchRecommend: function(type, result){ 136 try { 137 if(type === 'success'){ 138 if(kt_common.isNull(result.data) !== '' && result.data.length > 0){ 139 var resultList = result.data[0].areaSetList[0].areaContsList; 140 if(kt_common.isNull(resultList) !== '' && resultList.length > 0){ 141 if(resultList.length > 0){ 142 cfmSearchRecommendResult = resultList[0]; // í¬ì»¤ì±ë ë ì¬ì¤ì ì ìí´ 143 144 $j('#total-search input[type=text]').attr('placeholder', cfmSearchRecommendResult.subTitle); 145 $j('#total-search input[type=text]').data('recommend', cfmSearchRecommendResult.title); 146 } 147 } 148 } 149 } 150 } catch (e) { 151 common_log.log('kt_search.js callbackSearchRecommend [' + e.message + ']'); 152 } 153 }, 154 155 //íµí©ê²ì-ì¸ê¸°ê²ìì´ callback 156 callbackSearchPopkeywords: function(type, result, mode){ 157 if(mode == undefined) mode = kt_common.pageType(); 158 159 $j('.cfmCltabs').find('a').removeClass('active').removeAttr('title'); 160 161 if(mode == 'shop'){ //Shop 162 $j('.shop_popkeyword').addClass('active'); 163 $j('.shop_popkeyword').attr('title','ì íë í'); 164 }else{ 165 $j('.kt_popkeyword').addClass('active'); 166 $j('.kt_popkeyword').attr('title','ì íë í'); 167 } 168 169 try { 170 if(type === 'success'){ 171 $j('#rltmkywd-list').empty(); //ì´ê¸°í 172 173 if(kt_common.isNull(result.data) !== ''){ 174 if(kt_common.isNull(result.data.response) !== ''){ 175 if(kt_common.isNull(result.data.response.docs) !== '' && result.data.response.docs.length > 0){ 176 var resultList = result.data.response.docs; 177 $j.each(resultList, function(idx, data){ 178 var quick = $j('<li>'+ 179 ' <a href="#">'+ 180 ' <span class="num">' + data.ranking + '</span>'+ 181 ' <em>' + data.keyword + '</em>'+ 182 ' </a>'+ 183 '</li>'); 184 185 if(data.rankarrow === 'U'){ 186 quick.find('a').append('<span class="rankf_U"><span>ìììì¹</span>' + data.changevlu + '</span>'); 187 } else if(data.rankarrow === 'D'){ 188 quick.find('a').append('<span class="rankf_D"><span>ììíë½</span>' + data.changevlu + '</span>'); 189 } else if(data.rankarrow === 'E'){ 190 quick.find('a').append('<span class="rankf_E"><span>ììë³ëìì</span></span>'); 191 } else { 192 quick.find('a').append('<span class="rankf_N">NEW</span>'); 193 } 194 195 quick.find('a').attr('keyword', data.keyword); 196 cfmSearchAreaHtml.linkInfo('search', 'popular', quick.find('a')); 197 198 $j('#rltmkywd-list').append(quick); 199 }); 200 } 201 } 202 } 203 } 204 } catch (e) { 205 common_log.log('kt_search.js callbackSearchPopkeywords [' + e.message + ']'); 206 } 207 208 }, 209 210 //íµí©ê²ì-ìëìì± callback 211 callbackSearchAutowords: function(type, result, words){ 212 var target = $j('.auto-list'); 213 214 try { 215 if(type === 'success'){ 216 target.empty(); //ì´ê¸°í 217 218 var resultList = result.data.response.docs; 219 if(resultList.length > 0){ 220 $j.each(resultList, function(idx, data){ 221 var resultValue = data.KEYWORD; 222 223 resultValue = resultValue.replaceAll("<", "<").replaceAll( "<","<").replaceAll(">",">").replaceAll( "(","(").replaceAll(")",")").replaceAll( "'","'"); 224 words = words.replaceAll("<", "<").replaceAll( "<","<").replaceAll(">",">").replaceAll( "(","(").replaceAll(")",")").replaceAll( "'","'"); 225 226 var highlight = ''; 227 if(words.length == 1){ 228 if(resultValue.indexOf(words.toUpperCase()) !== -1){ 229 highlight = resultValue.replace(words.toUpperCase(), '<em>' + words.toUpperCase() + '</em>'); 230 }else{ 231 highlight = resultValue.replace(words, '<em>' + words + '</em>'); 232 } 233 }else{ 234 highlight = cfmSearchAreaHtml.replaceKeyword(words, resultValue); 235 } 236 237 var auto = $j('<li><a href="#" class="cfmautolink" data-index="'+ idx +'">' + highlight + '</a></li>'); 238 239 auto.find('a').attr('keyword', resultValue); 240 cfmSearchAreaHtml.linkInfo('search', 'autowords', auto.find('a')); 241 242 target.append(auto); 243 }); 244 245 //ì´ë¯¸ì§ 246 if(kt_common.pageType() != 'shop'){ //Shop ìëê²½ì°ë§ 247 target.find('li:first').append('<div class="summary-banner"></div>'); 248 target.find('li a').on('mouseover focus', function(){ 249 var idx = $j(this).data('index'); 250 var data = resultList[idx]; 251 252 if(kt_common.isNull(data.IMG_URL) !== '' && kt_common.isNull(data.LINK_URL) !== ''){ 253 var html = $j('<a href="'+ data.LINK_URL +'">
253<img src="'+ data.IMG_URL +'" alt="'+ kt_common.removeTag(data.IMG_DESC) +'" onerror="this.src=\'' + cfm_domain + '/images/v2/common/KT_summarybanner_noimg.jpg\'"></a>'); 254 255 html.attr('keyword', data.KEYWORD); 256 cfmSearchAreaHtml.linkInfo('search', 'autoconts', html); 257 258 target.find('.summary-banner').html(html); 259 }else{ 260 target.find('.summary-banner').html('<img src="' + cfm_domain + '/images/v2/common/KT_summarybanner_noimg.jpg" alt="ì´ë¯¸ì§ìì">'); 261 } 262 }); 263 target.find('li:eq(0) a').mouseover(); 264 } 265 } else { 266 target.append('<li>í´ë¹ ê²ìì´ì ëí ê²ìê²°ê³¼ê° ììµëë¤.</li>'); 267 } 268 } 269 } catch (e) { 270 common_log.log('kt_search.js callbackSearchAutowords [' + e.message + ']'); 271 } 272 }, 273 274 //íµí©ê²ì-ë°ë¡ê°ê¸° callback 275 callbackSearchwords: function(type, result, words){ 276 var target = $j('.quick-menu'); 277 278 try { 279 if(type === 'success'){ 280 target.empty(); 281 282 var resultList = result.data.response.docs; 283 var searchKeyword = result.data.highlighting; 284 if(resultList.length > 0){ 285 $j.each(resultList, function(idx, data){ 286 var category = ''; 287 var menuPathArr = data.MENUPATH.split('^$^'); 288 var menuDepth = menuPathArr.length / 2; 289 var menuName = ''; 290 var highlightTxt = searchKeyword[data.DOCID].MENUNAME; 291 292 for(var depth = 1; depth <= menuDepth; depth++){ 293 if(category !== ''){ 294 category += ' > '; 295 } 296 297 menuName = menuPathArr[(depth - 1) * 2]; 298 if(depth === menuDepth){ 299 category += highlightTxt; 300 } else { 301 category += menuName; 302 } 303 } 304 305 var link; 306 if(kt_common.isNull(data.URL) !== ''){ 307 link = $j('<li><a href="'+ data.URL +'">' + category + '</a></li>'); 308 309 link.attr('keyword', category); 310 cfmSearchAreaHtml.linkInfo('search', 'words', link.find('a'), data); 311 } else { 312 link = $j('<li>' + category + '</li>'); 313 } 314 315 target.append(link); 316 }); 317 318 target.find('strong').contents().unwrap().wrap('<em></em>'); 319 } else { 320 target.append('<li>í´ë¹ ê²ìì´ì ëí ê²ìê²°ê³¼ê° ììµëë¤.</li>'); 321 } 322 } 323 } catch (e) { 324 common_log.log('kt_search.js callbackSearchwords [' + e.message + ']'); 325 } 326 }, 327 328 //íµí©ê²ì-기íì (Shop)-2ì°¨ 329 callbackSearchSpecial: function(type, result, words){ 330 var target = $j('.strategy-lilst'); 331 332 try { 333 if(type === 'success'){ 334 target.empty(); //ì´ê¸°í 335 336 var resultList = result.data.response.docs; 337 var searchKeyword = result.data.highlighting; 338 339 if(resultList.length > 0){ 340 $j.each(resultList, function(idx, data){ 341 var highlightTxt = searchKeyword[data.DOCID].TITLE; 342 var link; 343 344 data.URL = data.LINKURL; 345 if(kt_common.isNull(data.URL) !== ''){ 346 link = $j('<p class="tit"><a href="'+ data.URL +'">'+ highlightTxt +'</a></p>'); 347 348 cfmSearchAreaHtml.linkInfo('search', 'special', link.find('a'), data); 349 } else { 350 link = $j('<p class="tit">'+ highlightTxt +'</p>'); 351 } 352 353 target.append(link); 354 }); 355 356 target.find('strong').contents().unwrap().wrap('<em></em>'); 357 } else { 358 target.append('<p class="tit">í´ë¹ ê²ìì´ì ëí <br>ê²ìê²°ê³¼ê° ììµëë¤.</p>'); 359 } 360 } 361 } catch (e) { 362 common_log.log('kt_search.js callbackSearchSpecial [' + e.message + ']'); 363 } 364 }, 365 366 //íµí©ê²ì-ì°ê´ìí(Shop)-2ì°¨ 367 callbackSearchRelatedProduct: function(type, result, words){ 368 var target = $j('.relation-list'); 369 370 try { 371 if(type === 'success'){ 372 target.empty(); //ì´ê¸°í 373 374 var resultList = result.data.response.docs; 375 376 if(resultList.length > 0){ 377 $j.each(resultList, function(idx, data){ 378 var link, info = ''; 379 380 if(kt_common.isNull(data.THUMBNAIL) !== ''){ 381 info += '<img src="'+ data.THUMBNAIL +'" alt="'+ kt_c
381ommon.removeTag(data.RELATE_TITLE) +'" onerror="this.src=\'' + cfm_domain + '/images/v2/layout/KT_relatedbanner_noimg.png\'">'; 382 }else{ 383 info += '<img src="' + cfm_domain + '/images/v2/layout/KT_relatedbanner_noimg.png" alt="ì´ë¯¸ì§ìì">'; 384 } 385 386 if(kt_common.isNull(data.RELATE_TITLE) !== ''){ 387 info += '<span class="prd_name">'+ data.RELATE_TITLE +'</span>'; 388 } 389 390 if(kt_common.isNull(data.RELATE_PRICE) !== ''){ 391 info += '<span class="prd_price"><span>(ì)</span> <strong class="point">'+ kt_common.setComma(data.RELATE_PRICE) +'</strong>ì~</span>'; 392 } 393 394 data.URL = data.LINKURL; 395 if(kt_common.isNull(data.URL) !== ''){ 396 link = $j('<li><a href="'+ data.URL +'">'+ info +'</a></li>'); 397 398 cfmSearchAreaHtml.linkInfo('search', 'related', link.find('a'), data); 399 } else { 400 link = $j('<li>'+ info +'</li>'); 401 } 402 403 target.append(link); 404 }); 405 } else { 406 target.append('<li>í´ë¹ ê²ìì´ì ëí ê²ìê²°ê³¼ê° ììµëë¤.</li>'); 407 } 408 } 409 } catch (e) { 410 common_log.log('kt_search.js callbackSearchRelatedProduct [' + e.message + ']'); 411 } 412 } 413} 414 415$j(document).ready(function(){ 416 if($j('#total-search').length > 0){ 417 // íì´ì´íì¤ ì²ë¦¬ 418 var firefoxTimer; 419 var firefoxXKeyword; 420 var filefoxKeyword; 421 var akcDataExist = 'N'; 422 function firefoxClearInter() { 423 clearInterval(firefoxTimer); 424 } 425 426 function firefoxSetInter($input) { 427 firefoxClearInter(); 428 var intervalId = setInterval(function(){ 429 var filefoxKeyword = $input.val().trim(); 430 if (filefoxKeyword !== firefoxXKeyword){ 431 firefoxXKeyword = filefoxKeyword; 432 callSearch($input); 433 } 434 }, 10); 435 firefoxTimer = intervalId; 436 } 437 438 var agent = navigator.userAgent.toLowerCase(); 439 $j('#total-search input[type=text]').on('focus', function(event) { 440 if(agent.indexOf('firefox') !== -1) { 441 firefoxSetInter($j(this)); 442 return false; 443 } 444 }); 445 446 $j('#total-search input[type=text]').on('click', function(event){ 447 cfmSearchAreaHtml.linkInfo('search', 'click', null); 448 449 if($j(this).val().trim() === '') { 450 return false; 451 } else { 452 if(agent.indexOf('firefox') !== -1) { 453 t = 'click'; 454 firefoxSetInter($j(this)); 455 } 456 457 if(akcDataExist === "N") { 458 callSearch($j(this)); 459 return false; 460 } else { 461 firefoxClearInter(); 462 return false; 463 } 464 } 465 }); 466 467 //íµí©ê²ì(ìë¨ìì)-ê²ìë²í¼ 468 $j('#btn-search').on('click', function(e){ 469 if(!e.detail > 0) { 470 var $searchElement = $j('#total-search #searchInput'); 471 $searchElement.length && $searchElement.attr('data-cfm-active', 'form'); 472 } 473 kt_api.searchRecommend(); //ì¶ì²ê²ìì´ 474 kt_api.searchPopkeywords(); //ì¸ê¸°ê²ìì´ 475 476 // 0922 íì z-index ì¡°ì ìí´ ì¶ê°í¨ 477 $j("body").addClass("cfm-nonscroll"); 478 }); 479 480 //íµí©ê²ì(ê²ìë ì´ì´)-ì¸ê¸°ê²ìì´íì í-2ì°¨ 481 $j('.kt_popkeyword').on('click', function(){ 482 $j(this).closest('.cfmCltabs').find('a').removeClass('active').removeAttr('title'); 483 $j(this).addClass('active'); 484 $j(this).attr('title','ì íë í'); 485 486 //ì¸ê¸°ê²ìì´ 487 kt_api.searchPopkeywords('cl'); 488 489 //í´ë¦íµê³ 490 if(kt_common.pageType() == 'shop'){ //Shop 491 KT_trackClicks('KT-ê°ì¸_ê³µíµ', '^KT-ê°ì¸_ê³µíµ^GNB^Shop^ê²ìë ì´ì´^TAB_KT'); 492 }else{ 493 KT_trackClicks('KT-ê°ì¸_ê³µíµ', '^KT-ê°ì¸_ê³µíµ^GNB^ê²ìë ì´ì´^TAB_KT'); 494 } 495 496 return false;
497 }); 498 $j('.shop_popkeyword').on('click', function(){ 499 $j(this).closest('.cfmCltabs').find('a').removeClass('active').removeAttr('title'); 500 $j(this).addClass('active'); 501 $j(this).attr('title','ì íë í'); 502 503 //ì¸ê¸°ê²ìì´ 504 kt_api.searchPopkeywords('shop'); 505 506 //í´ë¦íµê³ 507 if(kt_common.pageType() == 'shop'){ //Shop 508 KT_trackClicks('KT-ê°ì¸_ê³µíµ', '^KT-ê°ì¸_ê³µíµ^GNB^Shop^ê²ìë ì´ì´^TAB_ë¤ì´ë í¸ìµ'); 509 }else{ 510 KT_trackClicks('KT-ê°ì¸_ê³µíµ', '^KT-ê°ì¸_ê³µíµ^GNB^ê²ìë ì´ì´^TAB_ë¤ì´ë í¸ìµ'); 511 } 512 513 return false; 514 }); 515 516 //íµí©ê²ì(ê²ìë ì´ì´)-ê²ììì(ë·ì»´-ìëìì±&ë°ë¡ê°ê¸°, Shop-ìëìì±&기íì &ì°ê´ìí)-2ì°¨ 517 if(kt_common.pageType() == 'shop'){ //Shop 518 $j("#searchWrapAfter").append(''+ 519 '<div class="search_word">'+ 520 ' <strong class="total-search-tit">ìëìì±</strong>'+ 521 ' <ul class="auto-list"></ul>'+ 522 '</div>'+ 523 '<div class="strategy">'+ 524 ' <strong class="total-search-tit">기íì </strong>'+ 525 ' <ol class="strategy-lilst"></ol>'+ 526 '</div>'+ 527 '<div class="relation">'+ 528 ' <strong class="total-search-tit">ì°ê´ ìí</strong>'+ 529 ' <ul class="relation-list"></ul>'+ 530 '</div>'); 531 }else{ 532 $j("#searchWrapAfter").append(''+ 533 '<div class="search_word">'+ 534 ' <strong class="total-search-tit">ìëìì±</strong>'+ 535 ' <ul class="auto-list"></ul>'+ 536 '</div>'+ 537 '<div class="menu-shortcut">'+ 538 ' <strong class="total-search-tit">ë©ë´ ë°ë¡ê°ê¸°</strong>'+ 539 ' <ol class="quick-menu"></ol>'+ 540 '</div>'); 541 } 542 543 //íµí©ê²ì(ê²ìë ì´ì´)-ê²ìì ë ¥ì°½ 544 $j('#total-search .result').hide(); 545 $j('#total-search input[type=text]').attr('placeholder', '무ìì´ ê¶ê¸íì ê°ì?'); 546 $j('#total-search input[type=text]').attr('maxlength', 30); 547 548 //íµí©ê²ì(ê²ìë ì´ì´)-ìëìì± & ë°ë¡ê°ê¸° ê²ì 549 $j('#total-search input[type=text]').val(''); //ì´ê¸°í(ë¤ë¡ê°ê¸°) 550 $j('#total-search input[type=text]').on(agent.indexOf('firefox') !== -1 ? 'keypress' : 'keyup', function(event){ 551 if (event.keyCode === 0 || event.keyCode === 8) { 552 if(agent.indexOf('firefox') !== -1) { 553 firefoxSetInter($j(this)); 554 return; 555 } 556 } else if(event.keyCode === 13) { 557 if($j(this).attr('data-cfm-active') === 'form') { 558 $j(this).removeAttr('data-cfm-active'); 559 return; 560 } 561 $j('#total-search .tsearch').trigger('click'); 562 return false; 563 } 564 callSearch($j(this)); 565 }); 566 567 //íµí©ê²ì(ê²ìë ì´ì´)-ê²ìì´ ì§ì°ê¸° 568 $j('#total-search .searchInput-btn-clear').on('click', function(){ 569 var $form = $j(this).closest('form'); 570 $form.length && $form.find('#searchInput').attr('data-cfm-active', 'form'); 571 572 $j(this).hide(); 573 $j('#searchWrapBefore').show(); 574 $j('#searchWrapAfter').hide(); 575 $j('#searchInput').val('').focus(); 576 577 $j('.auto-list').find('ul').empty(); 578 $j('.quick-menu').find('ul').empty(); 579 580 cfmSearchAreaHtml.linkInfo('search', 'clear', null); 581 }); 582 583 //íµí©ê²ì(ê²ìë ì´ì´)-ê²ìíì´ì§ì´ë 584 $j('#total-search .tsearch').on('click', function(){ 585 var searchWords = $j('#total-search input[type=text]').val(); 586 var recommendWords = $j('#total-search input[type=text]').data('recommend'); 587 588 var words = ''; 589 if(kt_common.isNull(searchWords) !== ''){ //ì¼ë°ê²ìì´ 590 words = searchWords; 591 } else { //ì¶ì²ê²ìì´ 592 words = kt_common.isNull(recommendWords); 593 } 594 595// if(words !== ''){ 596// cfmSearchAreaHtml.linkInfo('search', 'search', null, {keyword:words}); 597// } else { 598// alert('ê²ìì´ë¥¼ ì ë ¥í´ ì£¼ì¸ì.'); 599// setTimeout(function(){ 600// $j('#total-search input[type=text]').focus(); //ê²ìì´ ë¯¸ì ë ¥ ì림 í ê²ìì°½ì¼ë¡ í¬ì»¤ì¤ ë³´ë´ê¸° 601// }, 200); 602// return false;
603// } 604 cfmSearchAreaHtml.linkInfo('search', 'search', null, {keyword:words}); 605 }); 606 607 //íµí©ê²ì(ê²ìë ì´ì´)-ë«ê¸° 608 $j('#total-search .close-search').on('click', function(){ 609 cfmSearchAreaHtml.linkInfo('search', 'close', null); 610 // 0922 íì z-index ì¡°ì ìí´ ì¶ê°í¨ 611 $j("body").removeClass("cfm-nonscroll"); 612 }); 613 614 function callSearch($input){ 615 var words = cfmSearchAreaHtml.searchWordCheck($input.val().trim()); 616 if(words !== ''){ 617 $j('.searchInput-btn-clear').show(); 618 $j('#searchWrapBefore').hide(); 619 $j('#searchWrapAfter').show(); 620 621 kt_api.searchAutowords(words); //ìëìì± 622 623 //íµí©ê²ì(ê²ìë ì´ì´)-문구ë³ê²½-2ì°¨ 624 if(kt_common.pageType() == 'shop'){ //Shop 625 $j('#searchWrapAfter .menu-shortcut>strong').text('ì°ê´ ìí'); 626 kt_api.searchRelatedProduct(words); //ì°ê´ìí 627 kt_api.searchwords('shop', words); //기íì 628 }else{ 629 $j('#searchWrapAfter .menu-shortcut>strong').text('ë©ë´ ë°ë¡ê°ê¸°'); 630 kt_api.searchwords('search', words); 631 } 632 }else{ 633 $j('.searchInput-btn-clear').hide(); 634 $j('#searchWrapBefore').show(); 635 $j('#searchWrapAfter').hide(); 636 637 $j('.auto-list').find('ul').empty(); 638 $j('.quick-menu').find('ul').empty(); 639 } 640 } 641 642 $j('#searchInput').on('focus', function(){ 643 if (cfmSearchRecommendResult.subTitle !== undefined) { 644 setTimeout(function(){ 645 $j('#searchInput').attr('placeholder', cfmSearchRecommendResult.subTitle); 646 $j('#searchInput').data('recommend', cfmSearchRecommendResult.title); 647 }, 200); 648 } else { 649 $j('#searchInput').attr('placeholder', ""); 650 $j('#searchInput').data('recommend', ""); 651 } 652 }); 653 654 // $j('#searchInput').on('blur', function(){ 655 // if($j('#searchInput').val()==''){ 656 // kt_api.searchRecommend(); 657 // } 658 // }); 659 } 660});
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.