README.md

ISO New Maintainer

I'm sorry. I haven't had any time to maintain this library (sadpanda). I'm looking for a volunteer to help maintain and progress the library... because everyone's friends deserve to be selected sometimes.

Overview

This is an client side alternative to the Facebook Multi-Friend Selector that
relies on jQuery. No server side component necessary which makes it really
easy to adapt and use. Check out this blog post with more details and screencast. To see a demo go here. Click login and login to your facebook account and you should see the friend selector.

Much can be customized by CSS, for example if you want a stacked list type selector that's more stripped down

How to use it

This plugin is depends on the Facebook Javascript API so you have to include it:

<script src="http://connect.facebook.net/en_US/all.js"></script>

Include the plugin javascript file and CSS

Assuming you have a container like:

<div id="jfmfs-container"></div>

And you have included the Facebook Javascript API
And you have already logged the user in. (FB.init and FB.login)
You can load the friend selector in a container like this:

$("#jfmfs-container").jfmfs();

This should fetch the current users friends and give you the interface to select friends. Then when you're ready to move on, there's a function to call that returns an array of the Facebook Ids of the selected friends.

friend_fields: a comma separated list of fields to return in case you need additional fields for sorting. However you should always at least specify: "id,name",

sorter: a function reference that will be called to do the sorting. It takes two arguments which are the two friend objects to be compared and returns "truthy if the first should come before the second. The default is:

pre_selected_friends: an array of ids of friends to preselect once loaded like: pre_selected_friends: [1014025367]

exclude_friends: an array of ids of friends to exclude from the list like: exclude_friends: [33333333]

For example your options might look like this if you want a max of 3 friends selected, friends 11111111 and 22222222 preselected, friend 33333333 excluded from the list and to sort by friends' last name: