-
Notifications
You must be signed in to change notification settings - Fork 2
/
footer.php
247 lines (240 loc) · 9.07 KB
/
footer.php
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
<?php
if (!defined('EMLOG_ROOT')) {
exit('error!');
}
?>
<?php if(ISLOGIN && empty($authflg)): ?>
<a href="admin">
<button id="adminbtn" class="btn btn-icon-only rounded-circle btn-primary admin-btn">
<span class="btn-inner--icon"><i class="fa fa-cogs" aria-hidden="true"></i></span>
</button>
</a>
<?php endif; ?>
</main>
<!-- Footer -->
<footer class="footer">
<div class="container">
<?php include View::getView('side') ?>
<hr/>
<div class="row">
<div class="col-md-6">
<div class="copyright">
<?= $footer_info ?>
<?php doAction('index_footer') ?>
</div>
</div>
<div class="col-md-6">
<ul class="nav nav-footer justify-content-end">
<li class="nav-item">
<a class="nav-link" href="<?= BLOG_URL ?>">首页</a>
</li>
<?php if (ISLOGIN): ?>
<li class="nav-item"><a class="nav-link" href="/admin">进入后台(<?= getUser(UID)['nickname'] ?>)</a></li>
<li class="nav-item"><a class="nav-link" href="/admin/account.php?action=logout">退出</a></li>
<?php else: ?>
<li class="nav-item"><a class="nav-link" href="/admin">登录</a></li>
<?php endif; ?>
</ul>
</div>
</div>
</div>
</footer>
<?php if (_g('Pjax')) echo '</div>'; ?>
<a id="scrollup" href="#" style="display: none;">
<button id="scrollbtn" class="btn btn-icon-only rounded-circle btn-secondary scrollup-btn">
<span class="btn-inner--icon"><i class="fa fa-arrow-up" aria-hidden="true"></i></span>
</button>
</a>
<!-- Core -->
<script src="https://cdn.bootcdn.net/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.4.1/js/bootstrap.min.js"></script>
<!-- Optional plugins -->
<script src="https://cdn.bootcdn.net/ajax/libs/headroom/0.11.0/headroom.min.js"></script>
<!-- Theme JS -->
<script src="<?= TEMPLATE_URL ?>assets/js/argon.min.js"></script>
<script src="<?= TEMPLATE_URL ?>assets/js/bbrender.js"></script>
<!-- scrollup -->
<script>
$(function () {
let scrollBottom = parseInt($("#adminbtn").css("bottom")) + parseInt($("#adminbtn").css("height")) + 25;
$("#scrollbtn").css("bottom", scrollBottom);
let resizeTimer;
$(window).resize(function () {
if ($("#adminbtn").length > 0) {
clearTimeout(resizeTimer);
resizeTimer = setTimeout(function () {
scrollBottom = parseInt($("#adminbtn").css("bottom")) + parseInt($("#adminbtn").css("height")) + 25;
$("#scrollbtn").css("bottom", scrollBottom);
}, 250);
}
});
let scrollLock = 0;
if ($(window).scrollTop() > 500) $("#scrollup").fadeIn(400);
$(window).scroll(function () {
if (!scrollLock) {
if ($(window).scrollTop() > 500) $("#scrollup").fadeIn(400);
else $("#scrollup").fadeOut(400);
}
});
$("#scrollup").click(function () {
scrollLock = 1;
$("#scrollup").fadeOut(400);
$("html,body").animate({scrollTop: "0px"}, 500, function () {
scrollLock = 0;
});
});
});
</script>
<!-- Pjax -->
<script>
function init() {
<?php if(_g('prismjs') and _g('prismLine')): ?>
let pres = document.querySelectorAll('pre');
let lineNumberClassName = 'line-numbers';
pres.forEach(function (item) {
item.className = item.className === '' ? lineNumberClassName : item.className + ' ' + lineNumberClassName;
});
Prism.highlightAll(false, null);
<?php endif; ?>
$("img").Lazy({
threshold: 700,
effect: 'fadeIn',
effectTime: 1000,
defaultImage: "<?= TEMPLATE_URL ?>images/Loading.gif"
});
$("div[data-src]").Lazy({
threshold: 700,
effect: 'fadeIn',
placeholder: "<?= TEMPLATE_URL ?>images/Loading.gif",
effectTime: 1000
});
<?php if(_g('katex')): ?>
try {
renderMathInElement(document.body, {
delimiters: [
{left: "$$", right: "$$", display: true},
{left: "$", right: "$", display: false}
]
})
} catch (e) {
}
<?php endif; ?>
parseBbcode()
parseBblink()
<?php if(_g('Pjax')): ?>
<?php echo _g('pjaxcomp'); ?>
try {
window.onload()
} catch (e) {
}
<?php endif; ?>
}
</script>
<?php if (_g('Pjax')): ?>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery.pjax/2.0.1/jquery.pjax.min.js"></script>
<script src="<?= TEMPLATE_URL ?>assets/js/progress.js"></script>
<script>
let pgid = 0;
$(document).pjax('a[href^="<?= BLOG_URL ?>"]:not(a[target="_blank"], a[no-pjax], a[href^="<?= BLOG_URL ?>admin"])',
{
container: '#pjax-container',
fragment: '#pjax-container',
timeout: 8000
}).on('pjax:send', function () {
pgid = start_progress()
$(".black-cover").fadeIn(400)
$('html,body').animate({scrollTop: $('html').offset().top}, 500)
}).on('pjax:complete', function () {
$(".black-cover").fadeOut(400)
stop_progress(pgid)
init()
})
$("#search").submit(function () {
let att = $(this).serializeArray();
for (let i in att) {
if (att[i].name === "s") {
$.pjax({
url: "<?= BLOG_URL ?>?keyword=" + att[i].value,
container: '#pjax-container',
fragment: '#pjax-container',
timeout: 8000
})
}
}
return false
})
</script>
<div class="black-cover" style="display: none;"></div>
<?php endif; ?>
<!-- KaTeX JS -->
<?php if (_g('katex')): ?>
<script src="https://cdnjs.loli.net/ajax/libs/KaTeX/0.11.1/katex.min.js"></script>
<script src="https://cdnjs.loli.net/ajax/libs/KaTeX/0.11.1/contrib/auto-render.min.js"></script>
<?php endif; ?>
<!-- Prism JS -->
<?php if (_g('prismjs')): ?>
<script src="https://cdnjs.loli.net/ajax/libs/prism/1.20.0/components/prism-core.min.js"></script>
<script src="https://cdnjs.loli.net/ajax/libs/prism/1.20.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdnjs.loli.net/ajax/libs/prism/1.20.0/plugins/toolbar/prism-toolbar.min.js"></script>
<script src="https://cdnjs.loli.net/ajax/libs/prism/1.20.0/plugins/show-language/prism-show-language.min.js"></script>
<script src="https://cdnjs.loli.net/ajax/libs/prism/1.20.0/plugins/copy-to-clipboard/prism-copy-to-clipboard.min.js"></script>
<?php if (_g('prismLine')): ?>
<script src="https://cdnjs.loli.net/ajax/libs/prism/1.20.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<?php endif; ?>
<?php endif; ?>
<!-- Alert -->
<div id="modal-notification" class="modal fade show" style="z-index: 102;display: none;">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<h5 id="msgMain" class="modal-title"></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"
onclick="$('#modal-notification').hide('normal');">
<span aria-hidden="true">×</span>
</button>
</div>
<div id="msgDetail" class="modal-body"></div>
</div>
</div>
</div>
<script>
function alert(main, detail, time=0) {
$("#msgMain").html(main)
if (detail) $("#msgDetail").html(detail)
else $("#msgDetail").html("")
$("#modal-notification").show("normal");
if (time===0) return
setTimeout(function() {
$("#modal-notification").hide("normal");
}, time)
}
init()
</script>
<?php if(blog_tool_ishome()&&_g('notice')):?>
<script>alert("<?=_g('noticeTittle')?>","<?=_g('noticeContent')?>",<?=_g('noticeTime')?>);</script>
<?php endif;?>
<script>
$(document).ready(function(){
$("a").each(function(){
var link = $(this);
var href = link.attr("href");
if (href && !href.startsWith('#') && !href.includes(window.location.host)) {
link.click(function(event){
var proceed = confirm("您即将离开本站,是否继续?");
if(!proceed){
event.preventDefault();
}
});
}
});
});
</script>
<script>
Fancybox.bind("[data-fancybox]", {
});
</script>
<script>
<?= _g('customJs') ?>
</script>
</body>
</html>