react-line-social
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -43,3 +43,3 @@ 'use strict'; | ||
value: function componentDidMount() { | ||
if (!global.script) { | ||
if (!_utils2.default.getScript()) { | ||
var script = document.createElement('script'); | ||
@@ -55,3 +55,3 @@ script.id = 'recaptcha'; | ||
document.body.appendChild(script); | ||
global.script = script; | ||
_utils2.default.setScript(script); | ||
} | ||
@@ -58,0 +58,0 @@ } |
@@ -43,3 +43,3 @@ 'use strict'; | ||
value: function componentDidMount() { | ||
if (!global.script) { | ||
if (!_utils2.default.getScript()) { | ||
var script = document.createElement('script'); | ||
@@ -55,3 +55,3 @@ script.id = 'recaptcha'; | ||
document.body.appendChild(script); | ||
global.script = script; | ||
_utils2.default.setScript(script); | ||
} | ||
@@ -73,3 +73,3 @@ } | ||
'data-type': 'like', | ||
'data-url': url | ||
'data-url': location.href | ||
}, share && { 'data-share': 'true' }, lineid && { 'data-lineid': lineid })); | ||
@@ -84,3 +84,2 @@ } | ||
locale: _propTypes2.default.oneOf(['en', 'ja', 'zh-TW', 'th', 'id']), | ||
url: _propTypes2.default.string.isRequired, | ||
share: _propTypes2.default.bool, | ||
@@ -87,0 +86,0 @@ lineid: _propTypes2.default.string |
@@ -41,3 +41,3 @@ 'use strict'; | ||
value: function componentDidMount() { | ||
if (!global.script) { | ||
if (!_utils2.default.getScript()) { | ||
var script = document.createElement('script'); | ||
@@ -56,3 +56,3 @@ script.id = 'recaptcha'; | ||
document.body.appendChild(script); | ||
global.script = script; | ||
_utils2.default.setScript(script); | ||
} | ||
@@ -72,3 +72,3 @@ } | ||
'data-type': 'share-a', | ||
'data-url': url }); | ||
'data-url': location.href }); | ||
} | ||
@@ -81,4 +81,3 @@ }]); | ||
Share.propTypes = { | ||
locale: _propTypes2.default.oneOf(['en', 'ja', 'zh-TW', 'th', 'id']), | ||
url: _propTypes2.default.string.isRequired | ||
locale: _propTypes2.default.oneOf(['en', 'ja', 'zh-TW', 'th', 'id']) | ||
}; | ||
@@ -85,0 +84,0 @@ |
@@ -6,5 +6,15 @@ 'use strict'; | ||
}); | ||
var lineScript = void 0; | ||
var Utils = { | ||
localeToLang: function localeToLang(locale) { | ||
return 'zh-TW' === locale ? 'zh_Hant' : locale; | ||
}, | ||
setScript: function setScript(script) { | ||
if (!lineScript) { | ||
lineScript = script; | ||
} | ||
}, | ||
getScript: function getScript() { | ||
return lineScript; | ||
} | ||
@@ -11,0 +21,0 @@ }; |
{ | ||
"name": "react-line-social", | ||
"author": "szchenghuang <szchenghuang@gmail.com>", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Line Social Plugins in React", | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
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
15978
235