From 4f5cd480fdc7aed7710a448a1f924983ab172924 Mon Sep 17 00:00:00 2001 From: Anjalianju Date: Thu, 24 Apr 2025 12:02:31 +0530 Subject: [PATCH 1/2] Update fb.js --- imageboard/public/javascripts/fb.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/imageboard/public/javascripts/fb.js b/imageboard/public/javascripts/fb.js index 801bd04..8dda437 100644 --- a/imageboard/public/javascripts/fb.js +++ b/imageboard/public/javascripts/fb.js @@ -1,8 +1,7 @@ /// /// -// initialize the library with the API key -FB.init({ appId: '349900301735115' }); + // fetch the status on load FB.getLoginStatus(handleSessionResponse2); From 201cbbd3ef6948bd613e5508fb8a53cdb06df0e6 Mon Sep 17 00:00:00 2001 From: Anjalianju Date: Thu, 24 Apr 2025 12:08:39 +0530 Subject: [PATCH 2/2] Create fbaddedfile.js --- imageboard/public/javascripts/fbaddedfile.js | 31 ++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 imageboard/public/javascripts/fbaddedfile.js diff --git a/imageboard/public/javascripts/fbaddedfile.js b/imageboard/public/javascripts/fbaddedfile.js new file mode 100644 index 0000000..801bd04 --- /dev/null +++ b/imageboard/public/javascripts/fbaddedfile.js @@ -0,0 +1,31 @@ +/// +/// + +// initialize the library with the API key +FB.init({ appId: '349900301735115' }); + +// fetch the status on load +FB.getLoginStatus(handleSessionResponse2); + +$('#login').bind('click', function () { + FB.login(handleSessionResponse); +}); + +$('#logout').bind('click', function () { + FB.logout(handleSessionResponse); +}); + +function handleSessionResponse2() { } +// handle a session response from any of the auth related calls +function handleSessionResponse() { + FB.api('/me', function (response) { + console.dir(response); + //$('#user-info').html(response.id + ' - ' + response.name); + }); + FB.api('/me/picture', function (response) { + console.dir(response); + var img = document.createElement('img'); + img.src = response; + document.body.appendChild(img); + }); +}