hexo-component-inferno 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/core/migrate.js +10 -28
- package/lib/core/migrate.test.js +10 -12
- package/lib/core/schema.js +33 -109
- package/lib/core/schema.test.js +2 -6
- package/lib/core/view.js +3 -10
- package/lib/core/view.test.js +0 -7
- package/lib/hexo/filter/locals.js +3 -18
- package/lib/hexo/filter/locals.test.js +2 -19
- package/lib/hexo/generator/assets.js +2 -8
- package/lib/hexo/generator/assets.test.js +0 -4
- package/lib/hexo/generator/categories.test.js +0 -3
- package/lib/hexo/generator/category.js +1 -6
- package/lib/hexo/generator/category.test.js +0 -5
- package/lib/hexo/generator/insight.js +1 -9
- package/lib/hexo/generator/insight.test.js +0 -3
- package/lib/hexo/generator/manifest.js +0 -3
- package/lib/hexo/generator/manifest.test.js +0 -3
- package/lib/hexo/generator/tags.test.js +0 -3
- package/lib/hexo/helper/cdn.js +6 -19
- package/lib/hexo/helper/cdn.test.js +0 -3
- package/lib/hexo/helper/page.test.js +0 -3
- package/lib/hexo/tag/message.js +0 -8
- package/lib/hexo/tag/message.test.js +0 -7
- package/lib/hexo/tag/tabs.js +3 -35
- package/lib/hexo/tag/tabs.test.js +0 -8
- package/lib/util/cache.js +0 -11
- package/lib/util/cache.test.js +0 -4
- package/lib/util/classname.js +0 -3
- package/lib/util/classname.test.js +0 -1
- package/lib/util/yaml.js +2 -7
- package/lib/util/yaml.test.js +0 -4
- package/lib/view/comment/changyan.js +12 -31
- package/lib/view/comment/disqus.js +11 -32
- package/lib/view/comment/disqusjs.js +22 -43
- package/lib/view/comment/facebook.js +9 -28
- package/lib/view/comment/gitalk.js +28 -49
- package/lib/view/comment/gitment.js +15 -37
- package/lib/view/comment/isso.js +6 -27
- package/lib/view/comment/livere.js +6 -27
- package/lib/view/comment/twikoo.js +14 -33
- package/lib/view/comment/utterances.js +17 -45
- package/lib/view/comment/valine.js +39 -60
- package/lib/view/comment/waline.js +45 -66
- package/lib/view/common/article_media.js +11 -28
- package/lib/view/donate/afdian.js +9 -30
- package/lib/view/donate/alipay.js +9 -30
- package/lib/view/donate/buymeacoffee.js +9 -30
- package/lib/view/donate/patreon.js +9 -30
- package/lib/view/donate/paypal.js +10 -31
- package/lib/view/donate/wechat.js +9 -30
- package/lib/view/misc/article_licensing.js +21 -43
- package/lib/view/misc/meta.js +7 -34
- package/lib/view/misc/open_graph.js +25 -67
- package/lib/view/misc/paginator.js +12 -36
- package/lib/view/misc/structured_data.js +16 -43
- package/lib/view/misc/web_app.js +15 -49
- package/lib/view/plugin/baidu_analytics.js +7 -28
- package/lib/view/plugin/bing_webmaster.js +7 -28
- package/lib/view/plugin/busuanzi.js +6 -26
- package/lib/view/plugin/cnzz.js +9 -30
- package/lib/view/plugin/cookie_consent.js +28 -49
- package/lib/view/plugin/gallery.js +10 -31
- package/lib/view/plugin/google_analytics.js +7 -28
- package/lib/view/plugin/hotjar.js +7 -28
- package/lib/view/plugin/katex.js +11 -32
- package/lib/view/plugin/mathjax.js +7 -28
- package/lib/view/plugin/outdated_browser.js +10 -31
- package/lib/view/plugin/progressbar.js +7 -28
- package/lib/view/plugin/statcounter.js +10 -31
- package/lib/view/plugin/twitter_conversion_tracking.js +7 -28
- package/lib/view/search/algolia.js +14 -35
- package/lib/view/search/baidu.js +9 -28
- package/lib/view/search/google_cse.js +10 -30
- package/lib/view/search/insight.js +9 -28
- package/lib/view/share/addthis.js +6 -27
- package/lib/view/share/addtoany.js +6 -25
- package/lib/view/share/bdshare.js +6 -25
- package/lib/view/share/sharejs.js +8 -27
- package/lib/view/share/sharethis.js +6 -27
- package/lib/view/widget/adsense.js +11 -32
- package/lib/view/widget/archives.js +24 -51
- package/lib/view/widget/categories.js +23 -57
- package/lib/view/widget/followit.js +12 -31
- package/lib/view/widget/links.js +10 -32
- package/lib/view/widget/recent_posts.js +14 -36
- package/lib/view/widget/subscribe_email.js +12 -31
- package/lib/view/widget/tags.js +16 -39
- package/lib/view/widget/toc.js +26 -66
- package/package.json +1 -1
|
@@ -1,38 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
var _inferno = require("inferno");
|
|
6
|
-
|
|
7
5
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
-
|
|
9
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
10
|
-
|
|
6
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
11
7
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
12
|
-
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
10
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
14
|
-
|
|
15
11
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
16
|
-
|
|
17
12
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
18
|
-
|
|
19
13
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
20
|
-
|
|
21
14
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
22
|
-
|
|
23
15
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
24
|
-
|
|
25
16
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
26
|
-
|
|
27
17
|
/**
|
|
28
18
|
* DisqusJS comment JSX component.
|
|
29
19
|
* @module view/comment/disqusjs
|
|
30
20
|
*/
|
|
31
21
|
var _require = require('inferno'),
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
Component = _require.Component;
|
|
34
23
|
var _require2 = require('../../util/cache'),
|
|
35
|
-
|
|
24
|
+
cacheComponent = _require2.cacheComponent;
|
|
25
|
+
|
|
36
26
|
/**
|
|
37
27
|
* DisqusJS comment JSX component.
|
|
38
28
|
*
|
|
@@ -53,41 +43,33 @@ var _require2 = require('../../util/cache'),
|
|
|
53
43
|
* jsUrl="/path/to/disqus.js"
|
|
54
44
|
* cssUrl="/path/to/disqusjs.css" />
|
|
55
45
|
*/
|
|
56
|
-
|
|
57
|
-
|
|
58
46
|
var DisqusJs = /*#__PURE__*/function (_Component) {
|
|
59
47
|
_inherits(DisqusJs, _Component);
|
|
60
|
-
|
|
61
48
|
var _super = _createSuper(DisqusJs);
|
|
62
|
-
|
|
63
49
|
function DisqusJs() {
|
|
64
50
|
_classCallCheck(this, DisqusJs);
|
|
65
|
-
|
|
66
51
|
return _super.apply(this, arguments);
|
|
67
52
|
}
|
|
68
|
-
|
|
69
53
|
_createClass(DisqusJs, [{
|
|
70
54
|
key: "render",
|
|
71
55
|
value: function render() {
|
|
72
56
|
var _this$props = this.props,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
57
|
+
shortname = _this$props.shortname,
|
|
58
|
+
apiKey = _this$props.apiKey,
|
|
59
|
+
api = _this$props.api,
|
|
60
|
+
admin = _this$props.admin,
|
|
61
|
+
adminLabel = _this$props.adminLabel,
|
|
62
|
+
nesting = _this$props.nesting,
|
|
63
|
+
disqusId = _this$props.disqusId,
|
|
64
|
+
path = _this$props.path,
|
|
65
|
+
permalink = _this$props.permalink,
|
|
66
|
+
pageTitle = _this$props.pageTitle,
|
|
67
|
+
siteTitle = _this$props.siteTitle,
|
|
68
|
+
jsUrl = _this$props.jsUrl,
|
|
69
|
+
cssUrl = _this$props.cssUrl;
|
|
87
70
|
if (!shortname) {
|
|
88
71
|
return (0, _inferno.createVNode)(1, "div", "notification is-danger", [(0, _inferno.createTextVNode)("You forgot to set the "), (0, _inferno.createVNode)(1, "code", null, "shortname", 16), (0, _inferno.createTextVNode)(" or "), (0, _inferno.createVNode)(1, "code", null, "api_key", 16), (0, _inferno.createTextVNode)(" for Disqus. Please set it in "), (0, _inferno.createVNode)(1, "code", null, "_config.yml", 16), (0, _inferno.createTextVNode)(".")], 4);
|
|
89
72
|
}
|
|
90
|
-
|
|
91
73
|
var url = permalink || path;
|
|
92
74
|
var identifier = disqusId || path;
|
|
93
75
|
var js = "new DisqusJS({\n shortname: '".concat(shortname, "',\n apikey: ").concat(JSON.stringify(apiKey), ",\n ").concat(siteTitle ? "siteName: ".concat(JSON.stringify(siteTitle), ",") : '', "\n ").concat(identifier ? "identifier: ".concat(JSON.stringify(identifier), ",") : '', "\n ").concat(url ? "url: ".concat(JSON.stringify(url), ",") : '', "\n ").concat(pageTitle ? "title: ".concat(JSON.stringify(pageTitle), ",") : '', "\n ").concat(api ? "api: ".concat(JSON.stringify(api), ",") : '', "\n ").concat(admin ? "admin: ".concat(JSON.stringify(admin), ",") : '', "\n ").concat(adminLabel ? "adminLabel: ".concat(JSON.stringify(adminLabel), ",") : '', "\n ").concat(nesting ? "nesting: ".concat(JSON.stringify(nesting), ",") : '', "\n });");
|
|
@@ -107,7 +89,6 @@ var DisqusJs = /*#__PURE__*/function (_Component) {
|
|
|
107
89
|
})], 4);
|
|
108
90
|
}
|
|
109
91
|
}]);
|
|
110
|
-
|
|
111
92
|
return DisqusJs;
|
|
112
93
|
}(Component);
|
|
113
94
|
/**
|
|
@@ -136,13 +117,11 @@ var DisqusJs = /*#__PURE__*/function (_Component) {
|
|
|
136
117
|
* config={{ title: '******' }}
|
|
137
118
|
* helper={{ cdn: function() { ... } }} />
|
|
138
119
|
*/
|
|
139
|
-
|
|
140
|
-
|
|
141
120
|
DisqusJs.Cacheable = cacheComponent(DisqusJs, 'comment.disqusjs', function (props) {
|
|
142
121
|
var config = props.config,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
122
|
+
page = props.page,
|
|
123
|
+
helper = props.helper,
|
|
124
|
+
comment = props.comment;
|
|
146
125
|
return {
|
|
147
126
|
path: page.path,
|
|
148
127
|
shortname: comment.shortname,
|
|
@@ -1,38 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
var _inferno = require("inferno");
|
|
6
|
-
|
|
7
5
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
-
|
|
9
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
10
|
-
|
|
6
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
11
7
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
12
|
-
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
10
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
14
|
-
|
|
15
11
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
16
|
-
|
|
17
12
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
18
|
-
|
|
19
13
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
20
|
-
|
|
21
14
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
22
|
-
|
|
23
15
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
24
|
-
|
|
25
16
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
26
|
-
|
|
27
17
|
/**
|
|
28
18
|
* Facebook comment JSX component.
|
|
29
19
|
* @module view/comment/facebook
|
|
30
20
|
*/
|
|
31
21
|
var _require = require('inferno'),
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
Component = _require.Component;
|
|
34
23
|
var _require2 = require('../../util/cache'),
|
|
35
|
-
|
|
24
|
+
cacheComponent = _require2.cacheComponent;
|
|
25
|
+
|
|
36
26
|
/**
|
|
37
27
|
* Facebook comment JSX component.
|
|
38
28
|
*
|
|
@@ -42,25 +32,19 @@ var _require2 = require('../../util/cache'),
|
|
|
42
32
|
* language="******"
|
|
43
33
|
* permalink="/page/permanent/path" />
|
|
44
34
|
*/
|
|
45
|
-
|
|
46
|
-
|
|
47
35
|
var Facebook = /*#__PURE__*/function (_Component) {
|
|
48
36
|
_inherits(Facebook, _Component);
|
|
49
|
-
|
|
50
37
|
var _super = _createSuper(Facebook);
|
|
51
|
-
|
|
52
38
|
function Facebook() {
|
|
53
39
|
_classCallCheck(this, Facebook);
|
|
54
|
-
|
|
55
40
|
return _super.apply(this, arguments);
|
|
56
41
|
}
|
|
57
|
-
|
|
58
42
|
_createClass(Facebook, [{
|
|
59
43
|
key: "render",
|
|
60
44
|
value: function render() {
|
|
61
45
|
var _this$props = this.props,
|
|
62
|
-
|
|
63
|
-
|
|
46
|
+
language = _this$props.language,
|
|
47
|
+
permalink = _this$props.permalink;
|
|
64
48
|
var fbLanguage = language.split('-').join('_');
|
|
65
49
|
var js = "(function(d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s); js.id = id;\n js.src = \"//connect.facebook.net/".concat(fbLanguage, "/sdk.js#xfbml=1&version=v12.0\";\n fjs.parentNode.insertBefore(js, fjs);\n }(document, 'script', 'facebook-jssdk'));");
|
|
66
50
|
return (0, _inferno.createFragment)([(0, _inferno.createVNode)(1, "div", "fb-comments", null, 1, {
|
|
@@ -74,7 +58,6 @@ var Facebook = /*#__PURE__*/function (_Component) {
|
|
|
74
58
|
})], 4);
|
|
75
59
|
}
|
|
76
60
|
}]);
|
|
77
|
-
|
|
78
61
|
return Facebook;
|
|
79
62
|
}(Component);
|
|
80
63
|
/**
|
|
@@ -93,11 +76,9 @@ var Facebook = /*#__PURE__*/function (_Component) {
|
|
|
93
76
|
* permalink: '/page/permanent/link'
|
|
94
77
|
* }} />
|
|
95
78
|
*/
|
|
96
|
-
|
|
97
|
-
|
|
98
79
|
Facebook.Cacheable = cacheComponent(Facebook, 'comment.facebook', function (props) {
|
|
99
80
|
var config = props.config,
|
|
100
|
-
|
|
81
|
+
page = props.page;
|
|
101
82
|
return {
|
|
102
83
|
language: page.lang || page.language || config.language || 'en',
|
|
103
84
|
permalink: page.permalink
|
|
@@ -1,40 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
var _inferno = require("inferno");
|
|
6
|
-
|
|
7
5
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
-
|
|
9
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
10
|
-
|
|
6
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
11
7
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
12
|
-
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
10
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
14
|
-
|
|
15
11
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
16
|
-
|
|
17
12
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
18
|
-
|
|
19
13
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
20
|
-
|
|
21
14
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
22
|
-
|
|
23
15
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
24
|
-
|
|
25
16
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
26
|
-
|
|
27
17
|
/**
|
|
28
18
|
* Gitalk comment JSX component.
|
|
29
19
|
* @module view/comment/gitalk
|
|
30
20
|
*/
|
|
31
21
|
var crypto = require('crypto');
|
|
32
|
-
|
|
33
22
|
var _require = require('inferno'),
|
|
34
|
-
|
|
35
|
-
|
|
23
|
+
Component = _require.Component;
|
|
36
24
|
var _require2 = require('../../util/cache'),
|
|
37
|
-
|
|
25
|
+
cacheComponent = _require2.cacheComponent;
|
|
26
|
+
|
|
38
27
|
/**
|
|
39
28
|
* Gitalk comment JSX component.
|
|
40
29
|
*
|
|
@@ -58,48 +47,40 @@ var _require2 = require('../../util/cache'),
|
|
|
58
47
|
* jsUrl="/path/to/gitalk.js",
|
|
59
48
|
* cssUrl="/path/to/gitalk.css" />
|
|
60
49
|
*/
|
|
61
|
-
|
|
62
|
-
|
|
63
50
|
var Gitalk = /*#__PURE__*/function (_Component) {
|
|
64
51
|
_inherits(Gitalk, _Component);
|
|
65
|
-
|
|
66
52
|
var _super = _createSuper(Gitalk);
|
|
67
|
-
|
|
68
53
|
function Gitalk() {
|
|
69
54
|
_classCallCheck(this, Gitalk);
|
|
70
|
-
|
|
71
55
|
return _super.apply(this, arguments);
|
|
72
56
|
}
|
|
73
|
-
|
|
74
57
|
_createClass(Gitalk, [{
|
|
75
58
|
key: "render",
|
|
76
59
|
value: function render() {
|
|
77
60
|
var _this$props = this.props,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
61
|
+
id = _this$props.id,
|
|
62
|
+
repo = _this$props.repo,
|
|
63
|
+
owner = _this$props.owner,
|
|
64
|
+
admin = _this$props.admin,
|
|
65
|
+
clientId = _this$props.clientId,
|
|
66
|
+
clientSecret = _this$props.clientSecret,
|
|
67
|
+
_this$props$createIss = _this$props.createIssueManually,
|
|
68
|
+
createIssueManually = _this$props$createIss === void 0 ? false : _this$props$createIss,
|
|
69
|
+
_this$props$distracti = _this$props.distractionFreeMode,
|
|
70
|
+
distractionFreeMode = _this$props$distracti === void 0 ? false : _this$props$distracti,
|
|
71
|
+
_this$props$pagerDire = _this$props.pagerDirection,
|
|
72
|
+
pagerDirection = _this$props$pagerDire === void 0 ? 'last' : _this$props$pagerDire,
|
|
73
|
+
_this$props$perPage = _this$props.perPage,
|
|
74
|
+
perPage = _this$props$perPage === void 0 ? 10 : _this$props$perPage,
|
|
75
|
+
proxy = _this$props.proxy,
|
|
76
|
+
flipMoveOptions = _this$props.flipMoveOptions,
|
|
77
|
+
enableHotKey = _this$props.enableHotKey,
|
|
78
|
+
language = _this$props.language,
|
|
79
|
+
jsUrl = _this$props.jsUrl,
|
|
80
|
+
cssUrl = _this$props.cssUrl;
|
|
99
81
|
if (!id || !repo || !owner || !admin || !clientId || !clientSecret) {
|
|
100
82
|
return (0, _inferno.createVNode)(1, "div", "notification is-danger", [(0, _inferno.createTextVNode)("You forgot to set the "), (0, _inferno.createVNode)(1, "code", null, "owner", 16), (0, _inferno.createTextVNode)(", "), (0, _inferno.createVNode)(1, "code", null, "admin", 16), (0, _inferno.createTextVNode)(", "), (0, _inferno.createVNode)(1, "code", null, "repo", 16), (0, _inferno.createTextVNode)(","), (0, _inferno.createVNode)(1, "code", null, "client_id", 16), (0, _inferno.createTextVNode)(", or "), (0, _inferno.createVNode)(1, "code", null, "client_secret", 16), (0, _inferno.createTextVNode)(" for Gitalk. Please set it in"), (0, _inferno.createTextVNode)(' '), (0, _inferno.createVNode)(1, "code", null, "_config.yml", 16), (0, _inferno.createTextVNode)(".")], 0);
|
|
101
83
|
}
|
|
102
|
-
|
|
103
84
|
var js = "var gitalk = new Gitalk({\n id: ".concat(JSON.stringify(id), ",\n repo: ").concat(JSON.stringify(repo), ",\n owner: ").concat(JSON.stringify(owner), ",\n clientID: ").concat(JSON.stringify(clientId), ",\n clientSecret: ").concat(JSON.stringify(clientSecret), ",\n admin: ").concat(JSON.stringify(admin), ",\n createIssueManually: ").concat(!!createIssueManually, ",\n distractionFreeMode: ").concat(!!distractionFreeMode, ",\n perPage: ").concat(JSON.stringify(perPage), ",\n pagerDirection: ").concat(JSON.stringify(pagerDirection), ",\n ").concat(proxy ? "proxy: ".concat(JSON.stringify(proxy), ",") : '', "\n ").concat(flipMoveOptions ? "flipMoveOptions: ".concat(JSON.stringify(flipMoveOptions), ",") : '', "\n enableHotKey: ").concat(enableHotKey ? !!enableHotKey : true, ",\n ").concat(language ? "language: ".concat(JSON.stringify(language), ",") : '', "\n })\n gitalk.render('comment-container')");
|
|
104
85
|
return (0, _inferno.createFragment)([(0, _inferno.createVNode)(1, "div", null, null, 1, {
|
|
105
86
|
"id": "comment-container"
|
|
@@ -115,7 +96,6 @@ var Gitalk = /*#__PURE__*/function (_Component) {
|
|
|
115
96
|
})], 4);
|
|
116
97
|
}
|
|
117
98
|
}]);
|
|
118
|
-
|
|
119
99
|
return Gitalk;
|
|
120
100
|
}(Component);
|
|
121
101
|
/**
|
|
@@ -145,12 +125,11 @@ var Gitalk = /*#__PURE__*/function (_Component) {
|
|
|
145
125
|
* page={{ path: '/path/to/page' }}
|
|
146
126
|
* helper={{ cdn: function() {...} }} />
|
|
147
127
|
*/
|
|
148
|
-
|
|
149
|
-
|
|
150
128
|
Gitalk.Cacheable = cacheComponent(Gitalk, 'comment.gitalk', function (props) {
|
|
151
129
|
var helper = props.helper,
|
|
152
|
-
|
|
130
|
+
comment = props.comment;
|
|
153
131
|
|
|
132
|
+
// FIXME: config name change
|
|
154
133
|
var id = crypto.createHash('md5').update(props.page.path).digest('hex');
|
|
155
134
|
return {
|
|
156
135
|
id: id,
|
|
@@ -1,41 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
var _inferno = require("inferno");
|
|
6
|
-
|
|
7
5
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
-
|
|
9
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
10
|
-
|
|
6
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
11
7
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
12
|
-
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
10
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
14
|
-
|
|
15
11
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
16
|
-
|
|
17
12
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
18
|
-
|
|
19
13
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
20
|
-
|
|
21
14
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
22
|
-
|
|
23
15
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
24
|
-
|
|
25
16
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
26
|
-
|
|
27
17
|
/**
|
|
28
18
|
* Gitment comment JSX component.
|
|
29
19
|
* @module view/comment/gitment
|
|
30
20
|
* @deprecated
|
|
31
21
|
*/
|
|
32
22
|
var crypto = require('crypto');
|
|
33
|
-
|
|
34
23
|
var _require = require('inferno'),
|
|
35
|
-
|
|
36
|
-
|
|
24
|
+
Component = _require.Component;
|
|
37
25
|
var _require2 = require('../../util/cache'),
|
|
38
|
-
|
|
26
|
+
cacheComponent = _require2.cacheComponent;
|
|
27
|
+
|
|
39
28
|
/**
|
|
40
29
|
* Gitment comment JSX component.
|
|
41
30
|
*
|
|
@@ -51,37 +40,29 @@ var _require2 = require('../../util/cache'),
|
|
|
51
40
|
* perPage={10},
|
|
52
41
|
* maxCommentHeight={250} />
|
|
53
42
|
*/
|
|
54
|
-
|
|
55
|
-
|
|
56
43
|
var Gitment = /*#__PURE__*/function (_Component) {
|
|
57
44
|
_inherits(Gitment, _Component);
|
|
58
|
-
|
|
59
45
|
var _super = _createSuper(Gitment);
|
|
60
|
-
|
|
61
46
|
function Gitment() {
|
|
62
47
|
_classCallCheck(this, Gitment);
|
|
63
|
-
|
|
64
48
|
return _super.apply(this, arguments);
|
|
65
49
|
}
|
|
66
|
-
|
|
67
50
|
_createClass(Gitment, [{
|
|
68
51
|
key: "render",
|
|
69
52
|
value: function render() {
|
|
70
53
|
var _this$props = this.props,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
54
|
+
id = _this$props.id,
|
|
55
|
+
repo = _this$props.repo,
|
|
56
|
+
owner = _this$props.owner,
|
|
57
|
+
clientId = _this$props.clientId,
|
|
58
|
+
clientSecret = _this$props.clientSecret,
|
|
59
|
+
_this$props$perPage = _this$props.perPage,
|
|
60
|
+
perPage = _this$props$perPage === void 0 ? 20 : _this$props$perPage,
|
|
61
|
+
_this$props$maxCommen = _this$props.maxCommentHeight,
|
|
62
|
+
maxCommentHeight = _this$props$maxCommen === void 0 ? 250 : _this$props$maxCommen;
|
|
81
63
|
if (!id || !repo || !owner || !clientId || !clientSecret) {
|
|
82
64
|
return (0, _inferno.createVNode)(1, "div", "notification is-danger", [(0, _inferno.createTextVNode)("You forgot to set the "), (0, _inferno.createVNode)(1, "code", null, "owner", 16), (0, _inferno.createTextVNode)(", "), (0, _inferno.createVNode)(1, "code", null, "repo", 16), (0, _inferno.createTextVNode)(", "), (0, _inferno.createVNode)(1, "code", null, "clientId", 16), (0, _inferno.createTextVNode)(", or"), (0, _inferno.createTextVNode)(' '), (0, _inferno.createVNode)(1, "code", null, "clientSecret", 16), (0, _inferno.createTextVNode)(" for Gitment. Please set it in "), (0, _inferno.createVNode)(1, "code", null, "_config.yml", 16), (0, _inferno.createTextVNode)(".")], 0);
|
|
83
65
|
}
|
|
84
|
-
|
|
85
66
|
var js = "var gitment = new Gitment({\n id: '".concat(id, "',\n repo: '").concat(repo, "',\n owner: '").concat(owner, "',\n oauth: {\n client_id: '").concat(clientId, "',\n client_secret: '").concat(clientSecret, "',\n },\n perPage: ").concat(perPage, ",\n maxCommentHeight: ").concat(maxCommentHeight, "\n })\n gitment.render('comment-container')");
|
|
86
67
|
return (0, _inferno.createFragment)([(0, _inferno.createVNode)(1, "div", null, null, 1, {
|
|
87
68
|
"id": "comment-container"
|
|
@@ -97,7 +78,6 @@ var Gitment = /*#__PURE__*/function (_Component) {
|
|
|
97
78
|
})], 4);
|
|
98
79
|
}
|
|
99
80
|
}]);
|
|
100
|
-
|
|
101
81
|
return Gitment;
|
|
102
82
|
}(Component);
|
|
103
83
|
/**
|
|
@@ -120,8 +100,6 @@ var Gitment = /*#__PURE__*/function (_Component) {
|
|
|
120
100
|
* }}
|
|
121
101
|
* page={{ path: '/path/to/page' }} />
|
|
122
102
|
*/
|
|
123
|
-
|
|
124
|
-
|
|
125
103
|
Gitment.Cacheable = cacheComponent(Gitment, 'comment.gitment', function (props) {
|
|
126
104
|
var comment = props.comment;
|
|
127
105
|
var id = crypto.createHash('md5').update(props.page.path).digest('hex');
|
package/lib/view/comment/isso.js
CHANGED
|
@@ -1,38 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
4
|
var _inferno = require("inferno");
|
|
6
|
-
|
|
7
5
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
-
|
|
9
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
10
|
-
|
|
6
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
11
7
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
12
|
-
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
10
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
14
|
-
|
|
15
11
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
16
|
-
|
|
17
12
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
18
|
-
|
|
19
13
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
20
|
-
|
|
21
14
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
22
|
-
|
|
23
15
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
24
|
-
|
|
25
16
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
26
|
-
|
|
27
17
|
/**
|
|
28
18
|
* Isso comment JSX component.
|
|
29
19
|
* @module view/comment/isso
|
|
30
20
|
*/
|
|
31
21
|
var _require = require('inferno'),
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
Component = _require.Component;
|
|
34
23
|
var _require2 = require('../../util/cache'),
|
|
35
|
-
|
|
24
|
+
cacheComponent = _require2.cacheComponent;
|
|
25
|
+
|
|
36
26
|
/**
|
|
37
27
|
* Isso comment JSX component.
|
|
38
28
|
*
|
|
@@ -40,28 +30,20 @@ var _require2 = require('../../util/cache'),
|
|
|
40
30
|
* @example
|
|
41
31
|
* <Isso url="/path/to/isso/server" />
|
|
42
32
|
*/
|
|
43
|
-
|
|
44
|
-
|
|
45
33
|
var Isso = /*#__PURE__*/function (_Component) {
|
|
46
34
|
_inherits(Isso, _Component);
|
|
47
|
-
|
|
48
35
|
var _super = _createSuper(Isso);
|
|
49
|
-
|
|
50
36
|
function Isso() {
|
|
51
37
|
_classCallCheck(this, Isso);
|
|
52
|
-
|
|
53
38
|
return _super.apply(this, arguments);
|
|
54
39
|
}
|
|
55
|
-
|
|
56
40
|
_createClass(Isso, [{
|
|
57
41
|
key: "render",
|
|
58
42
|
value: function render() {
|
|
59
43
|
var url = this.props.url;
|
|
60
|
-
|
|
61
44
|
if (!url) {
|
|
62
45
|
return (0, _inferno.createVNode)(1, "div", "notification is-danger", [(0, _inferno.createTextVNode)("You forgot to set the "), (0, _inferno.createVNode)(1, "code", null, "url", 16), (0, _inferno.createTextVNode)(" for Isso. Please set it in "), (0, _inferno.createVNode)(1, "code", null, "_config.yml", 16), (0, _inferno.createTextVNode)(".")], 4);
|
|
63
46
|
}
|
|
64
|
-
|
|
65
47
|
return (0, _inferno.createFragment)([(0, _inferno.createVNode)(1, "div", null, null, 1, {
|
|
66
48
|
"id": "isso-thread"
|
|
67
49
|
}), (0, _inferno.createVNode)(1, "script", null, null, 1, {
|
|
@@ -70,7 +52,6 @@ var Isso = /*#__PURE__*/function (_Component) {
|
|
|
70
52
|
})], 4);
|
|
71
53
|
}
|
|
72
54
|
}]);
|
|
73
|
-
|
|
74
55
|
return Isso;
|
|
75
56
|
}(Component);
|
|
76
57
|
/**
|
|
@@ -83,8 +64,6 @@ var Isso = /*#__PURE__*/function (_Component) {
|
|
|
83
64
|
* @example
|
|
84
65
|
* <Isso.Cacheable comment={{ url: "/path/to/isso/server" }} />
|
|
85
66
|
*/
|
|
86
|
-
|
|
87
|
-
|
|
88
67
|
Isso.Cacheable = cacheComponent(Isso, 'comment.isso', function (props) {
|
|
89
68
|
var comment = props.comment;
|
|
90
69
|
return {
|