Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ include `share-buttons.js` in the end of page:
<script src="<path>/dist/share-buttons.js"></script>
```

Paste this html on the page:
Paste this HTML on the page:

``` html
<div class="share-btn">
Expand Down Expand Up @@ -110,4 +110,4 @@ If your using [Font-Awesome](https://github.com/FortAwesome/Font-Awesome):

----

&copy; 2015 - 2019 Yauheni Pakala
&copy; 2015 - 2020 Yauheni Pakala
2 changes: 1 addition & 1 deletion dist/share-buttons.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": "share-buttons",
"version": "1.4.0",
"version": "1.5.0",
"description": "Simple social buttons for your site.",
"directories": {
"example": "example"
Expand Down
13 changes: 5 additions & 8 deletions src/share-buttons.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Class to display the buttons of social networks.
*
* @author Yauheni Pakala <https://wcoder.github.io>
* @version 1.2
* @version 1.5
* @license MIT
*/
function ShareButtons() {
Expand All @@ -31,7 +31,7 @@
TU_LINK_FORMAT = 'https://www.tumblr.com/widgets/share/tool?posttype=link&title={0}&caption={0}&content={1}&canonicalUrl={1}&shareSource=tumblr_share_button',
HN_LINK_FORMAT = 'https://news.ycombinator.com/submitlink?t={0}&u={1}',
XI_LINK_FORMAT = 'https://www.xing.com/app/user?op=share;url={0};title={1}',
MAIL_LINK_FORMAT = 'mailto:?Subject={0}{1}&body={2}{3}',
MAIL_LINK_FORMAT = 'mailto:?subject={0}&body={1}',
FB_CLASS_NAME = 'fb',
VK_CLASS_NAME = 'vk',
TW_CLASS_NAME = 'tw',
Expand Down Expand Up @@ -314,14 +314,11 @@
if (title.length > 0 && desc.length > 0) {
text = mergeForTitle([title, desc]);
}
if (text.length > 0) {
text = text + ' / ';
}
if (title.length > 0) {
title += ' / ';
if (url.length > 0) {
text = text + ' / ' + url;
}

location.href = stringFormat(MAIL_LINK_FORMAT, [title, titleDef, text, url]);
location.href = stringFormat(MAIL_LINK_FORMAT, [title, text]);
break;

case PRINT_CLASS_NAME:
Expand Down