Permalink
Browse files

- [fix] header 头配置错误。

- [feature] 可选 banner 是否显示。
- [bug]fix any bugs.
  • Loading branch information...
shiyi
shiyi committed Jan 28, 2019
1 parent da09e02 commit ee7aa9ee3dc522c95e6807c9bc2cfd3ade45adb1
Showing with 64 additions and 26 deletions.
  1. +1 −1 css/index.min.css
  2. +8 −1 doc/changelog.md
  3. +9 −4 footer.php
  4. +16 −7 functions.php
  5. +26 −12 header.php
  6. +1 −1 js/index.min.js
  7. +3 −0 sidebar.php

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1,3 +1,10 @@
## 2018/1/28

- [fix] header 头配置错误。
- [feature] 可选 banner 是否显示。
- [bug]fix any bugs.

<!-- more -->
## 2018/10/30

- 修复 archive 页下缩略图问题
@@ -31,4 +38,4 @@
- [feature]指定一个图片链接作为头图。
- [bug]fix any bugs.

## todo
## todo
@@ -70,13 +70,18 @@
<script src="https://cdn.jsdelivr.net/npm/fastclick@1.0.6/lib/fastclick.min.js"></script>
<?php endif; ?>

<script>

// Scroll to article area
<?php if($this->is('post')) :?>
<!-- Scroll to article area -->
<?php if(!empty($this->options->StyleSettings) && in_array('Banner', $this->options->StyleSettings) && $this->is('post')) :?>
<script>
hasBanner()
var postScrolltimer = setInterval(postScroll, 10)
</script>
<?php endif; ?>


<script>
// Index auto loading
<?php if($this->is('index') && !empty($this->options->feature) && in_array('loadNextPagePost', $this->options->feature)) :?>
document.addEventListener('scroll',function(e){
@@ -86,7 +91,7 @@
if (scrollTop + clientHeight === scrollHeight) {
document.querySelector('.loading-more-post') && (document.querySelector('.loading-more-post').style.display = 'block')
loadNextPagePost()
}
}
})
<?php endif; ?>
@@ -41,6 +41,13 @@ function themeConfig($form) {
$form->addInput($GoogleAnalytics);
$StyleSettings = new Typecho_Widget_Helper_Form_Element_Checkbox('StyleSettings',
array('Banner' => _t('是否显示 Banner'),
),
array(), _t('主题样式设置'));
$form->addInput($StyleSettings->multiMode());
/* Theme feature */
$feature = new Typecho_Widget_Helper_Form_Element_Checkbox('feature',
array('showThumb' => _t('首页文章缩略图'),
@@ -50,11 +57,12 @@ function themeConfig($form) {
'commentEmoji' => _t('评论表情'),
'fastclick' => _t('解决移动端300ms延迟'),
/* 'pjax' => _t('mini-pjax'), */
/* 'lazyImg' => _t('文章内图片懒加载'), */
'lazyImg' => _t('文章内图片懒加载'),
),
array('showThumb'), _t('额外功能设置'));
$form->addInput($feature->multiMode());
$siderbarOption = new Typecho_Widget_Helper_Form_Element_Checkbox('siderbarOption',
array('TopViewPost' => _t('热门文章'),
'topComnentPost' => _t('热评文章'),
@@ -205,6 +213,7 @@ function getBrowser($agent){
}
echo $browserVersion;
}
function getOs($agent){
if (preg_match('/win/i', $agent)) {
if (preg_match('/nt 6.0/i', $agent)) {
@@ -374,15 +383,15 @@ function getTopCommentPosts($limit = 5){
}
}
function getRecentComments(){
}
function getRecentComments(){}
function thumbUp(){}
function replaceTag($content,$isLogin = false){
$config = Typecho_Widget::widget('Widget_Options')->feature;
/* if(in_array('lazyImg', $config)){
$content = preg_replace("/<[img|IMG].*?src=[\'|\"](.*?)[\'|\"].*?alt=[\'|\"].*?\s(\d+)\s(\d+)[\'|\"].*?[\/|img|IMG]?>/sm",'<div class="lazy-loader" lazy-src="$1" style="width:$2px;height:$3px"><span></span></div>', $content);
} */
if(in_array('lazyImg', $config)){
$content = preg_replace("/<[img|IMG].*?src=[\'|\"](.*?)[\'|\"].*?alt=[\'|\"].*?[\'|\"].*?[\/|img|IMG]?>/sm",'<div class="lazy-loader" lazy-src="$1"><span></span></div>', $content);
}
/* if($isLogin){
$obj->content = preg_replace("/\[hide\](.*?)\[\/hide\]/sm",'$1',$obj->content);
}else{
@@ -22,11 +22,8 @@
), '', ' - '); ?><?php $this->options->title(); ?></title>

<meta name="author" content="<?php $this->author() ?>" />
<?php $this->header('keywords=&generator=&template=&pingback=&xmlrpc=&wlw=&commentReply=&rss1=&rss2=&atom='); ?>
<meta name="keywords" content="<?php $this->keywords() ?>" />


<link rel="icon" href="<?php $this->options->fav() or $this->options->themeUrl('favicon.jpg'); ?>" />
<?php $this->header('generator=&pingback=&xmlrpc=&wlw='); ?>
<link rel="icon" href="<?php $this->options->fav() or $this->options->themeUrl('favicon.jpg'); ?>" />

<!-- About IOS -->
<meta name="format-detection" content="telephone=no">
@@ -38,8 +35,6 @@
<meta name="theme-color" content="<?php $this->options->themeColor ? $this->options->themeColor() : _e('#fff') ?>">
<link rel="apple-touch-icon" sizes="32x32 58x58 72x72 96x96 114x114" href="<?php $this->options->IOSIcon(); ?>">



<!-- Disable Baidu transformation -->
<meta http-equiv="Cache-Control" content="no-transform " />
<meta http-equiv="Cache-Control" content="no-siteapp" />
@@ -80,11 +75,25 @@
<link rel="stylesheet" href="<?php $this->options->themeUrl('./lib/OwO/OwO.min.css'); ?>">
<?php endif; ?>

<!--[if lt IE 9]>
<script src="//cdnjscn.b0.upaiyun.com/libs/html5shiv/r29/html5.min.js"></script>
<script src="//cdnjscn.b0.upaiyun.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->

<?php if (empty($this->options->StyleSettings) || !in_array('Banner', $this->options->StyleSettings)): ?>
<style>
.header-wrap{
height: 120px;
}
.site-nav{
background:rgba(255,255,255,.8);
box-shadow: 0 0 2px 2px rgba(172,172,172,.4);
}
@media (max-width: 991px) {
.header-wrap{
height: 70px;
}
}
.sidebar-inner.affix{
top: 70px;
}
</style>
<?php endif; ?>
</head>
<body>
<div id="root">
@@ -105,14 +114,19 @@
</li>
</ul>
</nav>

<div class="header-wrap">
<?php if (!empty($this->options->StyleSettings) && in_array('Banner', $this->options->StyleSettings)): ?>
<div class="site-config" style="background-image:url(<?php $this->options->backGroundImage ? $this->options->backGroundImage() : _e('https://i.loli.net/2018/10/05/5bb7144897e8c.jpg') ?>)">
<div class="site-meta">
<div class="site-title"><?php $this->options->title(); ?></div>
<div class="site-description"><?php $this->options->description(); ?></div>
</div>
</div>
<?php endif; ?>
</div>


</header>


Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -81,6 +81,9 @@
<?php if (in_array('randomPost', $this->options->siderbarOption)): ?>
<li class="sidebar-nav-random">相关文章</li>
<?php endif; ?>
<?php if (in_array('recentComment', $this->options->siderbarOption)): ?>
<?php $this->widget('Widget_Comments_Recent','ignoreAuthor=true')->to($comments); ?>
<?php endif; ?>
</ul>
<?php if (in_array('TopViewPost', $this->options->siderbarOption)): ?>
<section class="topview-post-wrap sidebar-section-active">

0 comments on commit ee7aa9e

Please sign in to comment.