|
1 | 1 | /*
|
2 | 2 | * angular-socialshare
|
3 |
| - * 2.3.2 |
4 |
| - * |
| 3 | + * 2.3.4 |
| 4 | + * |
5 | 5 | * A social media url and content share module for angularjs.
|
6 | 6 | * http://720kb.github.io/angular-socialshare
|
7 |
| - * |
| 7 | + * |
8 | 8 | * MIT license
|
9 |
| - * Wed Oct 26 2016 |
| 9 | + * Fri Dec 16 2016 |
10 | 10 | */
|
11 | 11 | /*global angular*/
|
12 | 12 | /*eslint no-loop-func:0, func-names:0*/
|
|
536 | 536 |
|
537 | 537 | urlString += '&bcc=' + encodeURIComponent(attrs.socialshareBcc);
|
538 | 538 | }
|
539 |
| - if ($window.self !== $window.top) { |
| 539 | + if($window.self !== $window.top) { |
540 | 540 | $window.open(urlString, '_blank');
|
541 | 541 | } else {
|
542 | 542 | $window.open(urlString, '_self');
|
543 | 543 | }
|
544 |
| - |
| 544 | + |
545 | 545 | }
|
546 | 546 | , facebookMessengerShare = function facebookMessengerShare($window, attrs, element) {
|
547 | 547 |
|
|
818 | 818 | }
|
819 | 819 | , manageWhatsappShare = function manageWhatsappShare($window, attrs, element) {
|
820 | 820 |
|
821 |
| - var href = 'whatsapp://send?text=' + encodeURIComponent(attrs.socialshareText + ' ') + encodeURIComponent(attrs.socialshareUrl || $window.location.href); |
| 821 | + var href = 'whatsapp://send?text=' + encodeURIComponent(attrs.socialshareText) + encodeURIComponent(attrs.socialshareUrl || $window.location.href); |
822 | 822 |
|
823 | 823 | element.attr('href', href);
|
824 | 824 | element.attr('target', '_top');
|
825 | 825 |
|
826 | 826 | }
|
827 | 827 | , manageSmsShare = function smsShare($window, attrs, element) {
|
828 | 828 |
|
829 |
| - if (attrs.socialshareText.indexOf('%') >= 0) { |
| 829 | + if(attrs.socialshareText.indexOf('%') >= 0) { |
830 | 830 | $log.warn('sending sms text with "%" sign is not supported');
|
831 | 831 | }
|
832 | 832 |
|
833 |
| - var body = encodeURIComponent(attrs.socialshareText.replace('%','')) + ' - ' + encodeURIComponent(attrs.socialshareUrl) |
| 833 | + var body = encodeURIComponent(attrs.socialshareText.replace('%','')) + encodeURIComponent(attrs.socialshareUrl) |
834 | 834 | , toPhoneNumber = attrs.socialshareTo || ''
|
835 | 835 | , urlString = 'sms:' + toPhoneNumber + '?&body=' + body;
|
836 | 836 |
|
|
839 | 839 | }
|
840 | 840 | , manageViberShare = function manageViberShare($window, attrs, element) {
|
841 | 841 |
|
842 |
| - var href = 'viber://forward?text=' + encodeURIComponent(attrs.socialshareText + ' ') + encodeURIComponent(attrs.socialshareUrl || $window.location.href); |
| 842 | + var href = 'viber://forward?text=' + encodeURIComponent(attrs.socialshareText) + encodeURIComponent(attrs.socialshareUrl || $window.location.href); |
843 | 843 |
|
844 | 844 | element.attr('href', href);
|
845 | 845 | element.attr('target', '_top');
|
|
0 commit comments