Skip to content

Commit

Permalink
change redirect url to reflect new directory structure
Browse files Browse the repository at this point in the history
  • Loading branch information
vjsingh committed Oct 13, 2011
1 parent 687f0c3 commit f5521bc
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions fb/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<head>
<title>Virion</title>
<style>
body {
body {
background: white;
color: black;
font-family: Arial, sans-serif;
Expand All @@ -10,31 +10,31 @@
</head>

<body>
<!-- Facebook Integration
<!-- Facebook Integration
All of this is just to set g_user_id and g_user_name
-->
<!-- This initialized the SDK so we can use it -->
<div id="fb-root"></div>
<script src="http://connect.facebook.net/en_US/all.js">
</script>
<script>
FB.init({
appId:179028108782663, cookie:true,
status:true, xfbml:true
FB.init({
appId:179028108782663, cookie:true,
status:true, xfbml:true
});
// Reload when user logs in (like with the fb login button)
FB.Event.subscribe('auth.login', function(response) {
window.location.reload();
});
</script>
</script>


<script>
// If user is already logged in, then refresh to get
// the auth token
if(window.location.hash.length == 0)
{
var real_index = "http://virus-game.cs.brown.edu/fb/index1.html";
var real_index = "http://virus-game.cs.brown.edu/game/fb/index1.html";
var url = "https://www.facebook.com/dialog/oauth?client_id= \
179028108782663&redirect_uri=" + real_index + //window.location + "1"+
"&response_type=token";
Expand All @@ -53,17 +53,17 @@

} else { // access token in URL
accessToken = window.location.hash.substring(1);

// Only update if hash is from facebook
//console.log(accessToken.indexOf('access_token'));
if (accessToken.indexOf('access_token') !== -1) {
graphUrl = "https://graph.facebook.com/me?" + accessToken +
"&callback=got_user"

//use JSON-P to call the graph
var script = document.createElement("script");
script.src = graphUrl;
document.body.appendChild(script);
document.body.appendChild(script);
}
}

Expand All @@ -75,17 +75,17 @@
function got_user(user) {
//userName.innerText = user.name;
//console.log("user id: " + user.id);

// Error checking, only update if it went correctly
if (user.id) {
//Global vars for Unique User ID and name

//Global vars for Unique User ID and name
g_user_id = user.id;
g_user_name = user.name;

// do scores after setting name and id
//scores.do_scores();

// Display name
/*
console.log("Adding name");
Expand Down

0 comments on commit f5521bc

Please sign in to comment.