1 {% load extra_tags %}
\r
3 <div id="fb-root"></div>
\r
4 <script src="http://connect.facebook.net/en_US/all.js"></script>
\r
6 var FB_API_KEY = "{{ provider.API_KEY }}";
\r
8 appId:FB_API_KEY, cookie:true,
\r
9 status:true, xfbml:true
\r
12 function check_login_status() {
\r
13 FB.getLoginStatus(function(response) {
\r
14 if (response.session) {
\r
15 redirect_to_done_page();
\r
17 FB.login(function(response) {
\r
18 if (response.session) {
\r
19 redirect_to_done_page();
\r
21 // user cancelled login
\r
23 }, {perms:'email'});
\r
28 function redirect_to_done_page() {
\r
29 window.location = "{% url auth_provider_done provider=provider.id %}";
\r
32 <a style="position: relative; top: -8px;" href="javascript:void(0);" onclick="check_login_status()" perms="email"><img src="{% media '/media/images/openid/facebook.gif' %}" /></a>
\r