1.0.1 • Published 9 years ago

social-junk v1.0.1

Weekly downloads
4
License
Apache-2.0
Repository
github
Last release
9 years ago

Social Junk

Why

While social buttons are ugly, probably horcruxes, and definitely tracking you, there are times when they are unavoidable. This library is written to limit their interactions and overhead by asynchronously loading social libraries only when needed.

Note: You should probably block social buttons.

Usage

UMD so use how you would like.

Options

facebookAppId

Optionally set your Facebook App ID.

Examples

Initialize:

new SocialJunk();

Initialize with Facebook App ID:

new SocialJunk( {
	facebookAppId: '123456789'
} );

Listen for an event:

document.addEventListener( 'twitter:loaded', function ( event ) {
	console.log( event.type );
} );

Events

Facebook

facebook:libraryLoaded

Library script has loaded.

facebook:loaded

All buttons are rendered.

Google+

googleplus:libraryLoaded

Library script has loaded.

Twitter

twitter:libraryLoaded

Library script has loaded.

twitter:rendered

Parameter: event.rendered HTML element

Button is rendered.

twitter:loaded

Parameter: event.loaded array of HTML elements

All buttons are rendered.

Contributing

Dudes (like Facebook) tend to change things up often. If this happens, feel free to fix.

Run the following for the uglified version:

npm run build-js

Browser Support

Probably IE 9+ ¯_(ツ)_/¯

1.0.1

9 years ago

1.0.0

9 years ago