-
-
Save singalen/df0765852d689963f08c to your computer and use it in GitHub Desktop.
Facebook connect code
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
window.fbAsyncInit = function () { | |
// Attach event handlers for Facebook operations: | |
$('[data-facebook="login"]').click($.proxy(Foobar.Social.Facebook.toggleConnection, Foobar.Social.Facebook)); | |
$('[data-facebook="logout"]').click($.proxy(Foobar.Social.Facebook.toggleConnection, Foobar.Social.Facebook)); | |
// Trigger FB loaded state: | |
$.event.trigger(Foobar.Events.FB_LOADED); | |
FB.init({ | |
appId : window.fbAppId, // App ID | |
// channelUrl : 'http://localhost:8080/channel.html', // Channel File | |
status : true, // check login status | |
cookie : true, // enable cookies to allow the server to access the session | |
xfbml : true // parse XFBML | |
}); | |
// Subscribe to Facebook events: | |
FB.Event.subscribe('auth.statusChange', Foobar.Social.Facebook.onStatusChange); | |
}; | |
// Load the SDK asynchronously: | |
(function(d, s, id) { | |
var js, fjs = d.getElementsByTagName(s)[0]; | |
if (d.getElementById(id)) return; | |
js = d.createElement(s); js.id = id; | |
js.src = "//connect.facebook.net/en_US/all.js"; | |
fjs.parentNode.insertBefore(js, fjs); | |
}(document, 'script', 'facebook-jssdk')); |
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
<div id="social"> | |
<div class="fb-like" data-href="{{ url('fd') }}" data-send="false" | |
data-layout="button_count" data-show-faces="false"></div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment