Created
January 30, 2013 17:56
-
-
Save dhigginbotham/4675163 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _s | |
, FacebookConnect = { | |
settings: { | |
status: null, | |
login: $('#facebook-auth') | |
}, | |
init: function() { | |
_s = this.settings; | |
this.bindUI(); | |
}, | |
bindUI: function() { | |
_s.login.live('click', function() { | |
FacebookConnect.getLoginStatus(); | |
}); | |
}, | |
getLoginStatus: function() { | |
FB.getLoginStatus(function(response) { | |
if (response.status === 'connected') { | |
// the user is logged in and has authenticated | |
console.log('User is connected'); | |
} else if (response.status === 'not_authorized') { | |
console.log('User is not connected'); | |
// the user is logged in to Facebook, | |
// but has not authenticated your app | |
} else { | |
console.log('User is not logged into Facebook'); | |
// the user isn't logged in to Facebook. | |
} | |
}); | |
} | |
}; | |
//fireworks! | |
(function() { | |
FacebookConnect.init(); | |
// console.log(FB.getAccessToken()); | |
})(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment