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

Commit

Permalink
weibo new provider thanks to @shahzad-0
Browse files Browse the repository at this point in the history
  • Loading branch information
45kb committed Feb 7, 2017
1 parent 7795e52 commit cf9ce4e
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-socialshare",
"version": "2.3.5",
"version": "2.3.6",
"description": "A social media url and content share module for angularjs.",
"authors": [
"Filippo Oretti <filippo.oretti@gmail.com",
Expand Down
34 changes: 31 additions & 3 deletions dist/angular-socialshare.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
* angular-socialshare
* 2.3.5
* 2.3.6
*
* A social media url and content share module for angularjs.
* http://720kb.github.io/angular-socialshare
*
* MIT license
* Fri Jan 27 2017
* Tue Feb 07 2017
*/
/*global angular*/
/*eslint no-loop-func:0, func-names:0*/
Expand All @@ -16,7 +16,7 @@

var directiveName = 'socialshare'
, serviceName = 'Socialshare'
, 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']
, 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']
, socialshareConfigurationProvider = /*@ngInject*/ function socialshareConfigurationProvider() {

var socialshareConfigurationDefault = [{
Expand Down Expand Up @@ -299,6 +299,16 @@
'popupHeight': 600,
'popupWidth': 500
}
},
{
'provider': 'weibo',
'conf': {
'url': '',
'text': '',
'trigger': 'click',
'popupHeight': 600,
'popupWidth': 500
}
}];

return {
Expand Down Expand Up @@ -874,6 +884,18 @@
, 'Skype', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight
+ ',top=' + ($window.innerHeight - attrs.socialsharePopupHeight) / 2 + ',left=' + ($window.innerWidth - attrs.socialsharePopupWidth) / 2);
}
, weiboShare = function weiboShare($window, attrs) {
var urlString = 'http://service.weibo.com/share/share.php?url=' + encodeURIComponent(attrs.socialshareUrl || $window.location.href);

if (attrs.socialshareText) {
urlString += '&title=' + encodeURIComponent(attrs.socialshareText);
}

$window.open(
urlString
, 'Weibo', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight
+ ',top=' + ($window.innerHeight - attrs.socialsharePopupHeight) / 2 + ',left=' + ($window.innerWidth - attrs.socialsharePopupWidth) / 2);
}
, socialshareService = /*@ngInject*/ ['$window', '$log', function socialshareService($window, $log) {

this.emailShare = manageEmailShare;
Expand Down Expand Up @@ -905,6 +927,7 @@
//this.whatsappShare = manageWhatsappShare;
this.skypeShare = skypeShare;
this.smsShare = manageSmsShare;
this.weiboShare = weiboShare;

this.share = function shareTrigger(serviceShareConf) {

Expand Down Expand Up @@ -1001,6 +1024,10 @@
this.flipboardShare($window, serviceShareConf.attrs);
break;
}
case 'weibo': {
this.weiboShare($window, serviceShareConf.attrs);
break;
}
default: {
return;
}
Expand Down Expand Up @@ -1104,6 +1131,7 @@
, 'telegram': manageTelegramShare
, 'viber': manageViberShare
, 'skype': skypeShare
, 'weibo': weiboShare
};


Expand Down
Loading

0 comments on commit cf9ce4e

Please sign in to comment.