-
Notifications
You must be signed in to change notification settings - Fork 0
/
about.html
799 lines (681 loc) · 27.9 KB
/
about.html
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
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
<!DOCTYPE html>
<!--[if lte IE 8 ]>
<html class="ie" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<!--
*************** * * *
8 * * *
8 * * *
8 ** *
8 * * *
8 * * *
8 * * *
8 * * *********** -----Theme By Kieran(http://go.kieran.top)
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" lang="zh-CN">
<!--<![endif]-->
<head>
<title>About Me | ZY's Blog</title>
<!-- Meta data -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8" >
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="generator" content="ZY's Blog">
<meta name="author" content="Z Yong">
<meta name="description" content="Young for you." />
<meta name="keywords" content="" />
<!-- Favicon, (keep icon in root folder) -->
<link rel="Shortcut Icon" href="/img/xfavicon.ico" type="image/ico">
<link rel="alternate" href="/atom.xml" title="ZY's Blog" type="application/atom+xml">
<link rel="stylesheet" href="/css/all.css" media="screen" type="text/css">
<link rel="stylesheet" href="/highlightjs/tomorrow-night-eighties.css" type="text/css">
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="/css/ie8.css" />
<![endif]-->
<!-- jQuery | Load our jQuery, with an alternative source fallback to a local version if request is unavailable -->
<script src="/js/jquery-1.11.1.min.js"></script>
<script>window.jQuery || document.write('<script src="js/jquery-1.11.1.min.js"><\/script>')</script>
<!-- Load these in the <head> for quicker IE8+ load times -->
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="/js/html5shiv.min.js"></script>
<script src="/js/respond.min.js"></script>
<![endif]-->
<link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="atom.xml">
<style>.col-md-8.col-md-offset-2.opening-statement img{display:none;}</style>
</head>
<!--
<body class="post-template">
-->
<body id="index" class="lightnav animsition">
<!-- ============================ Off-canvas navigation =========================== -->
<div class="sb-slidebar sb-right sb-style-overlay sb-momentum-scrolling">
<div class="sb-close" aria-label="Close Menu" aria-hidden="true">
<img src="/img/close.png" alt="Close"/>
</div>
<!-- Lists in Slidebars -->
<ul class="sb-menu">
<li><a href="/" class="animsition-link" title="Home">Home</a></li>
<li><a href="/archives" class="animsition-link" title="archive">archives</a></li>
<!-- Dropdown Menu -->
<li>
<a class="sb-toggle-submenu">Categories<span class="sb-caret"></span></a>
<ul class="sb-submenu">
<li><a href="/categories/技术/" class="animsition-link">技术<small>(46)</small></a></li>
<li><a href="/categories/芭乐/" class="animsition-link">芭乐<small>(1)</small></a></li>
</ul>
</li>
<li>
<a class="sb-toggle-submenu">Links<span class="sb-caret"></span></a>
<ul class="sb-submenu">
<li><a href="http://www.xiaonanbobo.com/" class="animsition-link">Bobo</a></li>
<li><a href="http://xxgblog.com/" class="animsition-link">Wucao</a></li>
<li><a href="http://www.ruanyifeng.com/blog/" class="animsition-link">阮一峰</a></li>
<li><a href="http://www.importnew.com/" class="animsition-link">Importnew</a></li>
<li><a href="http://www.hollischuang.com/" class="animsition-link">Holis</a></li>
</ul>
</li>
</ul>
<!-- Lists in Slidebars -->
<ul class="sb-menu secondary">
<li><a href="javascript:;" class="popup-trigger" title="Search"><span class="search-icon"></span>Search</a></li>
<li><a href="/about.html" class="animsition-link" title="about">About</a></li>
<li><a href="/tagCloud.html" class="animsition-link" title="tagCloud">Tag</a></li>
<li><a href="/atom.xml" class="animsition-link" title="rss">RSS</a></li>
</ul>
</div>
<!-- ============================ END Off-canvas navigation =========================== -->
<!-- ============================ #sb-site Main Page Wrapper =========================== -->
<div id="sb-site">
<!-- #sb-site - All page content should be contained within this id, except the off-canvas navigation itself -->
<!-- ============================ Header & Logo bar =========================== -->
<div id="navigation" class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<!-- Nav logo -->
<div class="logo">
<a href="/" title="Logo" class="animsition-link">
<img src="/img/x2.png" alt="Logo" width="60px;"/>
</a>
</div>
<!-- // Nav logo -->
<!-- Info-bar -->
<nav>
<ul class="nav">
<li><a href="/" class="animsition-link">ZY's Blog</a></li>
<li class="nolink"><span>Always </span>Creative.</li>
<li class="nolink"><span>Welcome!</span></li>
</ul>
</nav>
<!--// Info-bar -->
</div>
<!-- // .container -->
<div class="learnmore sb-toggle-right">More</div>
<button type="button" class="navbar-toggle menu-icon sb-toggle-right" title="More">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar before"></span>
<span class="icon-bar main"></span>
<span class="icon-bar after"></span>
</button>
</div>
<!-- // .navbar-inner -->
</div>
<!-- ============================ Header & Logo bar =========================== -->
<!-- ============================ Hero Image =========================== -->
<section id="hero" class="scrollme">
<div class="container-fluid element-img" style="background: url(/img/m1.jpeg) no-repeat center center fixed;background-size: cover">
<div class="row">
<div class="col-xs-12 col-sm-8 col-sm-offset-2 col-md-8 col-md-offset-2 vertical-align cover boost text-center">
<div class="center-me animateme" data-when="exit" data-from="0" data-to="0.6" data-opacity="0" data-translatey="100">
<div>
<h2>YOU'VE MADE A <span>BRAVE</span> DECISION, WELCOME.</h2>
<p></p>
<h2></h2>
<p>每一个不曾起舞的日子都是对生命的辜负。</p>
</div>
</div>
</div>
<!-- // .col-md-12 -->
</div>
<div class="herofade beige-dk"></div>
</div>
</section>
<!-- Height spacing helper -->
<div class="heightblock"></div>
<!-- // End height spacing helper -->
<!-- ============================ END Hero Image =========================== -->
<section id="intro">
<div class="container">
<div class="row col-md-offset-2">
<div class="col-md-8">
<h1>About Me</h1>
</div>
</div>
<div class="col-md-8 col-md-offset-2">
<h2 id="关于我"><a href="#关于我" class="headerlink" title="关于我"></a>关于我</h2><p>      可能,可能我还算不上是一个菜鸟,但我会变成菜鸟,变成小鸟,变成雏鹰,变成……</p>
<p>      因为我知道,天空,才是我的归宿。</p>
<p> <img src="http://osuskkx7k.bkt.clouddn.com/1.jpg" alt="be yourself"><br><strong>鸿爪踏雪泥      还是来得及</strong><br><strong>对重遇的人说    原来你也在这里</strong> </p>
<h2 id=""><a href="#" class="headerlink" title=" *"></a> <em>*</em></h2><p>From SHU<br>QQ:352804515<br>Email:zy_lebron@163.com<br><em>不负勇往</em>。</p>
<div class="clearfix"></div>
</div>
</div>
</section>
<section id="process">
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-8 col-md-offset-2">
<div class="timeline-centered">
<div class="line"></div>
<div class="present">Past</div>
<div class="dot_tp"></div>
<div class="born">Now</div>
<div class="dot_bt"></div>
<div class="timeline-entry">
<div class="timeline-entry-inner">
<div class="timeline-icon wow fadeInUp" data-wow-delay="0.2s">
<span class="number">1</span>
</div>
<div class="timeline-label wow fadeInUp" data-wow-delay="0.2s">
<p>2017/07/01-永远保持一颗对技术的好奇心。</p>
</div>
</div>
</div>
<div class="timeline-entry">
<div class="timeline-entry-inner">
<div class="timeline-icon wow fadeInUp" data-wow-delay="0.2s">
<span class="number">2</span>
</div>
<div class="timeline-label wow fadeInUp" data-wow-delay="0.2s">
<p>2018/01/01-新的一年,不负勇往。</p>
</div>
</div>
</div>
<div class="timeline-entry">
<div class="timeline-entry-inner">
<div class="timeline-icon wow fadeInUp" data-wow-delay="0.2s">
<span class="number">3</span>
</div>
<div class="timeline-label wow fadeInUp" data-wow-delay="0.2s">
<p>2018/03/08-平淡日子里的刺。</p>
</div>
</div>
</div>
<div class="timeline-entry">
<div class="timeline-entry-inner">
<div class="timeline-icon wow fadeInUp" data-wow-delay="0.2s">
<span class="number">4</span>
</div>
<div class="timeline-label wow fadeInUp" data-wow-delay="0.2s">
<p>没有止境。</p>
</div>
</div>
</div>
</div>
<!-- timeline-centered -->
</div>
</div>
</div>
</section>
<!-- ============================ Footer =========================== -->
<footer>
<div class="container">
<div class="copy">
<p>
© 2017<script>new Date().getFullYear()>2010&&document.write("-"+new Date().getFullYear());</script>, Content By Z Yong. All Rights Reserved.
</p>
<p>Theme By <a href="#" style="color: #767D84">Kieran</a></p>
</div>
<div class="social">
<ul>
</ul>
</div>
<div class="clearfix"> </div>
</div>
</footer>
<!-- ============================ END Footer =========================== -->
<!-- Load our scripts -->
<!-- Resizable 'on-demand' full-height hero -->
<script type="text/javascript">
var resizeHero = function () {
var hero = $(".cover,.heightblock"),
window1 = $(window);
hero.css({
"height": window1.height()
});
};
resizeHero();
$(window).resize(function () {
resizeHero();
});
</script>
<script src="/js/plugins.min.js"></script><!-- Bootstrap core and concatenated plugins always load here -->
<script src="/js/jquery.flexslider-min.js"></script><!-- Flexslider plugin -->
<script src="/js/scripts.js"></script><!-- Theme scripts -->
<link rel="stylesheet" href="/fancybox/jquery.fancybox.css" media="screen" type="text/css">
<script src="/fancybox/jquery.fancybox.pack.js"></script>
<script type="text/javascript">
$('#intro').find('img').each(function(){
var alt = this.alt;
if (alt){
$(this).after('<span class="caption" style="display:none">' + alt + '</span>');
}
$(this).wrap('<a href="' + this.src + '" title="' + alt + '" class="fancybox" rel="gallery" />');
});
(function($){
$('.fancybox').fancybox();
})(jQuery);
</script>
<!-- Initiate flexslider plugin -->
<script type="text/javascript">
$(document).ready(function($) {
(function(){
console.log('font');
var getCss = function(path) {
var head = document.getElementsByTagName('head')[0];
link = document.createElement('link');
link.href = path;
link.rel = 'stylesheet';
link.type = 'text/css';
head.appendChild(link);
};
getCss('https://fonts.googleapis.com/css?family=Montserrat:400,700');
getCss('https://fonts.googleapis.com/css?family=Open+Sans:400,600');
})();
$('.flexslider').flexslider({
animation: "fade",
prevText: "",
nextText: "",
directionNav: true
});
});
</script>
<style>
.local-search-popup {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
padding: 0;
background: rgba(255, 255, 255, .9);
color: #333;
z-index: 9999;
border-radius: 5px;
overflow: scroll;
}
#local-search-input {
width: 100%;
border: none;
outline: none;
border-bottom: 1px solid #151515;
background-color: initial;
}
.search-result-list {
list-style: none;
padding-left: 0;
}
.search-result-list > li {
margin-top: 15px;
border-bottom: 1px solid #ddd;
transition: all ease .3s;
}
.search-result-list > li:hover {
border-bottom: 1px solid gray;
}
.search-result-title {
font-size: 16px;
}
.search-result {
line-height: 20px;
}
.search-keyword {
font-weight: normal;
color: #c00;
}
@media (min-width: 890px) {
.popup-btn-close {
position: absolute;
top: 15px;
left: 35px;
border: 1px solid #151515;
padding: 0px 10px;
border-top-left-radius: 8px;
cursor: pointer;
transition: all ease .3s;
}
.popup-btn-close:hover {
background: #151515;
opacity: .9;
color: #fff;
}
}
@media (max-width: 890px) {
.popup-btn-close {
font-size: 0;
position: fixed;
right: 20px;
bottom: 50px;
width: 50px;
height: 50px;
background: #fff;
border-radius: 50%;
box-shadow: 1px 1px 5px #888;
cursor: pointer;
}
.popup-btn-close::after {
content: '←';
color: #151515;
position: absolute;
top: 0;
left: 0;
font-size: 20px;
width: 100%;
height: 100%;
line-height: 50px;
text-align: center;
}
}
</style>
<div class="popup search-popup local-search-popup">
<span class="popup-btn-close">
ESC
</span>
<div class="container">
<div class="col-md-8 col-md-offset-2">
<div class="local-search-header clearfix">
<span class="search-icon">
<i class="fa fa-search"></i>
</span>
<div class="local-search-input-wrapper">
<input autocomplete="off" placeholder="Search..." type="text" id="local-search-input">
</div>
</div>
<div id="local-search-result"></div>
</div>
</div>
</div>
<script src="/js/ziploader.js"></script>
<script type="text/javascript">
// Popup Window;
var isfetched = false;
var isXml = true;
// Search DB path;
var search_path = "search.json";
if (search_path.length === 0) {
search_path = "search.xml";
} else if (/json$/i.test(search_path)) {
isXml = false;
}
// monitor main search box;
var onPopupClose = function (e) {
$('.popup').fadeOut(300);
$('#local-search-input').val('');
$('.search-result-list').remove();
$('#no-result').remove();
$('body').css('overflow', '');
}
function proceedsearch() {
$('.popup').fadeIn(300);
var $localSearchInput = $('#local-search-input');
$localSearchInput.attr("autocapitalize", "none");
$localSearchInput.attr("autocorrect", "off");
$localSearchInput.focus();
}
// get search zip version
$.get('/searchVersion.txt?t=' + (+new Date()), function(res) {
if (localStorage.getItem('searchVersion') !== res) {
localStorage.setItem('searchVersion', res);
initSearchJson();
}
});
function initSearchJson () {
initLoad(['/search.zip'], {
loadOptions: {
success: function(obj) {
localStorage.setItem('searchJson', obj['search.json'])
},
error: function(e) {
return console.log(e)
}
},
returnOptions: {
'json': TYPE_TEXT
},
mimeOptions:{
'json':'application/json'
}
})
}
// search function;
var searchFunc = function(search_id, content_id) {
'use strict';
isfetched = true;
var datas = JSON.parse(localStorage.getItem('searchJson'));
console.log(search_id)
var input = document.getElementById(search_id);
var resultContent = document.getElementById(content_id);
var inputEventFunction = function() {
var searchText = input.value.trim().toLowerCase();
var keywords = searchText.split(/[\s\-]+/);
if (keywords.length > 1) {
keywords.push(searchText);
}
var resultItems = [];
if (searchText.length > 0) {
// perform local searching
datas.forEach(function(data) {
var isMatch = false;
var hitCount = 0;
var searchTextCount = 0;
var title = data.title ? data.title.trim() : '';
var titleInLowerCase = title.toLowerCase();
var content = data.content ? data.content.trim().replace(/<[^>]+>/g,"") : '';
var contentInLowerCase = content.toLowerCase();
var articleUrl = decodeURIComponent(data.url);
var indexOfTitle = [];
var indexOfContent = [];
// only match articles with not empty titles
keywords.forEach(function(keyword) {
function getIndexByWord(word, text, caseSensitive) {
var wordLen = word.length;
if (wordLen === 0) {
return [];
}
var startPosition = 0, position = [], index = [];
if (!caseSensitive) {
text = text.toLowerCase();
word = word.toLowerCase();
}
while ((position = text.indexOf(word, startPosition)) > -1) {
index.push({position: position, word: word});
startPosition = position + wordLen;
}
return index;
}
indexOfTitle = indexOfTitle.concat(getIndexByWord(keyword, titleInLowerCase, false));
indexOfContent = indexOfContent.concat(getIndexByWord(keyword, contentInLowerCase, false));
});
if (indexOfTitle.length > 0 || indexOfContent.length > 0) {
isMatch = true;
hitCount = indexOfTitle.length + indexOfContent.length;
}
// show search results
if (isMatch) {
// sort index by position of keyword
[indexOfTitle, indexOfContent].forEach(function (index) {
index.sort(function (itemLeft, itemRight) {
if (itemRight.position !== itemLeft.position) {
return itemRight.position - itemLeft.position;
} else {
return itemLeft.word.length - itemRight.word.length;
}
});
});
// merge hits into slices
function mergeIntoSlice(text, start, end, index) {
var item = index[index.length - 1];
var position = item.position;
var word = item.word;
var hits = [];
var searchTextCountInSlice = 0;
while (position + word.length <= end && index.length != 0) {
if (word === searchText) {
searchTextCountInSlice++;
}
hits.push({position: position, length: word.length});
var wordEnd = position + word.length;
// move to next position of hit
index.pop();
while (index.length != 0) {
item = index[index.length - 1];
position = item.position;
word = item.word;
if (wordEnd > position) {
index.pop();
} else {
break;
}
}
}
searchTextCount += searchTextCountInSlice;
return {
hits: hits,
start: start,
end: end,
searchTextCount: searchTextCountInSlice
};
}
var slicesOfTitle = [];
if (indexOfTitle.length != 0) {
slicesOfTitle.push(mergeIntoSlice(title, 0, title.length, indexOfTitle));
}
var slicesOfContent = [];
while (indexOfContent.length != 0) {
var item = indexOfContent[indexOfContent.length - 1];
var position = item.position;
var word = item.word;
// cut out 100 characters
var start = position - 20;
var end = position + 80;
if(start < 0){
start = 0;
}
if (end < position + word.length) {
end = position + word.length;
}
if(end > content.length){
end = content.length;
}
slicesOfContent.push(mergeIntoSlice(content, start, end, indexOfContent));
}
// sort slices in content by search text's count and hits' count
slicesOfContent.sort(function (sliceLeft, sliceRight) {
if (sliceLeft.searchTextCount !== sliceRight.searchTextCount) {
return sliceRight.searchTextCount - sliceLeft.searchTextCount;
} else if (sliceLeft.hits.length !== sliceRight.hits.length) {
return sliceRight.hits.length - sliceLeft.hits.length;
} else {
return sliceLeft.start - sliceRight.start;
}
});
// select top N slices in content
var upperBound = parseInt('2');
if (upperBound >= 0) {
slicesOfContent = slicesOfContent.slice(0, upperBound);
}
// highlight title and content
function highlightKeyword(text, slice) {
var result = '';
var prevEnd = slice.start;
slice.hits.forEach(function (hit) {
result += text.substring(prevEnd, hit.position);
var end = hit.position + hit.length;
result += '<b class="search-keyword">' + text.substring(hit.position, end) + '</b>';
prevEnd = end;
});
result += text.substring(prevEnd, slice.end);
return result;
}
var resultItem = '';
if (slicesOfTitle.length != 0) {
resultItem += "<li><a target='_blank' href='" + articleUrl + "' class='search-result-title'>" + highlightKeyword(title, slicesOfTitle[0]) + "</a>";
} else {
resultItem += "<li><a target='_blank' href='" + articleUrl + "' class='search-result-title'>" + title + "</a>";
}
slicesOfContent.forEach(function (slice) {
resultItem += "<a target='_blank' href='" + articleUrl + "'>" +
"<p class=\"search-result\">" + highlightKeyword(content, slice) +
"...</p>" + "</a>";
});
resultItem += "</li>";
resultItems.push({
item: resultItem,
searchTextCount: searchTextCount,
hitCount: hitCount,
id: resultItems.length
});
}
})
};
if (keywords.length === 1 && keywords[0] === "") {
resultContent.innerHTML = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>'
} else if (resultItems.length === 0) {
resultContent.innerHTML = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>'
} else {
resultItems.sort(function (resultLeft, resultRight) {
if (resultLeft.searchTextCount !== resultRight.searchTextCount) {
return resultRight.searchTextCount - resultLeft.searchTextCount;
} else if (resultLeft.hitCount !== resultRight.hitCount) {
return resultRight.hitCount - resultLeft.hitCount;
} else {
return resultRight.id - resultLeft.id;
}
});
var searchResultList = '<ul class=\"search-result-list\">';
resultItems.forEach(function (result) {
searchResultList += result.item;
})
searchResultList += "</ul>";
resultContent.innerHTML = searchResultList;
}
}
if ('auto' === 'auto') {
input.addEventListener('input', inputEventFunction);
} else {
$('.search-icon').click(inputEventFunction);
input.addEventListener('keypress', function (event) {
if (event.keyCode === 13) {
inputEventFunction();
}
});
}
// remove loading animation
$('body').css('overflow', '');
proceedsearch();
}
// handle and trigger popup window;
$('.popup-trigger').click(function(e) {
e.stopPropagation();
if (isfetched === false) {
$('.sb-close').click();
searchFunc('local-search-input', 'local-search-result');
} else {
proceedsearch();
};
});
$('.popup-btn-close').click(onPopupClose);
$('.popup').click(function(e){
e.stopPropagation();
});
$(document).on('keyup', function (event) {
var shouldDismissSearchPopup = event.which === 27 &&
$('.search-popup').is(':visible');
if (shouldDismissSearchPopup) {
onPopupClose();
}
});
</script>
</body>
</html>