forked from youranreus/G
-
Notifications
You must be signed in to change notification settings - Fork 5
/
footer.php
153 lines (140 loc) · 5.26 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
</div>
</div>
<div id="footer">
<div id="footer-content" class="clear">
<div id="footer-content-left">
<p><?php $this->options->title(); ?> | <?php getBuildTime($this->options->builtTime); ?></p>
<p><?php $this->options->beian(); ?></p>
<a class="jj" href="mailto:[email protected]" target="_blank">©凉糕云提供计算服务</a>
并由 Typecho 强力驱动
</div>
<div id="footer-content-right">
<p><?php if ($this->options->enableUpyun): ?>
<a href="https://upyun.com" target="_blank"><img src="https://i.loli.net/2019/02/11/5c6187c809c8c.png"/></a>
<?php endif; ?>
<a href="https://niconiconi.cc/admin"><img src="https://s2.ax1x.com/2019/06/03/VYJ2ex.png"/></a></p>
</div>
</div>
<script src="https://cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/jquery.pjax/2.0.1/jquery.pjax.min.js"></script>
<script src="<?php $this->options->themeUrl('JS/X.js'); ?>"></script>
<script src="<?php $this->options->themeUrl('JS/prism.js'); ?>"></script>
<script src="https://cdn.bootcss.com/fancybox/3.5.6/jquery.fancybox.min.js"></script>
<script src="https://cdn.bootcss.com/toastr.js/latest/js/toastr.min.js"></script>
<script>
$(document).ready(
function(){
$("#post img").each(function(){
$(this).wrap(function(){
if($(this).is(".bq"))
{
return '';
}
return '<a data-fancybox="gallery" no-pjax data-type="image" href="' + $(this).attr("src") + '" class="light-link"></a>';
})
})
});
</script>
<script>
//感谢https://eriri.ink/archives/typecho-ajaxcomment.html
function ajaxc(){
var replyTo = '', //回复评论时候的ID
submitButton = $(".submit").eq(0), //提交评论按钮
commentForm = $("#comment-form"), //评论表单
newCommentId = ""; //新评论的ID
var bindButton = function () {
$(".comment-reply a").click(function () {
replyTo = $(this).parent().parent().parent().attr("id");
console.log(replyTo);
});
$(".cancel-comment-reply a").click(function () { replyTo = ''; });
};
bindButton();
/**
* 发送前的处理
*/
function beforeSendComment() {
toastr.info('发射中..');
}
/**
* 发送后的处理
* @param {boolean} ok
*/
function afterSendComment(ok) {
if (ok) {
$("#textarea").val('');
replyTo = '';
}
bindButton();
}
$("#comment-form").submit(function () {
commentData = $(this).serializeArray();
beforeSendComment();
$.ajax({
type: $(this).attr('method'),
url: $(this).attr('action'),
data: commentData,
error: function (e) {
console.log('Ajax Comment Error');
window.location.reload();
},
success: function (data) {
if (!$('#comments', data).length) {
var msg = $('title').eq(0).text().trim().toLowerCase() === 'error' ? $('.container', data).eq(0).text() : '评论提交失败!';
toastr.info(msg);
afterSendComment(false);
return false;
}
$("input,textarea", commentForm).attr('disabled', false);
$("#textarea").val('');
var newComment;
newCommentId = $(".comment-list", data).html().match(/id=\"?comment-\d+/g).join().match(/\d+/g).sort(function (a, b) { return a - b }).pop();
if('' === replyTo) {
if(!$('.comment-list').length) {
newComment = $("#li-comment-" + newCommentId, data);
$('.comments-header').after('<ol class="comment-list"></ol>');
$('.comment-list').first().prepend((newComment).addClass('animated fadeInUp'));
}
else if($('.prev').length) {
$('#page-nav ul li a').eq(1).click();
}
else {
newComment = $("#li-comment-" + newCommentId, data);
$('.comment-list').first().prepend((newComment).addClass('animated fadeInUp'));
}
$('html,body').animate({scrollTop:$('#response').offset().top - 100},1000);
}
else {
newComment = $("#li-comment-" + newCommentId, data);
if ($('#' + replyTo).find('.comment-children').length) {
$('#' + replyTo + ' .comment-children .comment-list').first().prepend((newComment).addClass('animated fadeInUp'));
TypechoComment.cancelReply();
}
else {
$('#' + replyTo).append('<div class="comment-children"><ol class="comment-list"></ol></div>');
$('#' + replyTo + ' .comment-children .comment-list').first().prepend((newComment).addClass('animated fadeInUp'));
TypechoComment.cancelReply();
}
}
afterSendComment(true);
toastr.success('评论成功');
}
});
return false;
});
}
ajaxc();
$(document).on('pjax:complete', function() {
ajaxc();
})
</script>
<?php $this->footer(); ?>
</div>
<a id="gototop"><img src="https://s2.ax1x.com/2019/06/04/VYUn1g.png"></a>
</body>
<style type="text/css">
a.jj:link {color: white} /* 未访问的链接 */
a.jj:visited {color: white} /* 已访问的链接 */
a.jj:hover {color: white} /* 鼠标移动到链接上 */
a.jj:active {color: white} /* 选定的链接 */
</style>