PageSourceSearch

https://www.worldvision.or.kr/static/js/common/common.js?v=20261003012801

js worldvision.or.kr collected 2026-10-02 16:28:31 UTC 8,199 bytes, 288 lines download raw bytes

1common = function() {}
2
3/** 빈 값인지 체크
4 * */
5common.chkEmpty = function(strVal) {
6    if (strVal == undefined || strVal == null || strVal.trim() == "") {
7        return true;
8	}
9	else {
10		return false;
11	}
12}
13
14/** 숫자만 입력 받기
15 * */
16common.chkNumOnly = function(obj) {
17    obj.val(obj.val().replace(/[^0-9]/g, ""));
18}
19
20/** 쿠키 값 셋팅하기
21 * */
22common.setCookie = function(key, value, expireDay) {
23    var expireDate = new Date();
24    expireDate.setDate(expireDate.getDate() + expireDay);
25    window.document.cookie = key + "=" + escape(value) + "; path=/; expires=" + expireDate.toGMTString() + ";"
26};
27
28/** 쿠키 값 가져오기
29 * */
30common.getCookie = function(key) {
31    var cookies = document.cookie.split(";");
32    var cookie = null;
33    for (var i in cookies) {
34        cookie = cookies[i].trim();
35        if (cookie.indexOf(key) == 0) {
36            return cookie.replace(key + "=", "");
37        }
38    }
39
40    return "";
41};
42
43/** 쿠키 값 삭제
44 * */
45common.deleteCookie = function(key) {
46    window.document.cookie = key + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
47};
48
49/** 유효성 체크
50 * */
51common.chkValidaction = function(chkType, strVal) {
52    var flag = false;
53	var pattern1 = /[0-9]/; 			// 숫자 
54	var pattern2 = /[a-z]/; 			// 영어(대문자) 
55	var pattern3 = /[A-Z]/; 			// 영어(소문자) 
56	var pattern4 = /[\{\}\[\]\/?.,|\)*!^_+<>@\#$%&\(]/g;	// 특수문자(비밀번호용) 
57	var pattern5 = /(012)|(123)|(234)|(345)|(456)|(567)|(678)|(789)|(890)/; // 연속된 숫자(정순) 
58	var pattern6 = /(098)|(987)|(876)|(765)|(654)|(543)|(432)|(321)|(210)/; // 연속된 숫자(역순) 
59	var pattern7 = /([0-9])\1{2,}/; 		// 동일한 숫자 정규식 
60	var pattern8 = /([a-zA-Z])\1{2,}/; 		// 동일한 문자 정규식 
61	var pattern9 = /^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]+$/;	// 이메일 정규식
62	var pattern91 = /([\w-]+\.)+[a-zA-Z]+$/;	// 이메일 도메인 정규식
63	var korean = /[ㄱ-ㅎ|ㅏ-ㅣ|가-힣]/;			// 한글 정규식 
64	var pattern10 = /^[ㄱ-ㅎ가-힣a-zA-Z0-9-&\(\)]+$/;		// 특수문자2(이름)
65	var pattern11 = /^[ㄱ-ㅎ가-힣a-zA-Z0-9]+$/;			// 특수문자3(아이디)
66	var pattern12 = /^[ㄱ-ㅎ가-힣a-zA-Z0-9-&\(\)\s]+$/;	// 특수문자4(이름, 담당자명)
67	var pattern13 = /^[ㄱ-ㅎ가-힣a-zA-Z0-9-&㈜\(\)\s]+$/;	// 특수문자4(단체명)
68
69	// 분기 처리 
70	if(chkType == 1){
71		// 영문 포함체크 
72		if(pattern2.test(strVal) && pattern3.test(strVal)){
73			// 영문 대문자 및 소문자 포함 
74			flag = true;
75		}
76	} else if(chkType == 2) {
77		// 숫자 포함체크 
78		if(pattern1.test(strVal)){
79			// 숫자 포함 
80			flag = true;
81		}
82	} else if(chkType == 3) {
83		// 특수문자 포함체크
84		if(pattern4.test(strVal)){
85			// 특수문자 포함 
86			flag = true;
87		}
88	} else if(chkType == 4) {
89		// 연속된 숫자 체크 
90		if(!pattern5.test(strVal) && !pattern6.test(strVal)){
91			// 연속된 숫자 존재 
92			flag = true;
93		}
94	} else if(chkType == 5){
95		// 동일한 숫자 체크 
96		if(!pattern7.test(strVal)){
97			// 동일한 숫자 존재 
98			flag = true;
99		}
100	} else if(chkType == 6){
101		// 동일한 문자 체크 
102		if(!pattern8.test(strVal)){
103			// 동일한 문자 존재 
104			flag = true;
105		}
106	} else if(chkType == 7){
107		// 한글 포함 체크 
108		if(korean.test(strVal)){
109			// 한글포함 
110			flag = true;
111		}
112	} else if(chkType == 8){
113		// 이메일 체크
114		if(!pattern9.test(strVal)){
115			// 이메일 형식 구조  
116			flag = true;
117		}
118	} else if(chkType == 81){
119		// 이메일 체크
120		if(!pattern91.test(strVal)){
121			// 이메일 도메인 형식 구조  
122			flag = true;
123		}
124	}else if(chkType == 9){
125		// 특수문자 포함체크2
126		if(pattern10.test(strVal)){
127			// 특정문자 제외 특수문자 포함
128			flag = false;
129		} else {
130			// 특수문자 포함 
131			flag = true;
132		}
133	} else if(chkType == 10){
134		// 특수문자 포함체크3
135		if(pattern11.test(strVal)){
136			// 특정문자 제외 특수문자 포함
137			flag = false;
138		} else {
139			// 특수문자 포함 
140			flag = true;
141		}
142	} else if(chkType == 11){
143		// 특수문자 포함체크3
144		if(pattern12.test(strVal)){
145			// 특정문자 제외 특수문자 포함
146			flag = false;
147		} else {
148			// 특수문자 포함 
149			flag = true;
150		}
151	} else if(chkType == 12){
152		// 특수문자 포함체크4
153		if(pattern13.test(strVal)){
154			// 특정문자 제외 특수문자 포함
155			flag = false;
156		} else {
157			// 특수문자 포함 
158			flag = true;
159		}
160	}
161	
162	return flag;
163};
164
165/** String(YYYYMMDD) → YYYY-MM-DD로 변환
166 * */
167common.addYmdFormat = function(str){
168	var formatNum = "";
169	try{
170		if(str.length == 8) {
171			formatNum = str.replace(/(\d{4})(\d{2})(\d{2})/, '$1-$2-$3');
172		}
173	} catch(e) {
174		formatNum = str;
175        console.log(e);
176   }
177   return formatNum;
178}
179
180/** 생년월일 유효성검사
181 * */
182common.isBirthdayChk = function(dateStr) {
183	// 올해 년,월, 일
184	var today = new Date(); 					// 날짜 변수 선언
185	var yearNow = today.getFullYear(); 			// 올해 연도 가져옴
186	var monthNow = (today.getMonth() + 1) > 9 ? (today.getMonth() + 1).toString() : "0" + (today.getMonth() + 1);			// 올해 월 가져옴
187	var dyaNow = today.getDate() > 9 ? today.getDate().toString() : "0" + today.getDate().toString(); 				// 올해 일 가져옴
188	
189	// 자리수 체크
190	if(dateStr.length == 6){
191		// 변수선언
192		var year2 = yearNow.toString().substr(2);
193		
194		// 연도 6자리 8자리로 변환
195		if(dateStr.substr(0,2) > year2){
196			// 해당 연도를 초과한 경우(19xx 년도)
197			dateStr = "19" + dateStr;
198		} else {
199			// 20xx 연도
200			dateStr = "20" + dateStr;
201		}
202	}
203	
204	// 변수 선언
205	var year = Number(dateStr.substr(0,4)); 	// 입력한 값의 0~4자리까지 (연)
206	var month = Number(dateStr.substr(4,2)); 	// 입력한 값의 4번째 자리부터 2자리 숫자 (월)
207	var day = Number(dateStr.substr(6,2)); 		// 입력한 값 6번째 자리부터 2자리 숫자 (일)
208	
209	// 오늘 날짜포맷
210	var nowDate = yearNow + monthNow + dyaNow;
211
212	// 8자리인지 체크
213	if (dateStr.length <= 8) {
214		// 연도의 경우 1899 보다 작거나 현재 년월일 보다 크다면 false를 반환합니다.
215		if (1900 > year || dateStr > nowDate){
216			return false;
217		} else if (month < 1 || month > 12) {
218			return false;
219		} else if (day < 1 || day > 31) {
220			return false;
221		} else if ((month==4 || month==6 || month==9 || month==11) && day==31) {
222			return false;
223		} else if (month == 2) {
224			// 2월달
225			var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
226			if (day>29 || (day==29 && !isleap)) {
227				return false;
228			} else {
229				return true;
230			} 
231		} else {
232			return true;
233		}
234	} else {
235		//1.입력된 생년월일이 8자 초과할때 :  auth:false
236		return false;
237	}
238	
239	
240}
241
242/** 특수 문자 변환
243 * */
244common.returnPageReplaceAll = function(str){
245	str = str.replaceAll("&lt;", "<");
246	str = str.replaceAll("&gt;", ">");
247	str = str.replaceAll("&amp;", "&");
248	str = str.replaceAll("&quot;", "\"");
249	str = str.replaceAll("&#39;", "\'");
250	
251	return str;
252}
253
254/** GA4 호출
255 * */
256common.ga4Call = function(ga4LayerData){
257	// 초기화
258	window.dataLayer = window.dataLayer || [];
259	
260	// GA4 호출 
261	window.dataLayer.push(ga4LayerData); 
262}
263
264common.initNoti = function(obj) {
265	$(obj).parent().parent().removeClass('error').removeClass('confirm');
266	$(obj).parent().find('p[id^="error"]').remove();
267}
268common.failNoti = function(obj, msg) {
269	$(obj).parent().parent().removeClass('confirm').addClass('error');
270	if (msg != '') {
271		$(obj).parent().find('p[id^="error"]').remove();
272		$(obj).parent().append('<p class="txt_error" id="error_'+$(obj).attr('id')+'">'+msg+'</p>');
273	}
274}
275common.succNoti = function(obj) {
276	$(obj).parent().parent().removeClass('error').addClass('confirm');
277}
278common.initNoti2 = function(obj) {
279	$(obj).parent().parent().removeClass('error').removeClass('confirm');
280	$(obj).parent().parent().find('p[id^="error"]').remove();
281}
282common.failNoti2 = function(obj, msg) {
283	$(obj).parent().parent().removeClass('confirm').addClass('error');
284	if (msg != '') {
285		$(obj).parent().parent().find('p[id^="error"]').remove();
286		$(obj).parent().parent().append('<p class="txt_error" id="error_'+$(obj).attr('id')+'">'+msg+'</p>');
287	}
288}

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.