react-social-kr
Advanced tools
Comparing version 1.0.3 to 1.1.0
@@ -0,1 +1,28 @@ | ||
## react-social-kr | ||
#### 1.1.0 (2017-06-14) | ||
* Refactoring applied eslint. | ||
* Merge changes from [origin](https://github.com/olahol/react-social) 1.8.0 ~1.9.0. | ||
#### 1.0.3 (2017-02-20) | ||
* Add Korean Social Media buttons. `NaverBlogButton `, `KaKaoStoryButton`, `KaKaoTalkButton` | ||
#### 1.0.0 (2017-02-20) | ||
* Project converted | ||
## From [Origin: olahol/react-social](https://github.com/olahol/react-social) | ||
##### 1.9.0 (2017-04-09) | ||
* Add `title` to `RedditButton` and `LinkedInButton`. | ||
##### 1.8.0 (2017-03-21) | ||
* Add default traget blank to EmailButton. | ||
* Add `title` and `message` parameter to VK button. | ||
##### 1.7.1 (2017-01-20) | ||
@@ -2,0 +29,0 @@ |
@@ -7,2 +7,10 @@ 'use strict'; | ||
var _createReactClass = require('create-react-class'); | ||
var _createReactClass2 = _interopRequireDefault(_createReactClass); | ||
var _propTypes = require('prop-types'); | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -38,3 +46,3 @@ | ||
var called = false; | ||
var now = +new Date(); | ||
var now = new Date(); | ||
var id = now + '_' + Math.floor(Math.random() * 1000); | ||
@@ -107,5 +115,5 @@ | ||
propTypes: { | ||
element: _react.PropTypes.string, | ||
pathname: _react.PropTypes.string, | ||
getLocation: _react.PropTypes.func, | ||
element: _propTypes2.default.string, | ||
pathname: _propTypes2.default.string, | ||
getLocation: _propTypes2.default.func, | ||
token: _react2.default.PropTypes.string | ||
@@ -181,11 +189,11 @@ }, | ||
propTypes: { | ||
element: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.func]), | ||
pathname: _react.PropTypes.string, | ||
getLocation: _react.PropTypes.func, | ||
media: _react.PropTypes.string, | ||
message: _react.PropTypes.string, | ||
onClick: _react.PropTypes.func, | ||
target: _react.PropTypes.string, | ||
windowOptions: _react.PropTypes.array, | ||
_open: _react.PropTypes.bool, | ||
element: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.func]), | ||
pathname: _propTypes2.default.string, | ||
getLocation: _propTypes2.default.func, | ||
media: _propTypes2.default.string, | ||
message: _propTypes2.default.string, | ||
onClick: _propTypes2.default.func, | ||
target: _propTypes2.default.string, | ||
windowOptions: _propTypes2.default.array, | ||
_open: _propTypes2.default.bool, | ||
sharer: _react2.default.PropTypes.bool | ||
@@ -218,3 +226,3 @@ }, | ||
return _react2.default.createElement(this.props.element, Object.assign({ 'onClick': this.click }, other)); | ||
return _react2.default.createElement(this.props.element, Object.assign({ onClick: this.click }, other)); | ||
} | ||
@@ -230,7 +238,7 @@ }; | ||
/* Counts */ | ||
exports.FacebookCount = _react2.default.createClass({ | ||
exports.FacebookCount = (0, _createReactClass2.default)({ | ||
displayName: 'FacebookCount', | ||
propTypes: { | ||
pathname: _react.PropTypes.string, | ||
getLocation: _react.PropTypes.func | ||
pathname: _propTypes2.default.string, | ||
getLocation: _propTypes2.default.func | ||
}, | ||
@@ -241,5 +249,5 @@ mixins: [Count], | ||
if (!this.props.token) { | ||
url = "https://graph.facebook.com/?callback=@&id=" + encodeURIComponent(this.props.getLocation(this.props.pathname)); | ||
url = 'https://graph.facebook.com/?callback=@&id=' + encodeURIComponent(this.props.getLocation(this.props.pathname)); | ||
} else { | ||
url = "https://graph.facebook.com/v2.8/?callback=@" + "&id=" + encodeURIComponent(this.props.getLocation(this.props.pathname)) + "&access_token=" + encodeURIComponent(this.props.token); | ||
url = 'https://graph.facebook.com/v2.8/?callback=@&id=' + encodeURIComponent(this.props.getLocation(this.props.pathname)) + '&access_token=' + encodeURIComponent(this.props.token); | ||
} | ||
@@ -258,7 +266,7 @@ | ||
exports.TwitterCount = _react2.default.createClass({ | ||
exports.TwitterCount = (0, _createReactClass2.default)({ | ||
displayName: 'TwitterCount', | ||
propTypes: { | ||
pathname: _react.PropTypes.string, | ||
getLocation: _react.PropTypes.func | ||
pathname: _propTypes2.default.string, | ||
getLocation: _propTypes2.default.func | ||
}, | ||
@@ -274,7 +282,7 @@ mixins: [Count], | ||
exports.GooglePlusCount = _react2.default.createClass({ | ||
exports.GooglePlusCount = (0, _createReactClass2.default)({ | ||
displayName: 'GooglePlusCount', | ||
propTypes: { | ||
pathname: _react.PropTypes.string, | ||
getLocation: _react.PropTypes.func | ||
pathname: _propTypes2.default.string, | ||
getLocation: _propTypes2.default.func | ||
}, | ||
@@ -290,7 +298,7 @@ mixins: [Count], | ||
exports.PinterestCount = _react2.default.createClass({ | ||
exports.PinterestCount = (0, _createReactClass2.default)({ | ||
displayName: 'PinterestCount', | ||
propTypes: { | ||
pathname: _react.PropTypes.string, | ||
getLocation: _react.PropTypes.func | ||
pathname: _propTypes2.default.string, | ||
getLocation: _propTypes2.default.func | ||
}, | ||
@@ -306,7 +314,7 @@ mixins: [Count], | ||
exports.LinkedInCount = _react2.default.createClass({ | ||
exports.LinkedInCount = (0, _createReactClass2.default)({ | ||
displayName: 'LinkedInCount', | ||
propTypes: { | ||
pathname: _react.PropTypes.string, | ||
getLocation: _react.PropTypes.func | ||
pathname: _propTypes2.default.string, | ||
getLocation: _propTypes2.default.func | ||
}, | ||
@@ -322,7 +330,7 @@ mixins: [Count], | ||
exports.RedditCount = _react2.default.createClass({ | ||
exports.RedditCount = (0, _createReactClass2.default)({ | ||
displayName: 'RedditCount', | ||
propTypes: { | ||
pathname: _react.PropTypes.string, | ||
getLocation: _react.PropTypes.func | ||
pathname: _propTypes2.default.string, | ||
getLocation: _propTypes2.default.func | ||
}, | ||
@@ -345,7 +353,7 @@ mixins: [Count], | ||
exports.VKontakteCount = _react2.default.createClass({ | ||
exports.VKontakteCount = (0, _createReactClass2.default)({ | ||
displayName: 'VKontakteCount', | ||
propTypes: { | ||
pathname: _react.PropTypes.string, | ||
getLocation: _react.PropTypes.func | ||
pathname: _propTypes2.default.string, | ||
getLocation: _propTypes2.default.func | ||
}, | ||
@@ -361,7 +369,7 @@ mixins: [Count], | ||
exports.TumblrCount = _react2.default.createClass({ | ||
exports.TumblrCount = (0, _createReactClass2.default)({ | ||
displayName: 'TumblrCount', | ||
propTypes: { | ||
pathname: _react.PropTypes.string, | ||
getLocation: _react.PropTypes.func | ||
pathname: _propTypes2.default.string, | ||
getLocation: _propTypes2.default.func | ||
}, | ||
@@ -377,7 +385,7 @@ mixins: [Count], | ||
exports.PocketCount = _react2.default.createClass({ | ||
exports.PocketCount = (0, _createReactClass2.default)({ | ||
displayName: 'PocketCount', | ||
propTypes: { | ||
pathname: _react.PropTypes.string, | ||
getLocation: _react.PropTypes.func | ||
pathname: _propTypes2.default.string, | ||
getLocation: _propTypes2.default.func | ||
}, | ||
@@ -394,10 +402,10 @@ mixins: [Count], | ||
/* Buttons */ | ||
exports.FacebookButton = _react2.default.createClass({ | ||
exports.FacebookButton = (0, _createReactClass2.default)({ | ||
displayName: 'FacebookButton', | ||
propTypes: { | ||
appId: _react.PropTypes.oneOfType([_react.PropTypes.string, _react.PropTypes.number]).isRequired, | ||
pathname: _react.PropTypes.string, | ||
getLocation: _react.PropTypes.func, | ||
appId: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.number]).isRequired, | ||
pathname: _propTypes2.default.string, | ||
getLocation: _propTypes2.default.func, | ||
sharer: _react2.default.PropTypes.bool, | ||
message: _react.PropTypes.string | ||
message: _propTypes2.default.string | ||
}, | ||
@@ -407,15 +415,15 @@ mixins: [Button, DefaultBlankTarget], | ||
if (this.props.sharer) { | ||
return "https://www.facebook.com/dialog/share?" + "app_id=" + encodeURIComponent(this.props.appId) + "&display=popup&caption=" + encodeURIComponent(this.props.message) + "&href=" + encodeURIComponent(this.props.getLocation(this.props.pathname)) + "&redirect_uri=" + encodeURIComponent("https://www.facebook.com/"); | ||
return 'https://www.facebook.com/dialog/share?' + 'app_id=' + encodeURIComponent(this.props.appId) + '&display=popup&caption=' + encodeURIComponent(this.props.message) + '&href=' + encodeURIComponent(this.props.getLocation(this.props.pathname)) + '&redirect_uri=' + encodeURIComponent('https://www.facebook.com/'); | ||
} | ||
return "https://www.facebook.com/dialog/feed?" + "app_id=" + encodeURIComponent(this.props.appId) + "&display=popup&caption=" + encodeURIComponent(this.props.message) + "&link=" + encodeURIComponent(this.props.getLocation(this.props.pathname)) + "&picture=" + encodeURIComponent(this.props.media) + "&redirect_uri=" + encodeURIComponent("https://www.facebook.com/"); | ||
return 'https://www.facebook.com/dialog/feed?' + 'app_id=' + encodeURIComponent(this.props.appId) + '&display=popup&caption=' + encodeURIComponent(this.props.message) + '&link=' + encodeURIComponent(this.props.getLocation(this.props.pathname)) + '&picture=' + encodeURIComponent(this.props.media) + '&redirect_uri=' + encodeURIComponent('https://www.facebook.com/'); | ||
} | ||
}); | ||
exports.TwitterButton = _react2.default.createClass({ | ||
exports.TwitterButton = (0, _createReactClass2.default)({ | ||
displayName: 'TwitterButton', | ||
propTypes: { | ||
pathname: _react.PropTypes.string, | ||
getLocation: _react.PropTypes.func, | ||
message: _react.PropTypes.string | ||
pathname: _propTypes2.default.string, | ||
getLocation: _propTypes2.default.func, | ||
message: _propTypes2.default.string | ||
}, | ||
@@ -429,13 +437,10 @@ mixins: [Button, DefaultBlankTarget], | ||
exports.EmailButton = _react2.default.createClass({ | ||
exports.EmailButton = (0, _createReactClass2.default)({ | ||
displayName: 'EmailButton', | ||
propTypes: { | ||
pathname: _react.PropTypes.string, | ||
getLocation: _react.PropTypes.func, | ||
message: _react.PropTypes.string | ||
pathname: _propTypes2.default.string, | ||
getLocation: _propTypes2.default.func, | ||
message: _propTypes2.default.string | ||
}, | ||
mixins: [Button], | ||
getDefaultProps: function getDefaultProps() { | ||
return { target: '_self' }; | ||
}, | ||
constructUrl: function constructUrl() { | ||
@@ -446,9 +451,9 @@ return 'mailto:?subject=' + encodeURIComponent(this.props.message) + '&body=' + encodeURIComponent(this.props.getLocation(this.props.pathname)); | ||
exports.PinterestButton = _react2.default.createClass({ | ||
exports.PinterestButton = (0, _createReactClass2.default)({ | ||
displayName: 'PinterestButton', | ||
propTypes: { | ||
pathname: _react.PropTypes.string, | ||
getLocation: _react.PropTypes.func, | ||
media: _react.PropTypes.string.isRequired, | ||
message: _react.PropTypes.string.isRequired | ||
pathname: _propTypes2.default.string, | ||
getLocation: _propTypes2.default.func, | ||
media: _propTypes2.default.string.isRequired, | ||
message: _propTypes2.default.string.isRequired | ||
}, | ||
@@ -462,19 +467,19 @@ mixins: [Button, DefaultBlankTarget], | ||
exports.VKontakteButton = _react2.default.createClass({ | ||
exports.VKontakteButton = (0, _createReactClass2.default)({ | ||
displayName: 'VKontakteButton', | ||
propTypes: { | ||
pathname: _react.PropTypes.string, | ||
getLocation: _react.PropTypes.func | ||
pathname: _propTypes2.default.string, | ||
getLocation: _propTypes2.default.func | ||
}, | ||
mixins: [Button, DefaultBlankTarget], | ||
constructUrl: function constructUrl() { | ||
return 'http://vk.com/share.php?url=' + encodeURIComponent(this.props.getLocation(this.props.pathname)); | ||
return 'http://vk.com/share.php?url=' + encodeURIComponent(this.props.getLocation(this.props.pathname)) + '&title=' + encodeURIComponent(this.props.title) + '&description=' + encodeURIComponent(this.props.message); | ||
} | ||
}); | ||
exports.GooglePlusButton = _react2.default.createClass({ | ||
exports.GooglePlusButton = (0, _createReactClass2.default)({ | ||
displayName: 'GooglePlusButton', | ||
propTypes: { | ||
pathname: _react.PropTypes.string, | ||
getLocation: _react.PropTypes.func | ||
pathname: _propTypes2.default.string, | ||
getLocation: _propTypes2.default.func | ||
}, | ||
@@ -487,32 +492,32 @@ mixins: [Button, DefaultBlankTarget], | ||
exports.RedditButton = _react2.default.createClass({ | ||
exports.RedditButton = (0, _createReactClass2.default)({ | ||
displayName: 'RedditButton', | ||
propTypes: { | ||
pathname: _react.PropTypes.string, | ||
getLocation: _react.PropTypes.func | ||
pathname: _propTypes2.default.string, | ||
getLocation: _propTypes2.default.func | ||
}, | ||
mixins: [Button, DefaultBlankTarget], | ||
constructUrl: function constructUrl() { | ||
return 'https://www.reddit.com/submit?url=' + encodeURIComponent(this.props.getLocation(this.props.pathname)); | ||
return 'https://www.reddit.com/submit?url=' + encodeURIComponent(this.props.getLocation(this.props.pathname)) + '&title=' + encodeURIComponent(this.props.title); | ||
} | ||
}); | ||
exports.LinkedInButton = _react2.default.createClass({ | ||
exports.LinkedInButton = (0, _createReactClass2.default)({ | ||
displayName: 'LinkedInButton', | ||
propTypes: { | ||
pathname: _react.PropTypes.string, | ||
getLocation: _react.PropTypes.func | ||
pathname: _propTypes2.default.string, | ||
getLocation: _propTypes2.default.func | ||
}, | ||
mixins: [Button, DefaultBlankTarget], | ||
constructUrl: function constructUrl() { | ||
return 'https://www.linkedin.com/shareArticle?url=' + encodeURIComponent(this.props.getLocation(this.props.pathname)); | ||
return 'https://www.linkedin.com/shareArticle?url=' + encodeURIComponent(this.props.getLocation(this.props.pathname)) + '&title=' + encodeURIComponent(this.props.title); | ||
} | ||
}); | ||
exports.XingButton = _react2.default.createClass({ | ||
exports.XingButton = (0, _createReactClass2.default)({ | ||
displayName: 'XingButton', | ||
propTypes: { | ||
pathname: _react.PropTypes.string, | ||
getLocation: _react.PropTypes.func, | ||
message: _react.PropTypes.string | ||
pathname: _propTypes2.default.string, | ||
getLocation: _propTypes2.default.func, | ||
message: _propTypes2.default.string | ||
}, | ||
@@ -525,8 +530,8 @@ mixins: [Button, DefaultBlankTarget], | ||
exports.TumblrButton = _react2.default.createClass({ | ||
exports.TumblrButton = (0, _createReactClass2.default)({ | ||
displayName: 'TumblrButton', | ||
propTypes: { | ||
pathname: _react.PropTypes.string, | ||
getLocation: _react.PropTypes.func, | ||
message: _react.PropTypes.string | ||
pathname: _propTypes2.default.string, | ||
getLocation: _propTypes2.default.func, | ||
message: _propTypes2.default.string | ||
}, | ||
@@ -539,8 +544,8 @@ mixins: [Button, DefaultBlankTarget], | ||
exports.PocketButton = _react2.default.createClass({ | ||
exports.PocketButton = (0, _createReactClass2.default)({ | ||
displayName: 'PocketButton', | ||
propTypes: { | ||
pathname: _react.PropTypes.string, | ||
getLocation: _react.PropTypes.func, | ||
message: _react.PropTypes.string | ||
pathname: _propTypes2.default.string, | ||
getLocation: _propTypes2.default.func, | ||
message: _propTypes2.default.string | ||
}, | ||
@@ -553,7 +558,7 @@ mixins: [Button, DefaultBlankTarget], | ||
exports.NaverBlogButton = _react2.default.createClass({ | ||
exports.NaverBlogButton = (0, _createReactClass2.default)({ | ||
displayName: 'NaverBlogButton', | ||
propTypes: { | ||
pathname: _react.PropTypes.string, | ||
getLocation: _react.PropTypes.func | ||
pathname: _propTypes2.default.string, | ||
getLocation: _propTypes2.default.func | ||
}, | ||
@@ -566,7 +571,7 @@ mixins: [Button, DefaultBlankTarget], | ||
exports.KaKaoStoryButton = _react2.default.createClass({ | ||
exports.KaKaoStoryButton = (0, _createReactClass2.default)({ | ||
displayName: 'KaKaoStoryButton', | ||
propTypes: { | ||
pathname: _react.PropTypes.string, | ||
getLocation: _react.PropTypes.func | ||
pathname: _propTypes2.default.string, | ||
getLocation: _propTypes2.default.func | ||
}, | ||
@@ -579,10 +584,10 @@ mixins: [Button, DefaultBlankTarget], | ||
exports.KaKaoTalkButton = _react2.default.createClass({ | ||
exports.KaKaoTalkButton = (0, _createReactClass2.default)({ | ||
displayName: 'KaKaoTalkButton', | ||
propTypes: { | ||
pathname: _react.PropTypes.string, | ||
getLocation: _react.PropTypes.func, | ||
message: _react.PropTypes.string, | ||
id: _react.PropTypes.string, | ||
jsKey: _react.PropTypes.string | ||
pathname: _propTypes2.default.string, | ||
getLocation: _propTypes2.default.func, | ||
message: _propTypes2.default.string, | ||
id: _propTypes2.default.string, | ||
jsKey: _propTypes2.default.string | ||
}, | ||
@@ -595,5 +600,5 @@ componentDidMount: function componentDidMount() { | ||
if (!document.getElementById('KakaoJSSDK')) { | ||
var scriptKakaoJS = document.createElement("script"); | ||
var scriptKakaoJS = document.createElement('script'); | ||
scriptKakaoJS.id = 'KakaoJSSDK'; | ||
scriptKakaoJS.src = "//developers.kakao.com/sdk/js/kakao.min.js"; | ||
scriptKakaoJS.src = '//developers.kakao.com/sdk/js/kakao.min.js'; | ||
document.body.appendChild(scriptKakaoJS); | ||
@@ -618,2 +623,3 @@ } | ||
}, | ||
mixins: [Button, DefaultBlankTarget], | ||
@@ -620,0 +626,0 @@ constructUrl: function constructUrl() { |
{ | ||
"name": "react-social-kr", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"description": "React social buttons and counts for Facebook, Pinterest, Google, Naver, KaKao etc ...", | ||
@@ -9,16 +9,7 @@ "main": "lib/react-social.js", | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.22.2", | ||
"babel-preset-es2015": "^6.22.0", | ||
"beefy": "~2.1.1", | ||
"browserify": "~8.1.1", | ||
"jquery": "^2.2.3", | ||
"react": "^15.0.1", | ||
"react-dom": "^15.0.1", | ||
"tape": "^4.5.1", | ||
"tape-run": "^2.1.3" | ||
}, | ||
"scripts": { | ||
"lint": "eslint -c .eslintrc src", | ||
"lintfix": "eslint -c .eslintrc src --fix", | ||
"build": "babel src --presets babel-preset-es2015 --out-dir lib", | ||
"prepublish": "npm run build", | ||
"prepublish": "npm run lint && npm run build", | ||
"dev": "beefy dev.js --live", | ||
@@ -54,3 +45,20 @@ "test": "browserify test.js | tape-run" | ||
}, | ||
"dependencies": {} | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"babel-cli": "^6.22.2", | ||
"babel-eslint": "^7.1.1", | ||
"babel-preset-es2015": "^6.22.0", | ||
"beefy": "~2.1.1", | ||
"browserify": "~8.1.1", | ||
"eslint": "^3.14.0", | ||
"eslint-config-airbnb": "^14.0.0", | ||
"eslint-plugin-import": "^2.2.0", | ||
"eslint-plugin-jsx-a11y": "^4.0.0", | ||
"eslint-plugin-react": "^6.9.0", | ||
"jquery": "^2.2.3", | ||
"react": "^15.0.1", | ||
"react-dom": "^15.0.1", | ||
"tape": "^4.5.1", | ||
"tape-run": "^2.1.3" | ||
} | ||
} |
@@ -130,2 +130,10 @@ # react-social-kr | ||
##### title | ||
- VKButton | ||
- RedditButton | ||
- LinkedInButton | ||
Title of your shared content. | ||
##### media | ||
@@ -190,2 +198,5 @@ | ||
* Ryan Nevius (@rnevius) | ||
* David Lakata (@dlakata) | ||
* Roman Kosovichev (@roma-so) | ||
* Igor Pnev (@exdeniz) | ||
@@ -192,0 +203,0 @@ |
@@ -122,3 +122,3 @@ var React = require("react"); | ||
test("EmailButton", function (t) { | ||
t.plan(testButton(t, "EmailButton", "_self")); | ||
t.plan(testButton(t, "EmailButton")); | ||
}); | ||
@@ -125,0 +125,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
35727
12
681
214
15