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 function check_login_status() {
\r
7 var FB_API_KEY = "{{ provider.API_KEY }}";
\r
9 appId:FB_API_KEY, cookie:true,
\r
10 status:true, xfbml:true, oauth:true
\r
12 FB.getLoginStatus(function(response) {
\r
13 if (response.session) {
\r
14 redirect_to_done_page();
\r
16 FB.login(function(response) {
\r
17 if (response.session) {
\r
18 redirect_to_done_page();
\r
20 // user cancelled login
\r
22 }, {perms:'email'});
\r
27 function redirect_to_done_page() {
\r
28 window.location = "{% url auth_provider_done provider=provider.id %}";
\r
31 <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