PageSourceSearch

https://fyndignews.com/_helpers/_js/netfu_util.class.js?time=1791257573

js fyndignews.com collected 2026-10-06 03:33:34 UTC 18,458 bytes, 638 lines download raw bytes

1var netfu_util = function() {
2
3	this.page_check = location.href.indexOf("/m/")>=0 ? 'mobile' : 'pc';
4
5	this.all_check = function(el, c) {
6		if(el.type=='checkbox') {
7			is = el.checked;
8		} else {
9			is = $(".all_chk")[0].checked;
10			is = is ? false : true;
11		}
12
13		$(".all_chk").prop("checked", is);
14		
15		$(c).prop("checked", is);
16	}
17
18	this.agree_chk = function(fname, name_arr) {
19		var form = document.forms[fname];
20		var len = name_arr.length;
21		if(len>0) {
22			for(var i=0; i<len; i++) {
23				var chk = $(form).find("[name='"+name_arr[i]+"']:checked").length;
24				if(chk<=0) return name_arr[i];
25			}
26		}
27		return false;
28	}
29
30	this.put_text = function(el, obj) {
31		obj.val(el.value);
32	};
33
34	this.email_select = function(el, name) {
35		$(el).closest("td").find("[name='"+name+"']").eq(1).val(el.value);
36	}
37
38
39	this.login_submit = function(form) {
40		netfu_util.ajax_submit(form);
41		return true;
42	}
43
44
45	this.ajax_cate = function(el, type, key, read_type) {
46		var obj = $(el.form).find("[name='"+el.name+"']");
47		var _put = $(el).attr("put");
48		var put_obj = _put ? $("#"+_put) : obj.eq(key);
49		var val = $(el).attr("val");
50		var _this = $(el).attr("this");
51		var _no = read_type!='auto' ? el.value : (el.value ? el.value : _this);
52
53		var _html = '<option value="">'+put_obj.find("option").eq(0).html()+'</option>';
54
55		if(!el.value && !read_type) {
56			put_obj.html(_html);
57		} else {
58			if(_no) {
59				$.post("/include/regist.php", "mode=get_cate_array&type="+type+"&no="+_no, function(data){
60					data = $.parseJSON(data);
61					var len = data.cate.length;
62					if($(put_obj).closest(".third_section")[0]) {
63						var _display = len>0 ? 'inline' : 'none';
64						$(".third_section").css("display",_display);
65					}
66					put_obj.html('');
67					for(var i=0; i<len; i++) {
68						var selected = val==data.cate[i]['wr_code'] && val ? 'selected' : '';
69						_html += '<option value="'+data.cate[i]['wr_code']+'" '+selected+'>'+data.cate[i]['wr_name']+'</option>';
70					}
71					put_obj.html(_html);
72				});
73			}
74		}
75	}
76
77
78	this.ajax_submit = function(el, noneObj) {
79		var form = el;
80		if(validate(form)) {
81			$(form).ajaxSubmit({
82				//보내기전 validation check가 필요할경우
83				beforeSubmit: function (data, frm, opt) {
84					//alert("전송전!!");
85					return true;
86				},
87				//submit이후의 처리
88				success: function(data, statusText) {
89					//alert(data);
90					data = $.parseJSON(data);
91					if(data.msg) alert(data.msg);
92					if(data.js) eval(data.js);
93					if(data.move) location.href = data.move;
94					if(noneObj) noneObj.css('display', 'none');
95					return false;
96				},
97				//ajax error
98				error: function(data,status,error){
99					alert("에러발생!!");
100					return false;
101				}
102			});
103		}
104		return false;
105	}
106
107
108	this.calendar_sels = function(){
109		$('#calendar_sel').datepicker({
110			dateFormat: 'yy-mm-dd',
111			maxDate: '+0d',
112			onSelect: function(dateText, inst) {
113				var date = $(this).val();
114				location.href = "./all.php?date=" + date;
115				/*
116				var time = $('#time').val();
117				alert('on select triggered');
118				$("#start").val(date + time.toString(' HH:mm').toString());
119				*/
120			}
121		});
122	}
123
124	/* : 쿠키 저장하기*/
125	this.setCookie = function( name, value, expiredays )
126	{
127		var todayDate = new Date();
128		todayDate.setDate(todayDate.getDate() + expiredays);
129		document.cookie = name + '=' + escape( value ) + '; path=/; expires=' + todayDate.toGMTString() + ';'
130	};
131	this.getCookie = function(name) {
132		var value = document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)');
133		return value? value[2] : null;
134	};
135
136	this.scaleFont = function (val, c) {
137		var fontSize = getFontSize();
138		var fontSizeSave = fontSize;
139		if (val > 0) {
140			if (fontSize <= 30) {
141				fontSize = fontSize + val; 
142			}
143		} else {
144			if (fontSize > 14) {
145				fontSize = fontSize + val; 
146			}
147		}
148		fontSize = fontSize + "px";
149		$(c).css({'font-size':fontSize});
150
151		//$(c).css('fontSize',fontSize);
152		set_cookies("ck_fontsize", fontSize, 30, domain);
153	}
154
155
156	this.password_reset_form = function(el, c) {
157		var form = $(el).closest("form")[0];
158		$(c).css({"display":"none"});
159		form.reset();
160	}
161
162	this.password_click = function(el, bo_table, no, code, c) {
163		var form = document.forms['fpassword'];
164		form.no.value = no;
165		form.code.value = code;
166		form.bo_table.value = bo_table;
167
168		$.post("/include/regist.php", "mode=get_token", function(data){
169			data = $.parseJSON(data);
170			form.token.value = data.token;
171
172			$(el).closest(c).css('position','relative');
173			$(".password_div__").css({"display":"block"});
174			$(".password_div__").parent().appendTo($(el).closest(c));
175
176			if(c=='.btn_board1_')  $(".password_div__").css({"top":"40px", "left"
176:"0px", "right":"auto"});
177			if(location.href.indexOf("/m/")>=0) $(".password_div__").css({"top":"50px"});
178			if(c=='.reply_con_list_') {
179				if(location.href.indexOf("/m/")>=0) $(".password_div__").css({"top":"95px", "left":"5px"});
180				else $(".password_div__").css({"top":"50px", "right":"5px"});
181			}
182			if(c=='.info_tag_') $(".password_div__").css({"top":"5px", "left":"30px"});
183
184			$(".password_div__").addClass("on");
185			form.password.focus();
186		});
187	}
188
189	this.password_click_confirm = function(el) {
190
191		if(validate(el)) {
192			var _para = $(el).serialize();
193			$.post("/include/regist.php", _para+"&mode=password_confirm", function(data){
194				data = $.parseJSON(data);
195				if(data.msg) alert(data.msg);
196				if(data.js) eval(data.js);
197				if(data.move) location.href = data.move;
198			});
199		}
200
201		return false;
202	}
203
204
205	this.search_page_rows = function(el, fname) {
206		var form = document.forms[fname];
207
208		form.submit();
209	}
210
211
212
213
214	this.mb_id_checking = function(fname){
215		var form = document.forms[fname];
216		var mb_id = form.mb_id.value;
217		if( mb_id.trim() ){
218			$('#duplicate_id_check').val(1);
219			$.post('/member/process/regist.php', { mode:'mb_id_check', ajax:1, mb_id:mb_id }, function(result){
220				if(result=='0007'){
221					$('#is_duplicate_id').val(1);
222					alert("이미 존재하는 아이디 입니다!");
223					form.mb_id.value = "";
224				} else if(result=='0003'){
225					$('#is_duplicate_id').val(0);
226					alert("사용 가능한 아이디 입니다.");
227				}
228			});
229		} else {
230			$('#duplicate_id_check').val(0);
231			$('#is_duplicate_id').val(1);
232			alert("아이디를 입력해 주세요.");
233			form.mb_id.focus();
234			return false;
235		}
236	}
237
238	this.mb_nick_checking = function(fname){
239		var form = document.forms[fname];
240		var mb_nick = form.mb_nick.value;
241		if( mb_nick.trim() ){
242			$('#duplicate_nick_check').val(1);
243			$.post('/member/process/regist.php', { mode:'mb_nick_check', ajax:1, mb_nick:mb_nick }, function(result){
244				if(result=='0010'){
245					$('#is_duplicate_nick').val(1);
246					$('#duplicate_nick_check').val(0);
247					alert("닉네임에 공백이 존재합니다.\n\n공백없이 입력해 주세요.");
248				} else if(result=='0011'){
249					$('#is_duplicate_nick').val(1);
250					alert("이미 존재하는 닉네임 입니다!");
251					if(location.href.indexOf('mypage/update_form.php')==-1) form.mb_nick.value = "";
252				} else if(result=='0004'){
253					$('#is_duplicate_nick').val(0);
254					alert("사용 가능한 닉네임 입니다.");
255				}
256			});
257		} else {
258			$('#duplicate_nick_check').val(0);
259			$('#is_duplicate_nick').val(1);
260			alert("닉네임을 입력해 주세요.");
261			form.mb_nick.focus();
262			return false;
263		}
264	}
265
266
267	this.find_id = function(){	// 아이디 찾기
268		var form = document.forms['f_findid'];
269		if( $('#find_id_use').length ){
270			var use_sel = $('#find_id_use').val();
271		} else {
272			var use_sel = $("input[name='find_id_use']:checked").val();
273		}
274		if(validate(form)) {
275			var find_name = $('#find_id_name').val(), find_email = $('#find_id_email').val();
276			$.post('/member/process/regist.php', { mode:'find_id', find_type:use_sel, find_name:find_name, find_email:find_email }, function(result){
277				if( result=='0026' ){
278					alert("가입된 회원정보를 찾을 수 없습니다.");
279				} else {
280					alert("문의하신 아이디가 ["+find_email+"] 로 전송되었습니다.");
281					form.reset();
282				}
283			});
284		}
285	}
286	this.find_pass = function(){	// 비밀번호 찾기
287		var form = document.forms['f_findpw'];
288		if( $('#find_pass_use').length ){
289			var use_sel = $('#find_pass_use').val();
290		} else {
291			var use_sel = $("input[name='find_pass_use']:checked").val();
292		}
293		if(validate(form)) {
294			var find_name = $('#find_pass_name').val(), find_id = $('#find_pass_id').val(), find_email = $('#find_pass_email').val();
295			$.post('/member/process/regist.php', { mode:'find_pass', find_type:use_sel, find_name:find_name, find_id:find_id, find_email:find_email }, function(result){
296				if(result=='0026'){
297					alert("가입된 회원정보를 찾을 수 없습니다.");
298				} else {
299					alert("문의하신 비밀번호가 ["+find_email+"] 로 전송되었습니다.");
300					form.reset();
301				}
302			});
303		}
304	}
305
306
307	this.date_calc = function(date, sel_date) {
308		var ch_date = new Date(date);
309		var sel_date_arr = sel_date.split(" ");
310		switch(sel_date_arr[1]) {
311			case "day":
312				ch_date.setDate(ch_date.getDate()-sel_date[0]);
313				break;
314
315			case "month":
316				ch_date.setDate(ch_date.getMonth()-sel_date[0]);
317				break;
318
319			case "year":
320				ch_date.setDate(ch_date.getFullYear()-sel_date[0]);
321				break;
322		}
323		return ch_date.getFullYear()+'-'+('0'+(ch_date.getMonth() + 1)).slice(-2)+'-'+('0'+ch_date.getDate()).slice(-2);
324	}
325
326
327	this.put_date = function(el) {
328		var sel_date = $(el).attr('date');
329		var d_start = $(el).attr("d_start");
330		var d_end = $(el).attr("d_end");
331
332		var todate = new Date();
333		var day_txt = todate.getFullYear()+'-'+('0'+(todate.getMonth() + 1)).slice(-2)+'-'+('0'+todate.getDate()).slice(-2);
334
335		switch(sel_date) {
336			case 'today':
337				$('#'+d_start).val(day_txt);
338				$('#'+d_end).val(day_txt);
339				break;
340
341			default:
342				var ch_date = netfu_util.date_calc(day_txt, sel_date);
343				$('#'+d_start).datepicker('setDate', '-'+sel_date);
344				$('#'+d_end).val(day_txt);
345				break;
346		}
347	}
348
349
350	this.editor_start = function() {
351		$("textarea").each(function(){
352			var _type = $(this).attr("type");
353			if(_type=='editor') {
354				var _name = $(this).attr("name");
355				var _width = $(this).css("width");
356				var _height = $(this).css("height");
357				if(!$(this).attr("id")) $(this).attr("id", "tx_"+_name);
358				try{
359					_editor_use[_name] = new cheditor('ed_'+_name);
360					_editor_use[_name].config.editorHeight = _height ? _height : '250px';
361					_editor_use[_name].config.editorWidth = _width ? _width : '100%';
362					_editor_use[_name].inputForm = 'tx_'+_name;
363					_editor_use[_name].run();
364				}catch(e){
365					alert(e.message);
366				}
367			}
368		});
369	}
370
371
372	this.tr_open = function(el, k) {
373		var display = $(el).closest("tbody").find("tr").eq(k).css("display");
374		display = display=='none' ? 'table-row' : 'none';
375		$(el).closest("tbody").find("tr").eq(k).css({"display":display});
376	}
377
378
379	this.view_photo = function(el) {
380	}
381
382
383
384	this.share_sns = function(el, code) {
385
386		var _subject = $(el).attr("txt_");
387		var _link = location.href;
388
389		switch(code) {
390			case "kakao_story":
391				Kakao.Story.share({
392					url: _link
393				});
394				break;
395
396
397			case "facebook":
398				window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(_link),'sharer','toolbar=0,status=0,width=626,height=436');
399				break;
400
401
402			case "twitter":
403				var url   = "http://twitter.com/share?text="+encodeURIComponent(_subject)+"&url="+escape(_link); 
404				window.open(url);
405				break;
406
407
408			case "google":
409				var url = "https://www.google.co.kr/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=&url=https://plus.google.com/share?url="+_link;
410				window.open(url);
411				break;
412
413
414			case "naver_band":
415				window.open('http://band.us/plugin/share?body='+encodeURIComponent(_subject+" - "+_link)+'&route='+encodeURIComponent(url), 'share_band', 'width=410, height=540, resizable=no');
416				break;
417
418			case "naver_blog":
419				var url = encodeURI(encodeURIComponent(_link));
420				var title = encodeURI(_subject);
421				var shareURL = "https://share.naver.com/web/shareView?url=" + url + "&title=" + title;
422				window.open(shareURL);
423				break;
424		}
425	}
426
427
428
429	this.share_btn_gp_click = function() {
430		var display = $(".share_btn_gp").css("display")=='none' ? 'block' : 'none';
431		$(".share_btn_gp").css("display", display);
432	}
433
434
435	this.get_date = function(val) {
436
437		var val_arr = val.split(" ");
438		val_arr[0] = parseInt(val_arr[0]);
439		if(val_arr[1]=='week') {
440			val_arr[0] = val_arr[0]*7;
441			val_arr[1] = 'day';
442		}
443
444		// : 오늘날짜
445		var today = new Date();
446		var today_dd = (today.getDate()+1 < 10) ? '0' + (today.getDate()+1) : today.getDate()+1;
447		var today_mm = (today.getMonth()+1 < 10) ? '0' + (today.getMonth()+1) : today.getMonth()+1;
448
449		var yy = today.getFullYear();
450		var mm = today.getMonth();
451		var dd = today.getDate();
452		if(val_arr[1]=='year') yy = yy - val_arr[0];
453		if(val_arr[1]=='month') mm = mm - val_arr[0];
454		if(val_arr[1]=='day') dd = dd - val_arr[0];
455
456		// : 클릭날짜
457		var prev_day = new Date(yy, mm, dd);
458		var prev_mm = (prev_day.getMonth()+1 < 10) ? '0' + (prev_day.getMonth()+1) : prev_day.getMonth()+1;
459		var prev_dd = (prev_day.getDate() < 10) ? '0' + (prev_day.getDate()+1) : prev_day.getDate()+1;
460
461		// : ê²°ê³¼
462		var day1 = prev_day.getFullYear()+'-'+(prev_mm)+'-'+prev_dd;
463		var day2 = today.getFullYear()+'-'+(today_mm)+'-'+today_dd;
464
465		return [day1, day2];
466	}
467
468	this.add_tag_func = function(el) {
469		var txt = $(el).text();
470		switch(txt) {
471			case "추가":
472				var tag = $(el).parent().eq(0).clone(true).wrapAll("<div/>").parent();
473				tag.find("input").val("");
474				tag = tag.html();
475				tag = tag.replace(/추가/gi, '삭제');
476				$(el).closest(".paste_tag_").append(tag);
477			break;
478
479			default:
480				if(confirm("삭제하시겠습니까?"))
481					$(el).parent().remove();
482			break;
483		}
484	}
485
486
487
488
489
490
491
492
493
494
495
496
497
498/*############## 설문조사 ###############*/
499	this.poll_result = function(el) {
500		$.post("/include/regist.php", "mode=poll_result", function(data){
501			data = $.parseJSON(data);
502			if(data.js) eval(data.js);
503		});
504	}
505
506	this.poll_position = function(el) {
507		var _offset = $(el).closest(".poll_select_").offset();
508		var _width = $(".poll_result_view").width();
509		$(".poll_result_view").css({'top':_offset.top, 'left':(_offset.left-_width-30)+'px'});
510	}
511
512	this.poll_insert = function( el, no ){
513		var poll_answer = $("input[name='wr_answer']:checked").val();
514		if(!poll_answer) {
515			alert("설문조사를 선택해주시기 바랍니다.");
516		} else {
517			$.post('/include/process/poll.php', { mode:'poll_insert', no:no, answer:poll_answer }, function(result){
518				switch(result){
519					case '0085':	// 회원만 투표 가능합니다.
520						alert("회원만 투표 가능합니다.");
521						location.href = "/member/login.php?url="+location.href;
522						return false;
523					break;
524					case '0086':	// 이미 투표하셨습니다.
525						alert("이미 투표하셨습니다.");
526						return false;
527					break;
528					default:
529						if(confirm("투표가 완료 되었습니다.\n결과를 확인하시겠습니까?")) {
530							netfu_util.poll_result(el);
531						}
532						return false;
533					break;
534				}
535				$('#poll_quest_info').show();
536			});
537		}
538	}
539
540	this.poll_questionAnswer = function(answer, mode, no, sels){	 // 질의 응답
540에 따른 처리
541		if(answer=='yes'){
542			switch(mode){
543				// 비회원일때 로그인 페이지로 이동
544				case 'member_login':
545					location.href = document.domain+"/member/login.php?url="+location.href;
546				break;
547				// 투표 결과 확인
548				case 'poll_view':
549					$.unblockUI();
550					$('#poll_info').load('/include/process/poll.php', { mode:'poll_view', no:no }, function(result){
551						$('#poll_info').show();
552					});
553				break;
554			}
555		} else {
556			$.unblockUI();
557		}
558	}
559/*############## 설문조사 ###############*/
560
561	this.copyToClipboard = function(val, al) {
562		var t = document.createElement("textarea");
563		document.body.appendChild(t);
564		t.value = val;
565		t.select();
566		document.execCommand('copy');
567		document.body.removeChild(t);
568		if(al) alert(al);
569	}
570
571}
572
573
574var netfu_util = new netfu_util();
575
576
577
578
579var date_val = new Date();
580var datepicker_json = {
581	dateFormat: "yy-mm-dd",    /* 날짜 포맷 */ 
582	prevText: '이전달',
583	nextText: '다음달',
584	showButtonPanel: true,    /* 버튼 패널 사용 */ 
585	changeMonth: true,        /* 월 선택박스 사용 */ 
586	changeYear: true,        /* 년 선택박스 사용 */ 
587	showOtherMonths: false,    /* 이전/다음 달 일수 보이기 */ 
588	selectOtherMonths: true,    /* 이전/다음 달 일 선택하기 */ 
589	yearSuffix: '년',
590	closeText: '닫기', 
591	currentText: '오늘', 
592	showMonthAfterYear: true,        /* 년과 달의 위치 바꾸기 */ 
593	/* 한글화 */ 
594	monthNames : ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], 
595	monthNamesShort : ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'], 
596	dayNames : ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일'],
597	dayNamesShort : ['일', '월', '화', '수', '목', '금', '토'],
598	dayNamesMin : ['일', '월', '화', '수', '목', '금', '토'],
599	weekHeader: 'Wk',
600	yearRange :"-100:+0",
601	firstDay: 0,
602	isRTL: false,
603	showAnim: 'slideDown',
604	onSelect:function(dateText, inst){
605	}
606};
607
608
609
610var _editor_use = {};
611
612$(window).ready(function() {
613
614	if(location.href.indexOf("/m/page/view.php")>=0) {
615		
616		$(".news_body").find("iframe").css({"max-width":($( window ).width()-30)+"px"});
617		$(".news_body").find("img").css({"max-width":($( window ).width()-30)+"px"});
618
619	}
620
621	netfu_util.editor_start();
622
623	// : 날짜
624	$( ".datepicker_inp" ).datepicker(datepicker_json).keyup(function(e) {
625		if(e.keyCode == 8 || e.keyCode == 46) {
626			$.datepicker._clearDate(this);
627		}
628	});
629	
630
631	
632	$('.set_day').click(function() {
633		$(this).closest("ol").find("button").removeClass("on");
634		$(this).parent().addClass("on");
635		netfu_util.put_date($(this)[0]);
636	});
637
638});

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.