Skip to content

Commit

Permalink
Added option for defining specific text for each share button, v1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ozdemirburak committed Nov 18, 2016
1 parent c9717f6 commit d5af4fe
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 28 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Or install via npm and include from your `node_modules` folder
Or install via <a target="_blank" href="https://github.com/ozdemirburak/jquery-floating-social-share/archive/master.zip">zip</a>, then include jQuery and Font-Awesome and the plugin on a page.

```html
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.2/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/fontawesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="dist/jquery.floating-social-share.min.css" />
<script type="text/javascript" src="https://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript" src="dist/jquery.floating-social-share.min.js"></script>
Expand Down Expand Up @@ -57,7 +57,8 @@ To make the social share buttons appear next to the specific content, instead of
* **buttons**: `Array` *(`["facebook", "twitter", "google-plus"]` by default)* Sets the social buttons for sharing. Available ones are `envelope`, `facebook`, `google-plus`, `linkedin`, `odnoklassniki`, `pinterest`, `reddit`, `stumbleupon`, `tumblr`, `twitter` and `vk`
* **title**: `String` *(`document.title` by default)* Sets the title for the share message.
* **url**: `String` *(`window.location.href` by default)* Sets the url for the share message.
* **text**: `String` *(`share with` by default)* Sets the share title for the social buttons.
* **text**: `Object | String` *({'default': 'share with:'} by default)* Sets the share title for the social buttons. If properties are not assigned specifically, will use the default one appended with the button tag, for instance share with facebook.
* **text_title_case**: `Boolean` *(`false` by default)* Converts share text to title case, for instance, share with facebook will become Share With Facebook when set to true
* **description**: `String` *(`$('meta[name="description"]').attr("content")` by default)* Sets the description for the share.
* **media**: `String` *(`$('meta[property="og:image"]').attr("content")` by default)* Sets the media for the Pinterest share.
* **popup_width**: `Number` *(`400` by default)* Sets the sharer popup's width.
Expand All @@ -74,7 +75,8 @@ $("body").floatingSocialShare({
buttons: ["envelope", "facebook", "google-plus", "linkedin", "odnoklassniki", "pinterest", "reddit", "stumbleupon", "tumblr", "twitter", "vk"], // all of the currently avalaible social buttons
title: document.title, // your title, default is current page's title
url: window.location.href, // your url, default is current page's url
text: "share with ", // the title of a tags
text: {'default': 'share with ', 'facebook': 'share with facebook', 'google-plus': 'share with g+'}, // the title of tags
text_title_case: false, // if set true, then will convert share texts to title case like Share With G+
description: $('meta[name="description"]').attr("content"), // your description, default is current page's description
media: $('meta[property="og:image"]').attr("content"), // pinterest media
popup_width: 400, // the sharer popup width, default is 400px
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jquery-floating-social-share",
"version": "1.5.0",
"version": "1.6.0",
"homepage": "http://github.com/ozdemirburak/jquery-floating-social-share",
"authors": [
"Burak Ozdemir <https://github.com/ozdemirburak>"
Expand Down
6 changes: 4 additions & 2 deletions demo/content.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
<script>
$(".content").floatingSocialShare({
buttons: ["facebook", "google-plus", "linkedin", "pinterest", "reddit", "stumbleupon", "tumblr", "twitter", "vk"],
text: "share with: ",
text: {'default': 'share with: ', 'facebook': 'share with facebook', 'google-plus': 'share with g+'},
text_title_case: true,
place: "content-left",
url: "http://google.com"
url: "http://google.com",
twitter_counter: true
});
</script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.floating-social-share.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jquery-floating-social-share",
"version": "1.5.0",
"version": "1.6.0",
"description": "social media share buttons with counters",
"main": "dist/jquery-floating-social-share.min.js",
"repository": {
Expand Down
Loading

0 comments on commit d5af4fe

Please sign in to comment.