Trigger the Buffer Share Popup from any specified DOM element
Share.js is a super minimal and easy plug in to make any DOM element trigger a Buffer share. It loads asynchronously to your page and doesn't add any overhead. It's still early in development, so please be sure to send any issues over to Sunil [email protected].
##How to use Share.js
- Include this script in your header
```
-
Add an anchor tag with class 'buffer-share' and parameters
###Example:
Share to Buffer ```
##Optional Parameters:
- data-url: URL to share. If not specified, the url will be the current page
- data-text: Text to share.
- data-preferred-login: <twitter, linkedin, facebook> Preferred service to share to or login from
- data-via: Via (twitter screen_name)
- data-partner-source: Partner name.
- data-partner-placement: Partner specified identifier (ie. mini)
##Creating Buffer Share DOM Elements with Javascript If a buffer-share element is created via javascript after window.onload is called, then be sure to call call BufferShare.reload() afterwards.
#Development Buffer Share.js is open source. While maintained by Buffer, we welcome any improvements you have! Here's how you can get started contributing.
##Building
- Install grunt.js
$ sudo npm install -g grunt-cli
$ npm install
- Run grunt after you're satisfied with your changes.
$ grunt
##Contributing When you've made your changes, feel free to submit pull requests. When/if merged, we'll be sure to update the Share.JS version and upload it onto the Buffer CDN.