PageSourceSearch

https://golfearth.co.kr/views/common/js/join.js?v=20211013

js golfearth.co.kr collected 2026-10-02 01:59:46 UTC 10,029 bytes, 347 lines download raw bytes

1var joinObject = {
2
3	email: null,
4	certTimer: {},
5	selecter: {},
6	certCode: null,
7
8	init: function(options)
9	{
10		var _this = this;
11		var settings = $.extend({}, options);
12		this.certTimer = {timer: null, runtime: 0, countOfSmsSending: 0};
13		this.selecter = {
14			certificationWrap: settings.certificationWrap,
15			agreeWrap: settings.agreeWrap,
16			joinWrap: settings.joinWrap,
17			completeWrap: settings.completeWrap,			
18			certNumberInput: settings.certNumberInput,
19			requestButton: settings.requestButton
20		};
21		this.selecter.certNumberInput.keyup(function(){
22			if($(this).val().length == 6){
23				_this.selecter.requestButton.prop("disabled", false).css({'background-color':'#515360'}).html("인증");
24			}
25			else if(!$(this).val() || $(this).val().length == 0){
26				if(_this.certTimer.runtime < 90){
27					_this.selecter.requestButton.html("인증번호 재전송");
28				}
29				else{
30					_this.selecter.requestButton.html("번호 받기").prop("disabled", true).css({'background-color':'#ccc'});
31				}
32			}
33		});
34		this.selecter.requestButton.click(function(){
35			_this.getCertificationCode();
36		});
37		$("#certification_btn").click(function(){
38			_this.chkCertification();
39		});
40		$("#agreement_btn").click(function(){
41			_this.chkAgreement();
42		});
43		/*
44		$("input[name='id']").blur(function(){
45			_this.chkId($(this).val());
46		});
47		*/
48		$("input[name='pw2']").blur(function(){
49			_this.chkPasswd(this.form);
50		});
51		/*
52		this.certNumberInput.focus(function(){
53			if($(this).val() && _this.certTimer.timer){
54				clearTimeout(_this.certTimer.timer);
55			}
56		}).blur(function(){
57			if(!$(this).val()){
58				_this.startTimer();
59			}
60		});
61		*/
62	},
63	chkValidateJoinForm: function(F)
64	{
65		var _this = this;
66		if(!F.name.value){
67			alert('한글이름을 입력해주세요');
68			F.name.focus();
69			return false;
70		}
71		if(!F.email1.value){
72			alert('이메일(ID)을 입력해주세요');
73			F.email1.focus();
74			return false;
75		}
76		if(!F.email2.value){
77			alert('이메일(도메인)을 입력해주세요');
78			F.email2.focus();
79			return false;
80		}
81		/*
82		if(!F.id.value){
83			alert('이메일(ID)을 입력해주세요');
84			F.id.focus();
85			return false;
86		}
87		*/
88		var id = F.email1.value + '@' + F.email2.value;
89		// 이메일 유효성 검사
90		if(!REGEX_OF_EMAIL.test(id)){
91			alert("이메일이 형식이 올바르지 않습니다. 다시 입력해주세요.");
92			F.id.focus();
93			return false;
94		}
95		if(!this.chkId(id)){
96			return false;
97		}
98		if(!F.pw.value){
99			alert('비밀번호를 입력해주세요');
100			F.pw.focus();
101			return false;
102		}
103		if(!F.pw2.value){
104			alert('비밀번호를 다시 입력해주세요');
105			F.pw2.focus();
106			return false;
107		}
108		if(!this.chkPasswd(F)){
109			return false;
110		}
111		if(F.sex.selectedIndex < 1){
112			alert('성별을 선택해주세요');
113			F.sex.focus();
114			return false;
115		}
116		if(F.start_area.selectedIndex < 1){
117			alert('출발지역을 선택해주세요');
118			F.start_area.focus();
119			return false;
120		}
121		if($(".passfort").css("display") != "none"){
122			if(!F.last_name.value){
123				alert('영문이름[성]을 입력해주세요');
124				F.last_name.focus();
125				return false;
126			}
127			if(!F.first_name.value){
128				alert('영문이름을 입력해주세요');
129				F.first_name.focus();
130				return false;
131			}
132			if(!F.birthday.value){
133				alert('생년월일을 입력해주세요');
134				F.birthday.focus();
135				return false;
136			}
137			if(!F.passport_no.value){
138				alert('여권번호를 입력해주세요');
139				F.passport_no.focus();
140				return false;
141			}
142			if(!F.passport_expire_date.value){
143				alert('여권만료일을 입력해주세요');
144				F.passport_expire_date.focus();
145				return false;
146			}
147			if(!F.passport_country.value){
148				alert('국적을 입력해주세요');
149				F.passport_country.focus();
150				return false;
151			}
152			if(!F.passport_issue_country.value){
153				alert('발행국을 입력해주세요');
154				F.passport_issue_country.focus();
155				return false;
156			}
157			if($("input[name='agree1']:checked").val() != "Y"){
158				alert("탑승자 개인정보수집/이용에 동의 하셔야 합니다.");
159				$("input[name='agree1']").focus();
160				return false;
161			}
162			if($("input[name='agree2']:checked").val() != "Y"){
163				alert("탑승자 고유식별정보수집/이용에 동의 하셔야 합니다.");
164				$("input[name='agree2']").focus();
165				return false;
166			}
167		}
168		$("#join_frm").ajaxSubmit({
169			dataType: "JSON",
170			success: function(response){
171				//console.log(response);
172				if(response.result_code == 1){
173					$(".steps").hide();
174					$("#member_name").text(F.name.value + "님");
175					_this.selecter.joinWrap.hide();
176					_this.selecter.completeWrap.show();
177				}
178				else{
179					console.log(response);
180					alert(response.result_message);
181				}
182			}
183		});
184		return false;
185	},
186	getCertificationCode: function()
187	{
188		var _this = this;
189		//인증요청
190		if(this.selecter.certNumberInput.val().length == 6){
191			this.chkCertification();
192		}
193		else{
194			if(this.certTimer.timer){
195				clearTimeout(this.certTimer.timer);
196			}
197			var phoneNumber = $("input[name='phone_number']").val();
198			if(!phoneNumber){
199				alert('휴대폰 번호를 입력해주세요');
200				$("input[name='phone_number']").focus();
201				return;
202			}
203			if(!REGEX_OF_PHONE_NUMBER.test(phoneNumber)){
204				alert('휴대폰 번호가 올바르지 않습니다.');
205				$("input[name='phone_number']").focus();
206				return;
207			}
208			$.ajax({
209				url: "/member/get_cert_code",
210				type: "POST",
211				data: {email: _this.email, handphone: phoneNumber, country_number: $("select[name='phone_country_number'] option:selected").val()},
212				dataType: "JSON",
213				success: function(response){
214					//console.log(response);
215					if(response.result_code == 1){
216						_this.selecter.certNumberInput.prop("disabled", false);
217						_this.selecter.requestButton.prop("disabled", true).css({'background-color':'#ccc'});
218						_this.certCode = response.result_data;
219
220						_this.selecter.certNumberInput.val(response.result_data);	//테스트를 위해 실서버 반영시 주석처리
221
222						_this.certTimer.runtime = 120;
223						_this.certTimer.countOfSmsSending++;
224						_this.startTimer();
225					}
226					else{
227						alert(response.result_message);
228					}
229				},
230				error: function(jqXHR, textError, thrown){
231					console.log(jqXHR, textError, thrown);
232				}
233			});
234		}
235	},
236	startTimer: function()
237	{
238		var _this = this;
239		this.certTimer.timer = setTimeout(function(){
240			var remainMinutes = Math.floor(_this.certTimer.runtime / 60);
241			var remainSeconds = Math.floor(_this.certTimer.runtime - (remainMinutes * 60));
242			var remainString = "(" + remainMinutes + ":" + remainSeconds + ")";
243			if(_this.certTimer.runtime > 0){
244				if(_this.selecter.requestButton.prop("disabled") == true && _this.certTimer.runtime == 90){
245					_this.selecter.requestButton.html("인증번호 재전송");
246					_this.selecter.requestButton.prop("disabled", false).css({'background-color':'#515360'});
247				}
248				_this.selecter.certNumberInput.prop("placeholder", "인증번호를 입력하세요. " + remainString);
249				_this.certTimer.runtime--;
250				_this.startTimer();
251			}
252			else{
253				_this.selecter.certNumberInput.prop("placeholder", "인증번호 받기를 클릭하세요.");
254				_this.selecter.certNumberInput.prop("disabled", true);
255				_this.selecter.certNumberInput.val("");
256				_this.selecter.requestButton.html("인증번호 받기");
257				alert("인증 번호 입력 시간이 초과되었습니다. 다시 인증번호 받기를 클릭하세요.");
258			}
259		}, 1000);
260	},
261	chkCertification: function()
262	{
263		var _this = this;
264		if(this.certCode == null){
265			alert('인증번호가 생성되지 않았습니다. 인증번호 받기를 클릭하세요');
266			this.selectercertNumberInput.focus();
267			return;
268		}
269		if(!this.selecter.certNumberInput.val()){
270			alert('인증번호를 입력해주세요');
271			this.selectercertNumberInput.focus();
272			return;
273		}
274		if(this.certCode == this.selecter.certNumberInput.val()){
275			alert("전화번호 인증이 완료되었습니다.");
276			this.selecter.certificationWrap.hide();
277			this.selecter.agreeWrap.show();
278			$(".steps li").removeClass("on");
279			$(".steps li:eq(1)").addClass("on");
280			clearTimeout(this.certTimer.timer)
281		}
282		else{
283			alert('인증번호가 일치하지 않습니다.');
284			this.selectercertNumberInput.focus();
285		}
286	},
287	chkAgreement: function()
288	{
289		if($("input[name='agreement_terms']:checked").val() != "Y"){
290			alert("이용약관에 동의해주세요.");
291			$("input[name='agreement_terms']").focus();
292			return;
293		}
294		if($("input[name='agreement_private']:checked").val() != "Y"){
295			alert("개인정보취급방침에 동의해주세요.");
296			$("input[name='agreement_private']").focus();
297			return;
298		}
299		this.selecter.agreeWrap.hide();
300		this.selecter.joinWrap.show();
301		$(".steps li").removeClass("on");
302		$(".steps li:eq(2)").addClass("on");
303	},
304	chkId: function(id)
305	{
306		var result = false;
307		if(id){
308			$.ajax({
309				url: "/member/check_id",
310				type: "POST",
311				data: {id: id},
312				//dataType: "JSON",
313				success: function(response){
314					if(response){
315						alert(response);
316					}
317					else{
318						result = true;
319					}
320				},
321				async: false
322			});
323		}
324		return result;
325	},
326	chkPasswd: function(F)
327	{
328		if(F.pw.value && F.pw2.value){
329			if((F.pw.value.length < 6) || (F.pw.value.length > 12)){
330				alert('비밀번호는 6자 ~ 12자 사이로 입력해주세요');
331				F.pw.value = "";
332				F.pw2.value = "";
333				F.pw.focus();
334				return false;
335			}
336			if(F.pw.value != F.pw2.value){
337				alert('비밀번호가 일치하지 않습니다.');
338				F.pw2.value = "";
339				F.pw.focus();
340				F.pw.value = F.pw.value;
341				return false;
342			}
343			return true;
344		}
345		return false;
346	}
347};

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.