Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

friend-selector

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

friend-selector

A plugin to select a friend from Facebook

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

friend-selector

A friend selector in Javascript

Demo

Usage

Put an empty div for FS to do its dirty business in:

<div data-friend-selector=""></div>

Set a callback and maybe some options:

FriendSelector.options({
  selectCallback: function(friend){
    console.log("You selected " + friend.name + " who has id: " friend.id)
  }
})

And have it launched:

$("#foo").click(function(){
  FriendSelector.launch()
}

That's pretty much it.

Dependencies

  • FBLogin
  • jQuery
  • Lo-dash

Builds

Find builds in the build/ folder.

  • friend-selector.js: Standalone build
  • friend-selector.min.js: Standalone minified build
  • friend-selector.all.js: With FBLogin bundled
  • friend-selector.all.min.js: With FBLogin bundled, minified

Options

selectCallback

Default: function(friend){}

Called when user has made a selection. friend is an object with properties name and id (which corresponds to an element of the array of the response to FB.api('/me/friends'))

Example: friend = {name: "Max Power", id: 4294967296}

confirm

Default: true

Determines what happens when the user selects a friend. Setting it to false will hide the Choose button, and trigger selectCallback as soon as the friend is clicked on.

dictionary

Default:

{
    title: 'Choose a friend',
    confirm: 'Choose',
    loading: 'Loading...',
    noFriends: 'No friends are using this app yet.'
}

Dictionary of strings displayed to the user. Useful for I18n.

elementSelector

Default: '[data-friend-selector]'

Selector for the empty element Friend Selector will make its nest in.

pagination

Default: 10

Maximum number of friends displayed per selector page.

Contributing

Yes.

Keywords

FAQs

Package last updated on 03 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc