Giter Site home page Giter Site logo

codersgrave / facebook-friend-selector Goto Github PK

View Code? Open in Web Editor NEW
64.0 64.0 23.0 381 KB

This repo is no longer maintained. Feel free to fork and update!

Home Page: http://facebook-friend-selector.codersgrave.com

CSS 35.77% HTML 32.96% JavaScript 31.27%

facebook-friend-selector's People

Contributors

ikarius6 avatar onder-yuce avatar pnm1231 avatar sevilyilmaz avatar smilli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

facebook-friend-selector's Issues

Uncaught TypeError: Object #<Object> has no method 'onPreStart'

I have copied all the files on my server. When i click on the link to open friend selector window I get following error message:

Uncaught TypeError: Object # has no method 'onPreStart' jquery.friend.selector-1.2.1.js:27

Could you please let me know whats wrong here?

The dialog box remains hidden

Hi,
Thanks a lot for this plugin who seem ideal for my current needs.
The only problem I have is that I can't figure how to display the dialog box.
The data is fetched and everything but I can't see nothing on screen except a little gray circle.
The panel doesn't extend or anything. :(

Any idea what could be wrong?

include groups as well as friends

Here is some code that will add groups to the selection list. The app needs to request 'user_group' permission.


_getFacebookFriend = function () {

    $('#fs-user-list').append('<div id="fs-loading"></div>');

    // start of group changes

    //FB.api("/me/groups", function(response){
    FB.api('/', 'POST', {
        batch: [
            { method: 'GET', relative_url: 'me/friends' },
            { method: 'GET', relative_url: 'me/groups' },
        ]
    }, function (response) {

        if (response.error) {
            alert(fsOptions.lang.fbConnectError);
            _close();
            return false;
        }          

        //var facebook_friends = response.data;
        var facebook_friends = JSON.parse(response[0].body).data;
        $.merge(facebook_friends, JSON.parse(response[1].body).data);
        // end of group changes

I am somewhat of a javascrips beginner, so please improve. .. and I've never forked anything on GitHub.. so not even sure how to go about that.

Sam

OpenGraph API 2.0

What happens after the final API change in 2015?
As it says: “Friend list now only returns friends who also use your app: The list of friends returned via the /me/friends endpoint is now limited to the list of friends that have authorized your app.”

Can you say something about that?

Thanks and cheers
Yves

Callback called even if user cancel

Hello,

Line 77 the callback : fsOptions.onSubmit(selected_friends); is called even if the user canceled his share in the FB.ui('apprequest') popin ,

the workaround is to check if there is no error_code in response object :

if(!response.error_code) fsOptions.onSubmit(selected_friends);

Browser hanging in Safari (Yosemite)

Hi - thanks so much for this plugin! I'm having a bit of trouble though. Even in your examples, when I click on the friend-selector samples, I get the spinning beachball of death and have to restart the browser. (To be fair, the FB app sample that FB themselves provide does the same thing. Friendsmash, when I play it online or locally, lets me click 5 times and then locks everything up.) Is anyone else having this issue? No errors in the console, it just hangs.

Bug with max friends limit

i've found that if you set the option "max" to, for example, 1 the script prevents you from selecting more than one only if you click in the user's name but not if you click the checkbox (i was able to select and get 3 friend's IDs besides restricting to max 1).

The temporary solution i've found was to add this line on the "click" function (under the "else" clause):

if (limit_state === false) {
        btn.find('input.fs-friends').attr('checked', false); // ADDED
        
        return false;
 }

Hope this helps to correctly fix it.

facebookInvite set to true on default?

In the documentation on the website, it says that the facebookInvite option was set to false by default, but I had to explicitly declare it as false to not have the friend selector send app requests. Looked through the js and facebookInvite is set to true by default, so I guess either that or the documentation should be changed?

Calling /me/friends return empty result

Hi,

first of all, thanks for your work, we used your plugin in a previous project and it's realy cool and easy to integrate.

But in our last project we had an issue : calling FB.api('/me/friends') only return the facebook friends who also use the app.. so it's not realy usefull for social sharing...

Apparently it seems to be a new thing in Facebook API V2 according to this

So the solution I found may be usefull for someone else : (Sorry, but I didn't have much time to create a full PR, with test and all the code, and I didn't know if i'm the only one having this issue or not..)

First : in your facebook application settings, set "game" as categorie

Second : in your script, method getFacebookFriends change FB.api('/me/friends') by FB.api('/me/invitable_friends') a method only available for games app (I don't know how work this block and I didn't use it, so I didn't take a look at it.

One of the main specificity to /me/invitable_friend is to not return the real facebook id of the friend, instead, we have a specific key to use as ID for inviting friend, plus a link to his profil pic, so we have to change a little bit the markup :

Third : (before third step, I think the method parseFacebookFriend need some change, but I didn't use any options in it, so i didn't have to change anything. In _setFacebookFriends

 var link =  '<a class="fs-anchor" href="javascript://">' +
              '<input class="fs-fullname" type="hidden" name="fullname[]" value="'+v[k].name.toLowerCase().replace(/\s/gi, "0")+'" />' +
              '<input class="fs-friends" type="checkbox" name="friend[]" value="fs-'+v[k].id+'" />' +
              '<img class="fs-thumb" src="https://graph.facebook.com/'+v[k].id+'/picture" />' +
              '<span class="fs-name">' + _charLimit(v[k].name, 15) + '</span>' +
            '</a>';

become :

var link =  '<a class="fs-anchor" href="javascript://">' +
              '<input class="fs-fullname" type="hidden" name="fullname[]" value="'+v[k].name.toLowerCase().replace(/\s/gi, "0")+'" />' +
              '<input class="fs-friends" type="checkbox" name="friend[]" value="fs-'+v[k].id+'" data-id="'+v[k].id+'" />' +
              '<img class="fs-thumb" src="'+v[k].picture.data.url+'" />' +
              '<span class="fs-name">' + _charLimit(v[k].name, 15) + '</span>' +
            '</a>';

And if I do not forgot something, the last step is to modify _submit method

Line 63 became :

selected_friends.push($(this).data('id'));

Line 69, replace

 var friends = selected_friends.join();

by

 var friends = selected_friends.join(',');

And there you are!, now the plugin almost work with the FBK API V2, but as i said before, there a lot of option i didn't use in your plugin so I didn't test all of them.

(Sorry for my english, hope you will understand me and it gonna be usefull)

Can i pass some parameter while clicking link to launch friend selector window

Sorry for being so stupid but I am new to javascript so could not find a way.
I am currently using it the same way you have shown in your example:

a href="javascript:{}" class="bt-fs-dialog">Click here

and in JS
jQuery(document).ready(function($) {
$(".bt-fs-dialog").fSelector({
onSubmit: function(response){
}
});
});

Now I want to pass some parameter when I click on this link.
Could you please let me know how can I do it?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.