PageSourceSearch

https://apte2026.kr/admin/js/contents.js?1788438287

js apte2026.kr collected 2026-10-07 16:41:37 UTC 60,449 bytes, 1,848 lines download raw bytes

1var adminContents = {
2	openBoardForm: function(board_code){
3		$.ajax({
4			type: 'POST',
5			data: {board_code: board_code},
6			url: ('/admin/contents/post/board_form.cm'),
7			dataType: 'json',
8			async: false,
9			cache: false,
10			success: function (res) {
11				if (res.msg == 'SUCCESS'){
12					$.cocoaDialog.open({type : 'admin', custom_popup : res.html, width : 550});
13				}else alert(res.msg);
14			}
15		});
16	},
17	addBoardForm: function () {
18		var f = $('#boardf');
19		var data = f.serializeObject();
20		$.ajax({
21			type: 'POST',
22			data: data,
23			url: ('/admin/contents/post/board_form_proc.cm'),
24			dataType: 'json',
25			async: false,
26			cache: false,
27			success: function (result) {
28				if (result.msg == 'SUCCESS') {
29						if (result.mode == 'add') {
30							var base_url = $('#new_board_btn').data('base_url');
31							var board_code = String(result.code || '');
32							var $board_item = $('<li>', {id: 'board_item_' + board_code});
33							var $board_link = $('<a>', {href: base_url + '&board_code=' + encodeURIComponent(board_code)});
34							$board_link.append(document.createTextNode(result.name || ''));
35							$board_link.append($('<small>', {'class': 'pull-right text-bold opacity-75'}));
36							$board_item.append($board_link);
37							$('#new_board_btn').before($board_item);
38							window.doznutadmin.AppForm.initialize();
39						}else if(result.mode == 'update'){
40						location.reload();
41					}
42					$.cocoaDialog.close();
43				} else
44					alert(result.msg);
45			}
46		});
47	},
48	editBoardForm : function (type) {
49		var f = $('#boardf');
50		var data = f.serializeObject();
51		data.type = type;
52		$.ajax({
53			type: 'POST',
54			data: data,
55			url: ('/admin/contents/post/board_edit_form_proc.cm'),
56			dataType: 'json',
57			async: false,
58			cache: false,
59			success: function (result) {
60				if (result.msg == 'SUCCESS') {
61					location.reload();
62					$.cocoaDialog.close();
63				} else
64					alert(result.msg);
65			}
66		});
67	},
68	editFormAdminContents: function(){
69		var f = $('#formf_modal');
70		var data = f.serializeObject();
71		data['type'] = 'dropdown';
72		$.ajax({
73			type: 'POST',
74			data: data,
75			url: ('/admin/contents/form/form_edit_form_proc.cm'),
76			dataType: 'json',
77			success: function (result) {
78				if (result.msg == 'SUCCESS') {
79					location.reload();
80				} else
81					alert(result.msg);
82			}
83		});
84	},
85	editFormForm: function (type) {
86		var f = $('#formf');
87		var data = f.serializeObject();
88    data.type = type;
89		$.ajax({
90			type: 'POST',
91			data: data,
92			url: ('/admin/contents/form/form_edit_form_proc.cm'),
93			dataType: 'json',
94			async: false,
95			cache: false,
96			success: function (result) {
97				if (result.msg == 'SUCCESS') {
98					$.cocoaDialog.close();
99					location.reload();
100				} else
101					alert(result.msg);
102			}
103		});
104	},
105	openDeleteBoardForm: function(board_code){
106		$.ajax({
107			type: 'POST',
108			data: {board_code: board_code},
109			url: ('/admin/contents/post/delete_board_form.cm'),
110			dataType: 'html',
111			async: false,
112			cache: false,
113			success: function (html) {
114				$.cocoaDialog.open({type:'admin',custom_popup:html,width:550,reopen:true, use_enter: true, hide_event:function(){
115						$(window).unbind('keydown');
116					}});
117			}
118		});
119	},
120	deleteBoardForm: function(board_code,type){
121		$.ajax({
122			type: 'POST',
123			data: {board_code: board_code,type:type},
124			url: ('/admin/contents/post/delete_board_form_proc.cm'),
125			dataType: 'json',
126			async: false,
127			cache: false,
128			success: function (obj) {
129				if(obj.msg=="SUCCESS"){
130					if(obj.type == 'map'){
131						location.href="/admin/contents/map";
132					}else if(obj.type == 'calendar'){
133						location.href="/admin/contents/calendar";
134					}else if(obj.type == 'gallery'){
135						location.href="/admin/contents/gallery";
136					}else{
137						location.href="/admin/contents/post";
138					}
139				}else{
140					alert(obj.msg);
141				}
142			}
143		});
144	},
145	openEditBoardForm : function(board_code, type){
146		$.ajax({
147			type: 'POST',
148			data: {board_code: board_code, type: type},
149			url: ('/admin/contents/post/board_edit_form.cm'),
150			dataType: 'json',
151			async: false,
152			cache: false,
153			success: function (res) {
154				if (res.msg == 'SUCCESS') {
155					let event = '';
156					const path = location.pathname.replace(/\/$/, '');
157
158					if (path === '/admin/contents/post') {
159						event = 'click_bo_content_post_group_settings';
160					} else if (path === '/admin/contents/form') {
161						event = 'click_bo_content_form_list_settings';
162					} else if (path === '/admin/contents/map') {
163						event = 'click_bo_content_map_group_settings';
164					} else if (path === '/admin/contents/calendar') {
165						event = 'click_bo_content_calendar_group_settings';
166					} else if (path === '/admin/contents/gallery') {
167						event = 'click_bo_content_gallery_group_settings';
168					}
169
170					// 설정 클릭
171					mixpanel.track(event,{'site_code': SITE_CODE});
172
173					$.cocoaDialog.open({type:'admin',custom_popup:res.html,width:550,reopen:true});
174				} else
175					alert(res.msg);
176			}
177		});
178	},
179	openEditFormForm : function(board_code, type){
180		// 입력폼 설정 클릭
181		mixpanel.track('click_bo_content_form_group_settings',{'site_code': SITE_CODE});
182		// 입력폼 수정시
183		$.ajax({
184			type: 'POST',
185			data: {board_code: board_code, type: type},
186			url: ('/admin/contents/form/form_edit_form.cm'),
187			dataType: 'json',
188			async: false,
189			cache: false,
190			success: function (res) {
191				if (res.msg == 'SUCCESS'){
192					$.cocoaDialog.open({type : 'admin', custom_popup : res.html, width : 550, reopen : true});
193				}else  alert(res.msg);
194			}
195		});
196	},
197	openDeleteForm : function(board_code, type){
198		$.ajax({
199			type: 'POST',
200			data: {board_code: board_code, type: type},
201			url: ('/admin/contents/post/delete_form.cm'),
202			dataType: 'html',
203			async: false,
204			cache: false,
205			success: function (html) {
206				$.cocoaDialog.open({type:'admin',custom_popup:html,width:550,reopen:true, use_enter: true, hide_event:function(){
207						$(window).unbind('keydown');
208					}});
209			}
210		});
211	},
212	addComment : function(id, type){
213		var that = this;
214		var form = $('#'+id);
215		var data = form.serializeObject();
216		$.ajax({
217			type: 'POST',
218			data: data,
219			url: ('/admin/contents/post/add_comment_proc.cm'),
220			dataType: 'json',
221			async: false,
222			cache: false,
223			success: function (result) {
224				if (result.msg == 'SUCCESS') {
225					let event = '';
226					const path = location.pathname.replace(/\/$/, '');
227
228					if (path === '/admin/contents/post') {
229						event = 'complete_bo_content_post_reply';
230					} else if (path === '/admin/contents/form') {
231						event = 'complete_bo_content_form_reply';
232					} else if (path === '/admin/contents/map') {
233						event = 'complete_bo_content_map_reply';
234					}
235
236					// 댓글 완료
237					mixpanel.track(event,{'site_code': SITE_CODE}
237);
238
239					$('#comment_list_html').append(result.html);
240					that.cancelComment(id);
241				} else
242					alert(result.msg);
243			}
244		});
245
246	},
247	addSubComment : function(id){
248		var that = this;
249		var form = $('#'+id);
250		var data = form.serializeObject();
251		$.ajax({
252			type: 'POST',
253			data: data,
254			url: ('/admin/contents/post/add_comment_proc.cm'),
255			dataType: 'json',
256			async: false,
257			cache: false,
258			success: function (result) {
259				if (result.msg == 'SUCCESS') {
260					var id = result.data.parent_code;
261					$('#child_w_'+id).append(result.html);
262					that.cancelComment(id);
263				} else
264					alert(result.msg);
265			}
266		});
267
268	},
269	addManageComment : function (id){
270		var that = this;
271		var form = $('#'+id);
272		var data = form.serializeObject();
273		$.ajax({
274			type: 'POST',
275			data: data,
276			url: ('/admin/contents/comment/add_comment_proc.cm'),
277			dataType: 'json',
278			async: false,
279			cache: false,
280			success: function (result) {
281				if (result.msg == 'SUCCESS') {
282					$('#comment_manage_list').prepend(result.html);
283					that.cancelComment(id);
284				} else
285					alert(result.msg);
286			}
287		});
288	},
289	cancelComment : function(id){
290		$('#'+id).find('textarea').val('');
291	},
292	deleteComment : function (id){
293		$.ajax({
294			type: 'POST',
295			data: {code:id},
296			url: ('/admin/contents/post/delete_comment.cm'),
297			dataType: 'html',
298			async: false,
299			cache: false,
300			success: function (html) {
301				$.cocoaDialog.open({type:'admin',custom_popup:html,width:550,reopen:true, use_enter: true, hide_event:function(){
302						$(window).unbind('keydown');
303					}});
304			}
305		});
306	},
307	deleteCommentProc : function (id){
308		$.ajax({
309			type: 'POST',
310			data: {code:id},
311			url: ('/admin/contents/post/delete_comment_proc.cm'),
312			dataType: 'json',
313			async: false,
314			cache: false,
315			success: function (result) {
316				if (result.msg == 'SUCCESS') {
317					if(result.mode == 'delete'){
318						$('#comment_wrap').find('#delete_'+id).text(getLocalizeString("설명_삭제된댓글", "", "삭제된 댓글"));
319						$('#comment_wrap').find('#body_'+id).text('');
320
321					}else if(result.mode == 'destroy'){
322						$('#comment_wrap').find('#'+id).remove();
323
324					}
325
326					$.cocoaDialog.close();
327				} else
328					alert(result.msg);
329			}
330		});
331	},
332	deleteManageComment : function (id){
333		$.cocoaDialog.open({
334			type:'delete',
335			terms : getLocalizeString("설명_삭제하시겠습니까", "","삭제하시겠습니까?")
336		},function(){
337			$.ajax({
338				type: 'POST',
339				data: {code:id},
340				url: ('/admin/contents/comment/delete_comment_proc.cm'),
341				dataType: 'json',
342				async: false,
343				cache: false,
344				success: function (result) {
345					if (result.msg == 'SUCCESS') {
346						if(result.mode == 'delete'){
347							$('#comment_manage_list').find('._delete_'+id).text(getLocalizeString("설명_삭제된댓글", "", "삭제된 댓글"));
348
349						}else if(result.mode == 'destroy'){
350							$('#comment_manage_list').find('#'+id).remove();
351
352						}
353
354					} else
355						alert(result.msg);
356				}
357			});
358
359		});
360	},
361	chkCommentItem : function(){
362		var list =  $('#comment_manage_list');
363		var chk_len = list.find('input:checkbox:checked').length;
364		if(chk_len>0){
365			$('#select_header').show();
366			$('#default_header').hide();
367		}else{
368			$('#select_header').hide();
369			$('#default_header').show();
370		}
371		$('#select_cnt').text(chk_len);
372	},
373	allChkCommentItem : function(){
374		var list =  $('#comment_manage_list');
375		list.find('input:checkbox').prop('checked',true);
376		this.chkCommentItem();
377	},
378	cancelChkCommentItem : function(){
379		var list =  $('#comment_manage_list');
380		list.find('input:checkbox').prop('checked',false);
381		this.chkCommentItem();
382	},
383	openDeleteCommentForm:function(code){
384		var chk_item = [];
385		if(code!="" && typeof code !="undefined")chk_item.push(code);
386		else{
387			var list =  $('#comment_manage_list');
388			list.find('input:checkbox:checked').each(function(){
389				var v = $(this).val();
390				chk_item.push(v);
391			});
392		}
393
394		$.ajax({
395			type: 'POST',
396			data: {comment_list: chk_item},
397			url: ('/admin/contents/comment/delete_comment_form.cm'),
398			dataType: 'html',
399			async: false,
400			cache: false,
401			success: function (html) {
402				$.cocoaDialog.open({type:'admin',custom_popup:html,width:550,reopen:true, use_enter
402: true, hide_event:function(){
403						$(window).unbind('keydown');
404					}});
405			}
406		});
407
408	},
409	deleteCommentForm:function(code){
410
411		$.ajax({
412			type: 'POST',
413			data: {mode:'multi',code: code},
414			url: ('/admin/contents/comment/delete_comment_proc.cm'),
415			dataType: 'json',
416			async: false,
417			cache: false,
418			success: function (result) {
419				if (result.msg == 'SUCCESS') {
420					var comment_count = $('#comment_count');
421					var decreaseCommentCount = function(){
422						// 전체 댓글이 상한("N+")이면 실제 건수를 모르므로 줄이지 않는다 (IMOPS-15165)
423						if(comment_count.data('capped') === 'Y') return;
424						comment_count.text(parseInt(comment_count.text(), 10) - 1);
425					};
426					$.each(result.multi,function(id,mode){
427						if(mode == 'delete'){
428							$('#comment_manage_list').find('._delete_'+id).text(getLocalizeString("설명_삭제된댓글",'', "삭제된 댓글"));
429							decreaseCommentCount();
430						}else if(mode == 'destroy'){
431							$('#comment_manage_list').find('#'+id).remove();
432							decreaseCommentCount();
433						}
434					});
435
436					$('#select_header').hide();
437					$('#default_header').show();
438					$.cocoaDialog.close();
439				} else
440					alert(result.msg);
441			}
442		});
443
444	},
445	openUpdateWtimeForm:function(code){
446		var chk_item = [];
447		if(code!="" && typeof code !="undefined")chk_item.push(code);
448		else{
449			var list =  $('#comment_manage_list');
450			list.find('input:checkbox:checked').each(function(){
451				var v = $(this).val();
452				chk_item.push(v);
453			});
454		}
455
456		$.ajax({
457			type: 'POST',
458			data: {comment_list: chk_item},
459			url: ('/admin/contents/comment/update_wtime_form.cm'),
460			dataType: 'html',
461			async: false,
462			cache: false,
463			success: function (html) {
464				$.cocoaDialog.open({type:'admin',custom_popup:html,width:550,reopen:true, use_enter: true, hide_event:function(){
465						$(window).unbind('keydown');
466					}});
467			}
468		});
469
470	},
471	updateWriteTimeCommentForm:function(code){
472		var date = $('._datepicker_input_obj').val();
473		var time = $('._timepicker_input_obj').val();
474		if(date == '' || date == null || time == '' || time == null) {
475			alert(getLocalizeString("설명_작성시각날짜시간입력", '', "날짜와 시간을 입력해 주세요."));
476			return false;
477		}
478		$.ajax({
479			type: 'POST',
480			data: {code : code, date : date, time : time},
481			url: ('/admin/contents/comment/update_wtime_commnet_form_proc.cm'),
482			dataType: 'json',
483			async: false,
484			cache: false,
485			success: function (result) {
486				if(result.msg == "SUCCESS") {
487					alert(getLocalizeString("설명_변경되었습니다", '', "변경 되었습니다."));
488					$.cocoaDialog.close();
489					location.reload();
490				}else
491					alert(result.msg);
492			}
493		});
494	},
495	hidePost : function(code, board_type, mode, view_type){
496		$.ajax({
497			type : 'POST',
498			data : {code : code, board_type : board_type, mode : mode},
499			url : ('/admin/contents/post/hide_post.cm'),
500			dataType : 'json',
501			async : false,
502			cache : false,
503			success : function(result){
504				if(result.msg == 'SUCCESS'){
505					if(result.multi == false){
506						$('._post_subject_' + code).toggleClass('hide_post_subject', result.hide_status == 'N' ? false : true);
507						$('._hide_badge_' + code).css('display', result.hide_status == 'N' ? 'none' : '');
508						//다국어처리시 문자열 비교 불가로 버튼 문구 변환 이슈 발생 - 전부 다국어 처리하면 기능상 문제 없으나 혹시모를 경우 대비 로직변경 (문자열 비교 -> 상태 값 비교)
509						$('._hide_post_btn_' + code).text(result.hide_status == 'Y' ? getLocalizeString("버튼_복원",'', "복원") : getLocalizeString("버튼_숨기기",'', "숨기기"));
510						if(view_type == 'view'){		// 게시물 본문에서 변경하는 경우
511							$('._post_subject').toggleClass('hide_post_subject', result.hide_status == 'N' ? false : true);
512							$('._hide_badge').css('display', result.hide_status == 'N' ? 'none' : '');
513							$('._hide_post_btn').text(result.hide_status == 'Y' ? getLocalizeString("버튼_복원",'', "복원") : getLocalizeString("버튼_숨기기",'', "숨기기"));
514						}
515					}else{
516						$.each(code, function(key, val){
517							$('._post_subject_' + val).toggleClass('hide_post_subject', mode == 'N' ? false : true);
518							$('._hide_badge_' + val).css('display', mode == 'N' ? 'none' : '');
519							$('._hide_post_btn_' + val).text(mode == 'N' ? getLocalizeString("버튼_복원",'', "복원") : getLocalizeString("버튼_숨기기",'', "숨기기"));
520						});
521					}
522					$('#select_header').hide();
523					$('#default_header').show();
524				}else{
525					alert(result.msg);
526				}
527			}
528		});
529	},
530	openDeletePostForm:function(board_code, type, b_code, mode){
531		$.ajax({
532			type: 'POST',
533			data: {board_code:board_code, type:type, b_code:b_code, mode:mode},
534			url: ('/admin/contents/post/delete_post_form.cm'),
535			dataType: 'html',
536			async: false,
537			cache: false,
538			success: function (html) {
539				$.cocoaDialog.open({type:'admin',custom_popup:html,width:550,reopen:true, use_enter
539: true, hide_event:function(){
540						$(window).unbind('keydown');
541					}});
542			}
543		});
544	},
545	openMovePostForm:function(post_code,type,board_code){
546		$.ajax({
547			type: 'POST',
548			data: {'post_code': post_code,'type':type,'board_code':board_code},
549			url: ('/admin/contents/post/move_post_form.cm'),
550			dataType: 'html',
551			async: false,
552			cache: false,
553			success: function (html) {
554				$.cocoaDialog.open({type:'admin',custom_popup:html,width:550,reopen:true, use_enter : true, hide_event:function(){
555						$(window).unbind('keydown');
556					}});
557			}
558		});
559	},
560	openEditViewsPostForm:function(target,post_code, board_type){
561		$.ajax({
562			type: 'POST',
563			data: {'target': target, 'post_code' : post_code, 'board_type' : board_type},
564			url: ('/admin/contents/post/editviews_post_form.cm'),
565			dataType: 'html',
566			async: false,
567			cache: false,
568			success: function (html) {
569				$.cocoaDialog.open({type:'admin',custom_popup:html,width:550,reopen:true, use_enter : true, hide_event:function(){
570						$(window).unbind('keydown');
571					}});
572			}
573		});
574	},
575	openEditWriterPostForm:function(post_code, board_type, writer){
576		$.ajax({
577			type: 'POST',
578			data: {'post_code' : post_code, 'board_type' : board_type, 'writer' : writer},
579			url: ('/admin/contents/post/edit_writer_post_form.cm'),
580			dataType: 'html',
581			async: false,
582			cache: false,
583			success: function (html) {
584				$.cocoaDialog.open({type:'admin',custom_popup:html,width:550,reopen:true, use_enter : true, hide_event:function(){
585						$(window).unbind('keydown');
586					}});
587			}
588		});
589	},
590	openEditWriteTimePostForm:function(post_code, board_type){
591		$.ajax({
592			type: 'POST',
593			data: {'post_code' : post_code, 'board_type' : board_type},
594			url: ('/admin/contents/post/edit_writetime_post_form.cm'),
595			dataType: 'html',
596			async: false,
597			cache: false,
598			success: function (html) {
599				$.cocoaDialog.open({type:'admin',custom_popup:html,width:550,reopen:true, use_enter : true, hide_event:function(){
600						$(window).unbind('keydown');
601					}});
602			}
603		});
604	},
605	deletePostUploadExcel:function(idx, type){
606		if(confirm(getLocalizeString("설명_삭제하시겠습니까", '', "삭제하시겠습니까?"))){
607			$.ajax({
608				type : 'POST',
609				data : {'idx' : idx},
610				url : ('/admin/ajax/delete_excel_upload_contents.cm'),
611				dataType : 'json',
612				async : false,
613				cache : false,
614				success : function(res){
615					if(res.msg == 'SUCCESS'){
616						adminContents.drawExcelUploadResult('', type);
617					}else{
618						alert(res.msg);
619					}
620				}
621			});
622		}
623	},
624	deletePostForm:function(code_list, type, board_code_list, mode){
625		$.ajax({
626			type: 'POST',
627			data: {code_list:code_list, type:type, board_code_list:board_code_list},
628			url: ('/admin/contents/post/delete_post_form_proc.cm'),
629			dataType: 'json',
630			async: false,
631			cache: false,
632			success: function (result){
633				if(result.msg == 'SUCCESS'){
634					if(mode != 'view'){
635						var comment_count = $('#comment_count');
636						var total_list_comment_count = $('#total_list_comment_count');
637						var all_check_btn = $('._all_check');
638
639						if(all_check_btn.length > 0 && all_check_btn.prop('checked') === true){
640							all_check_btn.prop('checked', false);
641						}
642						if($.isArray(code_list)){
643							$.each(code_list, function(k, v){
644								$('#post_item_' + v).remove();
645								comment_count.text(comment_count.text() - 1);
646								total_list_comment_count.text(total_list_comment_count.text() - 1);
647							})
648						}else{
649							$('#post_item_' + code_list).remove();
650							comment_count.text(comment_count.text() - 1);
651							total_list_comment_count.text(total_list_comment_count.text() - 1);
652						}
653						if($.isArray(board_code_list)){
654							$.each(board_code_list, function(k, v){
655								var list_comment_count = $('#list_comment_count_' + v);
656								list_comment_count.text(list_comment_count.text() - 1);
657							})
658						}else{
659							var list_comment_count = $('#list_comment_count_' + board_code_list);
660							list_comment_count.text(list_comment_count.text() - 1);
661						}
662						$('#select_header').hide();
663						$('#default_header').show();
664						$.cocoaDialog.close();
665					}else{
666						location.href = '/admin/contents/post';		// 게시물을 상세페이지에서 삭제할 경우 전체 게시물 관리자 페이지로 이동시킴
667					}
668				}else{
669					alert(result.msg);
670				}
671			},
672			error: function(){
673				alert(getLocalizeString('설명_잠시후다시시도해주세요', '', '잠시 후 다시 시도해주세요.'));
674			}
675		});
676	},
677	EditNoticePost:function(post_code, board_type, mode, writer, view_type){
678		$.ajax({
679			type: 'POST',
680			data: {post_code : post_code, board_type : board_type, mode : mode, writer : writer},
681			url: ('/admin/contents/post/edit_notice_post.cm'),
682			dataType: 'json',
683			async: false,
684			cache: false,
685			success: function (result) {
686				if(result.msg == 'SUCCESS'){
687					if(result.multi == false){
688						$('._icon_notice_' + post_code).css('display', result.notice_status == 'N' ? 'none' : '');
689						$('._notice_post_btn_' + post_code).text(result.notice_status == 'Y' ? getLocalizeString("버튼_공지해제",'', "공지해제") : getLocalizeString("버튼_공지설정",'', "공지설정"));
690						if(view_type == 'view'){		// 게시물 본문에서 변경하는 경우
691							$('._icon_notice').css('display', result.notice_status == 'N' ? 'none' : '');
692							$('._notice_post_btn').text(result.notice_status == 'Y' ? getLocalizeString("버튼_공지해제",'', "공지해제") : getLocalizeString("버튼_공지설정",'', "공지설정"));
693						}
694					}else{
695						$.each(post_code, function(key, val){
696							$('._icon_notice_' + val).css('display', mode == 'N' ? 'none' : '');
697							$('._notice_post_btn_' + val).text(mode == 'Y' ? getLocalizeString("버튼_공지해제",'', "공지해제") : getLocalizeString("버튼_공지설정",'', "공지설정"));
698						});
699					}
700					$('#select_header').hide();
701					$('#default_header').show();
702				}else{
703					alert(result.msg);
704				}
705			}
706		});
707	},
708	movePostForm:function(code_list,type,change_board_code,msg,update){
709		if(isBlank(change_board_code)){
710			alert(getLocalizeString("설명_이동할s선택", msg, "이동할 %1 선택하세요."));
711			return false;
712		}
713		$.ajax({
714			type: 'POST',
715			data: {code_list:code_list, type:type, 'change_board_code':change_board_code, update:update},
716			url: ('/admin/contents/post/move_post_form_proc.cm'),
717			dataType: 'json',
718			async: false,
719			cache: false,
720			success: function (result) {
721				if(result.msg == 'SUCCESS'){
722					alert(getLocalizeString("설명_게시물이이동되었습니다", '', "게시물이 이동 되었습니다."));
723				}else{
724					alert(result.msg);
725				}
726				$.cocoaDialog.close();
727				location.reload();
728			}
729		});
730	},
731	editViewsPostForm:function(target,type, code, board_type){
732		var cnt = $('#target_cnt').val();
733		if(cnt == '' || cnt == null) {
734			alert(getLocalizeString("설명_숫자를입력해주세요", '', "숫자를 입력해 주세요."));
735			return false;
736		}
737		$.ajax({
738			type: 'POST',
739			data: {'target' : target, 'type' : type, 'code' : code, 'cnt' : cnt, 'board_type' : board_type},
740			url: ('/admin/contents/post/editviews_post_form_proc.cm'),
741			dataType: 'json',
742			async: false,
743			cache: false,
744			success: function (result) {
745				if(result.msg == "SUCCESS") {
746					alert(getLocalizeString("설명_변경되었습니다", '', "변경 되었습니다."));
747					$.cocoaDialog.close();
748					location.reload();
749				}else
750					alert(result.msg);
751			}
752		});
753	},
754	editWriterPostForm:function(code, board_type){
755		var type = $('._edit_writer_type_val').val();
756		var writer = $('#modify_writer').val();
757		var writer_uid = $('#modify_writer_uid').val();
758		if(type != 'writer' && type != 'writer_uid'){
759			alert('ERROR : ' + getLocalizeString("설명_변경타입이없습니다", '', "변경 타입이 없습니다."));
760			return false;
761		}
762		if(type == 'writer' && writer == '') {
763			alert(getLocalizeString("설명_필명입력", '', "필명을 입력해 주세요."));
764			return false;
765		}
766		if(type == 'writer_uid' && writer_uid == ''){
767			alert(getLocalizeString("설명_회원ID입", '', "회원ID를 입력해 주세요."));
768			return false;
769		}
770		$.ajax({
771			type: 'POST',
772			data: {code : code, type : type, writer : writer, writer_uid : writer_uid, board_type : board_type},
773			url: ('/admin/contents/post/edit_writer_post_form_proc.cm'),
774			dataType: 'json',
775			async: false,
776			cache: false,
777			success: function (result) {
778				if(result.msg == "SUCCESS") {
779					alert(getLocalizeString("설명_변경되었습니다", '', "변경 되었습니다."));
780					$.cocoaDialog.close();
781					location.reload();
782				}else
783					alert(result.msg);
784			}
785		});
786	},
787	editWriteTimePostForm:function(code, board_type){
788		var date = $('._datepicker_input_obj').val();
789		var time = $('._timepicker_input_obj').val();
790		if(date == '' || date == null || time == '' || time == null) {
791			alert(getLocalizeString("설명_작성시각날짜시간입력", '', "날짜와 시간을 입력해 주세요."));
792			return false;
793		}
794		$.ajax({
795			type: 'POST',
796			data: {code : code, date : date, time : time, board_type : board_type},
797			url: ('/admin/contents/post/edit_writetime_post_form_proc.cm'),
798			dataType: 'json',
799			async: false,
800			cache: false,
801			success: function (result) {
802				if(result.msg == "SUCCESS") {
803					alert(getLocalizeString("설명_변경되었습니다", '', "변경 되었습니다."));
804					$.cocoaDialog.close();
805					location.reload();
806				}else
807					alert(result.msg);
808			}
809		});
810	},
811	DeleteBoardForm:function(board_code){
812		$.ajax({
813			type: 'POST',
814			data: {board_code: board_code},
815			url: ('/admin/contents/form/delect_board_form.cm'),
816			dataType: 'html',
817			async: false,
818			cache: false,
819			success: function (html) {
820				$.cocoaDialog.open({type:'admin',custom_popup:html,width:550,reopen:true, use_enter: true, hide_event:function(){
821						$(window).unbind('keydown');
822					}});
823			}
824		});
825	},
826	DeleteBoardFormProc:function(board_code){
827		$.ajax({
828			type: 'POST',
829			data: {board_code: board_code},
830			url: ('/admin/contents/form/delete_board_form_proc.cm'),
831			dataType: 'json',
832			async: false,
833			cache: false,
834			success: function (obj) {
835				if(obj.msg=="SUCCESS") location.href="/admin/contents/form";
836				else alert(obj.msg);
837			}
838		});
839	},
840	DeleteFormItem:function(form_code,url){
841		$.ajax({
842			type: 'POST',
843			data: {form_code: form_code,url: url},
844			url: ('/admin/contents/form/delect_form_item.cm'),
845			dataType: 'html',
846			async: false,
847			cache: false,
848			success: function (html) {
849				$.cocoaDialog.open({type:'admin',custom_popup:html,width:550,reopen:true, use_enter
849: true, hide_event:function(){
850						$(window).unbind('keydown');
851					}});
852			}
853		});
854	},
855	DeleteFormItemList: function(codes){
856		// 모달로 변경해서 더이상 사용하지 않음
857		if(confirm(getLocalizeString("설명_선택한n개응답들을삭제하시겠습니까", codes.length, "선택한 %1개 응답들을 삭제하시겠습니까? 삭제된 응답은 복원할 수 없습니다."))) {
858			$.ajax({
859				type: 'POST',
860				data: {'form_codes': codes},
861				url: ('/admin/contents/form/delete_form_item_list.cm'),
862				dataType: 'json',
863				async: false,
864				cache: false,
865				success: function (obj) {
866					if(obj.msg=="SUCCESS") location.reload();
867					else alert(obj.msg);
868				}
869			});
870		}
871	},
872	openDeleteFormItemListForm:function(codes){
873		$.ajax({
874			type: 'POST',
875			data: { "codes": codes},
876			url: ('/admin/contents/form/delete_form_item.cm'),
877			dataType: 'html',
878			async: false,
879			cache: false,
880			success: function (html) {
881				$.cocoaDialog.open({type:'admin',custom_popup:html,width:550,reopen:true, use_enter: true, hide_event:function(){$(window).unbind('keydown');}});
882			}
883		});
884	},
885	DeleteFormItemListProc: function(codes){
886		$.ajax({
887			type: 'POST',
888			data: {'form_codes': codes},
889			url: ('/admin/contents/form/delete_form_item_list.cm'),
890			dataType: 'json',
891			async: false,
892			cache: false,
893			success: function (obj) {
894				if(obj.msg=="SUCCESS") location.reload();
895				else alert(obj.msg);
896			}
897		});
898	},
899	DeleteFormItemProc:function(form_code,url){
900		$.ajax({
901			type: 'POST',
902			data: {form_code: form_code,url: url},
903			url: ('/admin/contents/form/delete_board_item_proc.cm'),
904			dataType: 'json',
905			async: false,
906			cache: false,
907			success: function (obj) {
908				if(obj.msg=="SUCCESS") location.href=obj.url;
909				else alert(obj.msg);
910			}
911		});
912	},
913	// 2021.08.05 제거
914	/*	DeleteFormItemAll:function(board_code){
915			$.ajax({
916				type: 'POST',
917				data: {board_code: board_code},
918				url: ('/admin/contents/form/delect_form_item_all.cm'),
919				dataType: 'html',
920				async: false,
921				cache: false,
922				success: function (html) {
923					$.cocoaDialog.open({type:'admin',custom_popup:html,width:550,reopen:true, use_enter: true, hide_event:function(){
924							$(window).unbind('keydown');
925						}});
926				}
927			});
928		},*/
929	// 2021.08.05 제거
930	/*	DeleteFormItemProcAll:function(board_code){
931			$.ajax({
932				type: 'POST',
933				data: {board_code: board_code},
934				url: ('/admin/contents/form/delete_board_item_proc_all.cm'),
935				dataType: 'json',
936				async: false,
937				cache: false,
938				success: function (obj) {
939					if(obj.msg=="SUCCESS") location.href="/admin/contents/form";
940					else alert(obj.msg);
941				}
942			});
943		},*/
944	formUpdate:function($obj){
945		$.ajax({
946			type        : 'POST',
947			data        : $obj.serialize(),
948			url         : ('/ajax/form_edit.cm'),
949			dataType    : 'json',
950			async       : true,
951			cache       : false,
952			success     : function (result) {
953				if(result.msg == 'SUCCESS'){
954					alert(getLocalizeString("설명_수정되었습니다", '', "수정 되었습니다."));
955				}else{
956					alert(result.msg);
957				}
958			}
959		});
960	},
961	formUpdateBookmark: function (form_code, status) {
962		$.ajax({
963			type        : 'POST',
964			data		: {code: form_code},
965			url			: ('/admin/contents/form/form_update_bookmark.cm'),
966			dataType    : 'json',
967			async       : true,
968			cache       : false,
969			success     : function (result) {
970				if (result.msg == 'SUCCESS') {
971					var $bookmark_counter = $('#bookmark_counter');
972					if (status === 'all') {
973						if (result.bookmark === 'Y') // bookmark 에 등록 되었을 때 #bookmark-counter +1 증가
974							$bookmark_counter.text(parseInt($bookmark_counter.text()) + 1);
975						else // bookmark 에 제거 되었을 때 #bookmark-counter -1 감소
976							$bookmark_counter.text(parseInt($bookmark_counter.text()) - 1);
977					}
978
979					// bookmark 클릭 시 css 변경
980					$('._bookmark_' + form_code).css({
981						color : result.bookmark === 'Y' ? '#1168FF' : '#E5E6E6',
982					});
983
984					// status 가 bookmark 인 경우 삭제를 함.
985					if (status === 'bookmark') {
986						$('#_content-' + form_code).remove();
987						$bookmark_counter.text(parseInt($bookmark_counter.text()) - 1);
988
989						var comment_count = $('#comment_count');
990						if (result.bookmark === 'Y')
991							comment_count.text(parseInt(comment_count.text()) + 1);
992						else
993							comment_count.text(parseInt(comment_count.text()) - 1);
994					}
995				} else {
996					alert(result.msg);
997				}
998			}
999		});
1000	},
1001	gallerySyncSiteSelect : function(unit_code){
1002		var $html = "<option value=''>" + getLocalizeString("설명_갤러리선택", '', "갤러리 선택") + "</
1002option>";
1003		$.ajax({
1004			type:'POST',
1005			data : {unit_code: unit_code},
1006			url : ('/admin/contents/post/change_sync_gallery_list.cm'),
1007			dataType : 'json',
1008			cache : false,
1009			success : function(result){
1010				if(result.boards != null){
1011					result.boards.list.forEach(function(e){
1012						$html += "<option value='" + e.code + "'>" + e.name + "</option>";
1013					});
1014				}
1015				$("#sync_board").html($html);
1016			}
1017		});
1018	},
1019	galleryCopySubmit : function(unit_code, board_code){
1020		var sync_unit = $('#sync_unit').val();
1021		var sync_board = $('#sync_board').val();
1022		$.ajax({
1023			type:'POST',
1024			data : {unit_code:unit_code, board_code: board_code,sync_unit:sync_unit,sync_board:sync_board},
1025			url : ('/admin/contents/post/sync_gallery.cm'),
1026			dataType : 'json',
1027			cache : false,
1028			success : function(result){
1029				if(result.msg == "SUCCESS"){
1030					location.reload();
1031				}else{
1032					alert(result.msg);
1033				}
1034			}
1035		});
1036	},
1037	openExcelUploadPostForm:function(board_code, type){
1038		$.ajax({
1039			type: 'POST',
1040			data: {board_code: board_code, type: type},
1041			url: ('/admin/contents/form/post_excel_upload_form.cm'),
1042			dataType: 'html',
1043			async: false,
1044			cache: false,
1045			success: function (html) {
1046				let event = '';
1047				if (type === 'post') {
1048					event = 'click_bo_content_post_import';
1049				} else if (type === 'calender') {
1050					event = 'complete_bo_content_calendar_import';
1051				}
1052
1053				if (event) {
1054					// 가져오기 버튼 클릭
1055					mixpanel.track(event,{'site_code': SITE_CODE}
1055);
1056				}
1057
1058				$.cocoaDialog.open({type:'admin',custom_popup:html,width:550,reopen:true});
1059			}
1060		});
1061	},
1062	changeMapAPIForm: function(type){
1063		var ncp_map_api_form = $('#_ncp_map_api_form');
1064		var google_map_api_form = $('#_google_map_api_form');
1065		if(type == 'google'){
1066			ncp_map_api_form.hide();
1067			google_map_api_form.show();
1068		}else{
1069			ncp_map_api_form.show();
1070			google_map_api_form.hide();
1071		}
1072	},
1073	changeMapBoard: function(){
1074		var excel_up_board_code = $('#excel_up_board_code');
1075		if(excel_up_board_code.val()){
1076			$('#show_map_category_code').show().on('click', function(){
1077				adminContents.showBoardCategoryCode(excel_up_board_code.val());
1078			});
1079		}else{
1080			$('#show_map_category_code').hide();
1081		}
1082		excel_up_board_code.on('change', function(){
1083			if(excel_up_board_code.val()){
1084				$('#show_map_category_code').show().on('click', function(){
1085					adminContents.showBoardCategoryCode(excel_up_board_code.val());
1086				})
1087			}else{
1088				$('#show_map_category_code').hide();
1089			}
1090		});
1091	},
1092	mapExcelUploadInit: function(){
1093		$('#post_excel_file_upload').fileupload({
1094			url: '/admin/ajax/excel_upload.cm',
1095			formData: {target_code: 'map_excel'},
1096			dataType: 'json',
1097			singleFileUploads: true,
1098			limitMultiFileUploads: 1,
1099			start: function(e, data){
1100				$('#post_excel_file_upload').addClass('file-loading');
1101			},
1102			progress: function(e, data){
1103				var progress = parseInt(data.loaded / data.total * 100, 10);
1104				if(progress == 100){
1105				}
1106			},
1107			done: function(e, data){
1108				var $google_map_api_key = $('#_google_map_api_key');
1109				var $ncp_map_api_key = $('#_ncp_map_api_key');
1110				var $ncp_map_api_secret = $('#_ncp_map_api_secret');
1111				var $board_code	= $('#excel_up_board_code');
1112				var api_type = 'naver';
1113				api_type = $('input[name=map_api_type]:checked').val();
1114
1115				if(api_type === 'google'){
1116					if($google_map_api_key.val().trim() == ''){
1117						alert(getLocalizeString("설명_GoogleMapsAPIkey를입력해주세요", "", "Google Maps API key를 입력해 주세요."));
1118						$google_map_api_key.focus();
1119						$('#post_excel_file_upload').removeClass('file-loading');
1120						$('#post_excel_file_upload').val('');
1121						return false;
1122					}
1123				}else{
1124					if($ncp_map_api_key.val().trim() == ''){
1125						alert(getLocalizeString("설명_네이버클라우드지도APIID를입력해주세요", "", "네이버 클라우드 플랫폼 지도 API Client ID를 입력해 주세요."));
1126						$ncp_map_api_key.focus();
1127						$('#post_excel_file_upload').removeClass('file-loading');
1128						$('#post_excel_file_upload').val('');
1129						return false;
1130					}else if($ncp_map_api_secret.val().trim() == ''){
1131						alert(getLocalizeString("설명_네이버클라우드지도APISecret을입력해주세요", "", "네이버 클라우드 플랫폼 지도 API Client Secret을 입력해 주세요."));
1132						$ncp_map_api_secret.focus();
1133						$('#post_excel_file_upload').removeClass('file-loading');
1134						$('#post_excel_file_upload').val('');
1135						return false;
1136					}
1137				}
1138
1139				if($board_code.val().trim() == ''){
1140					alert(getLocalizeString("설명_업로드할지도게시판선택해주세요", "", "업로드할 지도 게시판을 선택해 주세요."));
1141					$('#post_excel_file_upload').removeClass('file-loading');
1142					$('#post_excel_file_upload').val('');
1143				}else{
1144					var res_data = data.result;
1145					$.ajax({
1146						type : 'POST',
1147						data : {'file_name': res_data.file_name, 'board_code': $board_code.val()},
1148						url : ('/admin/ajax/run_map_batch.cm'),
1149						dataType : 'json',
1150						success : function(res){
1151							if(res.msg == 'SUCCESS'){
1152								EXCEL_UPLOAD_MAP_LIST.init({
1153									'file_name': res_data.file_name,
1154									'total':res.total_cnt,
1155									'board_code': $board_code.val(),
1156									'google_api_key': $google_map_api_key.val(),
1157									'ncp_api_key': $ncp_map_api_key.val(),
1158									'ncp_api_secret': $ncp_map_api_secret.val(),
1159									'api_type': api_type
1160								});
1161							}else{
1162								$('#post_excel_file_upload').removeClass('file-loading');
1163								$('#post_excel_file_upload').val('');
1164								if(res.msg == 'EXCEL_ERROR'){
1165
1166									$('#post_file_upload_add_status_msg').removeClass('alert-success');
1167									$('#post_file_upload_add_status_msg').addClass('alert-danger');
1168									var msg = getLocalizeString("설명_엑셀등록실패", '', "엑셀 등록을 실패하였습니다. 오류 내역을 수정하시고 다시 업로드 해주세요.<br/>CSV 업로드인 경우 UTF-8 형식만 지원합니다.");
1169									var api_error = {"API_KEY_INVALID": getLocalizeString("설명_API키오류", '', "API 키 오류"), "API_OVER_LIMIT": getLocalizeString("설명_API최대호출수초과", '', "API 1일 최대 호출 수를 초과")};
1170									if (res.error_list){
1171										msg += '<div style="padding-top: 20px;">';
1172										msg += getLocalizeString("설명_오류게시물목록총n개", res.error_list.length, "<strong>오류 게시물 목록 (총 %1개)</strong>");
1173										msg += '<ul>';
1174										for(var i = 0; i < res.error_list.length; i++){
1175											if(api_error[res.error_list[i].error_msg] != undefined){
1176												res.error_list[i].error_msg = api_error[res.error_list[i].error_msg];
1177											}
1178											msg += '<li><span class="text-gray line">
1178' + getLocalizeString("설명_n1행_n2열", [res.error_list[i].row_index, res.error_list[i].cell_char], "%1행 %2열") + ' </span><span>' + res.error_list[i].error_msg + '</span></li>';
1179											if (i>10) break;	//최대 10개만 뿌림
1180										}
1181										msg += '</ul></div>';
1182									}
1183									$('#post_file_upload_add_status_msg').html(msg).show();
1184								} else {
1185									alert(res.msg);
1186								}
1187							}
1188						}
1189					});
1190				}
1191			},
1192			fail: function(e, data){
1193				$('#post_excel_file_upload').removeClass('file-loading');
1194				alert(getLocalizeString("설명_업로드에실패하였습니다", '', "업로드에 실패 하였습니다."));
1195			}
1196		});
1197
1198	},
1199	deleteFile: function(file_name){
1200		$.ajax({
1201			type: 'POST',
1202			data: {'type': 'delete', 'file_name':file_name},
1203			url: ('/admin/contents/form/excel_upload_end.cm'),
1204			dataType: 'html',
1205			async: false,
1206			cache: false,
1207			success: function (res) {
1208				if(res == 'SUCCESS'){
1209					location.reload();
1210				}
1211			}
1212		});
1213	},
1214	postExcelUploadInit:function(board_code){
1215		$('#post_excel_file_upload').fileupload({
1216			url: '/admin/ajax/excel_upload.cm',
1217			formData: {target_code: 'post_excel'},
1218			dataType: 'json',
1219			singleFileUploads: true,
1220			limitMultiFileUploads: 1,
1221			start: function(e, data){
1222				$('#post_excel_file_upload').addClass('file-loading');
1223			},
1224			progress: function(e, data){
1225				var progress = parseInt(data.loaded / data.total * 100, 10);
1226				if(progress == 100){
1227				}
1228			},
1229			done: function(e, data){
1230				var res_data = data.result;
1231				$.ajax({
1232					type : 'POST',
1233					data : {'file_name':res_data.file_name,'board_code':board_code},
1234					url : ('/admin/ajax/run_post_batch.cm'),
1235					dataType : 'json',
1236					success : function(res){
1237						$('#post_excel_file_upload').removeClass('file-loading');
1238						if(res.msg=='SUCCESS'){
1239							$('#post_file_upload_add_status_msg').addClass('alert-success');
1240							$('#post_file_upload_add_status_msg').removeClass('alert-danger');
1241							var msg = getLocalizeString("설명_n개게시물등록완료", res.success_cnt, "%1개의 게시물 등록이 완료되었습니다.");
1242							$('#post_file_upload_add_status_msg').html(msg).show();
1243						}else if(res.msg=='EXCEL_ERROR'){
1244							$('#post_file_upload_add_status_msg').removeClass('alert-success');
1245							$('#post_file_upload_add_status_msg').addClass('alert-danger');
1246							var msg = getLocalizeString("설명_엑셀등록실패", "", "엑셀 등록을 실패하였습니다. 오류 내역을 수정하시고 다시 업로드 해주세요.<br/>CSV 업로드인 경우 UTF-8 형식만 지원합니다.");
1247							if (res.error_list){
1248								msg += '<div style="padding-top: 20px;">';
1249								msg += getLocalizeString("설명_오류게시물목록총n개", res.error_list.length, "<strong>오류 게시물 목록 (총 %1개)</strong>");
1250								msg += '<ul>';
1251								for(var i = 0; i < res.error_list.length; i++){
1252									msg += '<li><span class="text-gray line">' + getLocalizeString("설명_n1행_n2열", [res.error_list[i].row_index, res.error_list[i].cell_char ], "%1행 %2열") + ' </span><span>' + res.error_list[i].error_msg + '</span></li>';
1253									if (i>10) break;	//최대 10개만 뿌림
1254								}
1255								msg += '</ul></div>';
1256							}
1257							$('#post_file_upload_add_status_msg').html(msg).show();
1258						}else{
1259							$('#post_file_upload_add_status_msg').removeClass('alert-success');
1260							$('#post_file_upload_add_status_msg').addClass('alert-danger');
1261							$('#post_file_upload_add_status_msg').text(res.msg).show();
1262						}
1263					}
1264				});
1265			},
1266			fail: function(e, data){
1267				$('#post_excel_file_upload').removeClass('file-loading');
1268				alert(getLocalizeString("설명_업로드에실패하였습니다", '', "업로드에 실패 하였습니다."));
1269			}
1270		});
1271	},
1272	contentsExcelUploadInit:function(board_code, type){
1273		if(type === 'post' && $('#post_multi_add_image_upload').length){
1274			var $post_multi_add_status = $('#post_multi_add_status');
1275			var $post_multi_add_status_msg = $('#post_multi_add_status_msg');
1276			var post_image_count = 0;
1277			var post_image_max_count = 200;
1278			var post_image_over_limit = false;
1279			$('#post_multi_add_image_upload').fileupload({
1280				url : '/admin/ajax/upload_file_mongo.cm',
1281				formData : {temp : 'Y', target : 'content_post', target_code : 'multi_post_img', type : 'image', overwrite : 'Y', upload_count : 'Y'},
1282				dataType : 'json',
1283				singleFileUploads : false,
1284				limitMultiFileUploads : 300,
1285				add : function(e, data){
1286					var incoming_count = (data.files && data.files.length) ? data.files.length : 0;
1287					if (incoming_count > 0 && (post_image_count + incoming_count) > post_image_max_count) {
1288						var msg = getLocalizeString('설명_최대등록가능한개수는n개입니다', post_image_max_count, '최대 등록 가능한 개수는 %1개입니다.');
1289						post_image_over_limit = true;
1290						$post_multi_add_status_msg.removeClass('alert-success');
1291						$post_multi_add_status_msg.addClass('alert-danger');
1292						$post_multi_add_status_msg.html(msg).show();
1293						return;
1294					}
1295					data.submit();
1296				},
1297				start : function(e, data){
1298					$post_multi_add_status.addClass('img-loading');
1299				},
1300				progress : function(e, data){
1301					var progress = parseInt(data.loaded / data.total * 100, 10);
1302					if(progress == 100){
1303					}
1304				},
1305				done : function(e, data){
1306					$post_multi_add_status.removeClass('img-loading');
1307					if (data.result && data.result.error_code === 'UPLOAD_COUNT_LIMIT') {
1308						post_image_over_limit = true;
1309						if (typeof data.result.upload_count !== 'undefined') {
1310							post_image_count = Math.max(post_image_count, data.result.upload_count);
1311						}
1312						$post_multi_add_status_msg.removeClass('alert-success');
1313						$post_multi_add_status_msg.addClass('alert-danger');
1314						$post_multi_add_status_msg.html(data.result.error).show();
1315						return;
1316					}
1317					if (data.result && typeof data.result.upload_count !== 'undefined') {
1318						post_image_count = Math.max(post_image_count, data.result.upload_count);
1319						post_image_over_limit = post_image_count > post_image_max_count;
1320					}
1321					$.each(data.result.files, function(e, tmp){
1322						if(tmp.error == null){
1323							$post_multi_add_status_msg.addClass('alert-success');
1324							$post_multi_add_status_msg.removeClass('alert-danger');
1325							var msg = getLocalizeString('설명_게시물일괄이미지업로드n개완료', data.result.upload_count, '이미지 전송 %1개 완료. 엑셀, CSV 파일을 업로드 할 수 있습니다.');
1326							$post_multi_add_status_msg.html(msg).show();
1327						}else{
1328							alert(tmp.error);
1329						}
1330					});
1331				},
1332				fail : function(e, data){
1333					$post_multi_add_status.removeClass('img-loading');
1334					alert(getLocalizeString('설명_업로드에실패하였습니다', '', '업로드에 실패 하였습니다.'));
1335				},
1336			});
1337		}
1338		$('#post_excel_file_upload').fileupload({
1339			url: '/admin/ajax/excel_upload.cm',
1340			formData: {target_code: 'post_excel'},
1341			dataType: 'json',
1342			singleFileUploads: true,
1343			limitMultiFileUploads: 1,
1344			add: function(e, data){
1345				if(type === 'post' && post_image_over_limit){
1346					alert(getLocalizeString('설명_최대등록가능한개수는n개입니다', post_image_max_count, '최대 등록 가능한 개수는 %1개입니다.'));
1347					return;
1348				}
1349				data.submit();
1350			},
1351			start: function(e, data){
1352				$('#post_excel_file_upload').addClass('file-loading');
1353			},
1354			progress: function(e, data){
1355				var progress = parseInt(data.loaded / data.total * 100, 10);
1356				if(progress == 100){
1357				}
1358			},
1359			done: function(e, data){
1360				var res_data = data.result;
1361				if(type === 'map') {
1362					var $google_map_api_key = $('#_google_map_api_key');
1363					var $ncp_map_api_key = $('#_ncp_map_api_key');
1364					var $ncp_map_api_secret = $('#_ncp_map_api_secret');
1365					var $board_code	= $('#excel_up_board_code');
1366					var api_type = 'naver';
1367					api_type = $('input[name=map_api_type]:checked').val();
1368
1369					if(api_type === 'google'){
1370						if($google_map_api_key.val().trim() == ''){
1371							alert(getLocalizeString("설명_GoogleMapsAPIkey를입력해주세요", '', "Google Maps API key를 입력해 주세요."));
1372							$google_map_api_key.focus();
1373							$('#post_excel_file_upload').removeClass('file-loading');
1374							$('#post_excel_file_upload').val('');
1375							return false;
1376						}
1377					}else{
1378						if($ncp_map_api_key.val().trim() == ''){
1379							alert(getLocalizeString("설명_네이버클라우드지도APIID를입력해주세요", '', "네이버 클라우드 플랫폼 지도 API Client ID를 입력해 주세요."));
1380							$ncp_map_api_key.focus();
1381							$('#post_excel_file_upload').removeClass('file-loading');
1382							$('#post_excel_file_upload').val('');
1383							return false;
1384						}else if($ncp_map_api_secret.val().trim() == ''){
1385							alert(getLocalizeString("설명_네이버클라우드지도APISecret을입력해주세요", '', "네이버 클라우드 플랫폼 지도 API Client ID를 입력해 주세요."));
1386							$ncp_map_api_secret.focus();
1387							$('#post_excel_file_upload').removeClass('file-loading');
1388							$('#post_excel_file_upload').val('');
1389							return false;
1390						}
1391					}
1392					if($board_code.val().trim() == ''){
1393						alert(getLocalizeString("설명_업로드할지도게시판선택해주세요", '', "업로드할 지도 게시판을 선택해 주세요."));
1394						$('#post_excel_file_upload').removeClass('file-loading');
1395						$('#post_excel_file_upload').val('');
1396					}
1397
1398					var post_data = {
1399						'file_name' : res_data.file_name,
1400						'board_code' : $board_code.val(),
1401						'type' : type,
1402						'google_map_api_key' : $google_map_api_key.val(),
1403						'ncp_map_api_secret' : $ncp_map_api_secret.val(),
1404						'ncp_map_api_key' : $ncp_map_api_key.val(),
1405						'api_type' : api_type
1406					};
1407				} else {
1408					var post_data = {
1409						'file_name' : res_data.file_name,
1410						'board_code' : board_code,
1411						'type' : type
1412					}
1413				}
1414
1415				$.ajax({
1416					type : 'POST',
1417					data : post_data,
1418					url : ('/admin/ajax/upload_excel_contents.cm'),
1419					dataType : 'json',
1420					success : function(res){
1421						if (res.msg === 'SUCCESS') {
1422							var interval = setInterval(function(){
1423								$('#post_excel_file_upload').removeClass('file-loading');
1424								adminContents.drawExcelUploadResult(board_code, type);
1425								clearInterval(interval);
1426							}, 2000);
1427						} else if (res.msg === 'EXCEL_ERROR' && res.error_list) {
1428							var msg = getLocalizeString("설명_엑셀등록실패", "", "엑셀 등록을 실패하였습니다. 오류 내역을 수정하시고 다시 업로드 해주세요.");
1429							msg = msg.replace(/<br\s*\/?>/gi, "\n");
1430							if (res.error_list.length > 0) {
1431								msg += "\n" + getLocalizeString("설명_오류게시물목록총n개", res.error_list.length, "오류 게시물 목록 (총 %1개)");
1432								for (var i = 0; i < res.error_list.length; i++) {
1433									msg += "\n- " + getLocalizeString("설명_n1행_n2열", [res.error_list[i].row_index, res.error_list[i].cell_char], "%1행 %2열") + " " + res.error_list[i].error_msg;
1434									if (i > 9) break;
1435								}
1436							}
1437							alert(msg);
1438							$('#post_excel_file_upload').removeClass('file-loading');
1439						} else {
1440							alert(res.msg);
1441							$('#post_excel_file_upload').removeClass('file-loading');
1442						}
1443					}
1444				});
1445			},
1446			fail: function(e, data){
1447				$('#post_excel_file_upload').removeClass('file-loading');
1448				alert(getLocalizeString("설명_업로드에실패하였습니다", '', "업로드에 실패 하였습니다."));
1449			}
1450		});
1451	},
1452	drawExcelUploadResult : function(board_code, type) {
1453		$.ajax({
1454			type : 'POST',
1455			url : ('/admin/ajax/get_excel_contents_upload.cm'),
1456			dataType : 'json',
1457			data : {'board_code' : board_code, 'type' : type},
1458			async : false,
1459			cache : false,
1460			success : function(res){
1461				if(res.msg === 'SUCCESS') {
1462					if(type === 'map'){
1463						$('#msg_section').html(res.html).show();
1464					}else {
1465						if($('#log_list_table_wrap').css('display') === 'none'){
1466							$('#inform_expire_msg').show();
1467							$('#log_list_table_wrap').show();
1468						}
1469						if(res.html == "\t\t" || !res.html) { // row 값이 존재하지 않을때
1470							$('#inform_expire_msg').hide();
1471							$('#log_list_table_wrap').hide();
1472						} else {
1473							$('#inform_expire_msg').show();
1474							$('#log_list_table').html(res.html);
1475						}
1476
1477					}
1478				}
1479			}
1480		});
1481	},
1482	openMemberInfo:function(member_code){
1483		$.ajax({
1484			type: 'POST',
1485			data: {'member_code':member_code},
1486			url: ('/admin/contents/post/get_member_info.cm'),
1487			dataType: 'html',
1488			success: function(html){
1489				$.cocoaDialog.open({type:'admin', custom_popup:html, width:550});
1490			}
1491		})
1492	},
1493	showBoardCategoryCode : function(board_code){
1494		$.ajax({
1495			type : 'POST',
1496			data : {board_code : board_code},
1497			url : ('/admin/contents/post/show_board_category_code.cm'),
1498			dataType : 'html',
1499			success : function(html){
1500				$.cocoaDialog.open({type : 'admin', custom_popup : html, width:550});
1501			}
1502		})
1503	},
1504	editPostCategory : function(code, category_code, type){
1505		$.ajax({
1506			type : 'POST',
1507			data : {'code' : code, 'category_code' : category_code, 'type' : type},
1508			url : ('/admin/contents/post/edit_post_category.cm'),
1509			dataType : 'json',
1510			success : function(result){
1511				if(result.msg == 'SUCCESS'){
1512					location.reload();
1513				}else{
1514					alert(result.msg);
1515				}
1516			}
1517		})
1518	},
1519
1520	openModalBoardExcelDownload : function(board_code, type){
1521		let event = '';
1522		if (type === 'post') {
1523			event = 'click_bo_content_post_export';
1524		} else if (type === 'comment') {
1525			event = 'click_bo_content_comment_export';
1526		} else if (type === 'form') {
1527			event = 'click_bo_content_form_export';
1528		} else if (type === 'map') {
1529			event = 'click_bo_content_map_export';
1530		} else if (type === 'calender') {
1531			event = 'click_bo_content_calendar_export';
1532		}
1533
1534		if (event) {
1535			// 내보내기 버튼 클릭
1536			mixpanel.track(event,{'site_code': SITE_CODE}
1536);
1537		}
1538
1539		$.ajax({
1540			type: 'POST',
1541			url: ('/admin/ajax/open_download_excel_contents_list.cm'),
1542			data : {'board_code':board_code, 'type':type},
1543			dataType: 'json',
1544			async: false,
1545			cache: false,
1546			success: function (res) {
1547				if(res.msg === 'SUCCESS'){
1548					$.cocoaDialog.open({type : 'board_excel_download', custom_popup : res.html, width : 550});
1549				}else{
1550					alert(res.msg);
1551				}
1552			}
1553		});
1554	},
1555
1556	toggleCaptcha : function() {
1557		const is_captcha_checked = $('#captcha_checkbox').prop('checked');
1558		$.ajax({
1559			type: 'POST',
1560			dataType: 'json',
1561			data: {'is_enabled': is_captcha_checked ? 'Y' : 'N'},
1562			url: ('/admin/contents/comment/update_captcha_config.cm'),
1563			success: function (res) {
1564				if(res.msg != 'SUCCESS'){
1565					alert(res.msg);
1566				}
1567			}
1568		});
1569	},
1570
1571	loadExcelList : function(type){
1572		$.ajax({
1573			type : 'POST',
1574			url : ('/admin/ajax/get_excel_contents_list.cm'),
1575			dataType : 'json',
1576			data : {'type' : type},
1577			async : false,
1578			cache : false,
1579			success : function(res){
1580				if(res.msg === 'SUCCESS'){
1581					$('.modal_board_excel_download').find('._excel_empty_wrap').hide();
1582					$('.modal_board_excel_download').find('#_excel_list_body').html(res.html);
1583				}else{
1584					$('.modal_board_excel_download').find('#_excel_list_body').empty();
1585					$('.modal_board_excel_download').find('._excel_empty_wrap').show();
1586				}
1587			}
1588		});
1589	},
1590
1591	runBoardContentsExcelMake : function(board_code, type){
1592		var $dashboard_loader_sub = $('#dashboard_loader_sub');
1593		$.ajax({
1594			type: 'POST',
1595			url: '/admin/ajax/request_excel_contents_list.cm',
1596			dataType: 'json',
1597			data : {'board_code' : board_code, 'type' : type},
1598			cache: false,
1599			beforeSend : function() {
1600				$dashboard_loader_sub.show();
1601			},
1602			success: function (res) {
1603				if ( res.msg == 'SUCCESS' ) {
1604					var interval = setInterval(function(){
1605						$dashboard_loader_sub.hide();
1606						adminContents.loadExcelList(type, board_code);
1607						clearInterval(interval);
1608					}, 2000);
1609				} else {
1610					alert(res.msg);
1611					$dashboard_loader_sub.hide();
1612				}
1613			},
1614			error : function(res) {
1615				$dashboard_loader_sub.hide();
1616			}
1617		});
1618	},
1619
1620	deleteBoardExcel : function(idx, type){
1621		if(confirm(getLocalizeString("설명_삭제하시겠습니까", '', "삭제하시겠습니까?"))){
1622			$.ajax({
1623				type: 'POST',
1624				data: {'idx': idx},
1625				url: ('/admin/ajax/delete_excel_contents.cm'),
1626				dataType: 'json',
1627				async: false,
1628				cache: false,
1629				success: function(res){
1630					if(res.msg == 'SUCCESS'){
1631						adminContents.loadExcelList(type);
1632					}else{
1633						alert(res.msg);
1634					}
1635				}
1636			});
1637		}
1638	},
1639
1640	deleteBoardUploadExcel : function(idx, type){
1641		if(confirm(getLocalizeString("설명_삭제하시겠습니까", '', "삭제하시겠습니까?"))){
1642			$.ajax({
1643				type: 'POST',
1644				data: {'idx': idx},
1645				url: ('/admin/ajax/delete_excel_upload_contents.cm'),
1646				dataType: 'json',
1647				async: false,
1648				cache: false,
1649				success: function(res){
1650					if(res.msg == 'SUCCESS'){
1651						adminContents.drawExcelUploadResult('', type);
1652					}else{
1653						alert(res.msg);
1654					}
1655				}
1656			});
1657		}
1658	},
1659	setChangeListSort : function(type, $obj){
1660		var board_code = null;
1661		var action_index = null;
1662		var target_index = null;
1663		$obj.sortable({
1664			'handle' : '._sortable_handle',
1665			'start' : function(event, ui){
1666				board_code = ui.item.data('code');
1667				action_index = ui.item.index();
1668			},
1669			'stop' : function(event, ui){
1670				target_index = ui.item.index();
1671				// 제자리 이동 시 무시
1672				if ( target_index == action_index ) { return false; }
1673				if(target_index < action_index){
1674					var pos = 'up';
1675					var $target_obj = ui.item.next();
1676				}else{
1677					var pos = 'down';
1678					var $target_obj =  ui.item.prev();
1679				}
1680				var target_code = $target_obj.data('code');
1681
1682				if(isBlank(board_code)) return false;
1683				if(isBlank(target_code)) return false;
1684				if(board_code == target_code) return false;
1685
1686				$.ajax({
1687					type: 'POST',
1688					data: {'type' : type,'board_code':board_code, 'target_code':target_code, 'pos' : pos},
1689					url: ('/admin/ajax/content_change_sort.cm'),
1690					dataType: 'json',
1691					success: function (res) {
1692						if(res.msg == 'SUCCESS'){
1693
1694						}else
1695							alert(res.msg);
1696					}
1697				});
1698
1699			}
1700		});
1701	},
1702  
1703  /** 
1704   * 컨텐츠 관리 > 입력폼 관리 의 입력폼 게시판 리스트
1705   * @params : [board_code, base_url, input_form_keyword]
1706   * */
1707  inputForm : {
1708    page : 0,
1709    more : true,
1710    getInputFormList : function(params){
1711      var that = this;
1712      if(that.more){
1713        $.ajax({
1714          type: 'POST',
1715          data: {page:that.page, params},
1716          url: ('/admin/ajax/contents/get_input_form_list.cm'),
1717          dataType: 'json',
1718          async: false,
1719          cache: false,
1720          complete: function() {
1721            $('.spinner-box').css('display', 'none');
1722          },
1723          success: function (obj) {
1724            $("._sortable_list").append(obj.html);
1725            $("#mobile-select-box").append(obj.mobile_html);
1726            that.html = obj.html;
1727            that.page = obj.page;
1728            that.more = obj.more=="Y";
1729            that.data_count = obj.data_count;
1730            that.page_data_count = obj.page_data_count;
1731          }
1732        });
1733      }
1734      return that;
1735    }
1736  },
1737
1738  /**
1739   * 컨텐츠 관리 > 게시판 관리, 일정 관리, 지도 관리, 겔러리 관리 의 입력폼 게시판 리스트
1740   * @params : [board_code, base_url, input_form_keyword]
1741   * */
1742  post : {
1743    page : 0,
1744    more : true,
1745    getPostList : function(params){
1746      var that = this;
1747      if(that.more){
1748        $.ajax({
1749          type: 'POST',
1750          data: {page:that.page, params},
1751          url: ('/admin/ajax/contents/get_post_list.cm'),
1752          dataType: 'json',
1753          async: false,
1754          cache: false,
1755          complete: function() {
1756            $('.spinner-box').css('display', 'none');
1757          },
1758          success: function (obj) {
1759            $("._sortable_list").append(obj.html);
1760            $("#mobile-select-box").append(obj.mobile_html);
1761            that.html = obj.html;
1762            that.page = obj.page;
1763            that.more = obj.more=="Y";
1764            that.data_count = obj.data_count;
1765            that.page_data_count = obj.page_data_count;
1766          }
1767        });
1768      }
1769      return that;
1770    }
1771  }
1772};
1773
1774
1775
1776var EXCEL_UPLOAD_MAP_LIST = {
1777	post_data: {},
1778	global_error : '',
1779	location_err_list : [],
1780	total: 0,
1781	success: 0,
1782	idx: 0,
1783	init : function(data){
1784		this.post_data = data;
1785		this.total = data.total;
1786
1787		this.upload();
1788	},
1789	upload: function(){
1790		var progress = Math.round((this.idx/this.total) * 100);
1791		var msg = '<span class="text-gray-light">'+this.idx+'/'+this.total+' ('+progress+'%)</span>';
1792		msg += '<div class="progress progress-striped active">';
1793		msg += '<div class="progress-bar progress-bar-primary" id="map_progress" style="width:'+progress+'%"></div>';
1794		msg += '</div>';
1795		$('#post_file_upload_add_status_msg').html(msg).show();
1796
1797
1798		var post_data = this.post_data;
1799		post_data['start'] = this.idx;
1800		$.ajax({
1801			type : 'POST',
1802			data : post_data,
1803			url : ('/admin/ajax/run_map_batch_exe.cm'),
1804			dataType : 'json',
1805			success : function(res){
1806				if(res.location_err_list.length > 0){
1807					var loca_err = res.location_err_list;
1808					for(var i=0; i<loca_err.length;i++){
1809						EXCEL_UPLOAD_MAP_LIST.location_err_list.push(loca_err[i]);
1810					}
1811				}
1812				if(res.global_error != '')
1813					EXCEL_UPLOAD_MAP_LIST.global_error = res.global_error;
1814				EXCEL_UPLOAD_MAP_LIST.success += res.success_cnt;
1815				EXCEL_UPLOAD_MAP_LIST.idx = (res.next_idx);
1816				EXCEL_UPLOAD_MAP_LIST.next();
1817			}
1818		});
1819	},
1820	next : function(){
1821		if(this.global_error == '' && this.total > this.idx){
1822			setTimeout(function(){
1823				EXCEL_UPLOAD_MAP_LIST.upload();
1824			},1000);
1825		}else {
1826			//업로드 다 끝남
1827			var result = {'global_error': this.global_error, 'last': this.idx, 'total_cnt': this.total, 'success_cnt': this.success,'location_err_list': this.location_err_list};
1828			var file_name = this.post_data['file_name'];
1829
1830			$('#post_excel_file_upload').removeClass('file-loading');
1831			$('#post_file_upload_add_status_msg').addClass('alert-success');
1832			$('#post_file_upload_add_status_msg').removeClass('alert-danger');
1833			$.cocoaDialog.close();
1834			$.ajax({
1835				type: 'POST',
1836				data: {'data': result, 'file_name': file_name},
1837				url: ('/admin/contents/form/excel_upload_end.cm'),
1838				dataType: 'html',
1839				async: false,
1840				cache: false,
1841				success: function (html) {
1842					$.cocoaDialog.open({type:'admin',custom_popup:html,width:500,reopen:true});
1843				}
1844			});
1845		}
1846
1847	},
1848};

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.