Skip to content
Open
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
14 changes: 11 additions & 3 deletions dist/js/social-share-kit.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ var SocialShareKit = (function () {
};
switch (network) {
case 'facebook':
url = 'https://www.facebook.com/share.php?u=' + paramsObj.shareUrlEncoded();
url = 'https://www.facebook.com/share.php?u=' + paramsObj.shareUrlEncoded() + (!!paramsObj.text ? '&quote=' + encodeURIComponent(paramsObj.text.replace(/\n/g, ' ... ')) : '');
break;
case 'twitter':
url = 'https://twitter.com/intent/tweet?url=' + paramsObj.shareUrlEncoded() +
Expand Down Expand Up @@ -230,8 +230,12 @@ var SocialShareKit = (function () {
url = 'https://vkontakte.ru/share.php?url=' + paramsObj.shareUrlEncoded();
break;
case 'email':
url = 'mailto:?subject=' + encodeURIComponent(title) +
'&body=' + encodeURIComponent(title + '\n' + shareUrl + '\n\n' + text + '\n');
url = 'mailto:?subject=' + encodeURIComponent(title?title:document.title) +
'&body=' + encodeURIComponent(
(!!title ? title + '\n' : '') +
(!!shareUrl ? shareUrl + '\n\n' : '') +
(!!text ? text + '\n' : '')
);
break;
}

Expand All @@ -246,6 +250,7 @@ var SocialShareKit = (function () {

function getShareUrl(options, network, el, dataOpts) {
dataOpts = dataOpts || getDataOpts(options, network, el);
if (dataOpts['url'] === '') { return ''; }
return dataOpts['url'] || window.location.href;
}

Expand Down Expand Up @@ -283,6 +288,9 @@ var SocialShareKit = (function () {
if (typeof optValue != 'undefined') {
opts[optKey] = optValue;
}
else if(el.hasAttribute(dataKey)){
opts[optKey] = "";
}
}
return opts;
}
Expand Down