PageSourceSearch

https://2bob.co.kr/include/js/facebook.js

js 2bob.co.kr collected 2026-10-09 04:37:37 UTC 4,532 bytes, 131 lines download raw bytes

1window.fbAsyncInit = function() {
2	  FB.init({
3		appId      : '1881060105505187',
4		cookie     : true,  // 쿠키가 세션을 참조할 수 있도록 허용
5		xfbml      : true,  // 소셜 플러그인이 있으면 처리
6		version    : 'v2.2' // 버전 2.1 사용
7	  });
8  };
9
10  // SDK를 비동기적으로 호출
11  (function(d, s, id) {
12    var js, fjs = d.getElementsByTagName(s)[0];
13    if (d.getElementById(id)) return;
14    js = d.createElement(s); js.id = id;
15    js.src = "//connect.facebook.net/en_US/sdk.js";
16    fjs.parentNode.insertBefore(js, fjs);
17  }(document, 'script', 'facebook-jssdk'));
18
19 var accessToken = '';
20   $("#fbLogin").click(function(){
21	   FB.getLoginStatus(function(response) {
22			if (response.status === 'connected') {
23				var uid = response.authResponse.userID;
24				accessToken = response.authResponse.accessToken;
25				document.cookie = "access_token="+accessToken;
26			} else if (response.status === 'not_authorized') {
27				// the user is logged in to Facebook,
28				// but has not authenticated your app
29			} else {
30				// the user isn't logged in to Facebook.
31			}
32
33			FB.login(function(response) {
34				if (response.status === 'connected') {
35					// 페이스북과 앱에 같이 로그인되어 있다.
36					FB.api('/me', function(response1) {
37						var data = response1;
38						FB.api("/"+data.id+"/picture", function (response2) {
39							if (response2 && !response2.error) {
40								data.profile = response2.data.url;
41								data.access_token = accessToken;
42							}
43
44							$.ajax({
45								type: "POST",
46								url: "/snsLoginChk.php?just_login=1",
47								data: data,
48								success: function(data){
49									if(data!="login" && data !="join")
50										alert(data);
51									else if(data=="login"){
52										if(location.href.match('a=order')){
53											$("#login_form").submit();
54											return false;
55										}
56										var returl = $("input[name=returl]").val();
57										if(returl) _href = returl;
58										else if(href.match('shop_login')) _href='/shop.php';
59										else if(href.match('login') || href.match('join')) _href='/';
60										else _href = href;
61										location.href= _href;
62									}
63								}
64							});
65
66						});
67					 });
68				} else if (response.status === 'not_authorized') {
69					// 페이스북에는 로그인 되어있으나, 앱에는 로그인 되어있지 않다.
70					alert("앱 권한 없음");
71				} else {
72					// 페이스북에 로그인이 되어있지 않아서, 앱에 로그인 되어있는지 불명확하다.
73					alert("로그인 안되어 있음");
74				}
75			},{scope: 'email'});
76	   })
77  });
78
79  $("#fbJoin").click(function(){
80	  FB.login(function(response) {
81		  if (response.status === 'connected') {
82			// 페이스북과 앱에 같이 로그인되어 있다.
83			FB.api('/me', function(response1) {
84				var data = response1;
85				FB.api("/"+data.id+"/picture", function (response2) {
86					if (response2 && !response2.error) {
87						data.profile = response2.data.url;
88						data.access_token = accessToken;
89					}
90
91					$.ajax({
92						type: "POST",
93						url: "/snsLoginChk.php",
94						data: data,
95						success: function(data){
96							if(data!="login" && data !="join")
97								alert(data);
98							else if(data=="join"){
99								var _href = location.href;
100								if(_href.match('a=order')){
101									$("#login_form").submit();
102									return false;
103								}
104								if(_href.match('shop_login')) location.href='/shop.php';
105								else if(_href.match('login') || _href.match('join')) _href='/';
106								location.href=_href;
107								//document.joinForm.action="mypage.php?a=info_step2";
108								//$("input[name=mType]").val("fb");
109								//document.joinForm.submit();
110							}
111						}
112					});
113
114				});
115			 });
116		  } else if (response.status === 'not_authorized') {
117			// 페이스북에는 로그인 되어있으나, 앱에는 로그인 되어있지 않다.
118			alert("앱 권한 없음");
119		  } else {
120			// 페이스북에 로그인이 되어있지 않아서, 앱에 로그인 되어있는지 불명확하다.
121			alert("페이스북으로 로그인 시 하단 확인 버튼을 눌러주세요");
122		  }
123		},{scope: 'email'});
124  });
125  /*
126  $("#nvJoin, #nvLogin").click(function(){
127	  var nvState = $("input[name=nvState]").val();
128	  var url = "https://nid.naver.com/oauth2.0/authorize?client_id=FZ4lF9UkbshMPGzESmVi&response_type=code&redirect_uri=http://2bab.designod.co.kr/snsLoginChk.naver.php&state="+nvState;
129	  window.open(url, '네이버 로그인', 'width=400, height=600, menubar=no, status=no, toolbar=no');
130	});
131	*/

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.