|
1 | 1 | /*
|
2 | 2 | * angular-socialshare
|
3 |
| - * 2.3.5 |
| 3 | + * 2.3.6 |
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 |
| - * Fri Jan 27 2017 |
| 9 | + * Tue Feb 07 2017 |
10 | 10 | */
|
11 | 11 | /*global angular*/
|
12 | 12 | /*eslint no-loop-func:0, func-names:0*/
|
|
16 | 16 |
|
17 | 17 | var directiveName = 'socialshare'
|
18 | 18 | , serviceName = 'Socialshare'
|
19 |
| - , socialshareProviderNames = ['facebook', 'facebook-messenger','sms', 'twitter', 'linkedin', 'google', 'pinterest', 'tumblr', 'reddit', 'stumbleupon', 'buffer', 'digg', 'delicious', 'vk', 'pocket', 'wordpress', 'flipboard', 'xing', 'hackernews', 'evernote', 'whatsapp', 'telegram', 'viber', 'skype', 'email', 'ok'] |
| 19 | + , socialshareProviderNames = ['facebook', 'facebook-messenger','sms', 'twitter', 'linkedin', 'google', 'pinterest', 'tumblr', 'reddit', 'stumbleupon', 'buffer', 'digg', 'delicious', 'vk', 'pocket', 'wordpress', 'flipboard', 'xing', 'hackernews', 'evernote', 'whatsapp', 'telegram', 'viber', 'skype', 'email', 'ok', 'weibo'] |
20 | 20 | , socialshareConfigurationProvider = /*@ngInject*/ function socialshareConfigurationProvider() {
|
21 | 21 |
|
22 | 22 | var socialshareConfigurationDefault = [{
|
|
299 | 299 | 'popupHeight': 600,
|
300 | 300 | 'popupWidth': 500
|
301 | 301 | }
|
| 302 | + }, |
| 303 | + { |
| 304 | + 'provider': 'weibo', |
| 305 | + 'conf': { |
| 306 | + 'url': '', |
| 307 | + 'text': '', |
| 308 | + 'trigger': 'click', |
| 309 | + 'popupHeight': 600, |
| 310 | + 'popupWidth': 500 |
| 311 | + } |
302 | 312 | }];
|
303 | 313 |
|
304 | 314 | return {
|
|
874 | 884 | , 'Skype', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight
|
875 | 885 | + ',top=' + ($window.innerHeight - attrs.socialsharePopupHeight) / 2 + ',left=' + ($window.innerWidth - attrs.socialsharePopupWidth) / 2);
|
876 | 886 | }
|
| 887 | + , weiboShare = function weiboShare($window, attrs) { |
| 888 | + var urlString = 'http://service.weibo.com/share/share.php?url=' + encodeURIComponent(attrs.socialshareUrl || $window.location.href); |
| 889 | + |
| 890 | + if (attrs.socialshareText) { |
| 891 | + urlString += '&title=' + encodeURIComponent(attrs.socialshareText); |
| 892 | + } |
| 893 | + |
| 894 | + $window.open( |
| 895 | + urlString |
| 896 | + , 'Weibo', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
| 897 | + + ',top=' + ($window.innerHeight - attrs.socialsharePopupHeight) / 2 + ',left=' + ($window.innerWidth - attrs.socialsharePopupWidth) / 2); |
| 898 | + } |
877 | 899 | , socialshareService = /*@ngInject*/ ['$window', '$log', function socialshareService($window, $log) {
|
878 | 900 |
|
879 | 901 | this.emailShare = manageEmailShare;
|
|
905 | 927 | //this.whatsappShare = manageWhatsappShare;
|
906 | 928 | this.skypeShare = skypeShare;
|
907 | 929 | this.smsShare = manageSmsShare;
|
| 930 | + this.weiboShare = weiboShare; |
908 | 931 |
|
909 | 932 | this.share = function shareTrigger(serviceShareConf) {
|
910 | 933 |
|
|
1001 | 1024 | this.flipboardShare($window, serviceShareConf.attrs);
|
1002 | 1025 | break;
|
1003 | 1026 | }
|
| 1027 | + case 'weibo': { |
| 1028 | + this.weiboShare($window, serviceShareConf.attrs); |
| 1029 | + break; |
| 1030 | + } |
1004 | 1031 | default: {
|
1005 | 1032 | return;
|
1006 | 1033 | }
|
|
1104 | 1131 | , 'telegram': manageTelegramShare
|
1105 | 1132 | , 'viber': manageViberShare
|
1106 | 1133 | , 'skype': skypeShare
|
| 1134 | + , 'weibo': weiboShare |
1107 | 1135 | };
|
1108 | 1136 |
|
1109 | 1137 |
|
|
0 commit comments