jekyll-theme-h2o-ac 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +19 -21
- data/_config.yml +8 -5
- data/_data/collections.yml +11 -0
- data/_data/locales/en.yml +8 -1
- data/_data/locales/ja.yml +8 -1
- data/_data/locales/zh-Hans.yml +8 -1
- data/_data/locales/zh-Hant.yml +8 -1
- data/_includes/calendar.html +31 -0
- data/_includes/footer.html +110 -77
- data/_includes/head.html +4 -0
- data/_includes/header.html +2 -2
- data/_includes/mathjax.html +4 -9
- data/_includes/paginate-article.html +1 -1
- data/_includes/sidebar.html +21 -4
- data/_includes/submenu.html +20 -0
- data/_includes/toc.html +2 -2
- data/_includes/waline.html +1 -1
- data/_layouts/archives.html +25 -0
- data/_layouts/default.html +12 -4
- data/_layouts/links.html +14 -4
- data/_layouts/manifest.html +35 -0
- data/_layouts/page.html +31 -0
- data/_layouts/post.html +55 -32
- data/_layouts/search.html +7 -0
- data/_layouts/stats.html +22 -0
- data/_layouts/sw.js +4 -4
- data/_layouts/tags.html +2 -2
- data/assets/css/app.min.css +1 -2496
- data/assets/css/app.min.css.map +1 -1
- data/assets/css/cv.min.css +1 -279
- data/assets/css/cv.min.css.map +1 -1
- data/assets/icons/notbyAI-white.png +0 -0
- data/assets/js/app.min.js +1 -690
- data/assets/js/app.min.js.LICENSE.txt +15 -0
- data/assets/js/app.min.js.map +1 -1
- metadata +14 -9
- data/_layouts/manifest.json +0 -35
- data/assets/search.json +0 -13
- data/blog/index.html +0 -7
data/assets/js/app.min.js
CHANGED
@@ -1,690 +1 @@
|
|
1
|
-
/******/ (() => { // webpackBootstrap
|
2
|
-
/******/ var __webpack_modules__ = ({
|
3
|
-
|
4
|
-
/***/ "./dev/js/index.js":
|
5
|
-
/*!*************************!*\
|
6
|
-
!*** ./dev/js/index.js ***!
|
7
|
-
\*************************/
|
8
|
-
/***/ (() => {
|
9
|
-
|
10
|
-
$(document).ready(function(){
|
11
|
-
document.body.addEventListener('touchstart', function(){}, {passive: true});
|
12
|
-
|
13
|
-
var nav = $('.g-nav');
|
14
|
-
var baseurl = $("meta[property='og:baseurl']").attr('content');
|
15
|
-
var logo = $('.g-logo');
|
16
|
-
var themeStyle = $('.g-banner').attr('data-theme');
|
17
|
-
logo.css({
|
18
|
-
'background': 'url(' + baseurl + '/assets/icons/' + themeStyle + '.svg) no-repeat center',
|
19
|
-
'background-size': '100% 100%'
|
20
|
-
});
|
21
|
-
|
22
|
-
/**
|
23
|
-
* Cookie Tips
|
24
|
-
*/
|
25
|
-
var cookieconsent_status = getCookie("cookieconsent_status");
|
26
|
-
if(cookieconsent_status){
|
27
|
-
$('.cookie-tip').removeClass('active');
|
28
|
-
}else{
|
29
|
-
$('.cookie-tip').addClass('active');
|
30
|
-
}
|
31
|
-
$('#accept-tos').on('click', function() {
|
32
|
-
setCookie("cookieconsent_status", "allow", 365);
|
33
|
-
$('.cookie-tip').removeClass('active');
|
34
|
-
})
|
35
|
-
|
36
|
-
/**
|
37
|
-
* Fix table for small screens
|
38
|
-
*/
|
39
|
-
$("table").wrap("<div class='table-area'></div>");
|
40
|
-
|
41
|
-
|
42
|
-
/**
|
43
|
-
* Responsive Navigation
|
44
|
-
*/
|
45
|
-
$('#menu-toggle').on('click', function(e) {
|
46
|
-
var duration = 200;
|
47
|
-
nav.slideToggle(duration);
|
48
|
-
$(document).on('click', function() {
|
49
|
-
nav.slideUp(duration);
|
50
|
-
});
|
51
|
-
e.stopPropagation();
|
52
|
-
});
|
53
|
-
|
54
|
-
nav.on('click', function(e) {
|
55
|
-
e.stopPropagation();
|
56
|
-
});
|
57
|
-
|
58
|
-
$(".g-nav li.dropdown").on("click", function(){
|
59
|
-
$(".g-nav li.dropdown").not($(this)).children("ul.dropdown-menu").removeClass("show");
|
60
|
-
$(".g-nav li.dropdown").not($(this)).children("a.dropdown-toggle").removeClass("show");
|
61
|
-
$(this).children("a.dropdown-toggle").toggleClass("show");
|
62
|
-
$(this).children("ul.dropdown-menu").toggleClass("show");
|
63
|
-
});
|
64
|
-
$(document).on("click", function(){
|
65
|
-
$(".g-nav li.dropdown").children("a.dropdown-toggle").removeClass("show");
|
66
|
-
$(".g-nav li.dropdown").children("ul.dropdown-menu").removeClass("show");
|
67
|
-
})
|
68
|
-
|
69
|
-
/**
|
70
|
-
* Header Bar
|
71
|
-
*/
|
72
|
-
if($(window).width() > 695) {
|
73
|
-
var header = $('.g-header');
|
74
|
-
var headerHeight = header.outerHeight();
|
75
|
-
var navText = nav.find('a');
|
76
|
-
var scFlag = $(document).scrollTop();
|
77
|
-
var logo = $('.g-logo');
|
78
|
-
var themeStyle = $('.g-banner').attr('data-theme');
|
79
|
-
|
80
|
-
$(document).scroll(function() {
|
81
|
-
var scrollTop = $(this).scrollTop();
|
82
|
-
var navClassName = 'nav-' + themeStyle;
|
83
|
-
|
84
|
-
|
85
|
-
if (scrollTop > headerHeight) {
|
86
|
-
if(scrollTop > 3 * headerHeight) {
|
87
|
-
header.addClass('headerUp');
|
88
|
-
}
|
89
|
-
header.css({
|
90
|
-
'background-color': 'rgba(255, 255, 255, .98)',
|
91
|
-
'box-shadow': '0 1px 12px rgba(0, 0, 0, .08)'
|
92
|
-
});
|
93
|
-
logo.css({
|
94
|
-
'background': 'url(' + baseurl + '/assets/icons/' + themeStyle + '.svg) no-repeat center',
|
95
|
-
'background-size': '100% 100%'
|
96
|
-
});
|
97
|
-
navText.css('color', '#666');
|
98
|
-
nav.addClass(navClassName);
|
99
|
-
} else {
|
100
|
-
header.removeClass('headerUp');
|
101
|
-
// console.log("rm up");
|
102
|
-
$('#bttb').removeClass("active");
|
103
|
-
header.css({
|
104
|
-
'background-color': 'transparent',
|
105
|
-
'box-shadow': 'none'
|
106
|
-
});
|
107
|
-
logo.css({
|
108
|
-
'background': 'url(' + baseurl + '/assets/icons/' + themeStyle + '.svg) no-repeat center',
|
109
|
-
'background-size': '100% 100%'
|
110
|
-
});
|
111
|
-
navText.css('color', '#fff');
|
112
|
-
nav.removeClass(navClassName);
|
113
|
-
}
|
114
|
-
|
115
|
-
// scroll action
|
116
|
-
if (scFlag > scrollTop) {
|
117
|
-
header.addClass('headerDown');
|
118
|
-
if(header.hasClass('headerUp')){
|
119
|
-
$('#bttb').addClass("active");
|
120
|
-
}
|
121
|
-
} else {
|
122
|
-
header.removeClass('headerDown');
|
123
|
-
$('#bttb').removeClass("active");
|
124
|
-
}
|
125
|
-
scFlag = scrollTop;
|
126
|
-
});
|
127
|
-
}else{
|
128
|
-
var header = $('.g-header');
|
129
|
-
var headerHeight = header.outerHeight();
|
130
|
-
var scFlag = $(document).scrollTop();
|
131
|
-
$(document).scroll(function() {
|
132
|
-
var scrollTop = $(this).scrollTop();
|
133
|
-
|
134
|
-
if (scrollTop < 100){
|
135
|
-
$('#bttb').removeClass("active");
|
136
|
-
}
|
137
|
-
|
138
|
-
// scroll action
|
139
|
-
if (scFlag > scrollTop && scFlag > 5) {
|
140
|
-
$('#bttb').addClass("active");
|
141
|
-
} else {
|
142
|
-
$('#bttb').removeClass("active");
|
143
|
-
}
|
144
|
-
scFlag = scrollTop;
|
145
|
-
});
|
146
|
-
}
|
147
|
-
|
148
|
-
/**
|
149
|
-
* List for contents
|
150
|
-
*/
|
151
|
-
|
152
|
-
function clickMobileList(){
|
153
|
-
$('.table-of-contents').toggleClass("active");
|
154
|
-
var mode = getCookie("mode");
|
155
|
-
if(mode == "night"){
|
156
|
-
$('.mobile-list .icon.list.night').toggleClass('active');
|
157
|
-
$('.mobile-list .icon.exit.night').toggleClass('active');
|
158
|
-
}else{
|
159
|
-
$('.mobile-list .icon.list.day').toggleClass('active');
|
160
|
-
$('.mobile-list .icon.exit.day').toggleClass('active');
|
161
|
-
}
|
162
|
-
}
|
163
|
-
|
164
|
-
$('.mobile-list').bind('click', function(){
|
165
|
-
clickMobileList();
|
166
|
-
});
|
167
|
-
|
168
|
-
$(".table-of-contents").on('click', function(){
|
169
|
-
clickMobileList();
|
170
|
-
});
|
171
|
-
|
172
|
-
|
173
|
-
/**
|
174
|
-
* Back To Top Button
|
175
|
-
*/
|
176
|
-
$('.bttb').bind('click', function(){
|
177
|
-
$('html,body').animate({scrollTop:0}, function(){
|
178
|
-
$('#bttb').removeClass("active");
|
179
|
-
});
|
180
|
-
});
|
181
|
-
|
182
|
-
/**
|
183
|
-
* Post Cover Resize
|
184
|
-
*/
|
185
|
-
function postCover(img, container) {
|
186
|
-
var imgWidth = img.width();
|
187
|
-
var containerWidth = container.width();
|
188
|
-
var imgHeight = img.height();
|
189
|
-
var containerHeight = container.height();
|
190
|
-
|
191
|
-
if (imgHeight < containerHeight) {
|
192
|
-
img.css({
|
193
|
-
'width': 'auto',
|
194
|
-
'height': '100%'
|
195
|
-
});
|
196
|
-
imgWidth = img.width(),
|
197
|
-
containerWidth = container.width();
|
198
|
-
var marginLeft = (imgWidth - containerWidth) / 2;
|
199
|
-
img.css('margin-left', '-' + marginLeft + 'px');
|
200
|
-
} else {
|
201
|
-
var marginTop = (containerHeight - imgHeight) / 2;
|
202
|
-
img.css('margin-top', marginTop + 'px');
|
203
|
-
}
|
204
|
-
|
205
|
-
img.fadeIn();
|
206
|
-
}
|
207
|
-
|
208
|
-
/**
|
209
|
-
* The Post Navigator
|
210
|
-
*/
|
211
|
-
$('.read-next-item section').each(function() {
|
212
|
-
var n = $(this).height();
|
213
|
-
var rn = $('.read-next-item').height();
|
214
|
-
$(this).css('margin-top', (rn - n) / 2 + 'px');
|
215
|
-
$(this).fadeIn();
|
216
|
-
});
|
217
|
-
|
218
|
-
$('.read-next-item img').each(function(){
|
219
|
-
postCover($(this), $('.read-next-item'));
|
220
|
-
// $(this).addClass("lazyload");
|
221
|
-
$(this).attr('data-src', $(this).attr('src')).removeAttr('src').addClass("lazyload");
|
222
|
-
});
|
223
|
-
|
224
|
-
/**
|
225
|
-
* Pagination
|
226
|
-
*/
|
227
|
-
function pagination() {
|
228
|
-
var total = parseInt($('#total_pages').val());
|
229
|
-
var current = parseInt($('#current_pages').val());
|
230
|
-
var baseUrl = $('#base_url').val();
|
231
|
-
var limit = 3;
|
232
|
-
|
233
|
-
var link_html = '';
|
234
|
-
|
235
|
-
for (var i = current - limit; i < current; i++) {
|
236
|
-
if (i > 0 && i !== 1) {
|
237
|
-
link_html += '<a href="' + baseUrl + 'page' + i + '/index.html" class="page-link page-num">' + i + '</a>';
|
238
|
-
} else if (i === 1) {
|
239
|
-
link_html += '<a href="' + baseUrl + '" class="page-link page-num">' + i + '</a>';
|
240
|
-
}
|
241
|
-
}
|
242
|
-
|
243
|
-
link_html += '<span class="page-link page-num active">' + current + '</span>';
|
244
|
-
|
245
|
-
for (var j = current + 1; j <= current + limit; j++) {
|
246
|
-
if (j <= total) {
|
247
|
-
link_html += '<a href="' + baseUrl + 'page' + j + '/index.html" class="page-link page-num">' + j + '</a>';
|
248
|
-
}
|
249
|
-
}
|
250
|
-
|
251
|
-
$('#page-link-container').html(link_html);
|
252
|
-
}
|
253
|
-
pagination();
|
254
|
-
|
255
|
-
/**
|
256
|
-
* Search
|
257
|
-
*/
|
258
|
-
function Search() {
|
259
|
-
var self = this;
|
260
|
-
var input = $('#search_input');
|
261
|
-
var result = $('.search_result');
|
262
|
-
|
263
|
-
input.focus(function() {
|
264
|
-
$('.icon-search').css('color', '#3199DB');
|
265
|
-
result.show();
|
266
|
-
});
|
267
|
-
|
268
|
-
input.keyup(debounce(this.autoComplete));
|
269
|
-
|
270
|
-
$(document).click(function(e) {
|
271
|
-
if(e.target.id === 'search_input' || e.target.className === 'search_result' || e.target.className === 'search_item') {
|
272
|
-
return;
|
273
|
-
}
|
274
|
-
$('.icon-search').css('color', '#CAD3DC');
|
275
|
-
result.hide();
|
276
|
-
});
|
277
|
-
}
|
278
|
-
|
279
|
-
Search.prototype.autoComplete = function() {
|
280
|
-
var keywords = this.value.toLowerCase();
|
281
|
-
|
282
|
-
if (keywords.length) {
|
283
|
-
$('.icon-search').css('color', '#3199DB');
|
284
|
-
} else {
|
285
|
-
$('.icon-search').css('color', '#CAD3DC');
|
286
|
-
}
|
287
|
-
|
288
|
-
var jsonfile = baseurl + '/assets/search.json';
|
289
|
-
$.getJSON(jsonfile).done(function(data) {
|
290
|
-
var html = '';
|
291
|
-
for (var i in data) {
|
292
|
-
var item = data[i];
|
293
|
-
var title = item.title;
|
294
|
-
var tags = item.tags;
|
295
|
-
var url = item.url;
|
296
|
-
|
297
|
-
var k = title + tags;
|
298
|
-
if (keywords !== '' && k.toLowerCase().indexOf(keywords) >= 0) {
|
299
|
-
html += '<a class="search_item" href="' + item.url + '">' + item.title + '</a>';
|
300
|
-
}
|
301
|
-
}
|
302
|
-
$('.search_result').html(html);
|
303
|
-
});
|
304
|
-
};
|
305
|
-
|
306
|
-
function debounce(fn, delay) {
|
307
|
-
var timer;
|
308
|
-
delay = delay || 120;
|
309
|
-
|
310
|
-
return function () {
|
311
|
-
var ctx = this;
|
312
|
-
var args = arguments;
|
313
|
-
var later = function() {
|
314
|
-
fn.apply(ctx, args);
|
315
|
-
};
|
316
|
-
clearTimeout(timer);
|
317
|
-
timer = setTimeout(later, delay);
|
318
|
-
};
|
319
|
-
}
|
320
|
-
|
321
|
-
new Search();
|
322
|
-
|
323
|
-
/**
|
324
|
-
* Night mode
|
325
|
-
*/
|
326
|
-
function nightMode() {
|
327
|
-
var el = $('body');
|
328
|
-
var className = 'night-mode';
|
329
|
-
|
330
|
-
var date = new Date();
|
331
|
-
var hour = date.getHours();
|
332
|
-
|
333
|
-
var mode = getCookie("mode");
|
334
|
-
if (mode == "") {
|
335
|
-
console.log(mode);
|
336
|
-
if (hour <= 6 || hour >= 18){
|
337
|
-
console.log("Start night mode");
|
338
|
-
setCookie("mode", "night", 1)
|
339
|
-
}
|
340
|
-
// el.addClass(className);
|
341
|
-
}
|
342
|
-
}
|
343
|
-
|
344
|
-
if ($('#nm-switch').val() === 'true') {
|
345
|
-
nightMode();
|
346
|
-
}
|
347
|
-
|
348
|
-
/**
|
349
|
-
* Copy and copyright
|
350
|
-
*/
|
351
|
-
function setClipboardData(str) {
|
352
|
-
str += '\n\n著作权归作者所有。\n商业转载请联系作者获得授权,非商业转载请注明出处。\n原文: ' + location.href;
|
353
|
-
$('.post-content').on('copy', function(e) {
|
354
|
-
var data = window.clipboardData || e.originalEvent.clipboardData;
|
355
|
-
data.setData('text/plain', str);
|
356
|
-
e.preventDefault();
|
357
|
-
});
|
358
|
-
}
|
359
|
-
$('.post-content').on('mouseup', function(e) {
|
360
|
-
var txt = window.getSelection();
|
361
|
-
if (txt.toString().length >= 30) {
|
362
|
-
setClipboardData(txt);
|
363
|
-
}
|
364
|
-
});
|
365
|
-
|
366
|
-
/**
|
367
|
-
* TOC highlight with the corresponding content
|
368
|
-
*/
|
369
|
-
function locateCatelogList(){
|
370
|
-
/*获取文章目录集合,可通过:header过滤器*/
|
371
|
-
var alis = $('article :header');
|
372
|
-
/*获取侧边栏目录列表集合**/
|
373
|
-
var sidebar_alis = $('.table-of-contents').find('a');
|
374
|
-
/*获取滚动条到顶部的距离*/
|
375
|
-
var scroll_height = $(window).scrollTop();
|
376
|
-
if(scroll_height>0){
|
377
|
-
$('.g-header').addClass('headerUp');
|
378
|
-
}
|
379
|
-
for(var i =0;i<alis.length;i++){
|
380
|
-
/*获取锚点集合中的元素分别到顶点的距离*/
|
381
|
-
var a_height = $(alis[i]).offset().top - 100;
|
382
|
-
if (a_height < scroll_height){
|
383
|
-
/*高亮显示*/
|
384
|
-
$(sidebar_alis).removeClass('active');
|
385
|
-
$(sidebar_alis[i]).addClass('active');
|
386
|
-
}
|
387
|
-
}
|
388
|
-
}
|
389
|
-
|
390
|
-
locateCatelogList();
|
391
|
-
$(window).bind('scroll',locateCatelogList);
|
392
|
-
|
393
|
-
/**
|
394
|
-
* Day/Night mode switch button
|
395
|
-
*/
|
396
|
-
function getCookie(cname)
|
397
|
-
{
|
398
|
-
var name = cname + "=";
|
399
|
-
var ca = document.cookie.split(';');
|
400
|
-
for(var i=0; i<ca.length; i++)
|
401
|
-
{
|
402
|
-
var c = ca[i].trim();
|
403
|
-
if (c.indexOf(name)==0) return c.substring(name.length,c.length);
|
404
|
-
}
|
405
|
-
return "";
|
406
|
-
}
|
407
|
-
|
408
|
-
function setCookie(cname, cvalue, exdays){
|
409
|
-
var d = new Date();
|
410
|
-
d.setTime(d.getTime()+(exdays*24*60*60*1000));
|
411
|
-
var expires = "expires="+d.toGMTString();
|
412
|
-
if(!baseurl){
|
413
|
-
document.cookie = cname+"="+cvalue+"; path=/; "+expires;
|
414
|
-
}else {
|
415
|
-
document.cookie = cname+"="+cvalue+"; path="+baseurl+"; "+expires;
|
416
|
-
}
|
417
|
-
}
|
418
|
-
|
419
|
-
var mode = getCookie("mode");
|
420
|
-
// console.log(mode);
|
421
|
-
if(mode == "night"){
|
422
|
-
$(".g-nav li.mode .night").addClass("active");
|
423
|
-
$("#mode-toggle .icon-night").addClass("active");
|
424
|
-
$("body").addClass("night-mode");
|
425
|
-
$(".icon.up.night").toggleClass("active");
|
426
|
-
$(".icon.list.night").toggleClass("active");
|
427
|
-
}else{
|
428
|
-
$(".g-nav li.mode .day").addClass("active");
|
429
|
-
$("#mode-toggle .icon-day").addClass("active");
|
430
|
-
$("body").removeClass("night-mode");
|
431
|
-
$(".icon.up.day").toggleClass("active");
|
432
|
-
$(".icon.list.day").toggleClass("active");
|
433
|
-
}
|
434
|
-
|
435
|
-
function changeMode(){
|
436
|
-
var mode = getCookie("mode");
|
437
|
-
if(mode == ""){
|
438
|
-
setCookie("mode", "night", 1)
|
439
|
-
$("body").addClass("night-mode");
|
440
|
-
}else if(mode == "day"){
|
441
|
-
setCookie("mode", "night", 1)
|
442
|
-
$("body").addClass("night-mode");
|
443
|
-
}else{
|
444
|
-
setCookie("mode", "day", 1)
|
445
|
-
$("body").removeClass("night-mode");
|
446
|
-
}
|
447
|
-
// console.log(mode + "-->" + getCookie("mode"));
|
448
|
-
if($("#disqus_thread").length > 0){
|
449
|
-
DISQUS.reset({
|
450
|
-
reload: true
|
451
|
-
});
|
452
|
-
}
|
453
|
-
$(".g-nav li.mode .icon").toggleClass("active");
|
454
|
-
$("#mode-toggle .icon").toggleClass("active");
|
455
|
-
$(".icon.up.day").toggleClass("active");
|
456
|
-
$(".icon.up.night").toggleClass("active");
|
457
|
-
if($('.table-of-contents').css('visibility') == "visible"){
|
458
|
-
$(".icon.exit.day").toggleClass("active");
|
459
|
-
$(".icon.exit.night").toggleClass("active");
|
460
|
-
}else{
|
461
|
-
$(".icon.list.day").toggleClass("active");
|
462
|
-
$(".icon.list.night").toggleClass("active");
|
463
|
-
}
|
464
|
-
}
|
465
|
-
|
466
|
-
$(".g-nav li.mode").click(function(){
|
467
|
-
changeMode();
|
468
|
-
});
|
469
|
-
|
470
|
-
$("#mode-toggle").click(function(){
|
471
|
-
changeMode();
|
472
|
-
});
|
473
|
-
|
474
|
-
/**
|
475
|
-
* Copy code blocks
|
476
|
-
*/
|
477
|
-
// get all <code> elements
|
478
|
-
var allCodeBlocksElements = $("pre");
|
479
|
-
allCodeBlocksElements.each(function(i) {
|
480
|
-
// add different id for each code block
|
481
|
-
// target
|
482
|
-
var currentId = "codeblock" + (i + 1);
|
483
|
-
$(this).attr('id', currentId);
|
484
|
-
var lang = $(this).attr("class").split(" ")[1].substring(9).toUpperCase();
|
485
|
-
|
486
|
-
if(lang == "ERS"){
|
487
|
-
lang = $(this).attr("class").split(" ")[0].substring(9).toUpperCase();
|
488
|
-
if(lang == "MERMAID2") {
|
489
|
-
text = $(this).text();
|
490
|
-
$(this).before('<summary class="render-expand" aria-haspopup="dialog" role="button"><svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" class="octicon" style="display:inline-block;vertical-align:text-bottom"><path fill-rule="evenodd" d="M3.72 3.72a.75.75 0 011.06 1.06L2.56 7h10.88l-2.22-2.22a.75.75 0 011.06-1.06l3.5 3.5a.75.75 0 010 1.06l-3.5 3.5a.75.75 0 11-1.06-1.06l2.22-2.22H2.56l2.22 2.22a.75.75 0 11-1.06 1.06l-3.5-3.5a.75.75 0 010-1.06l3.5-3.5z"></path></svg></summary>');
|
491
|
-
$(this).after('<div class="mermaid2">' + text + '</div>');
|
492
|
-
}else {
|
493
|
-
$(this).wrap('<div class="highlight"></div>');
|
494
|
-
$(this).parent().wrap('<div class="'+ $(this).attr("class").split(" ")[0] +' highlighter-rouge"></div>');
|
495
|
-
$(this).addClass("highlight");
|
496
|
-
//trigger
|
497
|
-
var clipButton = '<div class="copy-container"><span class="lang">' + lang + '</span><button class="btn" data-bs-original-title="Copy" aria-label="Copy" data-clipboard-target="#' + currentId + '"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-copy"></use></svg><span class="tooltip unfinish">Copy</span><span class="tooltip finish">Copied</span></button></div>';
|
498
|
-
$(this).before(clipButton);
|
499
|
-
}
|
500
|
-
}else {
|
501
|
-
//trigger
|
502
|
-
var clipButton = '<div class="copy-container"><span class="lang">' + lang + '</span><button class="btn" data-bs-original-title="Copy" aria-label="Copy" data-clipboard-target="#' + currentId + '"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-copy"></use></svg><span class="tooltip unfinish">Copy</span><span class="tooltip finish">Copied</span></button></div>';
|
503
|
-
$(this).before(clipButton);
|
504
|
-
}
|
505
|
-
});
|
506
|
-
|
507
|
-
var clipboard = new ClipboardJS('.btn');
|
508
|
-
clipboard.on('success', function(e) {
|
509
|
-
e.clearSelection();
|
510
|
-
});
|
511
|
-
|
512
|
-
$(".markdown-body .btn").hover(function(){
|
513
|
-
$(this).find(".tooltip.unfinish").addClass("active");
|
514
|
-
},function(){
|
515
|
-
$(this).find(".tooltip.unfinish").removeClass("active");
|
516
|
-
});
|
517
|
-
|
518
|
-
$(".markdown-body .btn").click(function(){
|
519
|
-
$(this).find(".tooltip.unfinish").removeClass("active");
|
520
|
-
var finish = $(this).find(".tooltip.finish")
|
521
|
-
finish.addClass("active");
|
522
|
-
setTimeout(function () {
|
523
|
-
finish.removeClass("active");
|
524
|
-
}, 500);
|
525
|
-
});
|
526
|
-
|
527
|
-
/**
|
528
|
-
* Expand the mermaid figure
|
529
|
-
*/
|
530
|
-
$("summary").click(function(event){
|
531
|
-
var text = $(this).next().children().text();
|
532
|
-
$(".modal .modal-content .container").html('<div class="mermaid2">' + text + '</div>')
|
533
|
-
mermaid.init(undefined, $('.modal .modal-content .mermaid2'));
|
534
|
-
$('.modal').css("visibility","visible");
|
535
|
-
$(".modal .modal-content").click(function(event){
|
536
|
-
if(event.target.classList.contains("close")){
|
537
|
-
$(".modal").css("visibility","hidden");
|
538
|
-
}
|
539
|
-
event.stopPropagation();
|
540
|
-
});
|
541
|
-
event.stopPropagation();
|
542
|
-
});
|
543
|
-
|
544
|
-
$(document).click(function(){
|
545
|
-
$(".modal").css("visibility","hidden");
|
546
|
-
});
|
547
|
-
|
548
|
-
/**
|
549
|
-
* Error image loading
|
550
|
-
*/
|
551
|
-
document.addEventListener('error', function(e){
|
552
|
-
if(e.target.nodeName == 'IMG'){e.target.src = baseurl + '/assets/img/placeholder.webp';}
|
553
|
-
}, true);
|
554
|
-
|
555
|
-
/**
|
556
|
-
* Alive time
|
557
|
-
*/
|
558
|
-
|
559
|
-
var alivetime_days = $(".alivetime_days")
|
560
|
-
var alivetime_hours = $(".alivetime_hours")
|
561
|
-
var alivetime_minutes = $(".alivetime_minutes")
|
562
|
-
var alivetime_seconds = $(".alivetime_seconds")
|
563
|
-
function alive_time() {
|
564
|
-
var alivestart = $("meta[name='alivestart']").attr('content');
|
565
|
-
window.setTimeout(alive_time, 1000);
|
566
|
-
// Start at
|
567
|
-
BirthDay = new Date(alivestart);
|
568
|
-
// Now at
|
569
|
-
today = new Date();
|
570
|
-
timeold = (today.getTime() - BirthDay.getTime());
|
571
|
-
secondsold = Math.floor(timeold / 1000);
|
572
|
-
e_daysold = timeold / (24 * 60 * 60 * 1000);
|
573
|
-
daysold = Math.floor(e_daysold);
|
574
|
-
e_hrsold = (e_daysold - daysold) * 24;
|
575
|
-
hrsold = Math.floor(e_hrsold);
|
576
|
-
e_minsold = (e_hrsold - hrsold) * 60;
|
577
|
-
minsold= Math.floor(e_minsold)
|
578
|
-
seconds = Math.floor((e_minsold - minsold) * 60);
|
579
|
-
alivetime_days.html(daysold)
|
580
|
-
alivetime_hours.html(hrsold)
|
581
|
-
alivetime_minutes.html(minsold)
|
582
|
-
alivetime_seconds.html(seconds)
|
583
|
-
// alivetime.html(daysold + " 天 " + hrsold + " 小时 " + minsold + " 分 " + seconds + " 秒");
|
584
|
-
}
|
585
|
-
alive_time();
|
586
|
-
|
587
|
-
});
|
588
|
-
|
589
|
-
|
590
|
-
/***/ }),
|
591
|
-
|
592
|
-
/***/ "./dev/sass/app.scss":
|
593
|
-
/*!***************************!*\
|
594
|
-
!*** ./dev/sass/app.scss ***!
|
595
|
-
\***************************/
|
596
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
597
|
-
|
598
|
-
"use strict";
|
599
|
-
__webpack_require__.r(__webpack_exports__);
|
600
|
-
// extracted by mini-css-extract-plugin
|
601
|
-
|
602
|
-
|
603
|
-
/***/ })
|
604
|
-
|
605
|
-
/******/ });
|
606
|
-
/************************************************************************/
|
607
|
-
/******/ // The module cache
|
608
|
-
/******/ var __webpack_module_cache__ = {};
|
609
|
-
/******/
|
610
|
-
/******/ // The require function
|
611
|
-
/******/ function __webpack_require__(moduleId) {
|
612
|
-
/******/ // Check if module is in cache
|
613
|
-
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
614
|
-
/******/ if (cachedModule !== undefined) {
|
615
|
-
/******/ return cachedModule.exports;
|
616
|
-
/******/ }
|
617
|
-
/******/ // Create a new module (and put it into the cache)
|
618
|
-
/******/ var module = __webpack_module_cache__[moduleId] = {
|
619
|
-
/******/ // no module.id needed
|
620
|
-
/******/ // no module.loaded needed
|
621
|
-
/******/ exports: {}
|
622
|
-
/******/ };
|
623
|
-
/******/
|
624
|
-
/******/ // Execute the module function
|
625
|
-
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
626
|
-
/******/
|
627
|
-
/******/ // Return the exports of the module
|
628
|
-
/******/ return module.exports;
|
629
|
-
/******/ }
|
630
|
-
/******/
|
631
|
-
/************************************************************************/
|
632
|
-
/******/ /* webpack/runtime/compat get default export */
|
633
|
-
/******/ (() => {
|
634
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
635
|
-
/******/ __webpack_require__.n = (module) => {
|
636
|
-
/******/ var getter = module && module.__esModule ?
|
637
|
-
/******/ () => (module['default']) :
|
638
|
-
/******/ () => (module);
|
639
|
-
/******/ __webpack_require__.d(getter, { a: getter });
|
640
|
-
/******/ return getter;
|
641
|
-
/******/ };
|
642
|
-
/******/ })();
|
643
|
-
/******/
|
644
|
-
/******/ /* webpack/runtime/define property getters */
|
645
|
-
/******/ (() => {
|
646
|
-
/******/ // define getter functions for harmony exports
|
647
|
-
/******/ __webpack_require__.d = (exports, definition) => {
|
648
|
-
/******/ for(var key in definition) {
|
649
|
-
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
650
|
-
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
651
|
-
/******/ }
|
652
|
-
/******/ }
|
653
|
-
/******/ };
|
654
|
-
/******/ })();
|
655
|
-
/******/
|
656
|
-
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
657
|
-
/******/ (() => {
|
658
|
-
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
659
|
-
/******/ })();
|
660
|
-
/******/
|
661
|
-
/******/ /* webpack/runtime/make namespace object */
|
662
|
-
/******/ (() => {
|
663
|
-
/******/ // define __esModule on exports
|
664
|
-
/******/ __webpack_require__.r = (exports) => {
|
665
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
666
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
667
|
-
/******/ }
|
668
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
669
|
-
/******/ };
|
670
|
-
/******/ })();
|
671
|
-
/******/
|
672
|
-
/************************************************************************/
|
673
|
-
var __webpack_exports__ = {};
|
674
|
-
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
|
675
|
-
(() => {
|
676
|
-
"use strict";
|
677
|
-
/*!********************!*\
|
678
|
-
!*** ./dev/app.js ***!
|
679
|
-
\********************/
|
680
|
-
__webpack_require__.r(__webpack_exports__);
|
681
|
-
/* harmony import */ var _js_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./js/index.js */ "./dev/js/index.js");
|
682
|
-
/* harmony import */ var _js_index_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_js_index_js__WEBPACK_IMPORTED_MODULE_0__);
|
683
|
-
/* harmony import */ var _sass_app_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./sass/app.scss */ "./dev/sass/app.scss");
|
684
|
-
|
685
|
-
|
686
|
-
})();
|
687
|
-
|
688
|
-
/******/ })()
|
689
|
-
;
|
690
|
-
//# sourceMappingURL=app.min.js.map
|
1
|
+
(()=>{var t={774:()=>{$(document).ready((function(){document.body.addEventListener("touchstart",(function(){}),{passive:!0});var t=$(".g-nav"),e=$("meta[property='og:baseurl']").attr("content"),a=$("meta[property='og:lang']").attr("content"),o=$(".g-logo"),n=$(".g-banner").attr("data-theme");if(o.css({background:"url("+e+"/assets/icons/"+n+".svg) no-repeat center","background-size":"100% 100%"}),u("cookieconsent_status")?$(".cookie-tip").removeClass("active"):$(".cookie-tip").addClass("active"),$("#accept-tos").on("click",(function(){p("cookieconsent_status","allow",365),$(".cookie-tip").removeClass("active")})),$("table").wrap("<div class='table-area'></div>"),$("#menu-toggle").on("click",(function(e){t.slideToggle(200),$(document).on("click",(function(){t.slideUp(200)})),e.stopPropagation()})),t.on("click",(function(t){t.stopPropagation()})),$(".g-nav li.dropdown").on("click",(function(){$(".g-nav li.dropdown").not($(this)).children("ul.dropdown-menu").removeClass("show"),$(".g-nav li.dropdown").not($(this)).children("a.dropdown-toggle").removeClass("show"),$(this).children("a.dropdown-toggle").toggleClass("show"),$(this).children("ul.dropdown-menu").toggleClass("show")})),$(document).on("click",(function(){$(".g-nav li.dropdown").children("a.dropdown-toggle").removeClass("show"),$(".g-nav li.dropdown").children("ul.dropdown-menu").removeClass("show")})),$(window).width()>695){var s=(c=$(".g-header")).outerHeight(),i=t.find("a"),l=$(document).scrollTop();o=$(".g-logo"),n=$(".g-banner").attr("data-theme"),$(document).scroll((function(){var a=$(this).scrollTop(),r="nav-"+n;a>s?(a>3*s&&c.addClass("headerUp"),c.css({"background-color":"rgba(255, 255, 255, .98)","box-shadow":"0 1px 12px rgba(0, 0, 0, .08)"}),o.css({background:"url("+e+"/assets/icons/"+n+".svg) no-repeat center","background-size":"100% 100%"}),i.addClass("color-f-gray"),t.addClass(r)):(c.removeClass("headerUp"),$("#bttb").removeClass("active"),c.css({"background-color":"transparent","box-shadow":"none"}),o.css({background:"url("+e+"/assets/icons/"+n+".svg) no-repeat center","background-size":"100% 100%"}),i.removeClass("color-f-gray"),t.removeClass(r)),l>a?(c.addClass("headerDown"),c.hasClass("headerUp")&&$("#bttb").addClass("active")):(c.removeClass("headerDown"),$("#bttb").removeClass("active")),l=a}))}else{var c;s=(c=$(".g-header")).outerHeight(),l=$(document).scrollTop(),$(document).scroll((function(){var t=$(this).scrollTop();t<100&&$("#bttb").removeClass("active"),l>t&&l>5?$("#bttb").addClass("active"):$("#bttb").removeClass("active"),l=t}))}function r(){$(".table-of-contents").toggleClass("active"),$("#tools .tool.toc .b1").toggleClass("active"),$("#tools .tool.toc .b2").toggleClass("active"),$(".submenu").removeClass("active"),$("#tools .tool.collection .b1").addClass("active"),$("#tools .tool.collection .b2").removeClass("active")}function d(){$(".submenu").toggleClass("active"),$("#tools .tool.collection .b1").toggleClass("active"),$("#tools .tool.collection .b2").toggleClass("active"),$(".table-of-contents").removeClass("active"),$("#tools .tool.toc .b1").addClass("active"),$("#tools .tool.toc .b2").removeClass("active")}function h(){var t,e,a,o=$("#search_input"),n=$(".search_result");o.focus((function(){$(".icon-search").css("color","#3199DB"),n.show()})),o.keyup((t=this.autoComplete,e=e||120,function(){var o=this,n=arguments;clearTimeout(a),a=setTimeout((function(){t.apply(o,n)}),e)})),$(document).click((function(t){"search_input"!==t.target.id&&"search_result"!==t.target.className&&"search_item"!==t.target.className&&($(".icon-search").css("color","#CAD3DC"),n.hide())}))}function g(){var t=$("article :header"),e=$(".table-of-contents").find("a"),a=$(window).scrollTop();a>0&&$(".g-header").addClass("headerUp");for(var o=0;o<t.length;o++)$(t[o]).offset().top-100<a&&($(e).removeClass("active"),$(e[o]).addClass("active"))}function u(t){for(var e=t+"=",a=document.cookie.split(";"),o=0;o<a.length;o++){var n=a[o].trim();if(0===n.indexOf(e))return n.substring(e.length,n.length)}return""}function p(t,a,o){var n=new Date;n.setTime(n.getTime()+24*o*60*60*1e3);var s="expires="+n.toGMTString();document.cookie=e?t+"="+a+"; path="+e+"; "+s:t+"="+a+"; path=/; "+s}function m(){var t=u("mode");""==t||"day"==t?(p("mode","night",1),$("body").addClass("night-mode")):(p("mode","day",1),$("body").removeClass("night-mode")),$("#disqus_thread").length>0&&DISQUS.reset({reload:!0}),$(".g-nav li.mode .icon").toggleClass("active"),$("#mode-toggle .icon").toggleClass("active"),$(".icon.up.day").toggleClass("active"),$(".icon.up.night").toggleClass("active"),"visible"==$(".table-of-contents").css("visibility")?($(".icon.exit.day").toggleClass("active"),$(".icon.exit.night").toggleClass("active")):($(".icon.list.day").toggleClass("active"),$(".icon.list.night").toggleClass("active"))}$("#tools .tool.toc").bind("click",(function(){r()})),$("#tools .tool.collection").bind("click",(function(){d()})),$(".table-of-contents").on("click",(function(){r()})),$(".submenu").on("click",(function(){d()})),$(".bttb").bind("click",(function(){$("html,body").animate({scrollTop:0},(function(){$("#bttb").removeClass("active")}))})),$(".read-next-item section").each((function(){var t=$(this).height(),e=$(".read-next-item").height();$(this).css("margin-top",(e-t)/2+"px"),$(this).fadeIn()})),$(".read-next-item img").each((function(){!function(t,e){t.width(),e.width();var a=t.height(),o=e.height();if(a<o){t.css({width:"auto",height:"100%"});var n=(t.width()-e.width())/2;t.css("margin-left","-"+n+"px")}else{var s=(o-a)/2;t.css("margin-top",s+"px")}t.fadeIn()}($(this),$(".read-next-item")),$(this).attr("data-src",$(this).attr("src")).removeAttr("src").addClass("lazyload")})),function(){for(var t=parseInt($("#total_pages").val()),e=parseInt($("#current_pages").val()),a=$("#base_url").val(),o="",n=e-3;n<e;n++)n>0&&1!==n?o+='<a href="'+a+"page"+n+'/index.html" class="page-link page-num">'+n+"</a>":1===n&&(o+='<a href="'+a+'" class="page-link page-num">'+n+"</a>");o+='<span class="page-link page-num active">'+e+"</span>";for(var s=e+1;s<=e+3;s++)s<=t&&(o+='<a href="'+a+"page"+s+'/index.html" class="page-link page-num">'+s+"</a>");$("#page-link-container").html(o)}(),h.prototype.autoComplete=function(){var t=this.value.toLowerCase();t.length?$(".icon-search").css("color","#3199DB"):$(".icon-search").css("color","#CAD3DC");var a=e+"/assets/search.json";$.getJSON(a).done((function(e){var a="";for(var o in e){var n=e[o],s=n.title,i=n.tags;n.url,""!==t&&(s+i).toLowerCase().indexOf(t)>=0&&(a+='<a class="search_item" href="'+n.url+'">'+n.title+"</a>")}$(".search_result").html(a)}))},new h,"true"===$("#nm-switch").val()&&function(){$("body");var t=(new Date).getHours();""==u("mode")&&(t<=6||t>=18)&&p("mode","night",1)}(),$(".post-content").on("mouseup",(function(t){var e,a=window.getSelection();a.toString().length>=30&&(e=a,e+="\n\n著作权归作者所有。\n商业转载请联系作者获得授权,非商业转载请注明出处。\n原文: "+location.href,$(".post-content").on("copy",(function(t){(window.clipboardData||t.originalEvent.clipboardData).setData("text/plain",e),t.preventDefault()})))})),g(),$(window).bind("scroll",g),"night"==u("mode")?($(".g-nav li.mode .night").addClass("active"),$("#mode-toggle .icon-night").addClass("active"),$("body").addClass("night-mode"),$(".icon.up.night").toggleClass("active"),$(".icon.list.night").toggleClass("active")):($(".g-nav li.mode .day").addClass("active"),$("#mode-toggle .icon-day").addClass("active"),$("body").removeClass("night-mode"),$(".icon.up.day").toggleClass("active"),$(".icon.list.day").toggleClass("active")),$(".g-nav li.mode").click((function(){m()})),$("#mode-toggle").click((function(){m()})),$("pre").each((function(t){var e="codeblock"+(t+1);$(this).attr("id",e);var a=$(this).attr("class").split(" ")[1].substring(9).toUpperCase();if("ERS"==a)if("MERMAID2"==(a=$(this).attr("class").split(" ")[0].substring(9).toUpperCase()))text=$(this).text(),$(this).before('<summary class="render-expand" aria-haspopup="dialog" role="button"><svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" class="octicon" style="display:inline-block;vertical-align:text-bottom"><path fill-rule="evenodd" d="M3.72 3.72a.75.75 0 011.06 1.06L2.56 7h10.88l-2.22-2.22a.75.75 0 011.06-1.06l3.5 3.5a.75.75 0 010 1.06l-3.5 3.5a.75.75 0 11-1.06-1.06l2.22-2.22H2.56l2.22 2.22a.75.75 0 11-1.06 1.06l-3.5-3.5a.75.75 0 010-1.06l3.5-3.5z"></path></svg></summary>'),$(this).after('<div class="mermaid2">'+text+"</div>");else{$(this).wrap('<div class="highlight"></div>'),$(this).parent().wrap('<div class="'+$(this).attr("class").split(" ")[0]+' highlighter-rouge"></div>'),$(this).addClass("highlight");var o='<div class="copy-container"><span class="lang">'+a+'</span><button class="btn" data-bs-original-title="Copy" aria-label="Copy" data-clipboard-target="#'+e+'"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-copy"></use></svg><span class="tooltip unfinish">Copy</span><span class="tooltip finish">Copied</span></button></div>';$(this).before(o)}else o='<div class="copy-container"><span class="lang">'+a+'</span><button class="btn" data-bs-original-title="Copy" aria-label="Copy" data-clipboard-target="#'+e+'"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-copy"></use></svg><span class="tooltip unfinish">Copy</span><span class="tooltip finish">Copied</span></button></div>',$(this).before(o)})),new ClipboardJS(".btn").on("success",(function(t){t.clearSelection()})),$(".markdown-body .btn").hover((function(){$(this).find(".tooltip.unfinish").addClass("active")}),(function(){$(this).find(".tooltip.unfinish").removeClass("active")})),$(".markdown-body .btn").click((function(){$(this).find(".tooltip.unfinish").removeClass("active");var t=$(this).find(".tooltip.finish");t.addClass("active"),setTimeout((function(){t.removeClass("active")}),500)})),$("summary").click((function(t){var e=$(this).next().children().text();$(".modal .modal-content .container").html('<div class="mermaid2">'+e+"</div>"),mermaid.init(void 0,$(".modal .modal-content .mermaid2")),$(".modal").css("visibility","visible"),$(".modal .modal-content").click((function(t){t.target.classList.contains("close")&&$(".modal").css("visibility","hidden"),t.stopPropagation()})),t.stopPropagation()})),$(document).click((function(){$(".modal").css("visibility","hidden")})),document.addEventListener("error",(function(t){"IMG"==t.target.nodeName&&(t.target.src=e+"/assets/img/placeholder.webp")}),!0);var v=$(".alivetime_days"),f=$(".alivetime_hours"),b=$(".alivetime_minutes"),y=$(".alivetime_seconds");if(function t(){var e=$("meta[name='alivestart']").attr("content");window.setTimeout(t,1e3),BirthDay=new Date(e),today=new Date,timeold=today.getTime()-BirthDay.getTime(),secondsold=Math.floor(timeold/1e3),e_daysold=timeold/864e5,daysold=Math.floor(e_daysold),e_hrsold=24*(e_daysold-daysold),hrsold=Math.floor(e_hrsold),e_minsold=60*(e_hrsold-hrsold),minsold=Math.floor(e_minsold),seconds=Math.floor(60*(e_minsold-minsold)),v.html(daysold),f.html(hrsold),b.html(minsold),y.html(seconds)}(),today=new Date,year=today.getFullYear(),month=today.getMonth()+1,day=today.getDate(),endDay=year+"-"+("0"+month).slice(-2)+"-"+("0"+day).slice(-2),locales={"zh-Hans":"zh","zh-Hant":"zh-tw",en:"en",ja:"ja"},$("#cal-heatmap").length>0){const t=new CalHeatmap;axios.get(e+"/stats.json").then((e=>{stats_data=e.data,t.paint({itemSelector:"#cal-heatmap",domain:{type:"month",gutter:5,label:{text:"MMM",textAlign:"start",position:"top"}},subDomain:{type:"ghDay",gutter:5,width:13,height:13,radius:3,label:null},date:{start:new Date(dayjs(endDay).subtract(2,"month")),max:new Date(endDay),highlight:[new Date(endDay)],locale:locales[a]},range:3,data:{source:stats_data.calendar,x:"date",y:"count"},scale:{color:{type:"threshold",range:["#9be9a8","#40c463","#30a14e","#216e39"],domain:[4,6,8]}}},[[Tooltip,{text:function(t,e,a){return 1==e?e+" contribution on "+a.format("YYYY-MM-DD"):(e?e+" contributions":"No contribution")+" on "+a.format("YYYY-MM-DD")}}],[LegendLite,{includeBlank:!0,itemSelector:"#ex-ghDay-legend",radius:3,width:10,height:10,gutter:2}],[CalendarLabel,{width:30,textAlign:"start",text:()=>dayjs.weekdaysShort().map(((t,e)=>e%2==0?"":t)),padding:[25,0,0,0]}]]),$("#ex-ghDay-prev").on("click",(function(e){e.preventDefault(),t.previous()})),$("#ex-ghDay-next").on("click",(function(e){e.preventDefault(),t.next()})),$("#ex-ghDay-today").on("click",(function(e){e.preventDefault(),t.jumpTo(new Date(endDay))}))}))}if($("#archive-heatmap").length>0){postWidth=$(".post-content").width(),postWidth>=633?month=12:postWidth>=400?month=8:postWidth>=300?month=6:month=3;const t=new CalHeatmap;axios.get(e+"/stats.json").then((e=>{stats_data=e.data,t.paint({itemSelector:"#archive-heatmap",domain:{type:"month",gutter:2,label:{text:"MMM",textAlign:"start",position:"top"}},subDomain:{type:"ghDay",gutter:2,width:9,height:9,radius:2},date:{start:new Date(dayjs(endDay).subtract(month-1,"month")),max:new Date(endDay),highlight:[new Date(endDay)],locale:locales[a]},range:month,data:{source:stats_data.calendar,x:"date",y:"count"},scale:{color:{type:"threshold",range:["#9be9a8","#40c463","#30a14e","#216e39"],domain:[4,6,8]}}},[[Tooltip,{text:function(t,e,a){return 1==e?e+" contribution on "+a.format("YYYY-MM-DD"):(e?e+" contributions":"No contribution")+" on "+a.format("YYYY-MM-DD")}}],[LegendLite,{includeBlank:!0,itemSelector:"#ex-ghDay-legend2",radius:3,width:10,height:10,gutter:2}],[CalendarLabel,{width:30,textAlign:"start",text:()=>dayjs.weekdaysShort().map(((t,e)=>e%2==0?"":t)),padding:[25,0,0,0]}]]),$("#ex-ghDay-prev2").on("click",(function(e){e.preventDefault(),t.previous()})),$("#ex-ghDay-next2").on("click",(function(e){e.preventDefault(),t.next()})),$("#ex-ghDay-today2").on("click",(function(e){e.preventDefault(),t.jumpTo(new Date(endDay))}))}))}}))}},e={};function a(o){var n=e[o];if(void 0!==n)return n.exports;var s=e[o]={exports:{}};return t[o](s,s.exports,a),s.exports}a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var o in e)a.o(e,o)&&!a.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";a(774)})()})();
|