Posted to tcl by peterc at Fri Jan 16 14:20:17 GMT 2015view pretty

<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>Blah</title>
</head>
<body>
<script>
  window.fbAsyncInit = function() {
    FB.init({
      appId      : 'XXXXXXXXXXXXXXXXX',
      xfbml      : true,
      version    : 'v2.2'
    });

    // ADD ADDITIONAL FACEBOOK CODE HERE
  };

  (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/sdk.js";
     fjs.parentNode.insertBefore(js, fjs);
   }(document, 'script', 'facebook-jssdk'));

// Place following code after FB.init call.

function onLogin(response) {
  if (response.status == 'connected') {
    FB.api('/me?fields=first_name', function(data) {
      var welcomeBlock = document.getElementById('fb-welcome');
      welcomeBlock.innerHTML = 'Hello, ' + data.first_name + '!';
    });
  }
}

FB.getLoginStatus(function(response) {
  // Check login status on load, and if the user is
  // already logged in, go directly to the welcome message.
  if (response.status == 'connected') {
    onLogin(response);
  } else {
    // Otherwise, show Login dialog first.
    FB.login(function(response) {
      onLogin(response);
    }, {scope: 'user_friends, email'});
  }
});

</script>

<div id="playground"
   style="width: 100%;
   height: 100%;
   min-height: 100%;
   position: absolute;
   left: 0px;
   top: 0px;
   background-color: #dfdfdf;">

   <img src="GreySpinner.gif"
     style="width: 32px;
     height: 32px;
     top: 50%;
     left: 50%;
     position: absolute;
     margin-left: -16px;
     margin-top: -16px;"/>
</div>

<script type="text/javascript" src="script/au_js.js"></script>
</body>
</html>