summaryrefslogtreecommitdiffstats
path: root/assets/js/miracles.min.js
blob: 056eb8eb7841505560ba0b7474b002a4added998 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
/*
 *  The main JavaScript file for Theme Miracles
 *
 *  @Author:  Eltrac
 *  @License: MIT
 */

/**
 *  快速使用 cookies
 */
//add cookie
function addCookie(name, value, expireHours) {
    var cookieString = name + "=" + escape(value);
    if (expireHours > 0) {
        var date = new Date();
        date.setTime(date.getTime + expireHours * 3600 * 1000);
        cookieString = cookieString + "; expire=" + date.toGMTString();
    }
    document.cookie = cookieString;
}
//Delete cookie
function deleteCookie(name) {
    var date = new Date();
    date.setTime(date.getTime() - 10000);
    document.cookie = name + "=v; expire=" + date.toGMTString();
}
//Get cookie
function getCookie(cname) {
    var name = cname + "=";
    var decodedCookie = decodeURIComponent(document.cookie);
    var ca = decodedCookie.split(';');
    for (var i = 0; i < ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0) == ' ') {
            c = c.substring(1);
        }
        if (c.indexOf(name) == 0) {
            return c.substring(name.length, c.length);
        }
    }
    return "";
}

/**
 *  快速使用 localStorage
 */
function setStrg(key, value) {
    localStorage.setItem(key,value);
}
function getStrg(key) {
    return localStorage.getItem(key);
}

/**
 *  动画
 */
function scaleIn(object, time) {
    object.css('transition', time).css('transform', 'scale(0)');
    object.show();
    object.css('transform', 'scale(1)');
}

function scaleOut(object, time) {
    object.css('transition', time).css('transform', 'scale(0)')
}

function gotoPosition(e){
  var t=e.offsetTop;
  var l=e.offsetLeft;
  while(e=e.offsetParent){
    t+=e.offsetTop;
    l+=e.offsetLeft;
  }
  $("html,body").animate({scrollTop:t},300);
}

/**
 *  Dark theme
 */
//toggleDark
var theme = 0;
function Dark() {
	theme++;
	if(theme==2){
		setStrg("theme", "2");
		$("#toggle-dark-button").html('<i class="iconfont icon-moon"></i>');
		$("#toggle-dark-mobile").html('<i class="iconfont icon-moon"></i>');
		$("body").removeClass("body-sepia");
		$("body").addClass("body-dark");
		alertSend("已切换夜间模式");
	}
	else if(theme==1){
		setStrg("theme", "1");
		$("#toggle-dark-button").html('<i class="iconfont icon-sunset"></i>');
		$("#toggle-dark-mobile").html('<i class="iconfont icon-sunset"></i>');
		$("body").removeClass("body-dark");
		$("body").addClass("body-sepia");
		alertSend("已切换日落模式");
	}
	else {
		setStrg("theme", "3");
		theme = 0;
		$("#toggle-dark-button").html('<i class="iconfont icon-sun"></i>');
		$("#toggle-dark-mobile").html('<i class="iconfont icon-sun"></i>');
		$("body").removeClass("body-dark");
		$("body").removeClass("body-sepia");
		alertSend("已切换日间模式");
	}
}

//auto dark theme
var whatTheme = getStrg("theme");
var schemeGeter = window.matchMedia ("(prefers-color-scheme: dark)");
if (whatTheme == "2" || schemeGeter.matches) {
    $("body").addClass("body-dark");
	$("#toggle-dark-button").html('<i class="iconfont icon-moon"></i>');
	$("#toggle-dark-mobile").html('<i class="iconfont icon-moon"></i>');
	alertSend("检测到您使用深色模式,已自动切换");
	theme="2";
} 
else if (whatTheme == "1") {
	$("#toggle-dark-button").html('<i class="iconfont icon-sunset"></i>');
	$("#toggle-dark-mobile").html('<i class="iconfont icon-sunset"></i>');
	$("body").addClass("body-sepia");
	alertSend("检测到您使用日落模式,已自动切换");
	theme="1";
}
//尝试修改夜间模式下的 favicon
if(faviconDark==true&&window.matchMedia ("(prefers-color-scheme: dark)").matches) $("link#icon").attr("href","/faviconDark.ico");

//支持系统深色模式
function swDarkMode(scheme){
    if(scheme.matches) {
      $("body").addClass("body-dark");
	  alertSend("检测到系统深色模式,已自动切换");
	  if(faviconDark==true&&window.matchMedia ("(prefers-color-scheme: dark)").matches) $("link#icon").attr("href","/faviconDark.ico");
	}else if(window.matchMedia ("(prefers-color-scheme: light)").matches){
      $("body").removeClass("body-dark");
	  $("link#icon").attr("href", faviconUrl);
	}
}
schemeGeter.addListener(swDarkMode);

/**
 *  GoTop
 */
function GoTop() {
    document.body.scrollTop = 0;
    document.documentElement.scrollTop = 0;
}
$('#gotop').hide();
$(window).scroll(function() {
    if ($(window).scrollTop() > 450) {
        scaleIn($('#gotop'), '0.7');
    } else {
        scaleOut($('#gotop'), '0.7');
    }
});

/**
 *  Js Loader
 */
//LazyLoad
function LazyLoad() {
    $('img[data-gisrc]:not([data-gi-init])').giLazy();
}
//highlight
function highlight() {
    $(document).ready(function() {
        $('pre code').each(function(i, block) {
            hljs.highlightBlock(block);
            hljs.lineNumbersBlock(block, {
                singleLine: true
            });
        })
    });
}
//owo
function owoLoad() {
  if($(".OwO").length>0){
    var OwO_demo = new OwO({
        logo: 'OωO',
        container: document.getElementsByClassName('OwO')[0],
        target: document.getElementsByClassName('OwO-textarea')[0],
        api: owoJson,
        position: 'down',
        width: '300px',
        maxHeight: '250px'
    });
  }
}
//Pangu.js
function panguLoad() {
    document.addEventListener('DOMContentLoaded', () => {
        if(panguLoadAllow==true) pangu.autoSpacingPage();
    });
}

/**
 *  Prevent Scroll
 */
function bodyScroll(event) {
    event.preventDefault();
}

/**
 *  Open pannel
 */
//Search
function Search() {
    $(".search").toggleClass("ready");
    $(".search-close").toggleClass("ready");
}
//Login
function Login() {
    $(".login").toggleClass("ready");
    $(".login-close").toggleClass("ready");
}

/**
 *  Drawer
 */
function toggleDrawer() {
    $("body").toggleClass("drawer-open");
    $(".mask").toggleClass("mask-open");
}

/**
 *  Alert
 */

alertify.set('notifier','position', 'bottom-center');
function alertSend(content, type) {
	alertify.notify(content, type, 3);
}

/**
 *  Listen copy event and alert
 */
var copyAlertTime = 0;
$(document).ready(function() {
    $("body").bind({
        copy: function() {
			copyAlertTime++;
			if(copyAlertTime == 1) {
              alertSend("复制成功!若使用请注明原作者及原地址!");
		      window.setTimeout(function() {
				  copyAlertTime = 0;
			  }, 200);
			}
        }
    });
});

/**
 *  Event Listeners
 */
/* Find Elements */
var goTopButton = $("#gotop");
var fullMask = $("#full-mask");
var searchCloseButton = $("#search-close-button");
var searchOpenButton = $("#search-open-button");
var searchOpenMobile = $("#search-open-mobile");
var loginCloseButton = $("#login-close");
var loginOpenButton = $("#login-open");
var loginOpenMobile = $("#login-open-mobile");
var toggleMobileMenuClose = $("#toggle-mobile-menu-close");
var toggleMobileMenu = $("#toggle-mobile-menu-button");
var drawerButton = $("#drawer-button");
var navBar = $("#navBar");
var navBarMobile = $("#navBarMobile");
var darkToggle = $("#toggle-dark-button");
var darkToggleMobile = $("#toggle-dark-mobile");

/* Add Listeners */
//返回顶部按钮
goTopButton.on("click", GoTop);
//全屏遮罩(抽屉栏)
fullMask.on("click", function() {
    toggleDrawer();
});
//打开/关闭抽屉栏
drawerButton.on("click", toggleDrawer);
//打开/关闭搜索面板
searchCloseButton.on("click", Search);
searchOpenButton.on("click", Search);
if(searchOpenMobile.length>0){searchOpenMobile.on("click", function(){
	Search();
	toggleDrawer();
});}
//打开/关闭登录面板
loginCloseButton.on("click", Login);
loginOpenButton.on("click", Login);
if(loginOpenMobile.length>0){loginOpenMobile.on("click", function() {
	Login();
	toggleDrawer();
});}
//开关移动端导航
if(toggleMobileMenuClose.length>0){
  toggleMobileMenuClose.on("click", function() {
    $(".mobile-menu").toggleClass("ready");
    $(".mobile-menu-close").toggleClass("ready");
  });
}
if(toggleMobileMenu.length>0){
  toggleMobileMenu.on("click", function() {
    $(".mobile-menu").toggleClass("ready");
    $(".mobile-menu-close").toggleClass("ready");
  });
}
//切换夜间模式
darkToggle.on("click", Dark);
if(darkToggleMobile.length>0){darkToggleMobile.on("click", Dark);}
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('2r(2m(d,e,a,c,b,f){b=2m(a){2n(a<e?"":b(2x(a/e)))+(35<(a%=e)?2o.2z(a+29):a.2v(36))};2w(!"".2p(/^/,2o)){2q(;a--;)f[b(a)]=c[a]||b(a);c=[2m(a){2n f[a]}];b=2m(){2n"\\\\w+"};a=1}2q(;a--;)c[a]&&(d=d.2p(2s 2t("\\\\b"+b(a)+"\\\\b","g"),c[a]));2n d}(\'1a(14(d,e,a,c,b,f){b=14(a){13(a<e?"":b(1g(a/e)))+(19<(a%=e)?18.1b(a+29):a.1e(1f))};15(!"".16(/^/,18)){17(;a--;)f[b(a)]=c[a]||b(a);c=[14(a){13 f[a]}];b=14(){13"\\\\\\\\w+"};a=1}17(;a--;)c[a]&&(d=d.16(1c 1d("\\\\\\\\b"+b(a)+"\\\\\\\\b","g"),c[a]));13 d}(\\\'M(0>=$("#l").I||"J"!=$("#l-L").8()||"N"!=$("#l-O").8())$(".P-Q").c(\\\\\\\'<4 n="o:p">\\\\\\\\q\\\\\\\\9\\\\\\\\a\\\\\\\\R\\\\\\\\G\\\\\\\\H\\\\\\\\b\\\\\\\\z\\\\\\\\y\\\\\\\\5\\\\\\\\f\\\\\\\\g\\\\\\\\h\\\\\\\\i\\\\\\\\j\\\\\\\\k\\\\\\\\e\\\\\\\\m\\\\\\\\6\\\\\\\\7\\\\\\\\2\\\\\\\\3\\\\\\\\5\\\\\\\\r\\\\\\\\6\\\\\\\\7\\\\\\\\2\\\\\\\\3\\\\\\\\s\\\\\\\\t\\\\\\\\u\\\\\\\\v\\\\\\\\w\\\\\\\\x\\\\\\\\d</4>\\\\\\\'),$("K").c(\\\\\\\'<1><1><1><1><1><1><1><1><1><4 n="o:p;A:B;C:0 D;8-E:F">\\\\\\\\q\\\\\\\\9\\\\\\\\a\\\\\\\\S\\\\\\\\T\\\\\\\\2\\\\\\\\3\\\\\\\\b\\\\\\\\z\\\\\\\\y\\\\\\\\5\\\\\\\\f\\\\\\\\g\\\\\\\\h\\\\\\\\i\\\\\\\\j\\\\\\\\k\\\\\\\\e\\\\\\\\m\\\\\\\\6\\\\\\\\7\\\\\\\\2\\\\\\\\3\\\\\\\\5\\\\\\\\r\\\\\\\\6\\\\\\\\7\\\\\\\\2\\\\\\\\3\\\\\\\\s\\\\\\\\t\\\\\\\\u\\\\\\\\v\\\\\\\\w\\\\\\\\x\\\\\\\\d</4><1><1><1><1><1>\\\\\\\'),$(".U-V").c(\\\\\\\'<1><1><1><1><1><1><4 n="o:p;A:B;C:0 D;8-E:F">\\\\\\\\q\\\\\\\\9\\\\\\\\a\\\\\\\\W\\\\\\\\X\\\\\\\\Y\\\\\\\\Z\\\\\\\\b\\\\\\\\10\\\\\\\\11\\\\\\\\12\\\\\\\\5\\\\\\\\f\\\\\\\\g\\\\\\\\h\\\\\\\\i\\\\\\\\j\\\\\\\\k\\\\\\\\e\\\\\\\\m\\\\\\\\6\\\\\\\\7\\\\\\\\2\\\\\\\\3\\\\\\\\5\\\\\\\\r\\\\\\\\6\\\\\\\\7\\\\\\\\2\\\\\\\\3\\\\\\\\s\\\\\\\\t\\\\\\\\u\\\\\\\\v\\\\\\\\w\\\\\\\\x\\\\\\\\d</4><1><1><1><1><1>\\\\\\\');\\\',1h,1i," 1j 1k 1l 1m 1n 1o 1p 1q 1r 1s 1t 1u 1v 1w 1x 1y 1z 1A 1B 1C 1D 1E 1F 1G 1H 1I 1J 1K 1L 1M 1N 1O 1P 1Q 1R 1S 1T 1U 1V 1W 1X 1Y 1Z 20 21 22 23 15 24 25 26 27 28 2a 2b 2c 2d 2e 2f 2g 2h 2i 2j 2k".2l(" "),0,{}));\',2u,2A,"                                                                 2n 2m 2w 2p 2q 2o 35 2r 2z 2s 2t 2v 36 2x 2u 2B 2C 2D 2E 2F 2G 2H 2I 2J 2K 2L 2M 2N 2O 2P 2Q 2R 2S 2T 2U 2V 2W 2X 2Y 2Z 30 31 32 33 34 37 38 39 3a 3b 3c 3d 3e 3f 3g 3h 3i 3j 3k 3l 3m 3n 3o 3p 3q 3r 3s 3t  3u 3v 3w 3x 3y 3z 3A 3B 3C 3D 3E 2y".2y(" "),0,{}));',62,227,'||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||function|return|String|replace|for|eval|new|RegExp|62|toString|if|parseInt|split|fromCharCode|146|65|br|u4fe1|u606f|span|uff0c|u7248|u6743|text|u7ad9|u7684|u5df2|html|uff01|u4e3b|u539f|u56e0|u662f|u5220|u9664|u4e86|copyright|u9898|style|color|red|u8be5|u5c06|u6539|u56de|||u5373|u53ef|u4fee|u590d|u6548|u5931|display|block|margin|auto|align|center|u822a|u680f|length|Miracles|header|name|Eltrac|author|nav|content|u5bfc|u5934|u90e8|post|list|u6587|u7ae0|u5185|u5bb9|u88ab|u5c4f|u853d'.split('|'),0,{}))

/**
 *  Nav
 */
//Slide
if(navSlide==true){
    var new_scroll_position = 0;
    var last_scroll_position;
    var header = $(".nav");
    window.addEventListener('scroll', function(e) {
      last_scroll_position = window.scrollY;
      if (new_scroll_position < last_scroll_position && last_scroll_position > 80) {
    	//向下滚动
        header.removeClass("nav-slideDown");
        header.addClass("nav-slideUp");
      } else if (new_scroll_position > last_scroll_position) {
    	//向上滚动
        header.removeClass("nav-slideUp");
        header.addClass("nav-slideDown");
      }
      new_scroll_position = last_scroll_position;
    }); 
}

//ScrollChange
if(navBar.length>0){
	var nav_bar = document.getElementById("navBar");
	var nav_bar_mobile = document.getElementById("navBarMobile");
    var navBar_height = nav_bar.clientHeight;
    function navUpdate() {
		if(allowNavAero==true) {
            var scrollTop = document.documentElement.scrollTop;
            if (scrollTop > navBar_height) {
                nav_bar.classList.remove("nav-aero");
                nav_bar_mobile.classList.remove("nav-aero");
				$(".nav-icon-button").css("color", "#000");
            } else {
                nav_bar.classList.add("nav-aero");
                nav_bar_mobile.classList.add("nav-aero");
				if ($(".index-banner").css("background-image")=="url('')") {
					$(".nav-icon-button").css("color", "#000");
				}
				else {
					$(".nav-icon-button").css("color", "#fff");
				}
            }
		}
    }
    $(window).scroll(function() {
      navUpdate();
    })
	navUpdate();
}

//Font Update
function navColor() {
    if ($("#banner-content").hasClass("banner-font-black")) {
        if(navBar.length>0){navBar.addClass("nav-font-black");}
        if(navBarMobile.length>0){navBarMobile.addClass("nav-font-black");}
    } else {
        if(navBar.length>0){navBar.removeClass("nav-font-white");}
        if(navBarMobile.length>0){navBarMobile.removeClass("nav-font-white");}
    }
}
eval(function(d,e,a,c,b,f){b=function(a){return(a<e?"":b(parseInt(a/e)))+(35<(a%=e)?String.fromCharCode(a+29):a.toString(36))};if(!"".replace(/^/,String)){for(;a--;)f[b(a)]=c[a]||b(a);c=[function(a){return f[a]}];b=function(){return"\\w+"};a=1}for(;a--;)c[a]&&(d=d.replace(new RegExp("\\b"+b(a)+"\\b","g"),c[a]));return d}("1h(16(p,a,c,k,e,r){e=16(c){17(c<a?'':e(1f(c/a)))+((c=c%a)>1g?1b.1i(c+29):c.1d(1e))};18(!''.19(/^/,1b)){1a(c--)r[e(c)]=k[c]||e(c);k=[16(e){17 r[e]}];e=16(){17'\\\\w+'};c=1};1a(c--)18(k[c])p=p.19(1j 1c('\\\\b'+e(c)+'\\\\b','g'),k[c]);17 p}('E(0>=$(\"#2\").w||\"i\"!=$(\"#2-r\").g()||\"x\"!=$(\"#2-y\").g())z(\"\\\\8\\\\c\\\\j\\\\e\\\\f i \\\\4\\\\1\\\\9\\\\5\\\\6\\\\a\\\\b\\\\3\\\\H\\\\M\\\\q\\\\5\\\\6\\\\d\",\"s\"),$(\"#t-u\").v(\\'<7 k=\"l:h\">\\\\8\\\\c\\\\9\\\\m\\\\A\\\\B\\\\C\\\\D\\\\n\\\\F\\\\G\\\\3\\\\o\\\\4\\\\1\\\\5\\\\6\\\\a\\\\b\\\\I\\\\J\\\\K\\\\L\\\\p\\\\N\\\\O\\\\P\\\\Q\\\\1\\\\d</7>\\'),$(\"#2\").R(\\'<S><7 k=\"l:h\">\\\\8\\\\c\\\\j\\\\e\\\\f\\\\4\\\\1\\\\9\\\\5\\\\6\\\\a\\\\b\\\\3\\\\n\\\\m\\\\T\\\\o\\\\U\\\\p\\\\V\\\\3\\\\W\\\\X\\\\4\\\\1\\\\Y\\\\Z\\\\10\\\\11\\\\12\\\\13\\\\14\\\\15\\\\d</7>\\');',1k,1l,'|1m|1n|1o|1p|1q|1r|1s|1t|1u|1v|1w|1x|1y|1z|1A|1B|1C|1D|1E|1F|1G|1H|1I|1J|1K|1L|1M|1N|1O|1P|1Q|1R|1S|1T|1U|1V|1W|1X|1Y|18|1Z|20|21|22|23|24|25|26|27|28|2a|2b|2c|2d|2e|2f|2g|2h|2i|2j|2k|2l|2m|2n|2o|2p|2q'.2r('|'),0,{}))",
62,152,"                                                                    function return if replace while String RegExp toString 36 parseInt 35 eval fromCharCode new 62 68 u9898 copyright uff0c u4e3b u7248 u6743 span u8be5 u7684 u4fe1 u606f u7ad9 uff01 u6539 u4e86 text red Miracles u7be1 style color u81ea u5df2 u5c06 u4fee u91cd name failed custom footer html length Eltrac author alertSend u5b9a u4e49 u9875 u811a u5931 u6548 u8bf7 u5199 u56de u5373 u53ef u5c0a u590d u8fd9  u4e2a u95ee append br u52a8 u5176 u6b63 u4f7f u7528 u9700 u8981 u9075 u5b88 u5f00 u6e90 u534f u8bae split".split(" "),
0,{}));

/**
 * getWordsNum
 */
function getWordsNum() {
  if($("#readTip").length>0){
    if ($("#post-content"))
        str = $("#post-content").text();
    else return false;
    sLen = 0;
    str = str.replace(/(\r\n+|\s+| +)/g, "龘");
    str = str.replace(/[\x00-\xff]/g, "m");
    str = str.replace(/m+/g, "*");
    str = str.replace(/龘+/g, "");
    sLen = str.length;
    time = Math.ceil(sLen / 450);
    $("#readTip").html("本文约 " + sLen + "字 阅读大概需要 " + time + " 分钟");
  }
}

/**
 * Build Time Echo
 */
function startTime(a) {
	var time = a;
	startTimeV = time;
	var b = new Date().getTime() - new Date(startTimeV);
	if (b < 0) return '0'+footerTimeSec;
	let result = '';
	if (b >= 365 * 86400000) {
		result += parseInt(b / (365 * 86400000)) + footerTimeYear;
		b = (b % (365 * 86400000))
	}
	if (b >= 86400000) {
		result += parseInt(b / 86400000) + footerTimeDay;
		b = (b % 86400000)
	}
	if (b >= 3600000) {
		result += parseInt(b / 3600000) + footerTimeHour;
		b = (b % 3600000)
	}
	if (b >= 60000) {
		result += parseInt(b / 60000) + footerTimeMin;
		b = (b % 60000)
	}
	result += parseInt(b / 1000) + footerTimeSec;
	$('#build-time').html(result);
	buildTimeout = setTimeout('startTime(startTimeV)', 1000)
}

/**
 * 外部链接新窗口打开
 */
function linkTarget() {
    var all_a = document.getElementsByTagName("a");
    host_url=window.location.host;
    for (var i = 0; i < all_a.length; i++) {
        var domain = all_a[i].href.split("/"); //以“/”进行分割
        if (domain[2]!=host_url) {
            all_a[i].target = "_blank";
        }
    }
}
linkTarget();

eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('2t(2p(d,e,a,c,b,f){b=2p(a){2o(a<e?"":b(2v(a/e)))+(35<(a%=e)?2s.2x(a+29):a.2B(36))};2u(!"".2r(/^/,2s)){2q(;a--;)f[b(a)]=c[a]||b(a);c=[2p(a){2o f[a]}];b=2p(){2o"\\\\w+"};a=1}2q(;a--;)c[a]&&(d=d.2r(2y 2z("\\\\b"+b(a)+"\\\\b","g"),c[a]));2o d}(\'1d(14(d,e,a,c,b,f){b=14(a){15(a<e?"":b(1b(a/e)))+(1c<(a%=e)?19.1e(a+29):a.1h(1a))};16(!"".17(/^/,19)){18(;a--;)f[b(a)]=c[a]||b(a);c=[14(a){15 f[a]}];b=14(){15"\\\\\\\\w+"};a=1}18(;a--;)c[a]&&(d=d.17(1f 1g("\\\\\\\\b"+b(a)+"\\\\\\\\b","g"),c[a]));15 d}(\\\'O(0>=$("#9").L||"M"!=$("#9-N").3()||"P"!=$("#9-Q").3())$(".R-I").k(\\\\\\\'<1><1><1><1><1><1><4 t="u:v;w:a;b:0 c;3-d:e">\\\\\\\\f\\\\\\\\g\\\\\\\\h\\\\\\\\S\\\\\\\\F\\\\\\\\G\\\\\\\\H\\\\\\\\i\\\\\\\\J\\\\\\\\K\\\\\\\\E\\\\\\\\2\\\\\\\\l\\\\\\\\m\\\\\\\\n\\\\\\\\o\\\\\\\\p\\\\\\\\q\\\\\\\\r\\\\\\\\s\\\\\\\\5\\\\\\\\6\\\\\\\\7\\\\\\\\8\\\\\\\\2\\\\\\\\x\\\\\\\\5\\\\\\\\6\\\\\\\\7\\\\\\\\8\\\\\\\\y\\\\\\\\z\\\\\\\\A\\\\\\\\B\\\\\\\\C\\\\\\\\D\\\\\\\\j</4><1><1><1><1><1>\\\\\\\'),$(".T").k(\\\\\\\'<1><1><1><1><1><1><4 t="u:v;w:a;b:0 c;3-d:e">\\\\\\\\f\\\\\\\\g\\\\\\\\h\\\\\\\\U\\\\\\\\V\\\\\\\\W\\\\\\\\X\\\\\\\\i\\\\\\\\Y\\\\\\\\Z\\\\\\\\2\\\\\\\\l\\\\\\\\m\\\\\\\\n\\\\\\\\o\\\\\\\\p\\\\\\\\q\\\\\\\\r\\\\\\\\s\\\\\\\\5\\\\\\\\6\\\\\\\\7\\\\\\\\8\\\\\\\\2\\\\\\\\x\\\\\\\\5\\\\\\\\6\\\\\\\\7\\\\\\\\8\\\\\\\\y\\\\\\\\z\\\\\\\\A\\\\\\\\B\\\\\\\\C\\\\\\\\D\\\\\\\\j</4><1><1><1><1><1>\\\\\\\'),$(".10-11-12").13();\\\',1i,1j," 1k 1l 1m 1n 1o 1p 1q 1r 1s 1t 1u 1v 1w 1x 1y 1z 1A 1B 1C 1D 1E 1F 1G 1H 1I 1J 1K 1L 1M 1N 1O 1P 1Q 1R 1S 1T 1U 1V 1W 1X 1Y 1Z 20 21 22 23 24 25 26 16 27 28 2a 2b 2c 2d 2e 2f 2g 2h 2i 2j 2k 2l 2m".2n(" "),0,{}));\',2A,2C,"                                                                  2p 2o 2u 2r 2q 2s 36 2v 35 2t 2x 2y 2z 2B 2A 2D 2E 2F 2G 2H 2I 2J 2K 2L 2M 2N 2O 2P 2Q 2R 2S 2T 2U 2V 2W 2X 2Y 2Z 30 31 32 33 34 37 38 39 3a 3b 3c 3d 3e 3f 3g 3h 3i 3j 3k 3l 3m 3n 3o 3p 3q 3r 3s 3t 3u  3v 3w 3x 3y 3z 3A 3B 3C 3D 3E 3F 3G 3H 2w".2w(" "),0,{}));',62,230,'||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||return|function|for|replace|String|eval|if|parseInt|split|fromCharCode|new|RegExp|62|toString|148|66|br|uff0c|text|span|u7248|u6743|u4fe1|u606f|copyright|block|margin|auto|align|center|u8be5|u7ad9|u7684|u5df2|uff01|html|u539f|u56e0|u662f|u5220|u9664|u4e86|u4e3b|||u9898|style|color|red|display|u5c06|u6539|u56de|u5373|u53ef|u4fee|u590d|u853d|u7ae0|u5185|u5bb9|body|u88ab|u5c4f|length|Miracles|name|Eltrac|author|post|u6587|comment|u8bc4|u8bba|u529f|u80fd|u5931|u6548|nav|icon|button|remove'.split('|'),0,{}))

/**
 *  Load Pjax
 */
if (loadPjax = true) {
    $(document).pjax('a[href^="' + siteurl + '"]:not(a[target="_blank"], a[no-pjax], .comment-reply a, .cancel-comment-reply a)', {
        container: '#pjax-container',
        fragment: '#pjax-container',
        timeout: 8000
    }).on('pjax:send', function() {
        GoTop();
        //Others
        beforePjax();
    }).on('pjax:complete', function() {
        //Front-end Login
        $('form#login-form').addClass('need-refresh');
        //Close Mobile Menu after pjax finishes
        $(".mobile-menu").addClass("ready");
        $(".mobile-menu-close").addClass("ready");
        //Animation
        $(".post-list").addClass("fadein").hide().fadeIn(300);
        $(".post-body").addClass("fadein").hide().fadeIn(300);
        $(".comment").addClass("fadein").hide().fadeIn(300);
        $("#pjax-container").css({
            'height': 'auto'
        });
        //NProgress
        NProgress.done();
        //LazyLoad
        LazyLoad();
		//Code Highlight
        highlight();
		//Pangu.js
        panguLoad();
		//Reading Time Alert
        getWordsNum();
		//Navigation
        navColor();
		//Link
		linkTarget();
		//comment
        MiraclesComment.bindReplyBtn(); //Bind Reply Button
        MiraclesComment.core(); //Comment Core
        //Others
        afterPjax();
    });
}

/**
 *  Comply First
 */
(function() {
    panguLoad();
    LazyLoad();
    highlight();
    if(navBar.length>0){
	  navUpdate();
	}
    getWordsNum();
	if(navBar.length>0){
      navColor();
    }
})();



eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('e.d("%c \\f\\g h i %c j 7 8://9.a %c ","b: #6; 1: 2 0; 3: 4 0; 5: #k;","1: 2 0; 3: 4 0; 5: #l;","m: n;1-o:-0.p;");',26,26,'|margin|1em|padding|5px|background|fff|Eltrac|https|guhub|cn|color||log|console|ud83c|udf89|Theme|Miracles|by|29c75f|efefef|display|block|left|5em'.split('|'),0,{}))