Skip to content

Commit

Permalink
更改了工具提示的样式
Browse files Browse the repository at this point in the history
  • Loading branch information
changbin1997 committed Feb 6, 2020
1 parent 8cd9017 commit c8f785d
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 25 deletions.
10 changes: 5 additions & 5 deletions archive.php
Expand Up @@ -38,22 +38,22 @@
<!--时间-->
<div class="info">
<i class="icon-calendar icon" aria-hidden="true"></i>
<span tabindex="0" title="发布时间:<?php $this->date('Y年m月d日'); ?>"><?php $this->date('Y年m月d日'); ?></span>
<span data-toggle="tooltip" data-placement="top" tabindex="0" title="发布时间:<?php $this->date('Y年m月d日'); ?>"><?php $this->date('Y年m月d日'); ?></span>
</div>
<!--作者-->
<div class="info">
<i class="icon-user icon" aria-hidden="true"></i>
<a href="<?php $this->author->permalink(); ?>" title="作者:<?php $this->author(); ?>"><?php $this->author(); ?></a>
<a data-toggle="tooltip" data-placement="top" href="<?php $this->author->permalink(); ?>" title="作者:<?php $this->author(); ?>"><?php $this->author(); ?></a>
</div>
<!--阅读量-->
<div class="info">
<i class="icon-eye icon" aria-hidden="true"></i>
<span tabindex="0" title="阅读量:<?php echo getPostView($this); ?>"><?php echo getPostView($this); ?></span>
<i data-toggle="tooltip" data-placement="top" class="icon-eye icon" aria-hidden="true"></i>
<span data-toggle="tooltip" data-placement="top" tabindex="0" title="阅读量:<?php echo getPostView($this); ?>"><?php echo getPostView($this); ?></span>
</div>
<!--评论-->
<div class="info">
<i class="icon-bubbles2 icon" aria-hidden="true"></i>
<a title="评论" href="#comments"><?php $this->commentsNum('%d 评论'); ?></a>
<a data-toggle="tooltip" data-placement="top" title="评论" href="#comments"><?php $this->commentsNum('%d 评论'); ?></a>
</div>
<!--分类-->
<div class="info">
Expand Down
4 changes: 2 additions & 2 deletions header.php
Expand Up @@ -26,7 +26,7 @@
<link rel="stylesheet" href="<?php $this->options->themeUrl('css/style.css'); ?>" type="text/css">
<link rel="stylesheet" href="<?php $this->options->themeUrl('css/vs2015.css'); ?>" type="text/css">
<script type="text/javascript" src="<?php $this->options->themeUrl('js/jquery-3.4.1.min.js'); ?>"></script>
<script type="text/javascript" src="<?php $this->options->themeUrl('js/bootstrap.min.js'); ?>"></script>
<script type="text/javascript" src="<?php $this->options->themeUrl('js/bootstrap.bundle.min.js'); ?>"></script>
<script type="text/javascript" src="<?php $this->options->themeUrl('js/highlight.pack.js'); ?>"></script>
<script type="text/javascript" src="<?php $this->options->themeUrl('js/app.js'); ?>"></script>
<?php $this->header(); ?>
Expand Down Expand Up @@ -74,7 +74,7 @@
<div class="input-group">
<input class="form-control form-control-md" type="search" placeholder="搜索" aria-label="搜索" required="required" name="s">
<div class="input-group-append">
<button class="btn my-sm-0 search-btn" type="submit" aria-label="搜索" title="搜索">
<button class="btn my-sm-0 search-btn" type="submit" aria-label="搜索" title="搜索" data-toggle="tooltip" data-placement="bottom">
<i class="icon-search"></i>
</button>
</div>
Expand Down
10 changes: 5 additions & 5 deletions index.php
Expand Up @@ -37,22 +37,22 @@
<!--时间-->
<div class="info">
<i class="icon-calendar icon" aria-hidden="true"></i>
<span tabindex="0" title="发布时间:<?php $this->date('Y年m月d日'); ?>"><?php $this->date('Y年m月d日'); ?></span>
<span data-toggle="tooltip" data-placement="top" tabindex="0" title="发布时间:<?php $this->date('Y年m月d日'); ?>"><?php $this->date('Y年m月d日'); ?></span>
</div>
<!--作者-->
<div class="info">
<i class="icon-user icon" aria-hidden="true"></i>
<a href="<?php $this->author->permalink(); ?>" title="作者:<?php $this->author(); ?>"><?php $this->author(); ?></a>
<a data-toggle="tooltip" data-placement="top" href="<?php $this->author->permalink(); ?>" title="作者:<?php $this->author(); ?>"><?php $this->author(); ?></a>
</div>
<!--阅读量-->
<div class="info">
<i class="icon-eye icon" aria-hidden="true"></i>
<span tabindex="0" title="阅读量:<?php echo getPostView($this); ?>"><?php echo getPostView($this); ?></span>
<span data-toggle="tooltip" data-placement="top" tabindex="0" title="阅读量:<?php echo getPostView($this); ?>"><?php echo getPostView($this); ?></span>
</div>
<!--评论-->
<div class="info">
<i class="icon-bubbles2 icon" aria-hidden="true"></i>
<a title="评论" href="<?php $this->permalink() ?>#comments"><?php $this->commentsNum('%d 评论'); ?></a>
<a data-toggle="tooltip" data-placement="top" title="评论" href="<?php $this->permalink() ?>#comments"><?php $this->commentsNum('%d 评论'); ?></a>
</div>
<!--分类-->
<div class="info">
Expand All @@ -67,7 +67,7 @@
</div>
<?php endwhile; ?>
<nav aria-label="分页导航区" class="pagination-nav">
<?php $this->pageNav('&laquo;', '&raquo;', 2, '...', array('wrapTag' => 'ul', 'wrapClass' => 'pagination', 'itemTag' => 'li', 'textTag' => 'a', 'currentClass' => 'active', 'prevClass' => 'prev', 'nextClass' => 'next')); ?>
<?php $this->pageNav('&laquo;', '&raquo;', 1, '...', array('wrapTag' => 'ul', 'wrapClass' => 'pagination', 'itemTag' => 'li', 'textTag' => 'a', 'currentClass' => 'active', 'prevClass' => 'prev', 'nextClass' => 'next')); ?>
</nav>
</div>
<?php $this->need('sidebar.php'); ?>
Expand Down
14 changes: 12 additions & 2 deletions js/app.js
Expand Up @@ -64,12 +64,20 @@ $(function () {

// 给文章信息的分类链接添加 title
if ($('.icon-folder-open').length > 0) {
$('.icon-folder-open').nextAll().attr('title', '分类');
$('.icon-folder-open').nextAll().attr({
'title': '分类',
'data-toggle': 'tooltip',
'data-placement': 'top'
});
}

// 给文章信息的标签链接添加 title
if ($('.tags a').length > 0) {
$('.tags a').attr('title', '标签');
$('.tags a').attr({
'title': '标签',
'data-toggle': 'tooltip',
'data-placement': 'top'
});
}

// 给评论区的链接添加 target
Expand Down Expand Up @@ -187,6 +195,8 @@ $(function () {
$('#max-img').click(); // 关闭大图
}
});

$('[data-toggle="tooltip"]').tooltip(); // 初始化工具提示
});

hljs.initHighlightingOnLoad(); // 代码高亮初始化
4 changes: 2 additions & 2 deletions page.php
Expand Up @@ -22,12 +22,12 @@
<!--时间-->
<div class="info">
<i class="icon-calendar icon" aria-hidden="true"></i>
<span tabindex="0" title="发布时间:<?php $this->date('Y年m月d日'); ?>"><?php $this->date('Y年m月d日'); ?></span>
<span data-toggle="tooltip" data-placement="top" tabindex="0" title="发布时间:<?php $this->date('Y年m月d日'); ?>"><?php $this->date('Y年m月d日'); ?></span>
</div>
<!--作者-->
<div class="info">
<i class="icon-user icon" aria-hidden="true"></i>
<a href="<?php $this->author->permalink(); ?>" title="作者:<?php $this->author(); ?>"><?php $this->author(); ?></a>
<a data-toggle="tooltip" data-placement="top" href="<?php $this->author->permalink(); ?>" title="作者:<?php $this->author(); ?>"><?php $this->author(); ?></a>
</div>
</div>
<article>
Expand Down
9 changes: 5 additions & 4 deletions post.php
Expand Up @@ -22,22 +22,22 @@
<!--时间-->
<div class="info">
<i class="icon-calendar icon" aria-label="日期图标"></i>
<span tabindex="0" title="发布时间:<?php $this->date('Y年m月d日'); ?>"><?php $this->date('Y年m月d日'); ?></span>
<span data-toggle="tooltip" data-placement="top" tabindex="0" title="发布时间:<?php $this->date('Y年m月d日'); ?>"><?php $this->date('Y年m月d日'); ?></span>
</div>
<!--作者-->
<div class="info">
<i class="icon-user icon" aria-hidden="true"></i>
<a href="<?php $this->author->permalink(); ?>" title="作者:<?php $this->author(); ?>"><?php $this->author(); ?></a>
<a data-toggle="tooltip" data-placement="top" href="<?php $this->author->permalink(); ?>" title="作者:<?php $this->author(); ?>"><?php $this->author(); ?></a>
</div>
<!--阅读量-->
<div class="info">
<i class="icon-eye icon" aria-hidden="true"></i>
<span tabindex="0" title="阅读量:<?php echo getPostView($this); ?>"><?php echo getPostView($this); ?></span>
<span data-toggle="tooltip" data-placement="top" tabindex="0" title="阅读量:<?php echo getPostView($this); ?>"><?php echo getPostView($this); ?></span>
</div>
<!--评论-->
<div class="info">
<i class="icon-bubbles2 icon" aria-hidden="true"></i>
<a title="评论" href="#comments"><?php $this->commentsNum('%d 评论'); ?></a>
<a data-toggle="tooltip" data-placement="top" title="评论" href="#comments"><?php $this->commentsNum('%d 评论'); ?></a>
</div>
<!--分类-->
<div class="info">
Expand Down Expand Up @@ -69,6 +69,7 @@
</div>
<?php endif; ?>
</div>
<span data-toggle="tooltip" data-placement="top" tabindex="0" title="发布时间:<?php $this->date('Y年m月d日'); ?>">最后编辑:<?php echo date('Y年m月d日', $this->modified);?></span>
</article>
<!--上一篇和下一篇文章的导航-->
<nav class="post-navigation navbar border-top">
Expand Down
10 changes: 5 additions & 5 deletions sidebar.php
Expand Up @@ -84,7 +84,7 @@
<section class="<?php echo in_array('HideCategory', $sidebarM)?$hideClass:''; ?>">
<h4>文章分类</h4>
<ul class="list-group list-group-flush" aria-label="文章分类">
<?php $this->widget('Widget_Metas_Category_List')->parse('<li class="d-flex justify-content-between align-items-center border-bottom"><a class="text-secondary" href="{permalink}" title="{description}">{name}</a><span class="badge badge-secondary badge-pill">{count}</span></li>'); ?>
<?php $this->widget('Widget_Metas_Category_List')->parse('<li class="d-flex justify-content-between align-items-center border-bottom"><a data-toggle="tooltip" data-placement="top" class="text-secondary" href="{permalink}" title="{description}">{name}</a><span class="badge badge-secondary badge-pill">{count}</span></li>'); ?>
</ul>
</section>
<?php endif; ?>
Expand All @@ -96,7 +96,7 @@
<?php if($tags->have()): ?>
<div class="ltags-list pt-2" aria-label="标签云">
<?php while ($tags->next()): ?>
<a href="<?php $tags->permalink(); ?>" rel="tag" class="size-<?php $tags->split(5, 10, 20, 30); ?>" title="<?php $tags->count(); ?> 篇文章"><?php $tags->name(); ?></a>
<a data-toggle="tooltip" data-placement="top" href="<?php $tags->permalink(); ?>" rel="tag" class="size-<?php $tags->split(5, 10, 20, 30); ?>" title="<?php $tags->count(); ?> 篇文章"><?php $tags->name(); ?></a>
<?php endwhile; ?>
</div>
<?php else: ?>
Expand All @@ -109,7 +109,7 @@
<section class="<?php echo in_array('HideArchive', $sidebarM)?$hideClass:''; ?>">
<h4>文章归档</h4>
<ul class="list-group list-group-flush" aria-label="文章归档">
<?php $this->widget('Widget_Contents_Post_Date', 'type=month&format=Y年m月')->parse('<li class="d-flex justify-content-between align-items-center border-bottom"><a class="text-secondary" href="{permalink}" title="{count}篇文章">{date}</a><span class="badge badge-secondary badge-pill">{count}</span></li>');
<?php $this->widget('Widget_Contents_Post_Date', 'type=month&format=Y年m月')->parse('<li class="d-flex justify-content-between align-items-center border-bottom"><a data-toggle="tooltip" data-placement="top" class="text-secondary" href="{permalink}" title="{count}篇文章">{date}</a><span class="badge badge-secondary badge-pill">{count}</span></li>');
?>
</ul>
</section>
Expand Down Expand Up @@ -140,13 +140,13 @@
<?php if ($this->options->homeLinks && $this->is('index')): ?>
<?php $homeLinks = json_decode($this->options->homeLinks); ?>
<?php foreach ($homeLinks as $val): ?>
<li class="border-bottom"><a class="text-secondary" href="<?php echo $val->url; ?>" title="<?php echo isset($val->title)?$val->title:'暂无简介'; ?>" target="_blank"><?php echo $val->name; ?></a></li>
<li class="border-bottom"><a data-toggle="tooltip" data-placement="top" class="text-secondary" href="<?php echo $val->url; ?>" title="<?php echo isset($val->title)?$val->title:'暂无简介'; ?>" target="_blank"><?php echo $val->name; ?></a></li>
<?php endforeach; ?>
<?php endif; ?>
<?php if ($this->options->links): ?>
<?php $links = json_decode($this->options->links); ?>
<?php foreach ($links as $val): ?>
<li class="border-bottom"><a class="text-secondary" href="<?php echo $val->url; ?>" title="<?php echo isset($val->title)?$val->title:'暂无简介'; ?>" target="_blank"><?php echo $val->name; ?></a></li>
<li class="border-bottom"><a data-toggle="tooltip" data-placement="top" class="text-secondary" href="<?php echo $val->url; ?>" title="<?php echo isset($val->title)?$val->title:'暂无简介'; ?>" target="_blank"><?php echo $val->name; ?></a></li>
<?php endforeach;; ?>
<?php endif; ?>
</ul>
Expand Down

0 comments on commit c8f785d

Please sign in to comment.