Comparing version 1.0.1 to 1.0.2
54
index.js
@@ -11,2 +11,6 @@ 'use strict'; | ||
var _react2 = _interopRequireDefault(_react); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -24,31 +28,33 @@ | ||
var _this = _possibleConstructorReturn(this, (Widgets.__proto__ || Object.getPrototypeOf(Widgets)).call(this)); | ||
return _possibleConstructorReturn(this, (Widgets.__proto__ || Object.getPrototypeOf(Widgets)).apply(this, arguments)); | ||
} | ||
if (!window.__3fp) { | ||
var _this$props = _this.props, | ||
license = _this$props.license, | ||
onLoaded = _this$props.onLoaded, | ||
onError = _this$props.onError; | ||
_createClass(Widgets, [{ | ||
key: 'componentDidMount', | ||
value: function componentDidMount() { | ||
if (!window.__3fp) { | ||
var _props = this.props, | ||
license = _props.license, | ||
onLoaded = _props.onLoaded, | ||
onError = _props.onError; | ||
if (!license) { | ||
console.error('You forgot to provide 3ForPage license id. Widgets will not work correctly.'); | ||
return _possibleConstructorReturn(_this); | ||
if (!license) { | ||
console.error('You forgot to provide 3ForPage license id. Widgets will not work correctly.'); | ||
return; | ||
} | ||
window.__3fp = window.__3fp || {}; | ||
window.__3fp.license = license; | ||
var fp = document.createElement('script'); | ||
fp.type = 'text/javascript'; | ||
fp.async = true; | ||
fp.src = 'https://widgets-3forpage.firebaseapp.com/widgets.js'; | ||
var s = document.getElementsByTagName('script')[0]; | ||
s.parentNode.insertBefore(fp, s); | ||
fp.addEventListener('load', onLoaded); | ||
fp.addEventListener('error', onError); | ||
} | ||
window.__3fp = window.__3fp || {}; | ||
window.__3fp.license = license; | ||
var fp = document.createElement('script'); | ||
fp.type = 'text/javascript'; | ||
fp.async = true; | ||
fp.src = 'https://widgets-3forpage.firebaseapp.com/widgets.js'; | ||
var s = document.getElementsByTagName('script')[0]; | ||
s.parentNode.insertBefore(fp, s); | ||
fp.addEventListener('load', onLoaded); | ||
fp.addEventListener('error', onError); | ||
} | ||
return _this; | ||
} | ||
_createClass(Widgets, [{ | ||
}, { | ||
key: 'render', | ||
@@ -55,0 +61,0 @@ value: function render() { |
{ | ||
"name": "3forpage", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "React component for widgets from 3forpage.com", | ||
@@ -5,0 +5,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
3624
51