q78kgblog 0.0.0-1720441708496 → 0.0.0-1720859005089

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.
Files changed (133) hide show
  1. package/404.html +3 -3
  2. package/about/index.html +5 -5
  3. package/archives/2023/02/index.html +4 -4
  4. package/archives/2023/04/index.html +4 -4
  5. package/archives/2023/05/index.html +4 -4
  6. package/archives/2023/08/index.html +4 -4
  7. package/archives/2023/09/index.html +4 -4
  8. package/archives/2023/index.html +4 -4
  9. package/archives/2024/01/index.html +4 -4
  10. package/archives/2024/02/index.html +4 -4
  11. package/archives/2024/index.html +4 -4
  12. package/archives/index.html +4 -4
  13. package/atom.xml +9 -9
  14. package/baidusitemap.xml +8 -8
  15. package/bangumis/index.html +4 -4
  16. package/bigpie/index.html +3 -3
  17. package/categories/Hexo/index.html +4 -4
  18. package/categories/index.html +3 -3
  19. package/categories//345/271/264/347/273/210/346/200/273/347/273/223/index.html +4 -4
  20. package/categories//347/264/240/346/235/220/index.html +4 -4
  21. package/categories//351/227/262/350/201/212/346/235/202/350/260/210/index.html +4 -4
  22. package/content.json +1 -1
  23. package/css/404page.css +1 -65
  24. package/css/ariasakablog.css +1 -6669
  25. package/css/commentBarrage.css +1 -118
  26. package/css/danmaku.css +1 -106
  27. package/css/essay.css +1 -306
  28. package/css/iconfont.css +1 -55
  29. package/css/index.css +1 -7006
  30. package/css/people.css +1 -18
  31. package/css/stylessimple.css +1 -40
  32. package/css/swiperstyle.css +1 -567
  33. package/fcircle/index.html +3 -3
  34. package/fontawesome/index.html +3 -3
  35. package/index.html +11 -11
  36. package/js/aplayersave.js +1 -268
  37. package/js/baiduhistory.js +1 -76
  38. package/js/browser.js +1 -35
  39. package/js/calendar.js +1 -380
  40. package/js/cate.js +1 -22
  41. package/js/commentBarrage.js +17 -232
  42. package/js/commentsCount.js +1 -43
  43. package/js/copy.js +1 -23
  44. package/js/countup.js +1 -209
  45. package/js/cursor.js +1 -82
  46. package/js/danmaku.js +0 -106
  47. package/js/day.js +13 -195
  48. package/js/dianzan.js +1 -249
  49. package/js/dis.js +4 -252
  50. package/js/dist/baiduhistory.dev.js +1 -102
  51. package/js/dist/bbtalk.dev.js +159 -12872
  52. package/js/dist/bbtalklunbo.dev.js +1 -45
  53. package/js/dist/calendar.dev.js +1 -395
  54. package/js/dist/fixbugpjax.dev.js +1 -8
  55. package/js/dist/gongnong.dev.js +1 -565
  56. package/js/dist/heimu.dev.js +1 -19
  57. package/js/dist/links.dev.js +1 -13
  58. package/js/dist/main.dev.js +5 -843
  59. package/js/dist/resizeTop.dev.js +1 -50
  60. package/js/dist/seo.dev.js +1 -33
  61. package/js/dist/twikoo.all.min.dev.js +946 -1
  62. package/js/fixbugpjax.js +1 -7
  63. package/js/fixed_card_widget.js +1 -46
  64. package/js/fps.js +1 -58
  65. package/js/gitalker.js +1 -11
  66. package/js/heimu.js +1 -16
  67. package/js/hide.show.js +1 -17
  68. package/js/languages.js +1 -511
  69. package/js/latest.js +1 -49
  70. package/js/local-search.js +2 -476
  71. package/js/lunar.js +1 -1071
  72. package/js/lyxTalk.js +1 -12
  73. package/js/main.js +5 -781
  74. package/js/nav.js +1 -30
  75. package/js/noie.js +1 -3
  76. package/js/owo.js +1 -52
  77. package/js/people.js +2 -175
  78. package/js/randomFriend.js +1 -95
  79. package/js/resizeTop.js +1 -43
  80. package/js/rightmenu.js +3 -333
  81. package/js/sakura.js +1 -164
  82. package/js/search/algolia.js +4 -154
  83. package/js/search/local-search.js +1 -188
  84. package/js/settings.js +3 -343
  85. package/js/sitetime.js +1 -25
  86. package/js/smooth-scrolling.js +1 -546
  87. package/js/sw-toolbox.js +1 -16
  88. package/js/swiperinit.js +1 -23
  89. package/js/tw_cn.js +1 -100
  90. package/js/utils.js +1 -278
  91. package/js/welcome.js +1 -107
  92. package/js/welcomeconsole.js +1 -23
  93. package/links/index.html +3 -3
  94. package/othersite/index.html +3 -3
  95. package/package.json +1 -1
  96. package/posts/164ef646/index.html +6 -6
  97. package/posts/228c2ef8/index.html +6 -6
  98. package/posts/a9a6c1fb/index.html +6 -6
  99. package/posts/c262e439/index.html +6 -6
  100. package/posts/c81531cf/index.html +6 -6
  101. package/posts/ccdf7cfc/index.html +6 -6
  102. package/posts/de1f83f4/index.html +6 -6
  103. package/posts/e54f7476/index.html +6 -6
  104. package/sitemap.xml +49 -49
  105. package/sw.js +2 -193
  106. package/swReg.js +1 -29
  107. package/tags/AI/index.html +5 -5
  108. package/tags/Butterfly/index.html +5 -5
  109. package/tags/Cloudflare/index.html +5 -5
  110. package/tags/DiffSinger/index.html +5 -5
  111. package/tags/Hexo/index.html +5 -5
  112. package/tags/Next/index.html +5 -5
  113. package/tags/RAID/index.html +5 -5
  114. package/tags/Vercel/index.html +5 -5
  115. package/tags/Workers/index.html +5 -5
  116. package/tags/index.html +3 -3
  117. package/tags//344/270/273/351/242/230/index.html +5 -5
  118. package/tags//345/206/231/344/275/234/index.html +5 -5
  119. package/tags//345/245/263/346/200/247/346/204/217/350/257/206/index.html +5 -5
  120. package/tags//345/255/246/344/271/240/index.html +5 -5
  121. package/tags//345/256/266/351/207/214/344/272/221/index.html +5 -5
  122. package/tags//345/271/264/347/273/210/346/200/273/347/273/223/index.html +5 -5
  123. package/tags//346/212/230/350/205/276/index.html +5 -5
  124. package/tags//346/227/245/345/270/270/index.html +5 -5
  125. package/tags//346/234/215/345/212/241/345/231/250/index.html +5 -5
  126. package/tags//346/265/252/346/275/256/index.html +5 -5
  127. package/tags//347/256/200/347/210/261/index.html +5 -5
  128. package/tags//350/207/252/345/212/250/346/240/207/346/263/250/index.html +5 -5
  129. package/tags//350/256/272/346/226/207/index.html +5 -5
  130. package/tags//350/260/267/346/255/214/347/277/273/350/257/221/index.html +5 -5
  131. package/tags//350/264/237/350/275/275/345/235/207/350/241/241/index.html +5 -5
  132. package/tags//351/207/221/345/217/245/index.html +5 -5
  133. package/tags//351/255/224/346/224/271/index.html +5 -5
package/js/latest.js CHANGED
@@ -1,49 +1 @@
1
- // 新代码
2
-
3
- // // 确保其他页面第一个不添加
4
- if (location.pathname == '/') newPost();
5
-
6
- // // 最新文章
7
- function newPost() {
8
- let ls = document.querySelectorAll('.recent-post-info')
9
- // 先让时间和索引值都等于第一个的
10
- let time = new Date(ls[0].querySelector('.post-meta-date-created').getAttribute('datetime')).getTime();
11
- let index = 0
12
- // 遍历数组,如果有时间比time大的则替换
13
- ls.forEach((i, num) => {
14
- let t = new Date(i.querySelector('.post-meta-date-created').getAttribute('datetime')).getTime()
15
- if (t > time) {
16
- time = t;
17
- index = num
18
- }
19
- })
20
- // 单数在右,双数在左
21
- // let className = index % 2 == 0 ? 'newPost-right' : 'newPost-left'
22
- // ls[index].innerHTML += '<span class="' + className + '">最 新</span>';
23
- // 如果你不想让其一左一右,可以注释上面的启用下面的
24
- ls[index].innerHTML += '<span class="newPost-left">最新</span>';
25
- }
26
-
27
-
28
- // 老代码
29
- // // 确保其他页面第一个不添加
30
- // if (location.pathname == '/') newPost();
31
-
32
- // // 最新文章
33
- // function newPost() {
34
- // // 获取此类名而不是获取recent-post-item是因为一些插件也会使用recent-post-item类。
35
- // // 所以获取recent-post-info可以确保每一篇都是文章。
36
- // let ls = document.querySelectorAll('.recent-post-info')
37
- // for (let i = 0; i < ls.length; i++) {
38
- // // 如果是置顶则跳过,所以如果你最新文章置顶的话就无法添加标志,只会给到置顶下面最新的文章。
39
- // // 不过一般来说置顶文章都会是早期文章,实在不行置顶之后再写一篇😂
40
- // if (ls[i].querySelector('.sticky')) continue;
41
- // let className = '';
42
- // // 封面在右则在左边添加,否则在右边
43
- // // 其实你也可以直接放在左边,我之所以这样弄是为了避免和分类图标冲突
44
- // if (ls[i].previousSibling.classList.contains('right')) className = 'newPost-left';
45
- // else className = 'newPost-right';
46
- // ls[i].innerHTML += '<span class="' + className + '">最 新</span>';
47
- // return
48
- // }
49
- // }
1
+ location.pathname=="/"&&newPost();function newPost(){let e=document.querySelectorAll(".recent-post-info"),t=new Date(e[0].querySelector(".post-meta-date-created").getAttribute("datetime")).getTime(),a=0;e.forEach((i,o)=>{let n=new Date(i.querySelector(".post-meta-date-created").getAttribute("datetime")).getTime();n>t&&(t=n,a=o)}),e[a].innerHTML+='<span class="newPost-left">\u6700\u65B0</span>'}
@@ -1,476 +1,2 @@
1
- "use strict";
2
-
3
- function _typeof(t) {
4
- return (_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) {
5
- return typeof t
6
- } : function (t) {
7
- return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
8
- })(t)
9
- }
10
-
11
- function _regeneratorRuntime() {
12
- _regeneratorRuntime = function () {
13
- return i
14
- };
15
- var i = {},
16
- t = Object.prototype,
17
- s = t.hasOwnProperty,
18
- e = "function" == typeof Symbol ? Symbol : {},
19
- n = e.iterator || "@@iterator",
20
- r = e.asyncIterator || "@@asyncIterator",
21
- o = e.toStringTag || "@@toStringTag";
22
-
23
- function a(t, e, r) {
24
- return Object.defineProperty(t, e, {
25
- value: r,
26
- enumerable: !0,
27
- configurable: !0,
28
- writable: !0
29
- }), t[e]
30
- }
31
- try {
32
- a({}, "")
33
- } catch (t) {
34
- a = function (t, e, r) {
35
- return t[e] = r
36
- }
37
- }
38
-
39
- function c(t, e, r, n) {
40
- var o, a, i, c, e = e && e.prototype instanceof h ? e : h,
41
- e = Object.create(e.prototype),
42
- n = new b(n || []);
43
- return e._invoke = (o = t, a = r, i = n, c = "suspendedStart", function (t, e) {
44
- if ("executing" === c) throw new Error("Generator is already running");
45
- if ("completed" === c) {
46
- if ("throw" === t) throw e;
47
- return x()
48
- }
49
- for (i.method = t, i.arg = e;;) {
50
- var r = i.delegate;
51
- if (r) {
52
- r = function t(e, r) {
53
- var n = e.iterator[r.method];
54
- if (void 0 === n) {
55
- if (r.delegate = null, "throw" === r.method) {
56
- if (e.iterator.return && (r.method = "return", r.arg = void 0, t(e, r), "throw" === r.method)) return l;
57
- r.method = "throw", r.arg = new TypeError("The iterator does not provide a 'throw' method")
58
- }
59
- return l
60
- }
61
- n = u(n, e.iterator, r.arg);
62
- if ("throw" === n.type) return r.method = "throw", r.arg = n.arg, r.delegate = null, l;
63
- n = n.arg;
64
- return n ? n.done ? (r[e.resultName] = n.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = void 0), r.delegate = null, l) : n : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, l)
65
- }(r, i);
66
- if (r) {
67
- if (r === l) continue;
68
- return r
69
- }
70
- }
71
- if ("next" === i.method) i.sent = i._sent = i.arg;
72
- else if ("throw" === i.method) {
73
- if ("suspendedStart" === c) throw c = "completed", i.arg;
74
- i.dispatchException(i.arg)
75
- } else "return" === i.method && i.abrupt("return", i.arg);
76
- c = "executing";
77
- r = u(o, a, i);
78
- if ("normal" === r.type) {
79
- if (c = i.done ? "completed" : "suspendedYield", r.arg === l) continue;
80
- return {
81
- value: r.arg,
82
- done: i.done
83
- }
84
- }
85
- "throw" === r.type && (c = "completed", i.method = "throw", i.arg = r.arg)
86
- }
87
- }), e
88
- }
89
-
90
- function u(t, e, r) {
91
- try {
92
- return {
93
- type: "normal",
94
- arg: t.call(e, r)
95
- }
96
- } catch (t) {
97
- return {
98
- type: "throw",
99
- arg: t
100
- }
101
- }
102
- }
103
- i.wrap = c;
104
- var l = {};
105
-
106
- function h() {}
107
-
108
- function f() {}
109
-
110
- function d() {}
111
- var e = {},
112
- y = (a(e, n, function () {
113
- return this
114
- }), Object.getPrototypeOf),
115
- y = y && y(y(L([]))),
116
- p = (y && y !== t && s.call(y, n) && (e = y), d.prototype = h.prototype = Object.create(e));
117
-
118
- function m(t) {
119
- ["next", "throw", "return"].forEach(function (e) {
120
- a(t, e, function (t) {
121
- return this._invoke(e, t)
122
- })
123
- })
124
- }
125
-
126
- function v(i, c) {
127
- var e;
128
- this._invoke = function (r, n) {
129
- function t() {
130
- return new c(function (t, e) {
131
- ! function e(t, r, n, o) {
132
- var a, t = u(i[t], i, r);
133
- if ("throw" !== t.type) return (r = (a = t.arg).value) && "object" == _typeof(r) && s.call(r, "__await") ? c.resolve(r.__await).then(function (t) {
134
- e("next", t, n, o)
135
- }, function (t) {
136
- e("throw", t, n, o)
137
- }) : c.resolve(r).then(function (t) {
138
- a.value = t, n(a)
139
- }, function (t) {
140
- return e("throw", t, n, o)
141
- });
142
- o(t.arg)
143
- }(r, n, t, e)
144
- })
145
- }
146
- return e = e ? e.then(t, t) : t()
147
- }
148
- }
149
-
150
- function g(t) {
151
- var e = {
152
- tryLoc: t[0]
153
- };
154
- 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e)
155
- }
156
-
157
- function w(t) {
158
- var e = t.completion || {};
159
- e.type = "normal", delete e.arg, t.completion = e
160
- }
161
-
162
- function b(t) {
163
- this.tryEntries = [{
164
- tryLoc: "root"
165
- }], t.forEach(g, this), this.reset(!0)
166
- }
167
-
168
- function L(e) {
169
- if (e) {
170
- var r, t = e[n];
171
- if (t) return t.call(e);
172
- if ("function" == typeof e.next) return e;
173
- if (!isNaN(e.length)) return r = -1, (t = function t() {
174
- for (; ++r < e.length;)
175
- if (s.call(e, r)) return t.value = e[r], t.done = !1, t;
176
- return t.value = void 0, t.done = !0, t
177
- }).next = t
178
- }
179
- return {
180
- next: x
181
- }
182
- }
183
-
184
- function x() {
185
- return {
186
- value: void 0,
187
- done: !0
188
- }
189
- }
190
- return a(p, "constructor", f.prototype = d), a(d, "constructor", f), f.displayName = a(d, o, "GeneratorFunction"), i.isGeneratorFunction = function (t) {
191
- t = "function" == typeof t && t.constructor;
192
- return !!t && (t === f || "GeneratorFunction" === (t.displayName || t.name))
193
- }, i.mark = function (t) {
194
- return Object.setPrototypeOf ? Object.setPrototypeOf(t, d) : (t.__proto__ = d, a(t, o, "GeneratorFunction")), t.prototype = Object.create(p), t
195
- }, i.awrap = function (t) {
196
- return {
197
- __await: t
198
- }
199
- }, m(v.prototype), a(v.prototype, r, function () {
200
- return this
201
- }), i.AsyncIterator = v, i.async = function (t, e, r, n, o) {
202
- void 0 === o && (o = Promise);
203
- var a = new v(c(t, e, r, n), o);
204
- return i.isGeneratorFunction(e) ? a : a.next().then(function (t) {
205
- return t.done ? t.value : a.next()
206
- })
207
- }, m(p), a(p, o, "Generator"), a(p, n, function () {
208
- return this
209
- }), a(p, "toString", function () {
210
- return "[object Generator]"
211
- }), i.keys = function (r) {
212
- var t, n = [];
213
- for (t in r) n.push(t);
214
- return n.reverse(),
215
- function t() {
216
- for (; n.length;) {
217
- var e = n.pop();
218
- if (e in r) return t.value = e, t.done = !1, t
219
- }
220
- return t.done = !0, t
221
- }
222
- }, i.values = L, b.prototype = {
223
- constructor: b,
224
- reset: function (t) {
225
- if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = !1, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(w), !t)
226
- for (var e in this) "t" === e.charAt(0) && s.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = void 0)
227
- },
228
- stop: function () {
229
- this.done = !0;
230
- var t = this.tryEntries[0].completion;
231
- if ("throw" === t.type) throw t.arg;
232
- return this.rval
233
- },
234
- dispatchException: function (r) {
235
- if (this.done) throw r;
236
- var n = this;
237
-
238
- function t(t, e) {
239
- return a.type = "throw", a.arg = r, n.next = t, e && (n.method = "next", n.arg = void 0), !!e
240
- }
241
- for (var e = this.tryEntries.length - 1; 0 <= e; --e) {
242
- var o = this.tryEntries[e],
243
- a = o.completion;
244
- if ("root" === o.tryLoc) return t("end");
245
- if (o.tryLoc <= this.prev) {
246
- var i = s.call(o, "catchLoc"),
247
- c = s.call(o, "finallyLoc");
248
- if (i && c) {
249
- if (this.prev < o.catchLoc) return t(o.catchLoc, !0);
250
- if (this.prev < o.finallyLoc) return t(o.finallyLoc)
251
- } else if (i) {
252
- if (this.prev < o.catchLoc) return t(o.catchLoc, !0)
253
- } else {
254
- if (!c) throw new Error("try statement without catch or finally");
255
- if (this.prev < o.finallyLoc) return t(o.finallyLoc)
256
- }
257
- }
258
- }
259
- },
260
- abrupt: function (t, e) {
261
- for (var r = this.tryEntries.length - 1; 0 <= r; --r) {
262
- var n = this.tryEntries[r];
263
- if (n.tryLoc <= this.prev && s.call(n, "finallyLoc") && this.prev < n.finallyLoc) {
264
- var o = n;
265
- break
266
- }
267
- }
268
- var a = (o = o && ("break" === t || "continue" === t) && o.tryLoc <= e && e <= o.finallyLoc ? null : o) ? o.completion : {};
269
- return a.type = t, a.arg = e, o ? (this.method = "next", this.next = o.finallyLoc, l) : this.complete(a)
270
- },
271
- complete: function (t, e) {
272
- if ("throw" === t.type) throw t.arg;
273
- return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), l
274
- },
275
- finish: function (t) {
276
- for (var e = this.tryEntries.length - 1; 0 <= e; --e) {
277
- var r = this.tryEntries[e];
278
- if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), w(r), l
279
- }
280
- },
281
- catch: function (t) {
282
- for (var e = this.tryEntries.length - 1; 0 <= e; --e) {
283
- var r, n, o = this.tryEntries[e];
284
- if (o.tryLoc === t) return "throw" === (r = o.completion).type && (n = r.arg, w(o)), n
285
- }
286
- throw new Error("illegal catch attempt")
287
- },
288
- delegateYield: function (t, e, r) {
289
- return this.delegate = {
290
- iterator: L(t),
291
- resultName: e,
292
- nextLoc: r
293
- }, "next" === this.method && (this.arg = void 0), l
294
- }
295
- }, i
296
- }
297
-
298
- function _toConsumableArray(t) {
299
- return _arrayWithoutHoles(t) || _iterableToArray(t) || _unsupportedIterableToArray(t) || _nonIterableSpread()
300
- }
301
-
302
- function _nonIterableSpread() {
303
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
304
- }
305
-
306
- function _unsupportedIterableToArray(t, e) {
307
- var r;
308
- if (t) return "string" == typeof t ? _arrayLikeToArray(t, e) : "Map" === (r = "Object" === (r = Object.prototype.toString.call(t).slice(8, -1)) && t.constructor ? t.constructor.name : r) || "Set" === r ? Array.from(t) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? _arrayLikeToArray(t, e) : void 0
309
- }
310
-
311
- function _iterableToArray(t) {
312
- if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t)
313
- }
314
-
315
- function _arrayWithoutHoles(t) {
316
- if (Array.isArray(t)) return _arrayLikeToArray(t)
317
- }
318
-
319
- function _arrayLikeToArray(t, e) {
320
- (null == e || e > t.length) && (e = t.length);
321
- for (var r = 0, n = new Array(e); r < e; r++) n[r] = t[r];
322
- return n
323
- }
324
-
325
- function asyncGeneratorStep(t, e, r, n, o, a, i) {
326
- try {
327
- var c = t[a](i),
328
- s = c.value
329
- } catch (t) {
330
- return void r(t)
331
- }
332
- c.done ? e(s) : Promise.resolve(s).then(n, o)
333
- }
334
-
335
- function _asyncToGenerator(c) {
336
- return function () {
337
- var t = this,
338
- i = arguments;
339
- return new Promise(function (e, r) {
340
- var n = c.apply(t, i);
341
-
342
- function o(t) {
343
- asyncGeneratorStep(n, e, r, o, a, "next", t)
344
- }
345
-
346
- function a(t) {
347
- asyncGeneratorStep(n, e, r, o, a, "throw", t)
348
- }
349
- o(void 0)
350
- })
351
- }
352
- }
353
- window.addEventListener("load", function () {
354
- function t() {
355
- var t = document.body.style;
356
- t.width = "100%", t.overflow = "hidden", btf.animateIn(n, "to_show 0.5s"), btf.animateIn(document.querySelector("#local-search .search-dialog"), "titleScale 0.5s"), setTimeout(function () {
357
- document.querySelector("#local-search-input input").focus()
358
- }, 100), r || (c(), r = !0), document.addEventListener("keydown", function t(e) {
359
- "Escape" === e.code && (a(), document.removeEventListener("keydown", t))
360
- })
361
- }
362
-
363
- function e() {
364
- document.querySelector("#search-button > .search").addEventListener("click", t);
365
- }
366
- var r = !1,
367
- o = [],
368
- n = document.getElementById("search-mask"),
369
- a = function () {
370
- var t = document.body.style;
371
- t.width = "", t.overflow = "", btf.animateOut(document.querySelector("#local-search .search-dialog"), "search_close .5s"), btf.animateOut(n, "to_hide 0.5s")
372
- },
373
- i = function () {
374
- var e = _asyncToGenerator(_regeneratorRuntime().mark(function t(e) {
375
- var r, n, o, a;
376
- return _regeneratorRuntime().wrap(function (t) {
377
- for (;;) switch (t.prev = t.next) {
378
- case 0:
379
- return r = [], t.next = 3, fetch(e);
380
- case 3:
381
- if (n = t.sent, /\.json$/.test(e)) return t.next = 7, n.json();
382
- t.next = 10;
383
- break;
384
- case 7:
385
- r = t.sent, t.next = 20;
386
- break;
387
- case 10:
388
- return t.next = 12, n.text();
389
- case 12:
390
- return o = t.sent, t.next = 15, (new window.DOMParser).parseFromString(o, "text/xml");
391
- case 15:
392
- return o = t.sent, t.next = 18, o;
393
- case 18:
394
- a = t.sent, r = _toConsumableArray(a.querySelectorAll("entry")).map(function (t) {
395
- var r = [],
396
- e = (t.querySelector("tags") && t.querySelector("tags").getElementsByTagName("tag") && Array.prototype.forEach.call(t.querySelector("tags").getElementsByTagName("tag"), function (t, e) {
397
- r.push(t.textContent)
398
- }), t.querySelector("content") && t.querySelector("content").textContent),
399
- n = /src=[\'\"]?([^\'\"]*)[\'\"]?/i,
400
- o = e.match(/<img.*?(?:>|\/>)/gi),
401
- a = [];
402
- if (o)
403
- for (var i = 0; i < o.length; i++) {
404
- var c = o[i].match(n);
405
- c[1].indexOf("http") || a.push(c[1])
406
- }
407
- return {
408
- title: t.querySelector("title").textContent,
409
- content: e,
410
- url: t.querySelector("url").textContent,
411
- tags: r,
412
- oneImage: a && a[0]
413
- }
414
- });
415
- case 20:
416
- return n.ok && ((a = document.getElementById("loading-database")).nextElementSibling.style.display = "block", a.remove()), t.abrupt("return", r);
417
- case 22:
418
- case "end":
419
- return t.stop()
420
- }
421
- }, t)
422
- }));
423
- return function (t) {
424
- return e.apply(this, arguments)
425
- }
426
- }(),
427
- c = function () {
428
- GLOBAL_CONFIG.localSearch.preload || (o = i(GLOBAL_CONFIG.localSearch.path));
429
- var t = document.querySelector("#local-search-input input"),
430
- r = document.getElementById("local-search-results"),
431
- n = document.getElementById("loading-status");
432
- t.addEventListener("input", function () {
433
- var m, e = this,
434
- v = this.value.trim().toLowerCase().split(/[\s]+/),
435
- g = ("" !== v[0] && (n.innerHTML = '<i class="fas fa-spinner fa-pulse"></i>'), r.innerHTML = "", '<div class="search-result-list">');
436
- v.length <= 0 || (m = 0, o.then(function (t) {
437
- t.forEach(function (t) {
438
- var r, n = !0,
439
- o = t.title ? t.title.trim().toLowerCase() : "",
440
- e = t.tags,
441
- a = null != (a = t.oneImage) ? a : "",
442
- i = t.content ? t.content.trim().replace(/<[^>]+>/g, "").toLowerCase() : "",
443
- t = t.url.startsWith("/") ? t.url : GLOBAL_CONFIG.root + t.url,
444
- c = -1,
445
- s = -1;
446
- if ("" !== o || "" !== i ? v.forEach(function (t, e) {
447
- r = o.indexOf(t), c = i.indexOf(t), r < 0 && c < 0 ? n = !1 : (c < 0 && (c = 0), 0 === e && (s = c))
448
- }) : n = !1, n) {
449
- if (0 <= s) {
450
- var u = s - 30,
451
- l = s + 100,
452
- h = "",
453
- f = "",
454
- d = (0 === (u = u < 0 ? 0 : u) ? l = 100 : h = "...", l > i.length ? l = i.length : f = "...", i.substring(u, l));
455
- if (v.forEach(function (t) {
456
- var e = new RegExp(t, "gi");
457
- d = d.replace(e, '<span class="search-keyword">' + t + "</span>"), o = o.replace(e, '<span class="search-keyword">' + t + "</span>")
458
- }), g = (g = (g += '<div class="local-search__hit-item">') + (a ? '<div class="search-left"><img src='.concat(a, " alt=").concat(a, " data-fancybox='gallery'>") : '<div class="search-left" style="width:0">')) + "</div>" + (a ? '<div class="search-right"><a href="' + t + '" class="search-result-title">' + o + "</a>" : '<div class="search-right" style="width: 100%"><a href="' + t + '" class="search-result-title">' + o + "</a>"), m += 1, "" !== i && (g += '<p class="search-result" onclick="pjax.loadUrl(`' + t + '`)">' + h + d + f + "</p>"), e.length) {
459
- g += '<div class="search-result-tags">';
460
- for (var y = 0; y < e.length; y++) {
461
- var p = e[y].trim();
462
- g += '<a class="tag-list" href="/tags/' + p + '/" data-pjax-state="" one-link-mark="yes">#' + p + "</a>"
463
- }
464
- g += "</div>"
465
- }
466
- }
467
- g += "</div></div>"
468
- }
469
- }), 0 === m && (g += '<div id="local-search__hits-empty">' + GLOBAL_CONFIG.localSearch.languages.hits_empty.replace(/\$\{query}/, e.value.trim()) + "</div>"), g += "</div>", r.innerHTML = g, "" !== v[0] && (n.innerHTML = ""), window.pjax && window.pjax.refresh(r)
470
- }))
471
- })
472
- };
473
- e(), document.querySelector("#local-search .search-close-button").addEventListener("click", a), n.addEventListener("click", a), GLOBAL_CONFIG.localSearch.preload && (o = i(GLOBAL_CONFIG.localSearch.path)), window.addEventListener("pjax:complete", function () {
474
- btf.isHidden(n) || a(), e()
475
- })
476
- });
1
+ "use strict";function _typeof(n){return(_typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l})(n)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return n};var n={},l=Object.prototype,s=l.hasOwnProperty,m=typeof Symbol=="function"?Symbol:{},b=m.iterator||"@@iterator",j=m.asyncIterator||"@@asyncIterator",E=m.toStringTag||"@@toStringTag";function d(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{d({},"")}catch{d=function(e,r,a){return e[r]=a}}function q(t,v,r,F){var o,p,i,g,v=v&&v.prototype instanceof A?v:A,v=Object.create(v.prototype),F=new T(F||[]);return v._invoke=(o=t,p=r,i=F,g="suspendedStart",function(L,G){if(g==="executing")throw new Error("Generator is already running");if(g==="completed"){if(L==="throw")throw G;return O()}for(i.method=L,i.arg=G;;){var w=i.delegate;if(w&&(w=function H(I,c){var N=I.iterator[c.method];if(N===void 0){if(c.delegate=null,c.method==="throw"){if(I.iterator.return&&(c.method="return",c.arg=void 0,H(I,c),c.method==="throw"))return f;c.method="throw",c.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}return N=y(N,I.iterator,c.arg),N.type==="throw"?(c.method="throw",c.arg=N.arg,c.delegate=null,f):(N=N.arg,N?N.done?(c[I.resultName]=N.value,c.next=I.nextLoc,c.method!=="return"&&(c.method="next",c.arg=void 0),c.delegate=null,f):N:(c.method="throw",c.arg=new TypeError("iterator result is not an object"),c.delegate=null,f))}(w,i),w)){if(w===f)continue;return w}if(i.method==="next")i.sent=i._sent=i.arg;else if(i.method==="throw"){if(g==="suspendedStart")throw g="completed",i.arg;i.dispatchException(i.arg)}else i.method==="return"&&i.abrupt("return",i.arg);if(g="executing",w=y(o,p,i),w.type==="normal"){if(g=i.done?"completed":"suspendedYield",w.arg===f)continue;return{value:w.arg,done:i.done}}w.type==="throw"&&(g="completed",i.method="throw",i.arg=w.arg)}}),v}function y(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(a){return{type:"throw",arg:a}}}n.wrap=q;var f={};function A(){}function S(){}function _(){}var m={},u=(d(m,b,function(){return this}),Object.getPrototypeOf),u=u&&u(u(x([]))),h=(u&&u!==l&&s.call(u,b)&&(m=u),_.prototype=A.prototype=Object.create(m));function C(t){["next","throw","return"].forEach(function(e){d(t,e,function(r){return this._invoke(e,r)})})}function B(t,e){var r;this._invoke=function(a,o){function p(){return new e(function(i,g){(function v(I,L,G,w){var H,I=y(t[I],t,L);if(I.type!=="throw")return(L=(H=I.arg).value)&&_typeof(L)=="object"&&s.call(L,"__await")?e.resolve(L.__await).then(function(c){v("next",c,G,w)},function(c){v("throw",c,G,w)}):e.resolve(L).then(function(c){H.value=c,G(H)},function(c){return v("throw",c,G,w)});w(I.arg)})(a,o,i,g)})}return r=r?r.then(p,p):p()}}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function x(t){if(t){var e,r=t[b];if(r)return r.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length))return e=-1,(r=function a(){for(;++e<t.length;)if(s.call(t,e))return a.value=t[e],a.done=!1,a;return a.value=void 0,a.done=!0,a}).next=r}return{next:O}}function O(){return{value:void 0,done:!0}}return d(h,"constructor",S.prototype=_),d(_,"constructor",S),S.displayName=d(_,E,"GeneratorFunction"),n.isGeneratorFunction=function(t){return t=typeof t=="function"&&t.constructor,!!t&&(t===S||(t.displayName||t.name)==="GeneratorFunction")},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,_):(t.__proto__=_,d(t,E,"GeneratorFunction")),t.prototype=Object.create(h),t},n.awrap=function(t){return{__await:t}},C(B.prototype),d(B.prototype,j,function(){return this}),n.AsyncIterator=B,n.async=function(t,e,r,a,o){o===void 0&&(o=Promise);var p=new B(q(t,e,r,a),o);return n.isGeneratorFunction(e)?p:p.next().then(function(i){return i.done?i.value:p.next()})},C(h),d(h,E,"Generator"),d(h,b,function(){return this}),d(h,"toString",function(){return"[object Generator]"}),n.keys=function(t){var e,r=[];for(e in t)r.push(e);return r.reverse(),function a(){for(;r.length;){var o=r.pop();if(o in t)return a.value=o,a.done=!1,a}return a.done=!0,a}},n.values=x,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!t)for(var e in this)e.charAt(0)==="t"&&s.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(v,F){return p.type="throw",p.arg=t,e.next=v,F&&(e.method="next",e.arg=void 0),!!F}for(var a=this.tryEntries.length-1;0<=a;--a){var o=this.tryEntries[a],p=o.completion;if(o.tryLoc==="root")return r("end");if(o.tryLoc<=this.prev){var i=s.call(o,"catchLoc"),g=s.call(o,"finallyLoc");if(i&&g){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(i){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!g)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&s.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}var p=(o=o&&(t==="break"||t==="continue")&&o.tryLoc<=e&&e<=o.finallyLoc?null:o)?o.completion:{};return p.type=t,p.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(p)},complete:function(t,e){if(t.type==="throw")throw t.arg;return t.type==="break"||t.type==="continue"?this.next=t.arg:t.type==="return"?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):t.type==="normal"&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,a,o=this.tryEntries[e];if(o.tryLoc===t)return(r=o.completion).type==="throw"&&(a=r.arg,k(o)),a}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:x(t),resultName:e,nextLoc:r},this.method==="next"&&(this.arg=void 0),f}},n}function _toConsumableArray(n){return _arrayWithoutHoles(n)||_iterableToArray(n)||_unsupportedIterableToArray(n)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray(n,l){var s;if(n)return typeof n=="string"?_arrayLikeToArray(n,l):(s=(s=Object.prototype.toString.call(n).slice(8,-1))==="Object"&&n.constructor?n.constructor.name:s)==="Map"||s==="Set"?Array.from(n):s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?_arrayLikeToArray(n,l):void 0}function _iterableToArray(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function _arrayWithoutHoles(n){if(Array.isArray(n))return _arrayLikeToArray(n)}function _arrayLikeToArray(n,l){(l==null||l>n.length)&&(l=n.length);for(var s=0,b=new Array(l);s<l;s++)b[s]=n[s];return b}function asyncGeneratorStep(n,l,s,b,j,E,d){try{var q=n[E](d),y=q.value}catch(f){return void s(f)}q.done?l(y):Promise.resolve(y).then(b,j)}function _asyncToGenerator(n){return function(){var l=this,s=arguments;return new Promise(function(b,j){var E=n.apply(l,s);function d(y){asyncGeneratorStep(E,b,j,d,q,"next",y)}function q(y){asyncGeneratorStep(E,b,j,d,q,"throw",y)}d(void 0)})}}window.addEventListener("load",function(){function n(){var y=document.body.style;y.width="100%",y.overflow="hidden",btf.animateIn(j,"to_show 0.5s"),btf.animateIn(document.querySelector("#local-search .search-dialog"),"titleScale 0.5s"),setTimeout(function(){document.querySelector("#local-search-input input").focus()},100),s||(q(),s=!0),document.addEventListener("keydown",function f(A){A.code==="Escape"&&(E(),document.removeEventListener("keydown",f))})}function l(){document.querySelector("#search-button > .search").addEventListener("click",n)}var s=!1,b=[],j=document.getElementById("search-mask"),E=function(){var y=document.body.style;y.width="",y.overflow="",btf.animateOut(document.querySelector("#local-search .search-dialog"),"search_close .5s"),btf.animateOut(j,"to_hide 0.5s")},d=function(){var y=_asyncToGenerator(_regeneratorRuntime().mark(function f(A){var S,_,m,u;return _regeneratorRuntime().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return S=[],h.next=3,fetch(A);case 3:if(_=h.sent,/\.json$/.test(A))return h.next=7,_.json();h.next=10;break;case 7:S=h.sent,h.next=20;break;case 10:return h.next=12,_.text();case 12:return m=h.sent,h.next=15,new window.DOMParser().parseFromString(m,"text/xml");case 15:return m=h.sent,h.next=18,m;case 18:u=h.sent,S=_toConsumableArray(u.querySelectorAll("entry")).map(function(C){var B=[],P=(C.querySelector("tags")&&C.querySelector("tags").getElementsByTagName("tag")&&Array.prototype.forEach.call(C.querySelector("tags").getElementsByTagName("tag"),function(e,r){B.push(e.textContent)}),C.querySelector("content")&&C.querySelector("content").textContent),k=/src=[\'\"]?([^\'\"]*)[\'\"]?/i,T=P.match(/<img.*?(?:>|\/>)/gi),x=[];if(T)for(var O=0;O<T.length;O++){var t=T[O].match(k);t[1].indexOf("http")||x.push(t[1])}return{title:C.querySelector("title").textContent,content:P,url:C.querySelector("url").textContent,tags:B,oneImage:x&&x[0]}});case 20:return _.ok&&((u=document.getElementById("loading-database")).nextElementSibling.style.display="block",u.remove()),h.abrupt("return",S);case 22:case"end":return h.stop()}},f)}));return function(f){return y.apply(this,arguments)}}(),q=function(){GLOBAL_CONFIG.localSearch.preload||(b=d(GLOBAL_CONFIG.localSearch.path));var y=document.querySelector("#local-search-input input"),f=document.getElementById("local-search-results"),A=document.getElementById("loading-status");y.addEventListener("input",function(){var S,_=this,m=this.value.trim().toLowerCase().split(/[\s]+/),u=(m[0]!==""&&(A.innerHTML='<i class="fas fa-spinner fa-pulse"></i>'),f.innerHTML="",'<div class="search-result-list">');m.length<=0||(S=0,b.then(function(h){h.forEach(function(t){var B,P=!0,k=t.title?t.title.trim().toLowerCase():"",T=t.tags,x=(x=t.oneImage)!=null?x:"",O=t.content?t.content.trim().replace(/<[^>]+>/g,"").toLowerCase():"",t=t.url.startsWith("/")?t.url:GLOBAL_CONFIG.root+t.url,e=-1,r=-1;if(k!==""||O!==""?m.forEach(function(L,G){B=k.indexOf(L),e=O.indexOf(L),B<0&&e<0?P=!1:(e<0&&(e=0),G===0&&(r=e))}):P=!1,P){if(0<=r){var a=r-30,o=r+100,p="",i="",g=((a=a<0?0:a)===0?o=100:p="...",o>O.length?o=O.length:i="...",O.substring(a,o));if(m.forEach(function(L){var G=new RegExp(L,"gi");g=g.replace(G,'<span class="search-keyword">'+L+"</span>"),k=k.replace(G,'<span class="search-keyword">'+L+"</span>")}),u=(u=(u+='<div class="local-search__hit-item">')+(x?'<div class="search-left"><img src='.concat(x," alt=").concat(x," data-fancybox='gallery'>"):'<div class="search-left" style="width:0">'))+"</div>"+(x?'<div class="search-right"><a href="'+t+'" class="search-result-title">'+k+"</a>":'<div class="search-right" style="width: 100%"><a href="'+t+'" class="search-result-title">'+k+"</a>"),S+=1,O!==""&&(u+='<p class="search-result" onclick="pjax.loadUrl(`'+t+'`)">'+p+g+i+"</p>"),T.length){u+='<div class="search-result-tags">';for(var v=0;v<T.length;v++){var F=T[v].trim();u+='<a class="tag-list" href="/tags/'+F+'/" data-pjax-state="" one-link-mark="yes">#'+F+"</a>"}u+="</div>"}}u+="</div></div>"}}),S===0&&(u+='<div id="local-search__hits-empty">'+GLOBAL_CONFIG.localSearch.languages.hits_empty.replace(/\$\{query}/,_.value.trim())+"</div>"),u+="</div>",f.innerHTML=u,m[0]!==""&&(A.innerHTML=""),window.pjax&&window.pjax.refresh(f)}))})};l(),document.querySelector("#local-search .search-close-button").addEventListener("click",E),j.addEventListener("click",E),GLOBAL_CONFIG.localSearch.preload&&(b=d(GLOBAL_CONFIG.localSearch.path)),window.addEventListener("pjax:complete",function(){btf.isHidden(j)||E(),l()})});