PageSourceSearch

https://wbjsoft.com/resources/home/js/common.js?ver=5.2.0.5498

js wbjsoft.com collected 2026-10-07 17:02:47 UTC 33,189 bytes, 1,071 lines download raw bytes

1/*다국어 객체*/
2var i18n_Prop;
3
4//replaceAll prototype 선언
5String.prototype.replaceAll = function(org, dest) {
6	return this.split(org).join(dest);
7}
8
9$(function() {
10	$.ajax({
11		async:false,
12		type:'GET',
13		dataType: "json",
14		url: "getLangDictionary_home",
15		suppressErrors:true,
16		success: function(data, status, xhr){
17			i18n_Prop = data;
18		}, 
19		error: function(jqxhr, status, thrownError){
20	    	var message = thrownError
21	    	if(jqxhr.responseJSON){
22	    		message = jqxhr.responseJSON.message;
23	    	}
24	    	alert(message);
25		}
26	});
27	
28	
29	//디바이스에 따른 마우스 이벤트
30	(window.matchMedia("(max-width: 1024px)").matches) ? MEvnt() : PCEvnt();
31	$(window).resize(function(){
32		(window.matchMedia("(max-width: 1024px)").matches) ? MEvnt() : PCEvnt();
33	});
34});
35
36var commUtil = {
37	/**오늘 날자*/
38    today: new Date(),
39    
40    /**주어진 변수에 내용이 없는지 확인*/
41    isEmpty: function (value) {
42        return value === undefined || value === null || value === "" || value.length == 0;
43    },
44    
45    /**주어진 변수에 내용이 있는지 확인*/
46	isNotEmpty: function (value) {
47        return !isEmpty(value);
48    },
49    /**IE 여부 확인*/
50    isIE :function(){
51    	return navigator.appVersion.indexOf('Trident/') > -1; //IE  9:Trident/5.0, 10:Trident/6.0, 11:Trident/7.0
52    },
53    /** ajax를 호출하고 결과는 promise로 전달
54     * method : GET/POST(default : GET) 
55     * .done(), .fail(), .always() = complete
56    */
57    sendRequest: function (url, data, method, suppressErrors) {
58    	  var defer = $.Deferred();
59
60    	  var param;
61    	  if(typeof data === "function")
62    		  param = data();
63    	  else if (data){
64    		  param = data;
65    	  } else{
66    		  param =""
67    	  }
68    	  
69    	  $.ajax(url, {
70    	      cache: false,    	      
71    	      dataType: "json",
72    	      data: param,
73    	      method: method || "GET",
74    	      contentType: "application/json;charset=UTF-8",
75    	      xhrFields: { withCredentials: true },
76    	      suppressErrors: suppressErrors
77    	  }).done(function(resultData) {
78    		  defer.resolve(resultData);
79    	  }).fail(function(jqXHR, textStatus, errorThrown) {
80    		  defer.reject(jqXHR.responseJSON ? jqXHR.responseJSON : {code: jqXHR.status, message:errorThrown});
81    	  });
82
83    	  return defer.promise();
84    },
85    /** ajax를 sync로호출하고 결과는 promise로 전달
86     * method : GET/POST(default : GET) 
87     * .done(), .fail(), .always() = complete
88    */
89    sendRequestSync: function (url, data, method, suppressErrors) {
90		var param;
91		if(typeof data === "function")
92			param = data();
93		else if (data){
94			param = data;
95		} else{
96			param =""
97		}
98  
99  	  return $.ajax(url, {
100  		  async: false,
101  		  cache: false,    	      
102	      dataType: "json",
103	      data: param,
104	      method: method || "GET",
105	      contentType: "application/json",
106	      xhrFields: { withCredentials: true },
107	      suppressErrors: suppressErrors
108  	  });
109  	},
110    /** 다국어 처리 Dictionary 에 정의된 언어의 문자로 치환 */
111    i18n: function(keyword){
112    	if(!keyword || !i18n_Prop) return keyword;
113    	
114    	var temp = i18n_Prop[keyword];
115    	if(temp) return temp;
116    	
117    	return keyword;
118    },
119    getParameter: function(paramName, defaultValue){
120    	
121    	var result = (defaultValue === undefined || defaultValue == null)? "" : defaultValue;
122    	// 현재 URL 가져오기
123        var url = location.href;
124        /*
125        if(appURL != undefined && appURL != "")
126        	url = appURL;
127*/
128        // get 파라미터 값을 가져올 수 있는 ? 를 기점으로 slice 한 후 split 으로 나눔
129        var idx = url.indexOf('?');
130        if(idx<0) return defaultValue;
131        
132        var parameters = (url.substr(idx+1)).split('&');
133
134        parameters.forEach(function(param){
135        	var arrayParam = param.split('=');
136        	
137        	if (arrayParam[0].toUpperCase() == paramName.toUpperCase()) {
138        		defaultValue = decodeURIComponent(arrayParam[1]);
139        		return false;
140            }
141        });
142        
143        return defaultValue;
144    },
145    /**
146     * 새창 열기
147     */
148    openPopupWindow : function (url, windowsName, w, h){
149    	var width = w || 1200;
150    	var height = h || 700;
151    	var px = (screen.availWidth-width)/2;
152    	var py = (screen.availHeight-height)/2;
153    	
154    	
155    	var specs='left='+px+', top='+py+', width=' +width+ ', height=' + height+", location=yes, resizable=yes";	
156    	var p = window.open(url, windowsName || "wbjPopWindows" , specs);
157    	
158    	if(p === undefined){
159    		commUtil.error("fail open new window");
160    	} else {
161    		p.focus();
162    	}	
163    	return p;
164    },
165
166    /**
167     * 두 날자의 차이를구하는 함수
168     */
169    diffDateCheck : function (str1, str2)  {
170    	var strdate = commUtil.strToDate(str1);
171    	var enddate = commUtil.strToDate(str2);
172    	
173    	return (strdate.getTime() <= enddate.getTime());
174    },
175
176    /**
177     * 일반 스트링형 날짜를 new Date로 변환
178     */
179    strToDate : function(str){
180    	if(str instanceof Date){
181    		return str;
182    		
183    	} else {
184    		if((str.length > 10) && (str.indexOf("-") > 0)){
185    			//2020-09-22 12:34:56 의 형식이라면 , ie에서  date parse할때 '-' 구분자를 사용하지 않음
186    			str = str.trim().replace(/\s/gi, 'T');
187    		}
188    		
189    		return new Date(str);
190    	}
191    },
192    
193    /**
194     * 공통 알림 팝업 (type : confirm-느낌표, alert-체크, fail)
195     */
196    alert: function(type, title, msg, showCancelBtn){
197    	var defer = $.Deferred();
198    	
199    	var alertType = type || "confirm"; //confirm, alert, fail
200    	if(showCancelBtn == undefined) showCancelBtn = false;
201    	
202    	var alertHtml = [];
203    	alertHtml.push('<div class="ui_wbj_layer_wrap" id="commLayer">');
204	    	alertHtml.push('<div class="ui_wbj_layer_inner">');
205		    	alertHtml.push('<div class="ui_wbj_layer_alert type_' + type + '">');
206			    	alertHtml.push('<div class="ui_wbj_alert_box">');
207						alertHtml.push('<div class="ui_wbj_alert_title">');
208							if(title) alertHtml.push(commUtil.i18n(title));
209						alertHtml.push('</div>');
210						alertHtml.push('<div class="ui_wbj_alert_message">');
211							if(msg) alertHtml.push(commUtil.i18n(msg));
212						alertHtml.push('</div>');
213			    	alertHtml.push('</div>');
214			    	alertHtml.push('<div class="ui_wbj_edit_btns">');
215				    	alertHtml.push('<button class="ui_wbj_btn point">' + commUtil.i18n("확인") + '</button>');
216				    	if(showCancelBtn)
217				    		alertHtml.push('<button class="ui_wbj_btn ui_wbj_btn_close">' + commUtil.i18n("취소") + '</button>');
218			    	alertHtml.push('</div>');
219		    	alertHtml.push('</div>');
220	    	alertHtml.push('</div>');
221    	alertHtml.push('</div>');
222    	
223    	$("body").append(alertHtml.join(""));
224    	
225    	$("#commLayer button.point").click(function(){
226    		defer.resolve("ok");
227    		$("#commLayer").removeClass('active');
228    		$("#commLayer").remove();
229    	});
230    	
231    	$("#commLayer button.ui_wbj_btn_close").click(function(){
232    		defer.reject("cancel");
233    		$("#commLayer").removeClass('active');
234    		$("#commLayer").remove();
235    	});
236    	
237    	//얼럿띄우기
238    	$("#commLayer").addClass("active");
239    	
240    	return defer.promise();
241    },
242    /**
243     * 내용에서 URL추출하여 a태그로 변경하기
244    **/
245    chgLink : function(originalData){
246    	var expUrl =  /(((http(s)?:\/\/)\S+(\.[^(\n|\t|\s,)]+)+)|((http(s)?:\/\/)?(([a-zA-z\-_]+[0-9]*)|([0-9]*[a-zA-z\-_]+)){2,}(\.[^(\n|\t|\s,)]+)+))+/gi;
247    	return originalData.replace(expUrl, '<a href="$&">$&</a>');
248    },
249    /**
250     * 서머노트 글꼴 리스트 
251    **/
252    editFontList : function(){
253    	var fontList = ['궁서', '바탕', '돋움', '굴림', '맑은 고딕', '나눔고딕', '나눔명조', '나눔펜', '나눔스퀘어'];
254    	
255    	if(g_langCode == 1){
256    		fontList = ['Arial', 'Verdana','Courier New', 'Comic Sans MS', 'Helvetica', 'Impact', 'Tahoma', 'Times New Roman'];
257    	} else if(g_langCode == 2){
258    		fontList = ['Meiryo','LINESeedJP'];
259    	}
260    	
261    	return fontList;
262    }
263};
264
265//쿠키 생성
266function setCookie(cName, cValue, cDay){
267    var expire = new Date();
268    expire.setDate(expire.getDate() + cDay);
269    cookies = cName + '=' + escape(cValue) + '; path=/ '; // 한글 깨짐을 막기위해 escape(cValue)를 합니다.
270    if(typeof cDay != 'undefined') cookies += ';expires=' + expire.toGMTString() + ';';
271    document.cookie = cookies;
272}
273
274// 쿠키 가져오기
275function getCookie(cName) {
276    cName = cName + '=';
277    var cookieData = document.cookie;
278    var start = cookieData.indexOf(cName);
279    var cValue = '';
280    if(start != -1){
281        start += cName.length;
282        var end = cookieData.indexOf(';', start);
283        if(end == -1)end = cookieData.length;
284        cValue = cookieData.substring(start, end);
285    }
286    return unescape(cValue);
287}
288
289//쿠키 삭제
290function deleteCookie(name, path, domain) {
291    if (getCookie(name))
292    	document.cookie = name + '=' 
293    	+ ((path) ? ';path=' + path : '') 
294    	+ ((domain) ? ';domain=' + domain : '') 
295    	+ ';expires=Thu, 01-Jan-1970 00:00:01 GMT';
296}
297
298//모바일 헤더 메뉴 마우스 이벤트
299function MEvnt() {
300	$('.ui_wbj_btn_menu').on('click', function () {
301		$('.ui_wbj_nav_area').addClass('active');
302	});
303
304	$('.ui_wbj_nav_area .ui_wbj_btn_close').on('click', function () {
305		$('.ui_wbj_nav_area').removeClass('active');
306	});
307	$('.ui_wbj_nav_area .ui_wbj_nav_item').on('click', function () {
308		$('.ui_wbj_nav_area .ui_wbj_nav_item').removeClass('active');
309		$(this).addClass('active');
310	});
311}
312
313// pc 헤더 메뉴 마우스 이벤트
314function PCEvnt() {
315	$('.ui_wbj_nav .ui_wbj_nav_item').on('mouseenter', function () {
316		$(this).addClass('active');
317	}).on('mouseleave', function () {
318		$(this).removeClass('active');
319	});
320
321	$('.ui_wbj_nav .ui_wbj_sub_list .ui_wbj_sub_item').on('click', function () {
322		$('.ui_wbj_nav .ui_wbj_sub_list .ui_wbj_sub_item').removeClass('active');
323		$(this).addClass('active');
324	});
325};
326
327function goSubMenu(menuId) {
328	var href = $("#" + menuId + " li:first-child a:first-child")[0].href
329
330	if (href.length != "") {
331		var func = href.substring(11, href.length);
332
333		if (func.substring(0, 6) == "goMenu") {
334			var key = func.substring(7, func.length - 1).replace(/\'/g, "");
335			goMenu(key);
336		} else {
337			var key = func.substring(12, func.length - 1).replace(/\'/g, "");
338			goDirectMenu(key);
339		}
340	}
341}
342
343function goMenu(subMenuKey) {
344	var menu = subMenuKey.split("_");
345
346	if (menu.length > 1) {
347		location.href = menu[0] + "?pageCode=" + menu[1];
348	}
349}
350
351function goDirectMenu(subMenuKey) {
352	var menu = subMenuKey.split("_");
353
354	if (menu.length > 1) {
355		location.href = menu[1];
356	}
357}
358
359function goPage(url, pages, lines, keyword, category, pageCode, simply) {
360	url += "?pageCode=" + pageCode + "&pages=" + pages + "&line=" + lines
361			+ "&keyword=" + urlencode(keyword) + "&category=" + category + "&simply=" + simply;
362	location.href = url;
363}
364
365function goMailPage(url, pages, lines, listType) {
366	url += "?pages=" + pages + "&lines=" + lines + "&listType=" + listType;
367	location.href = url;
368}
369
370function urlencode(str) {
371	str = (str + '').toString();
372	return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27')
373													.replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/\*/g, '%2A')
374													.replace(/%20/g, '+');
375}
376
377function urldecode(str) {
378	return decodeURIComponent((str + '').replace(/%(?![\da-f]{2})/gi,
379		function() {
380			return '%25';
381		}).replace(/\+/g, '%20'));
382}
383
384function rawurlencode(str) {
385	str = (str + '').toString();
386	return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27')
387			.replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/\*/g, '%2A');
388
389}
390
391function rawurldecode(str) {
392	return decodeURIComponent((str + '').replace(/%(?![\da-f]{2})/gi,
393		function() {
394			return '%25';
395		})
396	);
397}
398
399function sqlFilter(str) {
400	// sql filter
401	str = str.replace(/;/gi, "");
402	str = str.replace(/#/gi, "");
403	str = str.replace(/--/gi, "");
404	str = str.replace(/\'/gi, "&#39;");
405	str = str.replace(/\"/g, "&quot;");
406	str = str.replace(/\\/gi, "&#92;");
407	// str = str.replace(" ","");
408
409	// xss filter
410	str = str.replace(/</gi, "&lt;");
411	str = str.replace(/>/gi, "&gt;");
412	return (str);
413}
414
415function xssFilter(str) {
416	str = str.replace(/</gi, "&lt;");
417	str = str.replace(/>/gi, "&gt;");
418	return (str);
419}
420
421function validationEmail(strValue) {
422	var regExp = /[0-9a-zA-Z][_0-9a-zA-Z-]*@[_0-9a-zA-Z-]+(\.[_0-9a-zA-Z-]+){1,2}$/;
423
424	if (strValue != "" && !strValue.match(regExp)) {
425		return false;
426	}
427
428	return true;
429}
430
431function validationTel(strValue) {
432	var regExp = /^(01[016789]{1}|070|02|0[3-9]{1}[0-9]{1})-[0-9]{3,4}-[0-9]{4}$/;
433
434	if (!strValue.match(regExp)) {
435		return false;
436	}
437
438	return true;
439}
440
441function validationId(strValue) {
442	var regExp = /^[A-Za-z0-9]*$/;
443
444	if (!strValue.match(regExp)) {
445		return false;
446	}
447	if (strValue.length == 0) {
448		return false;
449	}
450
451	return true;
452}
453
454// //////////////////// File Upload ///////////////////
455$(document).ready(function() {
456	var fileTarget = $('.filebox .upload-hidden');
457
458	fileTarget.on('change', function() {
459		if (window.FileReader) {
460			// 파일명 추출
461			var filename = $(this)[0].files[0].name;
462		} else {
463			// Old IE 파일명 추출
464			var filename = $(this).val().split('/').pop().split('\\').pop();
465		};
466
467		$(this).siblings('.upload-name').val(filename);
468	});
469});
470
471// ///////////////////// Comment ///////////////////////
472
473function drawComments(obj, usid, isid) {
474
475	var comWidth = 300;
476
477	if(obj.length > 0){
478		for (var i = 0; i < obj.length; i++) {
479			// dept와 width 구하기
480			if (obj[i].pimdid == "0" || obj[i].pimdid == null || obj[i].pimdid == "") {
481				dept = 0;
482			} else {
483				dept = 1;
484			}
485			
486			// /// commentStr 만들기
487			// start------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
488			var visible = true;
489			if (!obj[i].usid && (Number(obj[i].usid) == 0)) { // 삭제된 댓글
490				visible = false;
491			};
492			
493			
494			var cmtItemBox = [];
495			cmtItemBox[cmtItemBox.length] = '<div class="ui_wbj_comment_box" id="commentBox_' + obj[i].imdid + '">';
496			cmtItemBox[cmtItemBox.length] = '<div class="ui_wbj_comment_info">';
497				if(visible){
498					cmtItemBox[cmtItemBox.length] = '<span class="ui_wbj_info_name">' + obj[i].realname + '</span>';
499					cmtItemBox[cmtItemBox.length] = '<span class="ui_wbj_info_date">' + obj[i].mdate + '</span>';
500				}
501				
502				if (obj[i].usid == usid) {
503					cmtItemBox[cmtItemBox.length] = '<div class="ui_wbj_comment_write" style="display: none;">';
504						cmtItemBox[cmtItemBox.length] = '<div class="ui_wbj_textarea">';
505						cmtItemBox[cmtItemBox.length] = '<textarea id="commentMsg_' + obj[i].imdid + '">';
506						cmtItemBox[cmtItemBox.length] = obj[i].idmsg;
507						cmtItemBox[cmtItemBox.length] = '</textarea>';
508						cmtItemBox[cmtItemBox.length] = '<button class="ui_wbj_btn" id="updateBtn_' + obj[i].imdid + '" onclick="saveComment(' + isid + ','+ obj[i].imdid + ', \'U\')">' 
509													  + commUtil.i18n("저장") + '</button>';
510					cmtItemBox[cmtItemBox.length] = '</div></div>';
511				}
512				
513				cmtItemBox[cmtItemBox.length] = '<p class="ui_wbj_comment_content">' + obj[i].idmsg + '</p>';
514				
515				
516				
517			cmtItemBox[cmtItemBox.length] = '</div>';  //ui_wbj_comment_info
518			cmtItemBox[cmtItemBox.length] = '</div>';  //ui_wbj_comment_box
519			
520			cmtItemBox[cmtItemBox.length] = '<div class="ui_wbj_comment_edit">';
521			if (visible && (obj[i].usid == usid)) { // 작성자만 수정, 삭제할 수 있음
522				cmtItemBox[cmtItemBox.length] = '<button class="ui_wbj_btn type_edit" onclick="updateComment(' + obj[i].imdid + ', ' + isid + ');">' + commUtil.i18n("수정") + '</button>';
523				cmtItemBox[cmtItemBox.length] = '<button class="ui_wbj_btn type_delete" onclick="deleteAlert(' + obj[i].imdid + ', ' + isid + ');">' + commUtil.i18n("삭제") + '</button>';
524			}
525			if(visible){
526				cmtItemBox[cmtItemBox.length] = '<button class="ui_wbj_btn" onclick="leaveComment(' + obj[i].imdid + ',' + comWidth + ')">' + commUtil.i18n("답글쓰기") + '</button>';
527			}
528			cmtItemBox[cmtItemBox.length] = '</div>';
529			
530			cmtItemBox[cmtItemBox.length] = '<div id="IMDID_' + obj[i].imdid + '_re" level="' + dept + '" pimdid="' + obj[i].pimdid + '" class="ui_wbj_comment_reply"></div>';
531			
532			// /// commentStr 만들기
533			// end------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
534			
535			$("#IMDID_" + (obj[i].pimdid == "" ? 0 : obj[i].pimdid) + "_re").append('<div id="IMDID_' + obj[i].imdid + '" class="ui_wbj_comment_item">' + cmtItemBox.join(""));
536			
537			// 댓글영역 height 자동 조절
538//			$("#commentMsg_" + obj[i].imdid).height($("#commentMsg_" + obj[i].imdid).prop("scrollHeight") + 10);
539		}
540		
541	} else {
542		$("#commentArea").height(80);
543	}
544
545}
546
547function insertComment(isid, imdid) {
548	if ($("#commentText_" + imdid).val() == "") {
549		commUtil.alert("fail", "내용을 입력해주세요.", "");
550		return;
551	}
552
553	saveComment(isid, imdid, "I");
554}
555
556function saveComment(isid, imdid, type) {
557
558	var idmsg = "";
559	var pimdid = "";
560	if (type == "U")
561		idmsg = $("#commentMsg_" + imdid).val();
562	else if (type == "D")
563		idmsg = "삭제된 코멘트입니다.";
564	else
565		idmsg = $("#commentText_" + imdid).val();
566
567	// 보안 필터링
568	idmsg = sqlFilter(idmsg);
569
570	if ($("#IMDID_" + imdid + "_re").attr('level') == "0") {
571		pimdid = imdid;
572	} else if ($("#IMDID_" + imdid + "_re").attr('level') == "1") {
573		pimdid = $("#IMDID_" + imdid + "_re").attr('pimdid');
574	}
575
576	$.post("home_saveComment", {
577		isid : isid,
578		imdid : imdid,
579		pimdid : pimdid,
580		idmsg : idmsg,
581		type : type,
582		wfdid : wfdid
583	}, function(comResult) {
584		// 성공
585		if (comResult != "") {
586
587			// 댓글리스트 다시 가지고 와서 다시 그리기
588			$("#IMDID_0_re").empty();
589			$("#commentText_0").val("");
590			drawComments(comResult, usid, isid);
591			
592			$("#commentArea").height($("#IMDID_0_re").height());
593
594		} else { // 실패
595			commUtil.alert("fail", "댓글 목록을 불러오지 못했습니다.", "");
596			return;
597		}
598	});
599}
600
601function leaveComment(imdid, comWidth) {
602	
603	var replyArea = [];
604	replyArea[replyArea.length] = '<div class="ui_wbj_comment_reply">';
605		replyArea[replyArea.length] = '<div class="ui_wbj_comment_write">';
606			replyArea[replyArea.length] = '<div class="ui_wbj_textarea">';
607				replyArea[replyArea.length] = '<textarea id="commentText_' + imdid + '" placeholder="' + commUtil.i18n("댓글 입력") + '"></textarea>';
608				replyArea[replyArea.length] = '<button class="ui_wbj_btn" onclick="insertComment(' + isid + ', ' + imdid + ')">' + commUtil.i18n("저장") + '</button>';
609			replyArea[replyArea.length] = '</div>';
610		replyArea[replyArea.length] = '</div>';
611	replyArea[replyArea.length] = '</div>';
612	
613	$("#commentBox_" + imdid).append(replyArea.join(""));
614}
615
616
617function updateComment(imdid, isid) {
618	var commtBox = $("#commentBox_" + imdid);
619	
620	commtBox.find("div.ui_wbj_comment_write").css("display", "")
621	commtBox.find("p.ui_wbj_comment_content").css("display", "none")
622}
623
624function deleteComment(imdid, isid) {
625	saveComment(isid, imdid, "D");
626}
627
628function deleteAlert(imdid, isid) {
629	commUtil.alert("confirm", "삭제하시겠습니까?", "확인 버튼을 누르면 작성하신 내용이 사라집니다.", true).done(function(){
630		deleteComment(imdid, isid);
631	});
632}
633
634// //////////////////////////////////////////////////////////////////////////////////////////////////
635
636function cancelBtn(url) {
637	commUtil.alert("confirm", "취소하시겠습니까?", "확인 버튼을 누르면 작성하신 내용이 사라집니다.", true).done(function(){
638		location.href = url;
639	});
640}
641
642function deleteBtn(url) {
643	commUtil.alert("confirm", "삭제하시겠습니까?", "확인 버튼을 누르면 작성하신 내용이 사라집니다.", true).done(function(){
644		location.href = url;
645	});
646}
647
648// //////////////////////////////////////////////////////////////////////////////////////////////////
649// ///////////////////////////// 파일 첨부 관련
650// //////////////////////////////////////////////////
651function getFileBtn(inputFileIndex) {
652	$("#addFileTd")
653			.append(
654					'<span class="ui_wbj_input_file">'
655					+ '<label for="uploadFile_' + inputFileIndex + '" class="ui_wbj_btn">' + commUtil.i18n("업로드") + '</label>'
656					+ '<input type="file" id="uploadFile_' + inputFileIndex + '" name="uploadFile_' + inputFileIndex + '" onchange="changeFileValue(' + inputFileIndex + ')">'
657					+ '<span id="upload-name-' + inputFileIndex + '" class="ui_wbj_file_name">'+commUtil.i18n("파일선택")+'</span>'
658					+'</span>');
659}
660
661function changeFileValue(fileindex) {
662	var fileTarget = $("#uploadFile_" + fileindex);
663
664	if (window.FileReader) {
665		// 파일명 추출
666		var filename = fileTarget[0].files[0].name;
667	} else {
668		// Old IE 파일명 추출
669		var filename = fileTarget.val().split('/').pop().split('\\').pop();
670	}
671	;
672
673	$("#upload-name-" + fileindex).text(filename);
674}
675
676function deleteFielBtn(isid, filename, iftdid) {
677	commUtil.alert("confirm", "삭제하시겠습니까?", "확인 버튼을 누르면 바로 삭제됩니다.", true).done(function(){
678		$.post("homeFileDelete", {
679			isid : isid,
680			filename : urlencode(filename)
681		}, function(result) {
682			// 성공
683			if (result == 0) {
684				commUtil.alert("alert", "삭제하였습니다.", "");
685				$("#file_" + iftdid).remove();
686				
687			} else { // 실패
688				commUtil.alert("fail", "죄송합니다", "일시적인 오류로 인하
688여 삭제하지 못했습니다.");
689				return;
690			}
691		});
692	});
693}
694
695function changeLanguage(type){
696	document.changeLanguageForm.languageType.value = type;
697	document.changeLanguageForm.submit();
698}
699
700function movePageSupport(pageType, pageCode, isid, simply){
701	$.ajax({
702		type:'post',  
703		url:'support_pageMovement',
704		data : {
705			pageType : pageType,
706			pageCode : pageCode,
707			isid : isid,
708			simply : simply
709		},
710		success:function(data){
711			if(data == "fail"){
712				commUtil.alert("fail", commUtil.i18n("죄송합니다"), commUtil.i18n("일시적인 오류로 인하여 삭제하지 못했습니다."))
713				
714			} else if(data == "last"){
715				if(pageType == 1) commUtil.alert("confirm", commUtil.i18n("이전 페이지가 없습니다."), "");
716				if(pageType == 2) commUtil.alert("confirm", commUtil.i18n("다음 페이지가 없습니다."), "");
717				
718			} else {
719				location.href='pwd_check_form?isid=' + data +'&type=v&pageCode=' + pageCode + '&simply=' + simply;
720			}
721		}
722  });
723}
724
725function movePageRecruit(pageType, pageCode, isid){
726	$.ajax({
727		type:'post',  
728		url:'recruit_pageMovement',
729		data : {
730			pageType : pageType,
731			pageCode : pageCode,
732			isid: isid
733		},
734		success:function(data){
735			if(data == "fail"){
736				commUtil.alert("fail", "죄송합니다", "일시적인 오류로 인하여 삭제하지 못했습니다.");
737				
738			} else if(data == "last"){
739				if(pageType == 1) commUtil.alert("confirm", commUtil.i18n("이전 페이지가 없습니다."), "");
740				if(pageType == 2) commUtil.alert("confirm", commUtil.i18n("다음 페이지가 없습니)다."), "");
741				
742			} else {
743				location.href='recruit_detail?isid=' + data +'&type=v&pageCode=' + pageCode;
744			}
745		}
746	});
747}
748
749$("#ScrollTopBtn").click(function(){
750	$('html, body').scrollTop(0);
751
752});
753
754//게시판 - 상세내역 서머노트 적용
755function fnGen_DetailSummernote(divId){
756	var fontLists = commUtil.editFontList();
757
758	$("#" + divId).summernote({
759		lang: 'ko-KR' ,
760		focus: true,
761		height : 200,
762		maxHeight : null,
763		disableDragAndDrop:true,
764		toolbar: [
765		    ['style', ['style']],
766		    ['font', ['bold', 'underline', 'clear']],
767		    ['fontname', ['fontname', 'fontsize']],
768		    ['color', ['color']],
769		    ['para', ['ul', 'ol', 'paragraph']],
770		    ['table', ['table']],
771		    ['insert', ['picture']],
772		    ['view', ['codeview', 'help']]
773	    ],
774		fontNames: fontLists,
775		fontNamesIgnoreCheck: fontLists,
776		callbacks: {
777			onImageUpload: function(files, editor, welEditable) {
778	            for (var i = files.length - 1; i >= 0; i--) {
779	              sendFile(files[i], this);
780	            }
781			}
782		}
783	});
784	
785	$("#" + divId).summernote('fontName', fontLists[0]); //기본폰트 설정
786}
787
788function sendFile(file, el) {
789	var form_data = new FormData();
790	form_data.append('file', file);
791	$.ajax({
792		data: form_data,
793		type: "POST",
794		url: 'summernote_fileupload',
795		cache: false,
796		contentType: false,
797		enctype: 'multipart/form-data',
798		processData: false,
799		success: function(url) {
800			$(el).summernote('editor.insertImage', url);
801			$('#imageBoard > ul').append('<li><img src="'+url+'" /></li>');
802		}
803	});
804}
805
806
807
808//editor 수정모드
809// type 0: title있음, 1 : 없음
810function editorEdit(type, hmid){
811	$('#content_' + hmid).toggleClass("ui_wbj_view ui_wbj_editor");
812	var height = Number($('#content_' + hmid).height()) + 150;
813	
814	var fontLists = commUtil.editFontList();
815	$('#content_' + hmid).summernote({
816		lang: 'ko-KR' ,
817		focus: true,
818		height : height,
819		minHeight : height,
820		maxHeight : null,
821		disableDragAndDrop:true,
822		toolbar: [
823		    ['style', ['style']],
824		    ['font', ['bold', 'underline', 'clear']],
825		    ['fontname', ['fontname', 'fontsize']],
826		    ['color', ['color']],
827		    ['para', ['ul', 'ol', 'paragraph']],
828		    ['table', ['table']],
829		    ['insert', ['link', 'picture', 'video']],
830		    ['view', ['codeview', 'help']]
831	    ],
832		fontNames: fontLists,
833		fontNamesIgnoreCheck: fontLists,
834		callbacks: {
835			onImageUpload: function(files, editor, welEditable) {
836	            for (var i = files.length - 1; i >= 0; i--) {
837	              sendFile(files[i], this);
838	            }
839			}
840		}
841	});
842	
843	$('#content_' + hmid).summernote('fontName', fontLists[0]); //기본폰트 설정
844	
845	//타이틀 수정 모드
846	if(type == 0){
847		$("#contentTitleInput_" + hmid).val($("#contentTitle_" + hmid)[0].innerText);
848		$("#contentTitleArea h3.ui_wbj_title_text").hide();
849		$("#contentTitleArea span.ui_wbj_input").show();
850	}
851	
852	//버튼
853	$("#editorSaveBtn_" + hmid).css("display", "inline-block");
854	$("#editorPreviewBtn_" + hmid).css("display", "inline-block");
855	$("#editorEditBtn_" + hmid).css("display", "none");
856}
857
858//editor 미리보기모드
859function editorPreview(type, hmid){
860	$('#content_' + hmid).summernote('destroy');
861	$('#content_' + hmid).toggleClass("ui_wbj_view ui_wbj_editor");
862
863	//타이틀 미리보기 모드
864	if(type == 0){
865		$("#contentTitle_" + hmid).text($("#contentTitleInput_" + hmid).val());
866		
867		$("#contentTitleArea h3.ui_wbj_title_text").show();
868		$("#contentTitleArea span.ui_wbj_input").hide();
869	}
870
871	//버튼
872	$("#editorPreviewBtn_" + hmid).css("display", "none");
873	$("#editorEditBtn_" + hmid).css("display", "inline-block");
874}
875
876function saveEditorData(type, hmid, url){
877	var editTitle = "";
878	if(type == 0){
879		editTitle = $("#contentTitleInput_" + hmid).val();
880	}
881	var editData = $('#content_' + hmid).summernote('code');
882	editData = editData
883		.replace(/\uFEFF/g, '')
884		.replace(/^\s*<p>\s*<span[^>]*>\s*<\/span>/, '<p>');
885	$('#content_' + hmid).summernote('destroy');
886	
887	$.ajax({
888        url: url,
889        data: {
890        	hmid : Number(hmid),
891        	customContentTitle : editTitle,
892        	customContentData : editData
893        },
894        type: 'POST',
895        success: function(data){
896        	if(data == "error"){
897        		commUtil.alert("fail", "저장에 실패 하였습니다.", "");
898        		
899        	} else {
900        		commUtil.alert("alert", "저장하였습니다.", "").done(function(){
901        			window.location.href = data;
902        		});
903        	}
904        }
905    });
906}
907
908function saveDynamicEditorData(hmid, url){
909	var editTitle = "";
910	var editData = $('#content_' + hmid).summernote('code');
911	editData = editData
912		.replace(/\uFEFF/g, '')
913		.replace(/^\s*<p>\s*<span[^>]*>\s*<\/span>/, '<p>');
914	$('#content_' + hmid).summernote('destroy');
915	
916	$.ajax({
917		url: url,
918		data: {
919			hmid : hmid,
920			customContentTitle : editTitle,
921			customContentData : editData,
922			pageUrl : pageUrl
923		},
924		type: 'POST',
925		success: function(data){
926			commUtil.alert("alert", "저장하였습니다.", "").done(function(){
927				window.location.href = data;
928        	});
929		}
930	});
931}
932
933function downloadBoardFile(isid, iftdid){
934	if(isid == 0 && iftdid == 0){
935		commUtil.alert("fail", "다운로드 할 수 없습니다.", "");
936		
937	} else {
938		//파일 다운로드
939		document.getElementById("fileDownFrame").src = "downloadBoardFile?isid=" + isid + "&iftdid=" + iftdid;
940		
941		var timer = setInterval(function () {
942		    var iframe = document.getElementById('fileDownFrame');
943		    var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
944		    
945	    	var cookie = getCookie("fileDownload");
946		    if(cookie != null && cookie != "") {
947				clearInterval(timer);
948				
949				//파일을 다운로드 받은 후엔 쿠키를 삭제
950				deleteCookie("fileDownload", '/');
951				return;
952		    }
953		}, 500);
954	}
955}
956
957/** FOOTER PRIVACY POLICY **/
958function openPrivacyPolicy(){
959	var langOpt = $("#fLangOpt").val() || "0";
960	$.ajax({
961		type : 'POST',
962		url : 'getPrivacyPolicy',
963		async : false,
964		success : function(data) {
965			if (data) {
966				$('#divPrivacyPolicyContent').html(data);
967			}
968			
969			//팝업
970			$('#dlgPrivacyPolicy').addClass('active');
971		},
972		error : function(request, status, error) {
973			console.log("code:" + request.status + "\n" + "message:" + request.responseText + "\n" + "error:" + error);
974		}
975	});
976
977	//수정
978	$("#btnEditPrivPolicy").off().click(function(e){
979		$("#btnEditPrivPolicy").hide();
980		$("#btnSavePrivPolicy").show();
981		$("#btnCancelPrivPolicy").show();
982		privacyPolicyEdit();
983	});
984	
985	$("#btnSavePrivPolicy").off().click(function(e){
986		privacyPolicySave();
987	});
988	
989	$("#btnCancelPrivPolicy").off().click(function(e){
990		$("#btnEditPrivPolicy").show();
991		$("#btnSavePrivPolicy").hide();
992		$("#btnCancelPrivPolicy").hide();
993		$('#divPrivacyPolicyContent').summernote('destroy');
994		
995		//기존 내용으로 변경
996	});
997	
998	//닫기
999	$('#dlgPrivacyPolicy button.type_delete').off().on('click', function(e){
1000		//초기화
1001		$("#btnEditPrivPolicy").show();
1002		$("#btnSavePrivPolicy").hide();
1003		$("#btnCancelPrivPolicy").hide();
1004		
1005		$('#divPrivacyPolicyContent').summernote('destroy');
1006		$('#dlgPrivacyPolicy').removeClass('active');
1007	});
1008}
1009
1010//개인정보 취급 방침 변경
1011function privacyPolicyEdit(){
1012	$('#divPrivacyPolicyContent').summernote({
1013		lang: 'ko-KR' ,
1014		focus: true,
1015		minWidth : 500,
1016		minHeight : 400,
1017//		maxHeight : 400,
1018		disableDragAndDrop:true,
1019		toolbar: [
1020		    ['style', ['style']],
1021		    ['font', ['bold', 'underline']],
1022		    ['fontname', ['fontname', 'fontsize']],
1023		    ['color', ['color']],
1024		    ['para', ['ul', 'ol', 'paragraph']],
1025		    ['table', ['table']],
1026//		    ['insert', ['link']]
1027	    ],
1028		fontNames: [
1029		    '궁서', '바탕', '돋움', '굴림', '맑은 고딕', 'Serif', 'Arial', 'Verdana',
1030		    'Courier New', 'Comic Sans MS', 'Helvetica', 'Impact', 'Tahoma', 'Times New Roman'
1031		],
1032		fontNamesIgnoreCheck: [
1033			'궁서', '바탕', '돋움', '굴림', '맑은 고딕'
1034		]
1035	});
1036}
1037
1038function privacyPolicySave(){
1039	var langOpt = $("#fLangOpt").val();
1040	var editData = $('#divPrivacyPolicyContent').summernote('code');
1041	editData = editData
1042		.replace(/\uFEFF/g, '')
1043		.replace(/^\s*<p>\s*<span[^>]*>\s*<\/span>/, '<p>');
1044	
1045	$.ajax({
1046		type:"POST",
1047		url : 'updatePrivacyPolicyData',
1048		data :{
1049			langopt : langOpt,
1050			ppData : editData
1051		},
1052		success : function(data) {
1053			if(!data || Number(data) < 0){
1054				commUtil.alert("fail", "저장에 실패하였습니다.", "", false);
1055				
1056			} else {
1057				commUtil.alert("alert", "저장하였습니다.", "", false).done(function(){
1058					$("#btnEditPrivPolicy").show();
1059					$("#btnSavePrivPolicy").hide();
1060					$("#btnCancelPrivPolicy").hide();
1061					
1062					$('#divPrivacyPolicyContent').summernote('destroy');
1063				});
1064			}
1065		},
1066		error : function(request, status, error) {
1067			console.log("code:" + request.status + "\n" + "message:" + request.responseText + "\n" + "error:" + error);
1068		}
1069	});
1070}
1071/** FOOTER PRIVACY POLICY **/

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.