https://github.com/bufferapp/sharejs
Trigger the Buffer Share popup from any DOM element
https://github.com/bufferapp/sharejs
Last synced: 9 months ago
JSON representation
Trigger the Buffer Share popup from any DOM element
- Host: GitHub
- URL: https://github.com/bufferapp/sharejs
- Owner: bufferapp
- License: mit
- Created: 2014-01-29T23:53:38.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-02-17T15:59:33.000Z (almost 12 years ago)
- Last Synced: 2025-03-29T10:23:50.350Z (10 months ago)
- Language: JavaScript
- Size: 283 KB
- Stars: 14
- Watchers: 7
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Share.js (0.0.3)
=======
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. Share.JS is still early in development, so please be sure to send any issues over to Sunil .
##How to use Share.js
1. Include this script in your header
```
```
2. Add an anchor tag with attribute `data-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**: 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)
####Native Retweets
Share.js supports creating Native Retweets. You'll need to supply four params if you'd like to use this.
- **data-retweeted-tweet-id**: Numeric Twitter ID of the status. You can find this on the twitter url of a status
- **data-retweeted-user-id**: The twitter user id who created the status
- **data-retweeted-user-name**: The user screen name of the twitter user who created the status
- **data-retweeted-user-display-name**: The display name of the twitter user who created this status
##Creating Buffer Share DOM Elements with Javascript
No worries ;-), Buffer will be automatically attached to elements created with javascript after window.onload is called.
#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
1. Install grunt.js
```
$ sudo npm install -g grunt-cli
$ npm install
```
2. 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.