Skip to content
/ sharejs Public
forked from bufferapp/sharejs

Trigger the Buffer Share popup from any DOM element

License

Notifications You must be signed in to change notification settings

mnort9/sharejs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Share.js (0.0.1)

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

  1. Include this script in your header
<script src='https://d389zggrogs7qo.cloudfront.net/js/sharejs/0.0.1/share.min.js'></script>
```
  1. 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

  1. Install grunt.js
$ sudo npm install -g grunt-cli
$ npm install
  1. 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.

About

Trigger the Buffer Share popup from any DOM element

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%