react-share
Advanced tools
Comparing version 1.12.1 to 1.13.0
@@ -0,1 +1,5 @@ | ||
## 1.13.0 (Mar 31, 2017) | ||
* Added share button and count for Odnoklassniki.ru (thanks @R0nd!). | ||
## 1.12.1 (Feb 25, 2017) | ||
@@ -2,0 +6,0 @@ |
@@ -38,2 +38,7 @@ 'use strict'; | ||
}, | ||
ok: { | ||
icon: 'M39,30c-1,0-3,2-7,2s-6-2-7-2c-1.1,0-2,0.9-2,2c0,1,0.6,1.5,1,1.7c1.2,0.7,5,2.3,5,2.3l-4.3,5.4 c0,0-0.8,0.9-0.8,1.6c0,1.1,0.9,2,2,2c1,0,1.5-0.7,1.5-0.7S32,39,32,39c0,0,4.5,5.3,4.5,5.3S37,45,38,45c1.1,0,2-0.9,2-2 c0-0.6-0.8-1.6-0.8-1.6L35,36c0,0,3.8-1.6,5-2.3c0.4-0.3,1-0.7,1-1.7C41,30.9,40.1,30,39,30z M32,15c-3.9,0-7,3.1-7,7s3.1,7,7,7c3.9,0,7-3.1,7-7S35.9,15,32,15z M32,25.5 c-1.9,0-3.5-1.6-3.5-3.5c0-1.9,1.6-3.5,3.5-3.5c1.9,0,3.5,1.6,3.5,3.5C35.5,23.9,33.9,22.5,35,22.5z ', | ||
mask: 'M45,1H5C2.8,1,1,2.8,1,5v40c0,2.2,1.8,4,4,4h40c2.2,0,4-1.8,4-4V5C49,2.8,47.2,1,45,1z', | ||
color: '#f2720c' | ||
}, | ||
telegram: { | ||
@@ -40,0 +45,0 @@ icon: 'm45.90873,15.44335c-0.6901,-0.0281 -1.37668,0.14048 -1.96142,0.41265c-0.84989,0.32661 -8.63939,3.33986 -16.5237,6.39174c-3.9685,1.53296 -7.93349,3.06593 -10.98537,4.24067c-3.05012,1.1765 -5.34694,2.05098 -5.4681,2.09312c-0.80775,0.28096 -1.89996,0.63566 -2.82712,1.72788c-0.23354,0.27218 -0.46884,0.62161 -0.58825,1.10275c-0.11941,0.48114 -0.06673,1.09222 0.16682,1.5716c0.46533,0.96052 1.25376,1.35737 2.18443,1.71383c3.09051,0.99037 6.28638,1.93508 8.93263,2.8236c0.97632,3.44171 1.91401,6.89571 2.84116,10.34268c0.30554,0.69185 0.97105,0.94823 1.65764,0.95525l-0.00351,0.03512c0,0 0.53908,0.05268 1.06412,-0.07375c0.52679,-0.12292 1.18879,-0.42846 1.79109,-0.99212c0.662,-0.62161 2.45836,-2.38812 3.47683,-3.38552l7.6736,5.66477l0.06146,0.03512c0,0 0.84989,0.59703 2.09312,0.68132c0.62161,0.04214 1.4399,-0.07726 2.14229,-0.59176c0.70766,-0.51626 1.1765,-1.34683 1.396,-2.29506c0.65673,-2.86224 5.00979,-23.57745 5.75257,-27.00686l-0.02107,0.08077c0.51977,-1.93157 0.32837,-3.70159 -0.87096,-4.74991c-0.60054,-0.52152 -1.2924,-0.7498 -1.98425,-0.77965l0,0.00176zm-0.2072,3.29069c0.04741,0.0439 0.0439,0.0439 0.00351,0.04741c-0.01229,-0.00351 0.14048,0.2072 -0.15804,1.32576l-0.01229,0.04214l-0.00878,0.03863c-0.75858,3.50668 -5.15554,24.40802 -5.74203,26.96472c-0.08077,0.34417 -0.11414,0.31959 -0.09482,0.29852c-0.1756,-0.02634 -0.50045,-0.16506 -0.52679,-0.1756l-13.13468,-9.70175c4.4988,-4.33199 9.09945,-8.25307 13.744,-12.43229c0.8218,-0.41265 0.68483,-1.68573 -0.29852,-1.70681c-1.04305,0.24584 -1.92279,0.99564 -2.8798,1.47502c-5.49971,3.2626 -11.11882,6.13186 -16.55882,9.49279c-2.792,-0.97105 -5.57873,-1.77704 -8.15298,-2.57601c2.2336,-0.89555 4.00889,-1.55579 5.75608,-2.23009c3.05188,-1.1765 7.01687,-2.7042 10.98537,-4.24067c7.94051,-3.06944 15.92667,-6.16346 16.62028,-6.43037l0.05619,-0.02283l0.05268,-0.02283c0.19316,-0.0878 0.30378,-0.09658 0.35471,-0.10009c0,0 -0.01756,-0.05795 -0.00351,-0.04566l-0.00176,0zm-20.91715,22.0638l2.16687,1.60145c-0.93418,0.91311 -1.81743,1.77353 -2.45485,2.38812l0.28798,-3.98957', |
@@ -6,3 +6,3 @@ 'use strict'; | ||
}); | ||
exports.VKShareButton = exports.PinterestShareButton = exports.LinkedinShareButton = exports.GooglePlusShareButton = exports.WhatsappShareButton = exports.TelegramShareButton = exports.TwitterShareButton = exports.FacebookShareButton = undefined; | ||
exports.OKShareButton = exports.VKShareButton = exports.PinterestShareButton = exports.LinkedinShareButton = exports.GooglePlusShareButton = exports.WhatsappShareButton = exports.TelegramShareButton = exports.TwitterShareButton = exports.FacebookShareButton = undefined; | ||
@@ -81,22 +81,20 @@ var _extends2 = require('babel-runtime/helpers/extends'); | ||
if (!disabled) { | ||
(function () { | ||
e.preventDefault(); | ||
e.preventDefault(); | ||
var windowOptions = { | ||
height: windowHeight, | ||
width: windowWidth | ||
}; | ||
var windowOptions = { | ||
height: windowHeight, | ||
width: windowWidth | ||
}; | ||
var windowOpenBound = function windowOpenBound() { | ||
return (0, _utils.windowOpen)(_this.link(), windowOptions); | ||
}; | ||
var windowOpenBound = function windowOpenBound() { | ||
return (0, _utils.windowOpen)(_this.link(), windowOptions); | ||
}; | ||
if (beforeOnClick) { | ||
beforeOnClick().then(function () { | ||
return windowOpenBound(); | ||
}); | ||
} else { | ||
windowOpenBound(); | ||
} | ||
})(); | ||
if (beforeOnClick) { | ||
beforeOnClick().then(function () { | ||
return windowOpenBound(); | ||
}); | ||
} else { | ||
windowOpenBound(); | ||
} | ||
} | ||
@@ -297,2 +295,17 @@ }, _temp), (0, _possibleConstructorReturn3.default)(_this, _ret); | ||
windowHeight: 460 | ||
}); | ||
var OKShareButton = exports.OKShareButton = createShareButton('ok', function (props) { | ||
return { | ||
title: props.title, | ||
description: props.description, | ||
image: props.image | ||
}; | ||
}, { | ||
title: _react.PropTypes.string, | ||
description: _react.PropTypes.string, | ||
image: _react.PropTypes.string | ||
}, { | ||
windowWidth: 660, | ||
windowHeight: 460 | ||
}); |
@@ -16,2 +16,3 @@ 'use strict'; | ||
exports.getPinterestShareCount = getPinterestShareCount; | ||
exports.getOKShareCount = getOKShareCount; | ||
@@ -100,4 +101,4 @@ var _jsonp = require('jsonp'); | ||
Share: { | ||
count: function count(index, _count) { | ||
return window.VK.callbacks[index](_count); | ||
count: function count(index, _count2) { | ||
return window.VK.callbacks[index](_count2); | ||
} | ||
@@ -120,2 +121,31 @@ }, | ||
} | ||
exports.getVKShareCount = getVKShareCount; | ||
exports.getVKShareCount = getVKShareCount; | ||
function getOKShareCount(shareUrl, callback) { | ||
if (!window.OK) { | ||
window.OK = { | ||
Share: { | ||
count: function count(index, _count) { | ||
return window.OK.callbacks[index](_count); | ||
} | ||
}, | ||
callbacks: [] | ||
}; | ||
} | ||
var url = 'https://connect.ok.ru/dk'; | ||
var index = window.OK.callbacks.length; | ||
window.ODKL = { | ||
updateCount: function updateCount(a, b) { | ||
window.OK.callbacks[index](b); | ||
} | ||
}; | ||
window.OK.callbacks.push(callback); | ||
return (0, _jsonp2.default)(url + (0, _utils.objectToGetParams)({ | ||
'st.cmd': 'extLike', | ||
uid: 'odklcnt0', | ||
ref: shareUrl | ||
})); | ||
} |
@@ -6,3 +6,3 @@ 'use strict'; | ||
}); | ||
exports.TwitterShareCount = exports.VKShareCount = exports.PinterestShareCount = exports.GooglePlusShareCount = exports.LinkedinShareCount = exports.FacebookShareCount = undefined; | ||
exports.TwitterShareCount = exports.OKShareCount = exports.VKShareCount = exports.PinterestShareCount = exports.GooglePlusShareCount = exports.LinkedinShareCount = exports.FacebookShareCount = undefined; | ||
@@ -101,4 +101,5 @@ var _extends2 = require('babel-runtime/helpers/extends'); | ||
var VKShareCount = exports.VKShareCount = shareCountFactory(_shareCountGetters.getVKShareCount); | ||
var OKShareCount = exports.OKShareCount = shareCountFactory(_shareCountGetters.getOKShareCount); | ||
var TwitterShareCount = exports.TwitterShareCount = function TwitterShareCount() { | ||
throw new Error('TwitterShareCount was removed in version 1.3.0 because' + 'the Twitter API was shut down and there is no replacement. Please ' + 'remove it from your code.'); | ||
}; |
@@ -15,2 +15,3 @@ 'use strict'; | ||
exports.vk = vk; | ||
exports.ok = ok; | ||
@@ -133,2 +134,17 @@ var _assert = require('assert'); | ||
}); | ||
} | ||
function ok(url, _ref8) { | ||
var title = _ref8.title, | ||
description = _ref8.description, | ||
image = _ref8.image; | ||
(0, _assert2.default)(url, 'ok.url'); | ||
return 'https://connect.ok.ru/offer' + (0, _utils.objectToGetParams)({ | ||
url: url, | ||
title: title, | ||
description: description, | ||
imageUrl: image | ||
}); | ||
} |
{ | ||
"name": "react-share", | ||
"version": "1.12.1", | ||
"version": "1.13.0", | ||
"description": "Easy social media share buttons and share counts.", | ||
@@ -5,0 +5,0 @@ "main": "./lib/react-share.js", |
@@ -14,4 +14,4 @@ # react-share | ||
* opens a popup share-window | ||
* sharing buttons for Facebook, Twitter, Google+, LinkedIn, Pinterest, VK | ||
* share counts for Facebook, Google+, Linkedin and Pinterest | ||
* sharing buttons for Facebook, Twitter, Google+, LinkedIn, Pinterest, VK, Telegram, Whatsapp and Odnoklassniki | ||
* share counts for Facebook, Google+, Linkedin, Pinterest and VK | ||
* share buttons with generated icons or custom icons of your choice | ||
@@ -62,3 +62,4 @@ | ||
PinterestShareButton, | ||
VKShareButton | ||
VKShareButton, | ||
OKShareButton | ||
} = ShareButtons; | ||
@@ -80,2 +81,3 @@ ``` | ||
|VKShareButton|-|__`title`__: Title of the shared page (string)<br/>__`description`__: Description of the shared page (string)<br/>__`image`__: An absolute link to the image that will be shared (string)| | ||
|OKShareButton|-|__`title`__: Title of the shared page (string)<br/>__`description`__: Description of the shared page (string)<br/>__`image`__: An absolute link to the image that will be shared (string)| | ||
@@ -95,3 +97,4 @@ ##### Notes | ||
PinterestShareCount, | ||
VKShareCount | ||
VKShareCount, | ||
OKShareCount | ||
} = ShareCounts; | ||
@@ -132,2 +135,3 @@ ``` | ||
const VKIcon = generateShareIcon('vk'); | ||
const OKIcon = generateShareIcon('ok'); | ||
``` | ||
@@ -134,0 +138,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48857
790
157