Permalink
Browse files

clean up login/logout

  • Loading branch information...
1 parent 72f307c commit d3967913f712ce2935dd13d0b712f0a8824b78db Charmaigne Lu committed May 5, 2012
Showing with 22 additions and 1 deletion.
  1. +8 −0 html/client.html
  2. +5 −0 html/css/client.css
  3. +9 −1 html/login.html
View
@@ -32,6 +32,14 @@
</head>
<body>
+ <div id="user-info"></div>
+ <script>
+ function updateUserInfo(response) {
+ FB.api('/me', function(response) {
+ document.getElementById('user-info').innerHTML = '<img src="https://graph.facebook.com/' + response.id + '/picture">' + response.name;
+ });
+ }
+ </script>
<canvas id="component" width="400" height="600" style="border: 1px solid silver;"></canvas>
</body>
View
@@ -53,3 +53,8 @@ h2 {
display: none;
margin: 20px 0 0;
}
+
+body.connected #login { display: none; }
+body.connected #logout { display: block; }
+body.not_connected #login { display: block; }
+body.not_connected #logout { display: none; }
View
@@ -17,7 +17,7 @@
<script src="js/libs/modernizr-2.5.3.min.js"></script>
</head>
-<body>
+<body class="not_connected">
<header>
<h2>Who Can Draw the Best Body Part?</h2>
<h1>DooDoll - Client</h1>
@@ -62,6 +62,14 @@
FB.login(function(response) { }, {scope:'email'});
}
</script>
+ <script>
+ function updateUserInfo(response) {
+ FB.api('/me', function(response) {
+ document.getElementById('user-info').innerHTML = '<img src="https://graph.facebook.com/' + response.id + '/picture">' + response.name;
+ });
+ }
+ </script>
+<div id="user-info"></div>
<div role="main" id="main">
<div id="login">
<p><button onClick="loginUser();">Login</button></p>

0 comments on commit d396791

Please sign in to comment.