Skip to content

Commit 8bc39bb

Browse files
committed
Merge branch 'upstreamdevelop-test-prs-381-382-401' into develop-test-upstream-prs-381-382-401
2 parents f77bce4 + 46b40f1 commit 8bc39bb

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

src/js/services/linkedin.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
module.exports = function(shariff) {
44
var url = encodeURIComponent(shariff.getURL())
5-
var title = encodeURIComponent(shariff.getTitle())
6-
var descr = encodeURIComponent(shariff.getMeta('description'))
75
return {
86
popup: true,
97
shareText: {
@@ -63,6 +61,6 @@ module.exports = function(shariff) {
6361
'tr': 'LinkedIn\'ta paylaş',
6462
'zh': '在LinkedIn上分享'
6563
},
66-
shareUrl: 'https://www.linkedin.com/shareArticle?mini=true&summary=' + descr + '&title=' + title + '&url=' + url
64+
shareUrl: 'https://www.linkedin.com/sharing/share-offsite/?url=' + url
6765
}
6866
}

src/js/services/twitter.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,16 @@ module.exports = function(shariff) {
2323

2424
var title = shariff.getTitle()
2525

26-
// 120 is the max character count left after twitters automatic url shortening with t.co
27-
shareUrl.query.text = abbreviateText(title, 120)
2826
shareUrl.query.url = shariff.getURL()
2927
if (shariff.options.twitterVia !== null) {
3028
shareUrl.query.via = shariff.options.twitterVia
3129
}
30+
// From Twitters documentation (May 2021):
31+
// The length of your passed Tweet text should not exceed 280 characters
32+
// when combined with any passed hashtags, via, or url parameters.
33+
var remainingTextLength = (280 - (shareUrl.query.via || '').length - (shareUrl.query.url || '').length)
34+
shareUrl.query.text = abbreviateText(title, remainingTextLength)
35+
3236
delete shareUrl.search
3337

3438
return {

src/js/services/whatsapp.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = function(shariff) {
66
var title = shariff.getTitle()
77

88
return {
9-
popup: false,
9+
popup: true,
1010
shareText: {
1111
'bg': 'cподеляне',
1212
'cs': 'sdílet',
@@ -64,6 +64,6 @@ module.exports = function(shariff) {
6464
'tr': 'Whatsapp\'ta paylaş',
6565
'zh': '在Whatsapp上分享'
6666
},
67-
shareUrl: 'whatsapp://send?text=' + encodeURIComponent(title) + '%20' + url + shariff.getReferrerTrack()
67+
shareUrl: 'https://api.whatsapp.com/send?text=' + encodeURIComponent(title) + '%20' + url + shariff.getReferrerTrack()
6868
}
6969
}

0 commit comments

Comments
 (0)