This repository has been archived by the owner on Sep 2, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathfooter.php
162 lines (160 loc) · 7.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
154
155
156
157
158
159
160
161
162
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<footer class="mdui-typo mdui-m-y-5">
<?php if (!empty($this->options->ButtomText)) echo $this->options->ButtomText . '<br />'; ?>
<?php if ($this->options->mdrHitokoto) : ?>
<span id="hitokoto"><?=_t('一言获取中……')?></span><br>
<script src="https://v1.hitokoto.cn/?encode=js&c=<?php $this->options->mdrHitokotoc(); ?>&select=%23hitokoto" defer></script>
<?php endif; ?>
<?php if ($this->options->SiteTime) : ?>
<?=_t('博客已上线')?> <span id="runtime_span"></span><br />
<script>
const mdrSiteTime = '<?= $this->options->SiteTime ?>';
</script>
<?php endif; ?>
<br />© <?php echo date('Y'); ?>
<a href="<?php $this->options->siteUrl(); ?>"><?php ($this->options->mdrCopytext) ? $this->options->mdrCopytext() : $this->options->title() ?></a>.
Powered by <a href="http://www.typecho.org" target="_blank">Typecho</a>.
Theme <a href="https://github.com/FlyingSky-CN/MDr/tree/petals-dev">MDr-Petals</a> by <a href="https://fsky7.com">FlyingSky</a>.<br>
</footer>
</main>
<?php if (!MDR_PJAX) : /** 如果是 PJAX 请求则可以跳过这部分 */ ?>
<button class="mdui-fab mdui-color-theme-accent mdui-fab-fixed mdui-ripple mdui-fab-hide" id="top">
<i class="mdui-icon material-icons"></i>
</button>
<script src="<?= staticUrl('mdui.min.js') ?>"></script>
<script>
const mdrVersion = '<?= MDR_VERSION ?>';
const mdrSnackbar = '<?= $this->options->mdrSnackbar ?>';
const mdrTab = new mdui.Tab('#mdrTab');
const mdrTabDom = mdui.$('#mdrTab');
const mdrAjaxLoadTimes = <?= $this->options->AjaxLoadTimes ?>;
</script>
<!-- mdr | jQuery -->
<script src="<?= staticUrl('jquery.min.js') ?>"></script>
<script src="<?= cjUrl('js/script.js?v=' . str_replace(' ', '-', strtolower(MDR_VERSION)) . (MDR_DEBUG ? '&ts=' . time() : '')) ?>"></script>
<?php if ($this->options->ViewImg) : ?>
<!-- mdr | FancyBox -->
<script src="<?= staticUrl('jquery.fancybox.min.js') ?>"></script>
<script>
function mdrfa() {
$('#post .mdui-card-content img').each(function() {
$(this).before('<div data-fancybox="gallery" href="' + $(this).attr('src') + '"><img src="' + $(this).attr('src') + '" alt="' + $(this).attr('alt') + '" title="' + $(this).attr('title') + '"></div>');
$(this).remove()
});
$.fancybox.defaults.buttons = ["zoom", "download", "thumbs", "close"]
}
mdrfa();
</script>
<?php endif; ?>
<?php if ($this->options->PjaxOption) : ?>
<!-- mdr | Pjax STR -->
<script src="<?= staticUrl('jquery.pjax.min.js') ?>"></script>
<script>
$(document).pjax('a[target!=_blank]', {
container: '#main',
fragment: '#main',
timeout: 10000
})
.on('submit', 'form[id=search], form[id=comment-form]', function(event) {
$.pjax.submit(event, {
container: '#main',
fragment: '#main',
timeout: 10000
})
})
.on('pjax:send', function() {
$('#mdr-loading').fadeIn();
})
.on('pjax:beforeReplace', function() {
mdrCatalog(false);
})
.on('pjax:complete', function() {
setTimeout(function() {
$("#mdr-loading").fadeOut()
}, 300);
$('#header').removeClass("on");
$('#s').val("");
$("#top").addClass("mdui-fab-hide");
})
.on('pjax:end', function() {
mdui.mutation();
if (document.body.clientWidth < 1024) {
mdui.Drawer('#mdrDrawerL').close();
}
<?php if ($this->options->mdrQrCode) : ?>
genQrCode();
<?php endif; ?>
al();
ac();
ap();
<?php if ($this->options->CustomContent) : ?>
if (typeof _hmt !== 'undefined') {
_hmt.push(['_trackPageview', location.pathname + location.search])
};
if (typeof ga !== 'undefined') {
ga('send', 'pageview', location.pathname + location.search)
}
if (typeof gtag !== 'undefined') {
gtag('event', 'page_view', {
page_location: location.href,
page_path: location.pathname + location.search,
page_title: document.title
})
}
<?php endif;
if ($this->options->ViewImg) : ?>
mdrfa();
<?php endif; ?>
<?php if (null !== @$_GET['debug'] and $this->user->hasLogin() && $this->user->pass('administrator', true)) : ?>
mdrDebug();
<?php endif; ?>
});
ac();
ap();
</script>
<!-- mdr | Pjax END -->
<?php endif; ?>
<?php if ($this->options->mdrQrCode) : ?>
<!-- mdr | mdrQrCode -->
<script src="<?= staticUrl('jquery.qrcode.min.js') ?>"></script>
<script>
new mdui.Menu('#switchQrCode', '#mdrQrCode', {
position: "bottom",
align: "right",
});
function genQrCode() {
$('#mdrQrCode').html('');
$('#mdrQrCode').qrcode({
width: 150,
height: 150,
text: window.location.href
})
}
genQrCode();
</script>
<?php endif; ?>
<?php if ($this->options->DarkMode) : ?>
<!-- mdr | DarkMode -->
<script>
const mdrDarkModeFD = '<?= ($this->options->DarkModeFD && $this->options->DarkModeDomain) ? "domain=" . $this->options->DarkModeDomain : '' ?>';
const mdrThemeColor = '<?= $this->options->mdrChrome ? $this->options->mdrChrome : "#FFFFFF" ?>';
</script>
<script src="<?php cjUrl('js/darkmode.js?v=' . str_replace(' ', '-', strtolower(MDR_VERSION)) . (MDR_DEBUG ? '&ts=' . time() : '')) ?>"></script>
<?php endif; ?>
<?php $this->footer(); ?>
<?php if ($this->options->CustomContent) $this->options->CustomContent(); ?>
<?php if (null !== @$_GET['debug'] and $this->user->hasLogin() && $this->user->pass('administrator', true)) : ?>
<script>
function mdrDebug() {
mdui.$.each($$('a[href]'), function(i, item) {
if (item.href.indexOf("?debug=true") == -1) {
item.href = item.href + '?debug=true'
}
})
}
mdrDebug();
</script>
<?php endif; ?>
<?php endif; ?>
</body>
</html>