PageSourceSearch

https://www.tenasia.co.kr/resource/js/w.common.js

js tenasia.co.kr collected 2026-10-02 05:57:51 UTC 4,388 bytes, 125 lines download raw bytes

1// 도메인 선언
2const current_domain = window.location.hostname;
3
4
5/**
6 * 공통 광고 HTML 생성 함수
7 * @adScript : (Array) 광고 스크립트
8 * @height : (String) 광고 높이
9 * @type : (String) 광고 타입
10 * @wrapClass : (String) 광고 영역에 추가할 클래스명
11 */ 
12const adCommonHtml = (adScript, height, type, wrapClass="") => {
13	let adHtml = "";
14	switch(type) {
15		// 1단 광고
16		case 'one-column':
17			adHtml = `<div class="ad-area-wrap bg ${wrapClass}">
18						<p class="ad-label">ADVERTISEMENT</p>
19						<div class="ad-wrap" style="min-height:${height}px">
20							<div class="ad-box">${adScript[0]}</div>
21						</div>
22					</div>`;
23			break;
24		// 2단 광고
25		case 'two-column':
26			adHtml = `<div class="ad-area-wrap bg ${wrapClass}">
27						<p class="ad-label">ADVERTISEMENT</p>
28						<div class="ad-wrap" style="min-height:${height}px">
29							<div class="ad-box">
30								${adScript[0]}
31							</div>
32							<div class="ad-box">
33								${adScript[1]}
34							</div>
35						</div>
36					</div>`;
37			break;
38        // 우측 모듈 광고
39        case 'right-module':
40            adHtml = `<div class="aside-module ad-module ad-area-wrap ${wrapClass}"> 
41                        <p class="ad-label">ADVERTISEMENT</p>
42                        <div class="ad-wrap" style="min-height:${height}px">
43                            ${adScript[0]}
44                        </div>
45                    </div>`
46	}
47
48	return adHtml;
49}
50
51$(document).ready(function(){
52    // 개발서버 도메인 치환
53	if(current_domain == 'stg-www.tenasia.co.kr'){
54		const html_now = document.documentElement.innerHTML;
55		const html_new = html_now.replace(/https:\/\/www.tenasia.co.kr/g, "https://stg-www.tenasia.co.kr");
56		document.documentElement.innerHTML = html_new;
57	}
58    
59    // 통합검색 레이어
60    $('.btn-search-open, .btn-search-close').click(function(){
61        $('.layer-search').slideToggle('fast');
62    });
63
64    // 검색 돋보기 클릭 시 포커스
65    $('.btn-search-open').click(function(){
66        $('.layer-search input[name=query]').focus();
67    });
68
69    // 우측모듈 텐스타 슬라이드
70    $('.slide-tenstar .slide-list').slick({
71        prevArrow:'.slide-tenstar .btn-prev',
72        nextArrow:'.slide-tenstar .btn-next'
73    }).on("afterChange", function (event, slick, currentSlide, nextSlide) {
74        $(".slide-control strong").text(currentSlide +1);
75    });
76
77    // 다른 영역 클릭 시 검색창 숨기기
78    $('#wrap').click(function(e){
79        if ($(e.target).hasClass('icon-search-open') || $(e.target).hasClass('btn-search-open')) {
80            return;
81        }
82
83        if (!$('.layer-search').has(e.target).length) {
84            $('.layer-search').hide();
85            return;
86        }
87    });
88
89    // 우측모듈 fixed
90    // if($('.aside-inner').length > 0){
91    //     var asideTop = $('.aside').offset().top;
92    //     var contTop = $('.contents-wrap').offset().top;
93
94    //     $(window).on("scroll", function () {
95    //         var asideHeight = $(".aside-inner").outerHeight();
96    //         if($('.contents').outerHeight() >= asideHeight){
97    //             var contHeight =  $('.contents-wrap').outerHeight();
98    //             var stopPos = contTop + contHeight;
99                
100    //             var asideBottom = asideHeight + asideTop;
101    //             var standard = $(window).scrollTop() + $(window).height();
102    //             var asideTop2 = $('.aside-inner').offset().top;
103                
104    //             if(standard >= asideBottom && stopPos > standard){
105    //                 $('.aside-inner').css({'position':'fixed','bottom':'0'});
106    //             }else if(standard >= stopPos){
107    //                 $('.aside-inner').css({'position':'absolute','bottom':'60px'});
108    //             }else if(asideTop > asideTop2){
109    //                 $('.aside-inner').css({'position':'static','bottom':'auto'});
110    //             }
111    //         }
112    //     });
113    // }
114
115    // TOP 버튼
116    $('.btn-top').click(function(){
117        $('html, body').animate( { scrollTop : 0 }, 300 );
118        return false;
119    });
120
121    // IE9 이하 브라우저 안내 레이어 닫기
122    $('.btn-close-layer').click(function() {
123        $(this).parents('.layer-pop').hide();
124    });
125});

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.