-
Notifications
You must be signed in to change notification settings - Fork 564
/
import_js.ejs
105 lines (90 loc) · 3.39 KB
/
import_js.ejs
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
<!-- Import File -->
<% if(theme.materialcdn.use === true) { %>
<%- jsLsload({path:(theme.materialcdn.base + '/js/lazyload.min.js'),key:'js/lazyload.min.js'}) %>
<%- jsLsload({path:(theme.materialcdn.base + '/js/js.min.js'),key:'js/js.min.js'}) %>
<%}else{%>
<%- jsLsload('js/lazyload.min.js') %>
<%- jsLsload('js/js.min.js') %>
<%}%>
<%- partial('_widget/nprogress') %>
<% if( theme.js_effect.smoothscroll === true ) { %>
<% if(theme.materialcdn.use === true) { %>
<%- jsLsload({path:(theme.materialcdn.base + '/js/smoothscroll.js'),key:'js/smoothscroll.js'}) %>
<%}else{%>
<%- jsLsload('js/smoothscroll.js') %>
<%}%>
<% } %>
<%- partial('_partial/footer-option') %>
<% if( (page.current === 1) && (is_home()) ) { %>
<!-- Swiftye -->
<% if( theme.search.use === 'swiftype' ) { %>
<%- partial('_widget/search-swiftype-js') %>
<% } %>
<!-- Local Search-->
<% if( theme.search.use === 'local' ) { %>
<%- partial('_widget/search-local-js') %>
<script type="text/ls-javascript" id="search-input-script">
var inputArea = document.querySelector('#search');
var getSearchFile = function() {
var path = '<%= config.search.path %>';
searchFunc(path, 'search', 'local-search-result');
}
if(inputArea) {
inputArea.onfocus = function() {
getSearchFile();
}
}
</script>
<% } %>
<% } %>
<!-- UC Browser Compatible -->
<script>
var agent = navigator.userAgent.toLowerCase();
if(agent.indexOf('ucbrowser')>0) {
document.write('<%- css("css/uc") %>');
alert('由于 UC 浏览器使用极旧的内核,而本网站使用了一些新的特性。\n为了您能更好的浏览,推荐使用 Chrome 或 Firefox 浏览器。');
}
</script>
<!-- Window Load-->
<script type="text/ls-javascript" id="window-load">
$(window).on('load', function() {
// Post_Toc parent position fixed
$('.post-toc-wrap').parent('.mdl-menu__container').css('position', 'fixed');
});
</script>
<!-- MathJax Load-->
<% if (page.mathjax) { %>
<%- partial('_widget/mathjax') %>
<% } %>
<script type="text/ls-javascript" id="lazy-load">
// Offer LazyLoad
queue.offer(function(){
$('.lazy').lazyload({
effect : 'show'
});
});
// Start Queue
$(document).ready(function(){
setInterval(function(){
queue.execNext();
},200);
});
</script>
<!-- Bing Background -->
<% if(theme.background.bing.enable) { %>
<script type="text/ls-javascript" id="Bing-Background-script">
queue.offer(function(){
$('body').attr('data-original', 'https://api.i-meto.com/bing?<%= theme.background.bing.parameter %>');
});
</script>
<% } %>
<script>
(function(){
var scriptList = document.querySelectorAll('script[type="text/ls-javascript"]')
for (var i = 0; i < scriptList.length; ++i) {
var item = scriptList[i];
lsloader.runInlineScript(item.id,item.id);
}
})()
console.log('\n %c © Material Theme | Version: 1.4.0 | https://github.com/viosey/hexo-theme-material %c \n', 'color:#455a64;background:#e0e0e0;padding:5px 0;border-top-left-radius:5px;border-bottom-left-radius:5px;', 'color:#455a64;background:#e0e0e0;padding:5px 0;border-top-right-radius:5px;border-bottom-right-radius:5px;');
</script>