Skip to content
This repository was archived by the owner on Mar 7, 2022. It is now read-only.

Commit 5e2dbfe

Browse files
committed
feat: mobile_iframe attribute for share dialog is added
1 parent 3c31b0c commit 5e2dbfe

5 files changed

+22
-22
lines changed

Diff for: dist/angular-socialshare.js

+11-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* http://720kb.github.io/angular-socialshare
77
*
88
* MIT license
9-
* Tue Feb 07 2017
9+
* Fri Feb 17 2017
1010
*/
1111
/*global angular*/
1212
/*eslint no-loop-func:0, func-names:0*/
@@ -40,6 +40,7 @@
4040
'hashtags':'',
4141
'text': '',
4242
'media': '',
43+
'mobile_iframe': '',
4344
'type': '',
4445
'via': '',
4546
'to': '',
@@ -457,6 +458,10 @@
457458
urlString += '&display=' + encodeURIComponent(attrs.socialshareDisplay);
458459
}
459460

461+
if (attrs.socialshareMobileiframe) {
462+
urlString += '&mobile_iframe=' + encodeURIComponent(attrs.socialshareMobileiframe);
463+
}
464+
460465
if (attrs.socialshareDescription) {
461466
urlString += '&description=' + encodeURIComponent(attrs.socialshareDescription);
462467
}
@@ -551,7 +556,7 @@
551556
} else {
552557
$window.open(urlString, '_self');
553558
}
554-
559+
555560
}
556561
, facebookMessengerShare = function facebookMessengerShare($window, attrs, element) {
557562

@@ -842,13 +847,13 @@
842847

843848
var body = encodeURIComponent(attrs.socialshareText.replace('%',''))
844849
, toPhoneNumber = attrs.socialshareTo || '';
845-
850+
846851
if (attrs.socialshareUrl) {
847852
body += encodeURIComponent(attrs.socialshareUrl);
848853
}
849-
854+
850855
var urlString = 'sms:' + toPhoneNumber + '?&body=' + body;
851-
856+
852857
element.attr('href', urlString);
853858
element.attr('target', '_blank');
854859
}
@@ -1064,6 +1069,7 @@
10641069
}
10651070

10661071
//if some attribute is not define provide a default one
1072+
attrs.socialshareMobileiframe = attrs.socialshareMobileiframe || configurationElement.conf.mobile_iframe;
10671073
attrs.socialshareQuote = attrs.socialshareQuote || configurationElement.conf.quote;
10681074
attrs.socialshareTitle = attrs.socialshareTitle || configurationElement.conf.title;
10691075
attrs.socialshareUrl = attrs.socialshareUrl || configurationElement.conf.url || configurationElement.conf.href;

0 commit comments

Comments
 (0)