-
Notifications
You must be signed in to change notification settings - Fork 16
3. JavaScript API
OpenShare JavaScript API reference.
You can use the last word from all the data attributes in the data attributes API as Share options in the JS API.
Property | Value |
---|---|
type |
Name of the service. e.g. 'Twitter', 'Facebook', 'Github', etc.. |
url
: URL being shared.
bindClick
: Boolean. Set true to allow Share Node to share when clicked.
appendTo
: Element to append the Share Node to.
innerHTML
: Sets a string as innerHtml to the Share Node.
element
: Element to create the Share Node as.
classes
: An array of classes to be added to the Share Node.
text
: String to tweet.
via
: via @{twitter user}
hashtags
: List of hashtags to tweet.
related
: Sets related items to url.
tweetId
: Tweet to retweet.
screenName
: User to follow.
userId
: User to follow.
link
: Link to share.
picture
: Photo to share.
caption
: Caption for picture.
description
: Description of picture.
video
: Video ID to share.
user
: User to subscribe to.
media
: Photo to share.
description
: Description of picture.
link
: Link to share.
to
: Email address to send to.
subject
: Subject of the email.
body
: Body of the email.
username
: Set the username to follow or share.
type
: 'display', 'search', or 'directions'.
search
: Sets a search query in Google Maps.
center
: comma separated string of latitude,longitude.
views
: 'satellite', 'traffic', or 'transit'.
zoom
: An integer that specifies the zoom level of the map.
saddr
: This can be a latitude,longitude or a query formatted address.
dadd
: Sets the end point for directions searches. Has the same format and behavior as saddr.
directionsMode
: Method of transportation. Can be set to: driving, transit, bicycling or walking.
repo
: Sets a repo to share or post a Github issue in.
issue
: Sets the issue title for a Github issue.
body
: Body of Github issue.
shot
: Sets the Dribbble shot to share.
username
: Set the username to follow or share.
view
: Sets the view to open Codepen in.
pen
: Sets the pen to open.
type
: The service to get a count from.
url
: URL to get a count from.
element
: Element to create a count node of. (Default: <span>
)
classes
: Array of classes to give the count node.
appendTo
: Element to append the count node to.