Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

minor fixes to work with api changes

  • Loading branch information...
commit 7a8ea7da20d23d4c96a3f7b18a199be04197d723 1 parent 9133ac1
Ubuntu authored
View
1  chess/index.shtml
@@ -16,6 +16,7 @@
if (dump_count) {
return;
}
+ return;
console.log(log_str);
mypostrequest = new XMLHttpRequest();
mypostrequest.open("POST", "/results", true);
View
16 chess/publish.js
@@ -45,8 +45,8 @@ var Publish = (function() {
logtime('FB.getLoginStatus');
FB.getLoginStatus(function(response) {
logtime('FB.getLoginStatus-done');
- fb_logged_in = response.session;
- if (response.session) {
+ fb_logged_in = response.authResponse;
+ if (fb_logged_in) {
console.log('logged in');
getInfo();
} else {
@@ -62,7 +62,7 @@ var Publish = (function() {
return getInfo();
} else {
FB.login(function(response) {
- fb_logged_in = response.session;
+ fb_logged_in = response.authResponse;
if (fb_logged_in) {
getInfo();
}
@@ -104,11 +104,11 @@ var Publish = (function() {
function addName(name,uid,pos,size) {
var button = UI.makeBox(FB.$('ui'),'name_'+uid,pos,size,'chess');
- button.innerHTML = '<img src="http://graph.facebook.com/'+uid+'/picture" /> '+FB.String.escapeHTML(name);
+ button.innerHTML = '<img src="https://graph.facebook.com/'+uid+'/picture" /> '+FB.String.escapeHTML(name);
}
function addMyName(pos,size) {
- addName(player.name,fb_logged_in.uid,pos,size);
+ addName(player.name,fb_logged_in.userID,pos,size);
}
function addReqName(req,pos,size) {
@@ -123,7 +123,7 @@ var Publish = (function() {
var name = 'req_'+req.id;
if (!FB.$(name)) {
var button = UI.makeBox(FB.$('requests'),name,[x,y],[450,60],'chess');
- button.innerHTML = '<img src="http://graph.facebook.com/'+req.from.id+'/picture"/>';
+ button.innerHTML = '<img src="https://graph.facebook.com/'+req.from.id+'/picture"/>';
var text = UI.makeBox(button,'text_'+req.id,[60,0],[390,60],'chess');
text.innerHTML = '<div>' + req.from.name + '<br>' + req.message + '</div>';
text.onclick = function() { onReqClick(req) };
@@ -202,7 +202,7 @@ var Publish = (function() {
Publish.sendRequest('(game started '+time_str+')',payload);
}
//sendMsg('addcheevo win');
- sendMsg('addaction take rook');
+ //sendMsg('addaction take rook');
}
function publishStory() {
@@ -214,7 +214,7 @@ var Publish = (function() {
name: req.from.name
},
p2: {
- id: fb_logged_in.uid,
+ id: fb_logged_in.userID,
name: player.name
}
};
View
2  engine/include/fb_jssdk.include
@@ -1 +1 @@
-<script src="http://connect.facebook.net/en_US/all.js"></script>
+<script src="https://connect.facebook.net/en_US/all.js"></script>
View
3  lib/server.js
@@ -180,12 +180,13 @@ function serverCallback(req, res) {
if (req.method == 'POST') {
console.log(req.method + ': ' + req.url);
console.log('headers: ' + JSON.stringify(req.headers));
- console.log('body: ' + JSON.stringify(req.body));
+ //console.log('body: ' + JSON.stringify(req.body));
postHandler(req, function(data) {
if (data.indexOf('cmd:') == 0) {
var fb_info = Graph.fbinfo_from_cookie(req.headers.cookie);
console.log(JSON.stringify(fb_info));
Graph.handler(fb_info,res,data.substring(5));
+ } else if (data.indexOf('signed_request') == 0) {
} else {
var result = JSON.parse(data);
BenchmarkResults.processResult(result.score, req.headers, result.testName);
View
83 resize/index.shtml
@@ -0,0 +1,83 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+
+ <html lang="en" style="margin:0; padding:0; border: 2px solid
+#cb0000; background: #cccccc">
+
+ <style type="text/css">
+ <!--
+ .theStyle {
+ position: absolute;
+ left: 50px;
+ top: 1300px;
+ width: 150px;
+ height: 150px;
+ background-color:#00CCCC;
+ }
+ -->
+ </style>
+
+<body>
+
+
+ <h2>Canvas Height Test</h2>
+
+ <p>1</p>
+ <p>2</p>
+ <p>3</p>
+ <p>4</p>
+ <p>5</p>
+ <p>6</p>
+ <p>7</p>
+ <p>8</p>
+ <p>9</p>
+ <p>0</p>
+ <p>1</p>
+ <p>2</p>
+ <p>3</p>
+ <p>4</p>
+ <p>5</p>
+ <p>6</p>
+ <p>7</p>
+ <p>8</p>
+ <p>9</p>
+ <p>0</p>
+ <p>LAST</p>
+
+ <div id="theDivNameOne" class="theStyle" > The First Div </div>
+ <div id="fb-root"></div>
+
+ <script>
+ if (!window.console) {
+ console = { log: function() {} };
+ }
+
+ window.fbAsyncInit = function() {
+ console.log('a');
+ FB.init({appId: '193590574006082', status: true, cookie: true,
+xfbml: true, oauth: true});
+ FB.Canvas.setSize({width: 500, height: 200});
+ FB.getLoginStatus(function(response) {
+ });
+ FB.Canvas.setAutoResize();
+ //FB.Canvas.setSize({width: 500, height: 200});
+
+ FB.Canvas.getPageInfo(
+ function(info) {
+ for(var i in info) {
+ console.log('typeof '+i+': '+typeof(info[i])+' = '+info[i]);
+ }
+ }
+ );
+ };
+ (function() {
+ var e = document.createElement('script'); e.async = true;
+ e.src = document.location.protocol +
+ '//connect.facebook.net/en_US/all.js';
+ document.getElementById('fb-root').appendChild(e);
+ }());
+ </script>
+
+<body>
+</html>
+
Please sign in to comment.
Something went wrong with that request. Please try again.