PageSourceSearch

https://gnews.gg.go.kr/js/new2024/cmmn_front_web_script.js

js gg.go.kr collected 2026-09-24 08:53:47 UTC 11,977 bytes, 353 lines download raw bytes

1/**
2 * 
3 */
4
5
6function Get_list_view(s_code,param1,param2,param3,param4,param5) {
7	console.log("2024");
8	var val = s_code.toLowerCase();
9	
10	if(val.indexOf('s') != -1){
11		s_code = s_code.toLowerCase();
12	}
13	
14	if(typeof param5 != 'undefined' && param5 != ''){
15		var encodeKeyword = encodeURI(param5);
16		param1 += '&keyword=' + encodeKeyword;
17	}
18	
19	if (s_code == "s043"){
20		location.href ="/news/story_news_list.do?bs_code="+s_code+"&sel="+param1+"&page="+param2;
21	}else if(s_code == "daily" || s_code == "C070" || s_code == "C071" || s_code == "C072" || s_code == "C073" || s_code == "C046" || s_code == "C045" || s_code == "C058"){
22		location.href ="/news/news_tv.do?s_code="+s_code+"&page="+param2+"&SchYear="+param3+"&SchMonth=";		
23	}else if(s_code == "s046"){
24		location.href ="/news/hot_news_list.do?bs_code="+s_code+"&sel="+param1+"&page="+param2;	
25	}else if(s_code == "s017"){
26		location.href ="/briefing/brief_gongbo.do?bs_code="+s_code+"&page="+param2;	
27	}else if(s_code == "s003"){
28		location.href ="/briefing/brief_sigun.do?"+param1;	
29	}else if(s_code == "W001"){
30		location.href ="/news/webtoon_list.do?"+param1;	
31	}else if(s_code == "s018"){
32		location.href ="/briefing/brief_psigun.do?"+param1;	
33	}else if(s_code == "s013"){
34		location.href ="/briefing/brief_ggi.do?"+param1;	
35	}else if(s_code == "s026"){
36		location.href ="/briefing/brief_ggi.do?"+param1;	
37	}else if(s_code == "s027"){
38		location.href ="/briefing/brief_today.do?"+param1;	
39	}else if(s_code == "s028"){
40		location.href ="/briefing/brief_gongbo.do?"+param1;	
41	}else if(s_code == "C076" || s_code == "C083" || s_code == "C071" || s_code == "C056" || s_code == "C094" || s_code == "C116"){
42		location.href ="/news/domin_list.do?s_code="+s_code+"&page="+param2+"&SchYear="+param3+"&SchMonth="+param4+"&c_type=N";	
43	}else if(s_code == "s011"){
44		location.href ="/valley_list.do?"+param1;	
45	}else {
46		location.href ="/news/news_list.do?s_code="+s_code+"&page="+param2+"&SchYear="+param3+"&SchMonth="+param4+"&c_type=N";
47	}
48	
49}
50
51function Get_list_view_M(s_code,param1,param2,param3,param4) {
52	location.href ="/news/news_tv.do?s_code="+s_code+"&page="+param2+"&SchYear="+param3+"&SchMonth="+param4+"&c_type=M";
53}
54
55function Go_Link_View(param,param2,param3) { //v2.0
56	debugger;
57	if (param3 == "S017") {
58		location.href = "/briefing/brief_gongbo_view.do?BS_CODE=" + param3 + "&number=" + param;
59	} else if (param3 == "S003") {
60		location.href = "/briefing/brief_sigun_view.do?BS_CODE=" + param3 + "&number=" + param;
61	} else if (param3 == "S018") {
62		location.href = "/briefing/brief_psigun_view.do?BS_CODE=" + param3 + "&number=" + param;
63	} else if (param3 == "S013") {
64		location.href = "/briefing/brief_gg_view.do?BS_CODE=" + param3 + "&number=" + param;
65	} else if (param3 == "S015") {
66		location.href = "/news/news_policy_view.do?BS_CODE=" + param3 + "&number=" + param;
67	} else if (param3 == "S016") {
68		location.href = "/news/news_policy_view.do?BS_CODE=" + param3 + "&number=" + param;
69	} else if (param3 == "S042") {
70		location.href = "/news/sports_news_view.do?BS_CODE=" + param3 + "&number=" + param;
71	} else if (param3 == "S043") {
72		location.href = "/news/story_news_view.do?BS_CODE=" + param3 + "&number=" + param;
73	} else if (param3 == "C070" || param3 == "C071" || param3 == "C072" || param3 == "C073") {
74		location.href = "/news/news_detail_m.do?number=" + param + "&s_code=" + param3;
75	} else if (param3 == "S044") {
76		location.href = "/news/official_news_view.do?BS_CODE=" + param3 + "&number=" + param;
77	} else if (param3 == "S046") {
78		location.href = "/news/hot_news_view.do?BS_CODE=" + param3 + "&number=" + param + "&sel=" + param2;
79	} else if (param3 == "W001") {
80		location.href = "/news/webtoon_view.do?number=" + param + "&&page=1&Cat=&Cat2=";
81	} else {
82		
83		location.href = "/news/news_detail.do?number=" + param + "&s_code=" + param3;
84		
85	}
86	
87}
88
89function Go_Link_View2026(param,param2,param3) { 
90	
91	var url = "/news/news_detail.do?number=" + param + "&s_code=" + param3;
92	
93	if (param3 == "S017") {
94		url = "/briefing/brief_gongbo_view.do?BS_CODE=" + param3 + "&number=" + param;
95	} else if (param3 == "S003") {
96		url = "/briefing/brief_sigun_view.do?BS_CODE=" + param3 + "&number=" + param;
97	} else if (param3 == "S018") {
98		url = "/briefing/brief_psigun_view.do?BS_CODE=" + param3 + "&number=" + param;
99	} else if (param3 == "S013") {
100		url = "/briefing/brief_gg_view.do?BS_CODE=" + param3 + "&number=" + param;
101	} else if (param3 == "S015") {
102		url = "/news/news_policy_view.do?BS_CODE=" + param3 + "&number=" + param;
103	} else if (param3 == "S016") {
104		url = "/news/news_policy_view.do?BS_CODE=" + param3 + "&number=" + param;
105	} else if (param3 == "S042") {
106		url = "/news/sports_news_view.do?BS_CODE=" + param3 + "&number=" + param;
107	} else if (param3 == "S043") {
108		url = "/news/story_news_view.do?BS_CODE=" + param3 + "&number=" + param;
109	} else if (param3 == "C070" || param3 == "C071" || param3 == "C072" || param3 == "C073") {
110		url = "/news/news_detail_m.do?number=" + param + "&s_code=" + param3;
111	} else if (param3 == "S044") {
112		url = "/news/official_news_view.do?BS_CODE=" + param3 + "&number=" + param;
113	} else if (param3 == "S046") {
114		url = "/news/hot_news_view.do?BS_CODE=" + param3 + "&number=" + param + "&sel=" + param2;
115	} else if (param3 == "C052") {
116		url = "/news/news_detail_m.do?number=" + param + "&&page=1&Cat=&Cat2=";
117	} else {
118		
119		url = "/news/news_detail.do?number=" + param + "&s_code=" + param3;
120		
121	}
122	
123    window.open(url, '_blank'); // 새 창에서 열기
124	
125}
126
127
128function Go_Page_View_RC(param,param2,param3,param4,param5,param6) { //v2.0
129
130	location.href ="/news/news_detail.do?number="+param+"&s_code="+param3+"&page="+param4+"&SchYear="+param5+"&SchMonth="+param6;
131	
132}
133
134function Go_Page_View_RC2026(param,param2,param3,param4,param5,param6) { //v2.0
135	location.href = "/news/news_detail.do?number="+param+"&s_code="+param3+"&page="+param4+"&SchYear="+param5+"&SchMonth="+param6;
136	
137}
138
139function goArticleSNS(mode,url){		
140	
141		var frm = document.frmSNS;
142		var cont = frm.cont.value;
143		var desc_t = frm.desc.value;
144		var thum = frm.thum.value;
145		var thum_fb = frm.thum_fb.value;
146		var filter = "win16|win32|win64|mac";
147
148		switch(mode){
149			case "twitter":
150				var link = "http://twitter.com/intent/tweet?text="+encodeURIComponent(cont)+' '+encodeURIComponent(url);
151				window.open(link,"twitter",'location=1,scrollbars=auto,resizable=no,top=25,left
151=100,width=800,height=400');
152			break;
153                        
154			case "facebook":
155				console.log(url);
156				var shareURL = encodeURIComponent(url);
157				console.log("shareURL : "+shareURL);
158				var popOption = "width=640,height=500,left=100,top=25,location=no,menubar=no,status=no,scrollbars=no,resizable=no,toolbar=no";
159				var url = "https://www.facebook.com/dialog/share?app_id=140586622674265&display=popup&href="+shareURL;
160				window.open(url,"facebook",popOption);
161			break;
162
163			case "metooday":
164				var link = 'http://me2day.net/posts/new?new_post[body]="' + encodeURIComponent(cont) + '":' + encodeURIComponent(url) + '&new_post[tags]=' + encodeURIComponent("경기도뉴스포털");
165				window.open(link,"metooday",'location=1,scrollbars=auto,resizable=no,top=25,left=100,width=1024,height=800');
166			break;
167
168			case "yozm":
169				var link = "http://yozm.daum.net/api/popup/prePost?sourceid=54&link=" + encodeURIComponent(url) + "&prefix=" + encodeURIComponent(cont) + "&parameter="; 
170				window.open(link,"yozm",'location=1,scrollbars=auto,resizable=no,top=25,left=100,width=640,height=500');
171			break;
172
173			case "cyworld":
174				var link = 'http://csp.cyworld.com/bi/bi_recommend_pop.php?url='+encodeURIComponent(url)+'&title_nobase64='+encodeURIComponent(cont)+'&thumbnail=&summary_nobase64='+encodeURIComponent(cont)+'&writer='+encodeURIComponent("경기도뉴스포털");
175				window.open(link,"cyworld",'location=1,scrollbars=auto,resizable=no,top=25,left=100,width=600,height=500');
176			break;
177
178			case "naver":
179				var link = 'http://share.naver.com/web/shareView.nhn?url='+encodeURI(encodeURIComponent(url))+'&title='+encodeURIComponent(cont);
180				window.open(link,"naver",'location=1,scrollbars=auto,resizable=no,top=25,left=100,width=500,height=600');
181			break;
182
183			case "google2":
184				var link = 'http://www.google.com/bookmarks/mark?op=add&title='+encodeURIComponent(cont)+'&bkmk='+encodeURIComponent(url);
185				window.open(link,"google2",'location=1,scrollbars=auto,resizable=no,top=25,left=100,width=1024,height=800');
186			break;
187			
188			case "kakao":
189				 if( navigator.platform  ){
190					if( filter.indexOf(navigator.platform.toLowerCase())<0 ){
191						kakao.link("talk").send({
192							  msg : cont,
193							  url : url,  
194							  appid : "gnews.gg.go.kr",
195							  appver : "2.0",
196							  appname : "경기도뉴스포털",
197							  type : "link"
198						  });
199					}else{
200						alert("모바일웹에서만 지원하는 기능입니다.");
201					}
202				}
203				break; 
204			
205			case "kakaolink":
206				Kakao.Share.sendScrap({
207					requestUrl : url,
208				});
209				break; 
210				
211			case "kaostory":
212				var link = 'https://story.kakao.com/share?text='+encodeURIComponent(cont)+'&url='+encodeURIComponent(url);
213				window.open(link,"kaostory",'location=1,scrollbars=auto,resizable=no,top=25,left=100,width=640,height=500');
214				break;
215				
216				default:
217			break;
218		}
219	}
220
221function info_print() {
222
223
224
225	var initBody = document.body.innerHTML;
226
227	window.onbeforeprint = function () {
228
229
230
231		document.body.innerHTML = document.getElementById("web_print").innerHTML;
232
233	}
234
235	window.onafterprint = function () {
236
237
238
239		document.body.innerHTML = initBody;
240
241
242
243	}
244
245	window.print();
246
247}
248
249//전체 검색
250function fn_go_total_search(){
251	
252	//alert($("#search_keyword").val());
253	var keyword = $("#search_keyword").val();
254	
255	if(typeof keyword != 'undefined' && keyword != null && keyword != ''){
256		keyword = encodeURI(keyword);
257		document.GNBsearchForm.search_word.value = keyword;
258		document.GNBsearchForm.kwd.value = keyword;
259		$('catagorySelect').css('display','block');
260		document.GNBsearchForm.action = "/search/search.do";
261		document.GNBsearchForm.submit();
262	}else{
263		keyword = '';
264		alert('검색어를 입력해 주세요.');
265		return;
266	}
267
268}
269
270//달력 유효성 체크
271
272/*
273 * 날짜포맷에 맞는지 검사
274 */
275function isDateFormat(d) {
276    var df = /[0-9]{4}-[0-9]{2}-[0-9]{2}/;
277    return d.match(df);
278}
279
280/*
281 * 윤년여부 검사
282 */
283function isLeaf(year) {
284    var leaf = false;
285
286    if(year % 4 == 0) {
287        leaf = true;
288
289        if(year % 100 == 0) {
290            leaf = false;
291        }
292
293        if(year % 400 == 0) {
294            leaf = true;
295        }
296    }
297
298    return leaf;
299}
300
301/*
302 * 날짜가 유효한지 검사
303 */
304function isValidDate(d) {
305    // 포맷에 안맞으면 false리턴
306    if(!isDateFormat(d)) {
307        return false;
308    }
309
310    var month_day = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
311
312    var dateToken = d.split('-');
313    var year = Number(dateToken[0]);
314    var month = Number(dateToken[1]);
315    var day = Number(dateToken[2]);
316    
317    // 날짜가 0이면 false
318    if(day == 0) {
319        return false;
320    }
321
322    var isValid = false;
323
324    // 윤년일때
325    if(isLeaf(year)) {
326        if(month == 2) {
327            if(day <= month_day[month-1] + 1) {
328                isValid = true;
329            }
330        } else {
331            if(day <= month_day[month-1]) {
332                isValid = true;
333            }
334        }
335    } else {
336        if(day <= month_day[month-1]) {
337            isValid = true;
338        }
339    }
340
341    return isValid;
342}
343
344$(function(){
345	$('.viewForm').on('click', function(){
346		$('.totalSearch').fadeIn('fast');
347		//$('body').css({'overflow-y':'hidden'});
348		$("#search_keyword").focus();
349	})
350});
351
352
353

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.