PageSourceSearch

http://www.ujeil.com/script/common.js?ver=11

js ujeil.com collected 2026-09-24 09:56:13 UTC 6,616 bytes, 180 lines download raw bytes

1/*---------------------------------------------------------------------------------------------
2                                      JAVASCRIPT CODE
3  ---------------------------------------------------------------------------------------------
4	function name						| description				| use process
5  ---------------------------------------------------------------------------------------------
6	setCookie(쿠키명, 값, 유효기간(일))	| 							| 쿠키생성
7	getCookie(쿠키명)					| 							| 쿠키가져오기
8  ---------------------------------------------------------------------------------------------*/
9
10// 쿠키 생성
11function setCookie(cName, cValue, cDay, cDomain){
12	var expire = new Date();
13	expire.setDate(expire.getDate() + cDay);
14	cookies = cName + '=' + escape(cValue) + '; path=/ '; // 한글 깨짐을 막기위해 escape(cValue)를 합니다.
15	if(typeof cDay != 'undefined') cookies += ';expires=' + expire.toGMTString() + ';';
16	document.cookie = cookies;
17    if (cDomain) {
18        document.cookie += "domain=" + cDomain + ";";
19    }
20}
21
22// 쿠키 가져오기
23function getCookie(cName) {
24	cName = cName + '=';
25	var cookieData = document.cookie;
26	var start = cookieData.indexOf(cName);
27	var cValue = '';
28	if(start != -1){
29		start += cName.length;
30		var end = cookieData.indexOf(';', start);
31		if(end == -1)end = cookieData.length;
32		cValue = cookieData.substring(start, end);
33	}
34	return unescape(cValue);
35}
36
37// 쿠키 지움
38function delCookie(cName) {
39    var today = new Date();
40
41    today.setTime(today.getTime() - 1);
42    var value = getCookie(cName);
43    if(value != "")
44        document.cookie = cName + "=" + value + "; path=/; expires=" + today.toGMTString();
45}
46
47
48/*---------------------------------------------------------------------------------------------
49                                      JAVASCRIPT CODE
50  ---------------------------------------------------------------------------------------------
51	function name						| description				| use process
52  ---------------------------------------------------------------------------------------------
53	checkMsgLength()					| 입력된 문자열 길이 검사			| 기사 댓글
54	calculateMsgLength()				| 문자열 길이 반환				| 기사 댓글
55	assertMsgLength()					| 문자열 길이만큼 잘라 변환		| 기사 댓글
56  ---------------------------------------------------------------------------------------------*/
57
58// 문자열길이 검사
59function checkMsgLength(frm, id, lenStr) {
60	var length = calculateMsgLength(document.getElementById(frm).value);
61	document.getElementById(id).innerHTML = length;
62	if (length > lenStr) {
63		alert("최대 "+lenStr+" 바이트까지 남기실 수 있습니다.\r\n초과된 " + (length - lenStr) + "바이트는 자동으로 삭제됩니다.");
64		document.getElementById(frm).value = assertMsgLength(document.getElementById(frm).value, lenStr, id);
65	}
66}
67
68//문자열길이 반환
69function calculateMsgLength(message) {
70	var nbytes = 0;
71
72	for (i=0; i<message.length; i++) {
73		var ch = message.charAt(i);
74
75		if (escape(ch).length > 4) {
76			nbytes += 2;
77		} else if (ch != "\r") {
78			nbytes++;
79		}
80	}
81
82	return nbytes;
83}
84
85//문자열 길이만큼 잘라 변환
86function assertMsgLength(message, maximum, id) {
87	var inc = 0;
88	var nbytes = 0;
89	var msg = "";
90	var msglen = message.length;
91
92	for (i=0; i<msglen; i++) {
93		var ch = message.charAt(i);
94
95		if (escape(ch).length > 4) {
96			inc = 2;
97		} else if (ch != "\r") {
98			inc = 1;
99		}
100
101		if ((nbytes + inc) > maximum) {
102			break;
103		}
104
105		nbytes += inc;
106		msg += ch;
107	}
108
109	document.getElementById(id).innerHTML = nbytes;
110	return msg;
111}
112
113/*---------------------------------------------------------------------------------------------
114                                      JAVASCRIPT CODE
115  ---------------------------------------------------------------------------------------------
116	function name						| description				| use process
117  ---------------------------------------------------------------------------------------------
118	articleHeader()						| 기사뷰 헤더 네비			| 기사뷰 헤더 네비
119  ---------------------------------------------------------------------------------------------*/
120
121var articleHeader = {
122
123	// 헤더 네비게이션 생성
124	setScroll:function(){		
125		jQuery(window).scroll(function() {
126			if (jQuery(this).scrollTop() > 300) {
127				jQuery('#article-header-title').slideDown(300);
128			} else {
129				jQuery('#article-header-title').slideUp(300);
130			}
131		});			
132	},
133	
134
135	// 기사이동
136	move:function(mod, order_type, order_value, section_code, sub_section_code, serial_code){
137		jQuery.post( "ajaxGetForwardIdxno.php", { mod: mod, order_type:order_type, order_value: order_value, section_code: section_code, sub_section_code: sub_section_code, serial_code: serial_code }, function( f_idxno ) {
138			
139			if(f_idxno){
140				location.href = '/news/articleView.html?idxno='+f_idxno				
141			}else{
142				alert('기사가 존재하지 않습니다');
143			}
144			
145		});
146	}
147	
148}
149
150
151/*---------------------------------------------------------------------------------------------
152                                      JAVASCRIPT CODE
153  ---------------------------------------------------------------------------------------------
154	function name						| description				| use process
155  ---------------------------------------------------------------------------------------------
156	articlePrint(idxno)					| 인쇄창 오픈				| 인쇄창 오픈
157	articleMail(idxno)					| 메일보내기창 오픈			| 메일보내기창 오픈
158	articleErr(idxno)					| 오류신고창 오픈				| 오류신고창 오픈
159	articleSingo(idxno)					| 댓글신고창 오픈				| 댓글신고창 오픈
160  ---------------------------------------------------------------------------------------------*/
161
162// 인쇄창 오픈
163function articlePrint( idxno ) {
164	window.open('/news/articlePrint.html?idxno='+idxno, 'articlePrint', 'width=660,height=500,scrollbars=yes');
165}
166
167// 메일보내기창 오픈
168function articleMail( idxno ) {
169	window.open('/news/articleMail.html?idxno='+idxno, 'articleMail', 'width=660,height=500,scrollbars=yes');
170}
171
172// 오류신고창 오픈
173function articleErr( idxno ) {
174	window.open('/news/articleErr.html?idxno='+idxno, 'articleErr', 'width=660,height=500,scrollbars=yes');
175}
176
177// 댓글신고창 오픈
178function articleSingo( idxno ) {
179	window.open('/news/articleSingo.html?idxno='+idxno, 'articleSingo', 'width=660,height=500,scrollbars=yes');
180}

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.