PageSourceSearch

https://cfm.kt.com/js/v2/common/kt_floating_new.js

js kt.com collected 2026-09-24 08:26:51 UTC 9,569 bytes, 224 lines download raw bytes

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
15 /*
16 // 플로팅 영역
17 <div id="cfmClFloatingCont" class="inner"> //디폴트: 닫힘, 펼침상태일경우(shortstt class 제거)
18 */
19var cfmfloatingHtml = `
20    <div class="floating-menu" data-nosnippet>
21        <div id="cfmClFloatingCont" class="inner shortstt">
22            <div class="floating-menu-tit-area"> 
23                <button type="button" class="floating-menu-btn floating-menu-btn-toggle"><span class="hidetxt">퀵메뉴 펼치기</span></button> 
24            </div>
25	        <div class="floating-menu-list-area floating-recommend-list">
26	        </div>
27	        <div class="floating-menu-list-area floating-popular-list">
28	        </div>
29	    </div>
30    </div>`;
31
32// DATA - 배포파일(cashing)
33var cfmFloatingNow = new Date();
34var cfmFloatingVersion = '?version=' + cfmFloatingNow.getFullYear() +''+ (cfmFloatingNow.getMonth()+1) +''+ cfmFloatingNow.getDate() +''+ cfmFloatingNow.getHours();
35
36if(kt.isLogin() == 'Y'){
37    document.write('<script src="' + cfm_domain + '/js/json/'+ kt_common.pageType() +'_gnb_direct_after.js' + cfmFloatingVersion + '" charset="UTF-8"></script>'); //로그인후
38}else{
39    document.write('<script src="' + cfm_domain + '/js/json/'+ kt_common.pageType() +'_gnb_direct_before.js' + cfmFloatingVersion + '" charset="UTF-8"></script>'); //로그인전
40    document.write('<script src="' + cfm_domain + '/js/json/cl_gnb_recommend_new.js' + cfmFloatingVersion + '" charset="UTF-8"></script>'); //간편서비스    
41}
42
43var cfmFloatingAreaTarget = '#cfm'+ ktChannel +'Header ';
44var cfmFloatingAreaHtml = {
45    //노출여부
46    cfmFloatingAreaShowYN : true,
47
48    //초기화 & 세팅
49    init: function(){
50        //기타 Areadata
51        cfmGnbEtc_codeList = cfmCodeJsonData.codeDetailList;
52
53        //floating 노출여부
54        if (cfmGnbEtc_codeList.length) {
55            var cfmFloatingNoList = $j.grep(cfmGnbEtc_codeList, function(element, index) {
56                return element.dtlCd == 'floatingNoMenu' && element.dtlCdDesc !== '' && element.dtlCdOpt3 == 'Y'
57            });
58            if (cfmFloatingNoList.length > 0) {
59                if (cfmFloatingNoList[0].dtlCdDesc.includes(`,${ktMenuCode},`)) {
60                    this.cfmFloatingAreaShowYN = false;
61                }
62            }
63        }
64        if (this.cfmFloatingAreaShowYN) {
65            //Html import
66            document.writeln(cfmfloatingHtml);
67
68            //간편서비스
69            cfmFloatingAreaHtml.recommendMenu();
70
71            //인기서비스
72            cfmFloatingAreaHtml.popularMenu();
73
74            //ui 처리 kt_ui.js 호출
75            cfmUi.COMMON.floating();
76        }
77    },
78
79    //간편서비스
80    recommendMenu: function(){
81        // 로그인여부
82        if(kt.isLogin() == 'Y'){
83            kt_api.targetMenu(); //최근본 메뉴
84        }else{
85            var isShow = false;
86            var html = $j(cfmFloatingAreaTarget + '.floating-recommend-list');
87            html.append(`
88            <strong class="floating-menu-tit"></strong>
89            <button type="button" id="cfmFloatingInfoBtn" class="floating-menu-btn floating-menu-btn-simplesvc" style="display:none;"><span class="hidetxt">안내 페이지로 이동</span></button>
90            <ul><li class="floating-menu-notext">메뉴가 없습니다.</li></ul>`);
91            try {
92                // title
93                var recomAreaData = cfmGnbRecommendJson[0];
94                html.find('strong').text(recomAreaData.areaNm);
95                html.find('.hidetxt').text(`${recomAreaData.areaNm} 안내 페이지로 이동`);
96                
97                //list
98                if (recomAreaData.cfmGnbRecommendlist.length > 0) {
99                    var maxCnt = 1;
100                    html.find('ul').html('');
101                    $j.each(recomAreaData.cfmGnbRecommendlist, function(i, item){
102                        if(item.title == '소개' && item.urlInfo !== '') {
103                            html.find('.floating-menu-btn').show();
104
105                            //메뉴링크
106                            kt_common.linkInfo('common', 'click', html.find('.floating-menu-btn'), item, item.floatTrgtType, item.floatPopupWdth, item.floatPopupVrtc);
107                        } else {
108                            var li = $j(`<li><a href="#"><span>${item.title}</span></a></li>`);
109
110                            //아이콘
111                            if(kt_common.isNull(item.imgPath) != ''){
112                                li.find('a').attr('style', 'background-image:url(\''+ cfm_domain + item.imgPath +'\');');
113                            }
114        
115                            //메뉴링크
116                            kt_common.linkInfo('common', 'recommend', li.find('a'), item, item.floatTrgtType, item.floatPopupWdth, item.floatPopupVrtc);        
117        
118                            html.find('ul').append(li);
119
120                            isShow = true;
121
122                            //간편서비스 최대4개 허용
123                            maxCnt++;
124                            if (maxCnt > 4) {return false;}
125                        }
126                    });
127                }
128            } catch (e) {
129                common_log.log('kt_floating.js recommendMenu() [' + e.message + ']');
130            }
131        }
132    },
133
134    //최근본메뉴(로그인후) callback
135	callBackTargetMenu: function(type, result){
136        var html = $j(cfmFloatingAreaTarget + '.floating-recommend-l
136ist');
137        html.append(`
138            <strong class="floating-menu-tit">최근 본 메뉴</strong>
139            <ul><li class="floating-menu-notext">최근 본 메뉴가 없습니다.</li></ul>`);
140
141        try {
142            if(type === 'success'){            
143                if(kt_common.isNull(result.data) != ''){
144                    html.find('ul').html('');
145                    
146                    var maxCnt = 1;
147                    var resultList = result.data.targetGnbMenus;
148                    $j.each(resultList, function(i, item){
149                        if(i < 4){ //최대4건
150                            var li = $j('<li><a href="#"><span>'+ item.gnbMenuNm +'</span></a></li>');
151    
152                            //아이콘
153                            var current = cfmGnbMenuJson.filter(function(element){
154                                return element.menuCd == item.menuCd;
155                            });                    
156                            if(current.length > 0){
157                                var path = current[0].path.split(' > ');
158                                var img = cfmGnbMenuJson.filter(function(element){
159                                    return element.menuCd == path[0]; //1Depth
160                                });
161    
162                                if(img.length > 0){
163                                    if(kt_common.isNull(img[0].imgUrl) != ''){
164                                        li.find('a').attr('style', 'background-image:url(\''+ img[0].imgUrl +'\');');
165                                    }
166                                }
167                            }
168    
169                            //메뉴링크
170                            kt_common.linkInfo('common', 'targetMenu', li.find('a'), item, item.newWndwType, '500', '500');        
171    
172                            html.find('ul').append(li);
173
174                            //최근본메뉴 최대4개 허용
175                            maxCnt++;
176                            if (maxCnt > 4) {return false;}
177                        }                    
178                    });
179                }
180            }            
181        } catch (e) {
182            common_log.log('kt_floating.js callBackTargetMenu() [' + e.message + ']');
183        }
184
185    },
186
187    //인기서비스
188    popularMenu: function(){      
189        var isShow = false;  
190        var html = $j(cfmFloatingAreaTarget + '.floating-popular-list');
191        html.append('<strong class="floating-menu-tit">인기메뉴</strong>'+
192                    '<ul></ul>');
193
194        try {
195            var maxCnt = 1;
196            $j.each(cfmGnbDirectJson, function(i, item){
197                var li = $j('<li><a href="#"><span>'+ item.title +'</span></a></li>');
198    
199                //아이콘
200                if(kt_common.isNull(item.imgPath) != ''){
201                    li.find('a').attr('style', 'background-image:url(\''+ cfm_domain + item.imgPath +'\');');
202                }
203    
204                //메뉴링크
205                kt_common.linkInfo('common', 'direct', li.find('a'), item, item.floatTrgtType, item.floatPopupWdth, item.floatPopupVrtc);        
206    
207                html.find('ul').append(li);
208    
209                isShow = true;
210
211                //인기서비스 최대4개 허용
212                maxCnt++;
213                if (maxCnt > 4) {return false;}
214            });
215        } catch (e) {
216            common_log.log('kt_floating.js popularMenu() [' + e.message + ']');
217        }
218
219        //노출
220        if(isShow){
221            $j(cfmFloatingAreaTarget + '.floating-popular-list').append(html);
222        }        
223    }
224}

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.