Skip to content

Commit

Permalink
修复1.1以来的若干bug,替换cdn源
Browse files Browse the repository at this point in the history
  • Loading branch information
zwying0814 committed May 19, 2022
1 parent a9c76b6 commit dc641c7
Show file tree
Hide file tree
Showing 9 changed files with 150 additions and 123 deletions.
35 changes: 17 additions & 18 deletions base/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
<h6>©<?php $this->options->title() ?></h6>
<p class="h6"> Powered by <a href="http://typecho.org" target="_blank">Typecho</a> ※ Theme is <a href="https://blog.zwying.com" target="_blank">Brave</a></p>
</div>
<script src="https://cdn.jsdelivr.net/npm/jquery-pjax@2.0.1/jquery.pjax.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/nprogress@0.2.0/nprogress.min.js"></script>
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery.pjax/2.0.1/jquery.pjax.min.js" type="application/javascript"></script>
<script src="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/nprogress/0.2.0/nprogress.min.js" type="application/javascript"></script>
<script>
window.showSiteRuntime = function() {
site_runtime = $("#site_runtime");
if (!site_runtime) {
return;
}
var site_runtime = $("#site_runtime");
if (!site_runtime) return;
window.setTimeout("showSiteRuntime()", 1000);
start = new Date("<?php $this->options->lovetime(); ?>");
now = new Date();
Expand All @@ -27,21 +25,22 @@
site_runtime.html("第 <span class=\"bigfontNum\">" + D + "</span> 天 <span class=\"bigfontNum\">" + H + "</span> 小时 <span class=\"bigfontNum\">" + M + "</span> 分钟 <span class=\"bigfontNum\">" + S + "</span> 秒");
};
showSiteRuntime();
$(document).pjax('a', '#Pjax', {
fragment: '#Pjax',
timeout: 6000
});
$(document).on('pjax:send', function() {
NProgress.start();
});
$(document).on('pjax:complete', function() {
<?php if ($this->options->pjaxContent) : $this->options->pjax回调(); ?><?php endif; ?>
NProgress.done();
});

$(document).pjax('a', '#pjax-container', {
fragment: '#pjax-container',
timeout: 6000
});
$(document).on('pjax:send', function() {
NProgress.start();
});
$(document).on('pjax:complete', function() {
<?php $this->options->pjax回调(); ?>
NProgress.done();
});
</script>
<script src="<?php $this->options->themeUrl('/base/main.js'); ?>"></script>
<?php $this->footer(); ?>
<?php if ($this->options->底部自定义) : $this->options->底部自定义(); ?><?php endif; ?>
<?php $this->options->底部自定义(); ?>
</body>

</html>
37 changes: 19 additions & 18 deletions base/head.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
<!DOCTYPE html>
<html lang="zh-cn">

<head>
<meta charset="<?php $this->options->charset(); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php $this->archiveTitle(array(
'category' => _t('分类 %s 下的文章'),
'search' => _t('包含关键字 %s 的文章'),
'tag' => _t('标签 %s 下的文章'),
'author' => _t('%s 发布的文章')
), '', ' - '); ?><?php $this->options->title(); ?></title>
<!-- 通过自有函数输出HTML头部信息 -->
<?php $this->header(); ?>
<link rel="stylesheet" href="<?php $this->options->themeUrl('/base/style.css'); ?>">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<?php $this->options->头部自定义(); ?>
</head>
<meta charset="<?php $this->options->charset(); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php $this->archiveTitle(array(
'category' => _t('分类 %s 下的文章'),
'search' => _t('包含关键字 %s 的文章'),
'tag' => _t('标签 %s 下的文章'),
'author' => _t('%s 发布的文章')
), '', ' - '); ?><?php $this->options->title(); ?></title>
<?php $this->header(); ?>
<link rel="stylesheet" href="<?php $this->options->themeUrl('/base/style.css'); ?>">
<link href="https://gfonts.ctfile.com/css2?family=Inter:wght@400;700&display=swap"
rel="stylesheet">
<link href="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/bootstrap/4.6.1/css/bootstrap.min.css" type="text/css" rel="stylesheet" />
<script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/3.6.0/jquery.min.js"
type="application/javascript"></script>
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/bootstrap/4.6.1/js/bootstrap.min.js" type="application/javascript"></script>
<?php $this->options->头部自定义(); ?>
</head>
<style>
<?php if ($this->options->Css自定义) : $this->options->Css自定义(); ?><?php endif; ?>
<?php $this->options->Css自定义(); ?>
</style>
<body>
5 changes: 3 additions & 2 deletions base/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Brave = {

// 请保留版权说明,祝99
if (window.console && window.console.log) {
console.log("%c Brave 主题 v1.2 %c https://blog.zwying.com ","color: #fff; margin: 1em 0; padding: 5px 0; background: #673ab7;","margin: 1em 0; padding: 5px 0; background: #efefef;");
}
17 changes: 11 additions & 6 deletions base/nav.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<nav class="navbar navbar-expand-lg navbar-dark text-white bg-transparent">
<div class="container">
<a class="navbar-brand" href="<?php Helper::options()->siteUrl() ?>"><?php $this->options->title() ?></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarText" aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarText"
aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarText">
Expand All @@ -19,7 +20,8 @@
<div class="row align-items-center pb-5 lover">
<div class="col">
<div class="d-flex flex-column">
<img class="mx-auto avatar-img rounded-circle" src="<?php $this->options->boy(); ?>" alt="<?php $this->options->boyname(); ?>">
<img class="mx-auto avatar-img rounded-circle" src="<?php $this->options->boy(); ?>"
alt="<?php $this->options->boyname(); ?>">
<h4 class="mx-auto text-white pt-2"><?php $this->options->boyname(); ?></h4>
</div>
</div>
Expand All @@ -30,16 +32,19 @@
</div>
<div class="col">
<div class="d-flex flex-column">
<img class="mx-auto avatar-img rounded-circle" src="<?php $this->options->girl(); ?>" alt="<?php $this->options->girlname(); ?>">
<img class="mx-auto avatar-img rounded-circle" src="<?php $this->options->girl(); ?>"
alt="<?php $this->options->girlname(); ?>">
<h4 class="mx-auto text-white pt-2"><?php $this->options->girlname(); ?></h4>
</div>
</div>
</div>
</section>
<section class="main-hero-waves-area waves-area">
<svg class="waves-svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto">
<svg class="waves-svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto">
<defs>
<path id="gentle-wave" d="M -160 44 c 30 0 58 -18 88 -18 s 58 18 88 18 s 58 -18 88 -18 s 58 18 88 18 v 44 h -352 Z"></path>
<path id="gentle-wave"
d="M -160 44 c 30 0 58 -18 88 -18 s 58 18 88 18 s 58 -18 88 -18 s 58 18 88 18 v 44 h -352 Z"></path>
</defs>
<g class="parallax">
<use xlink:href="#gentle-wave" x="48" y="0"></use>
Expand All @@ -50,4 +55,4 @@
</svg>
</section>
</div>
<div id="Pjax">
<div id="pjax-container">
9 changes: 9 additions & 0 deletions base/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
body{
font-family: Inter,'Noto Sans SC','Microsoft YaHei', sans-serif !important;
}
.page-navigator{
display: flex;
}
.page-navigator li{
margin: 0 10px;
}
ol,p {
margin: 0;
}
Expand Down
128 changes: 70 additions & 58 deletions commentPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,71 +21,83 @@
}
}
$commentLevelClass = $comments->levels > 0 ? ' comment-child' : ' comment-parent';
?>
?>
<div id="li-<?php $comments->theId(); ?>" class=" comment-body<?php if ($comments->levels > 0) {
echo ' comment-child';
$comments->levelsAlt(' comment-level-odd', ' comment-level-even');
} else {
echo ' comment-parent';
}
$comments->alt(' comment-odd', ' comment-even');
echo $commentClass;
?>">
echo ' comment-child';
$comments->levelsAlt(' comment-level-odd', ' comment-level-even');
} else {
echo ' comment-parent';
}
$comments->alt(' comment-odd', ' comment-even');
echo $commentClass;
?>">

<div class="commentlist">
<div class="comment" id="li-<?php $comments->theId(); ?>">
<div id="<?php $comments->theId(); ?>">
<div class="comment-avatar"><img alt="" src="<?= App::avatarQQ($comments->mail); ?>s=100" class="avatar avatar-96 photo" height="96" width="96" style="display: inline;"></div>
<div class="comment-body">
<div class="comment_author">
<span class="name"><?php $comments->author(); ?></span>
<em><?php $comments->date('Y-m-d H:i'); ?></em>
</div>
<div class="comment-text">
<?php $comments->content(); ?>
</div>
<div class="commentlist">
<div class="comment" id="li-<?php $comments->theId(); ?>">
<div id="<?php $comments->theId(); ?>">
<div class="comment-avatar"><img alt="" src="<?= App::avatarQQ($comments->mail); ?>s=100"
class="avatar avatar-96 photo" height="96" width="96"
style="display: inline;"></div>
<div class="comment-body">
<div class="comment_author">
<span class="name"><?php $comments->author(); ?></span>
<em><?php $comments->date('Y-m-d H:i'); ?></em>
</div>
<div class="comment-text">
<?php $comments->content(); ?>
</div>
</div>
</div>
</div>
<?php } ?>
<?php if ($this->allow('comment')) : ?>
<div id="<?php $this->respondId(); ?>" class="respond list-content mx-auto mt-5">
<div class="list-top">
<?php if ($comments->have()) : ?>
<h5 class="text-center"><?php $this->commentsNum(_t('暂无祝福'), _t('仅有一条祝福'), _t('累计已经收到<span class="bigfontNum"> %d </span>条祝福')); ?></h5>
<?php $comments->listComments(); ?>
<?php $comments->pageNav('&laquo; 前一页', '后一页 &raquo;'); ?>
<?php endif; ?>
<form method="post" action="<?php $this->commentUrl() ?>" name="comment-form" id="comment-form" role="form" class="comment-form">
<?php if ($this->user->hasLogin()) : ?>
<p><?php _e('登录身份: '); ?><a href="<?php $this->options->profileUrl(); ?>"><?php $this->user->screenName(); ?></a>.
<a href="<?php $this->options->logoutUrl(); ?>" title="Logout"><?php _e('退出'); ?> &raquo;</a>
</p>
<?php else : ?>
<div class="form-row">
<div class="form-group col-md-4">
<input type="text" name="author" id="author" class="form-control" placeholder="<?php _e('姓名或昵称*'); ?>" value="<?php $this->remember('author'); ?>" required />
</div>
<div class="form-group col-md-4">
<input type="email" name="mail" id="mail" class="form-control" placeholder="<?php _e('邮箱*'); ?>" value="<?php $this->remember('mail'); ?>" <?php if ($this->options->commentsRequireMail) : ?> required<?php endif; ?> />
</div>
<div class="form-group col-md-4">
<input type="url" name="url" id="url" class="form-control" placeholder="<?php _e('网站或博客'); ?>" value="<?php $this->remember('url'); ?>" <?php if ($this->options->commentsRequireURL) : ?> required<?php endif; ?> />
</div>
</div>
<?php } ?>
<?php if ($this->allow('comment')) : ?>
<div id="<?php $this->respondId(); ?>" class="respond list-content mx-auto mt-5">
<div class="list-top">
<?php if ($comments->have()) : ?>
<h5 class="text-center"><?php $this->commentsNum(_t('暂无祝福'), _t('仅有一条祝福'), _t('累计已经收到<span class="bigfontNum"> %d </span>条祝福')); ?></h5>
<?php $comments->listComments(); ?>
<?php $comments->pageNav('&laquo; 前一页', '后一页 &raquo;'); ?>
<?php endif; ?>
<form method="post" action="<?php $this->commentUrl() ?>" name="comment-form" id="comment-form" role="form"
class="comment-form">
<?php if ($this->user->hasLogin()) : ?>
<p><?php _e('登录身份: '); ?><a
href="<?php $this->options->profileUrl(); ?>"><?php $this->user->screenName(); ?></a>.
<a href="<?php $this->options->logoutUrl(); ?>" title="Logout"><?php _e('退出'); ?> &raquo;</a>
</p>
<?php else : ?>
<div class="form-row">
<div class="form-group col-md-4">
<input type="text" name="author" id="author" class="form-control"
placeholder="<?php _e('姓名或昵称*'); ?>" value="<?php $this->remember('author'); ?>"
required/>
</div>
<div class="form-group col-md-4">
<input type="email" name="mail" id="mail" class="form-control"
placeholder="<?php _e('邮箱*'); ?>"
value="<?php $this->remember('mail'); ?>" <?php if ($this->options->commentsRequireMail) : ?> required<?php endif; ?> />
</div>
<div class="form-group col-md-4">
<input type="url" name="url" id="url" class="form-control"
placeholder="<?php _e('网站或博客'); ?>"
value="<?php $this->remember('url'); ?>" <?php if ($this->options->commentsRequireURL) : ?> required<?php endif; ?> />
</div>
<?php endif; ?>
<div class="form-group">
<textarea rows="3" cols="50" name="text" id="textarea" class="form-control" placeholder="<?php _e('写下对我们的祝福'); ?>" required><?php $this->remember('text'); ?></textarea>
</div>
<div class="form-group">
<button type="submit" class="float-right btn btn-outline-danger"><?php _e('祝福发送'); ?></button>
</div>
</form>
</div>
<?php endif; ?>
<div class="form-group">
<textarea rows="3" cols="50" name="text" id="textarea" class="form-control"
placeholder="<?php _e('写下对我们的祝福'); ?>"
required><?php $this->remember('text'); ?></textarea>
</div>
<div class="form-group">
<button type="submit" class="float-right btn btn-outline-danger"><?php _e('祝福发送'); ?></button>
</div>
</form>
</div>
<?php else : ?>
<h3><?php _e('评论已关闭'); ?></h3>
<?php endif; ?>
</div>
<?php else : ?>
<h3><?php _e('评论已关闭'); ?></h3>
<?php endif; ?>

<?php $this->need('base/footer.php'); ?>
<?php $this->need('base/footer.php'); ?>
Loading

0 comments on commit dc641c7

Please sign in to comment.