From f72634f77aa569e45d008a703c4ec036568219a9 Mon Sep 17 00:00:00 2001 From: Yann Tripet Date: Fri, 28 Oct 2016 13:37:11 +0100 Subject: [PATCH 1/4] change lthat if data attribut is there not use default in ttitle --- dist/js/social-share-kit.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dist/js/social-share-kit.js b/dist/js/social-share-kit.js index 3c659fc..1f2594b 100644 --- a/dist/js/social-share-kit.js +++ b/dist/js/social-share-kit.js @@ -283,6 +283,9 @@ var SocialShareKit = (function () { if (typeof optValue != 'undefined') { opts[optKey] = optValue; } + else{ + opts[optKey] = ""; + } } return opts; } From 709620bfc2f607e326c191c9785421828a3d8eb2 Mon Sep 17 00:00:00 2001 From: Yann Tripet Date: Fri, 28 Oct 2016 13:45:32 +0100 Subject: [PATCH 2/4] change lthat if data attribut is there not use default in ttitle --- dist/js/social-share-kit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/js/social-share-kit.js b/dist/js/social-share-kit.js index 1f2594b..600d0a6 100644 --- a/dist/js/social-share-kit.js +++ b/dist/js/social-share-kit.js @@ -283,7 +283,7 @@ var SocialShareKit = (function () { if (typeof optValue != 'undefined') { opts[optKey] = optValue; } - else{ + else if(el.hasAttribute(dataKey)){ opts[optKey] = ""; } } From cd8e5b5824bf0db852b261ee842c48b6806ecb51 Mon Sep 17 00:00:00 2001 From: Amber Hodinott Date: Thu, 3 Nov 2016 16:38:35 +0000 Subject: [PATCH 3/4] improvments --- dist/js/social-share-kit.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dist/js/social-share-kit.js b/dist/js/social-share-kit.js index 600d0a6..2a86d85 100644 --- a/dist/js/social-share-kit.js +++ b/dist/js/social-share-kit.js @@ -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 ? '"e=' + encodeURIComponent(paramsObj.text.replace(/\n/g, ' ... ')) : ''); break; case 'twitter': url = 'https://twitter.com/intent/tweet?url=' + paramsObj.shareUrlEncoded() + @@ -231,7 +231,11 @@ var SocialShareKit = (function () { break; case 'email': url = 'mailto:?subject=' + encodeURIComponent(title) + - '&body=' + encodeURIComponent(title + '\n' + shareUrl + '\n\n' + text + '\n'); + '&body=' + encodeURIComponent( + (!!title ? title + '\n' : '') + + (!!shareUrl ? shareUrl + '\n\n' : '') + + (!!text ? text + '\n' : '') + ); break; } @@ -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; } From 1d34c7a17f4f8f1f0c3650fd1c93473cf9fe2e46 Mon Sep 17 00:00:00 2001 From: Yann Tripet Date: Wed, 9 Nov 2016 09:10:24 +0000 Subject: [PATCH 4/4] remove title on email body --- dist/js/social-share-kit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/js/social-share-kit.js b/dist/js/social-share-kit.js index 600d0a6..a9f3aec 100644 --- a/dist/js/social-share-kit.js +++ b/dist/js/social-share-kit.js @@ -231,7 +231,7 @@ var SocialShareKit = (function () { break; case 'email': url = 'mailto:?subject=' + encodeURIComponent(title) + - '&body=' + encodeURIComponent(title + '\n' + shareUrl + '\n\n' + text + '\n'); + '&body=' + encodeURIComponent( shareUrl + '\n\n' + text + '\n'); break; }