default theme clean & replace install data
@ -1,30 +0,0 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>归档 {{if $.curCateTitle}} - {{$.curCateTitle}}{{end}}</h2>
|
||||
</div>
|
||||
<div id="posts">
|
||||
|
||||
<div class="each-post">
|
||||
<ul>
|
||||
{{range $.archives}}
|
||||
<li><span class="archive-year">{{.Year}}</span>
|
||||
<ul>
|
||||
{{range .Posts}}
|
||||
<li>
|
||||
{{.PublicTime|date}} <a href="{{$.viewUrl}}/{{.NoteId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,41 +0,0 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>分类 - {{$.curCateTitle}}</h2>
|
||||
</div>
|
||||
<div id="posts">
|
||||
{{range $.posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}.</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,204 +0,0 @@
|
||||
<!-- 赞 -->
|
||||
<div class="entry-controls clearfix">
|
||||
<div class="vote-section-wrapper clearfix">
|
||||
<button class="btn btn-default btn-zan" id="likeBtn"><i class="fa fa-thumbs-o-up"></i> <span id="likeNum">{{.blog.LikeNum}}</span> {{msg . "like"}}</button>
|
||||
<span class="control-item read-counts"><i class="fa fa-eye"></i> {{if .blog.ReadNum}}{{.blog.ReadNum}}{{else}}1{{end}} {{msg . "viewers"}}</span>
|
||||
</div>
|
||||
<div class="right-section">
|
||||
<div id="weixinQRCode"></div>
|
||||
<!-- google+
|
||||
<g:plusone size=”medium”></g:plusone>
|
||||
-->
|
||||
<button class="btn btn-share btn-default btn-weibo"><i class="fa fa-weibo"></i> {{msg . "sinaWeibo"}}</button>
|
||||
<button class="btn btn-share btn-default btn-weixin"><i class="fa fa-wechat"></i> {{msg . "weixin"}}</button>
|
||||
<div class="dropdown" style="display: inline-block; cursor: pointer; padding: 5px 10px;">
|
||||
<!-- open -->
|
||||
<div class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown">
|
||||
<i class="fa fa-share-square-o"></i>
|
||||
{{msg . "moreShare"}}
|
||||
</div>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="#" class="btn-share tencent-weibo"><i class="fa fa-tencent-weibo"></i> {{msg . "tencentWeibo"}}</a></li>
|
||||
<li><a href="#" class="btn-share qq"><i class="fa fa-qq"></i> {{msg . "qqZone"}}</a></li>
|
||||
<li><a href="#" class="btn-share renren"><i class="fa fa-renren"></i> {{msg . "renren"}}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- 举报 -->
|
||||
{{if eq .locale "zh"}}
|
||||
<div style="display: inline-block">
|
||||
<a id="reportBtn"><i class="fa fa-flag-o"></i> {{msg . "report"}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="voters clearfix" id="likers">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/x-jsrender" id="tLikers">
|
||||
[[for users]]
|
||||
<a id="liker_[[:UserId]]" href="[[:~root.blogUrl]]/[[:Username]]" target="_blank" class="voter">
|
||||
[[if Logo]]
|
||||
<img alt="avatar" class="avatar-small" src="[[:Logo]]">
|
||||
[[else]]
|
||||
<img alt="avatar" class="avatar-small" src="/images/blog/default_avatar.png">
|
||||
[[/if]]
|
||||
</a>
|
||||
[[/for]]
|
||||
</script>
|
||||
{{if and .userBlog.CanComment (not (eq .userBlog.CommentType "disqus"))}}
|
||||
|
||||
<script type="text/x-jsrender" id="tComments">
|
||||
[[for comments]]
|
||||
<li class="comment-item">
|
||||
<!-- 头像 -->
|
||||
<a ui-hovercard="" target="_blank" class="avatar-link" title="[[:UserInfo.Username]]" href="[[:~root.blogUrl]]/[[:UserInfo.Username]]">
|
||||
<img class="avatar" src="[[:UserInfo.Logo]]">
|
||||
</a>
|
||||
<!-- 评论 -->
|
||||
<div class="comment-body">
|
||||
<div class="comment-hd">
|
||||
<a href="[[:~root.blogUrl]]/[[:UserInfo.Username]]" target="_blank" >[[:UserInfo.Username]]</a>
|
||||
[[if IsAuthorComment]]
|
||||
<span>({{msg . "author"}})</span>
|
||||
[[/if]]
|
||||
|
||||
<!-- 回复其它人 -->
|
||||
[[if ToUserInfo]]
|
||||
<span class="in-reply-to">
|
||||
{{rawMsg . "reply"}}
|
||||
<a href="[[:~root.blogUrl]]/[[:ToUserInfo.Username]]">[[:ToUserInfo.Username]]</a>
|
||||
</span>
|
||||
[[if ToUserIsAuthor]]
|
||||
<span>({{msg . "author"}})</span>
|
||||
[[/if]]
|
||||
[[/if]]
|
||||
</div>
|
||||
<div class="comment-content ng-binding" ng-bind-html="comment.content">
|
||||
[[html:Content]]
|
||||
</div>
|
||||
<div class="comment-ft clearfix" data-comment-id="[[:CommentId]]" >
|
||||
<span title="" ui-time="" class="date">[[:PublishDate]] </span>
|
||||
<span class="like-num [[if !LikeNum]]hide[[/if]]" title="[[:LikeNum]] {{rawMsg . "like"}}"><span class="like-num-i">[[:LikeNum]]</span> {{rawMsg . "like"}}</span></span>
|
||||
|
||||
[[if ~root.visitUserInfo.UserId]]
|
||||
[[if IsMyNote && !IsMyComment]]
|
||||
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> {{rawMsg . "delete"}}</a>
|
||||
[[/if]]
|
||||
[[if !IsMyComment]]
|
||||
<a href="javascript:;" class="comment-reply op-link ">
|
||||
<i class="fa fa-reply"></i>
|
||||
{{rawMsg . "reply"}}
|
||||
</a>
|
||||
<a href="javascript:;" class="comment-like op-link"><i class="fa fa-thumbs-o-up"></i> <span class="like-text">[[if IsILikeIt]]{{rawMsg . "unlike"}}[[else]]{{rawMsg . "like"}}[[/if]]</span></a>
|
||||
{{if eq .locale "zh"}}
|
||||
<a href="javascript:;" class="comment-report op-link "><i class="fa fa-flag-o"></i> {{rawMsg . "report"}}</a>
|
||||
{{end}}
|
||||
[[else]]
|
||||
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> {{rawMsg . "delete"}}</a>
|
||||
[[/if]]
|
||||
[[/if]]
|
||||
</div>
|
||||
|
||||
<!-- 回复该评论 -->
|
||||
[[if ~root.visitUserInfo.UserId]]
|
||||
<form class="comment-form comment-box-ft">
|
||||
<div class="clearfix">
|
||||
<div class="avatar-wrap">
|
||||
<img class="avatar" src="[[:~root.visitUserInfo.Logo]]">
|
||||
</div>
|
||||
<div class="editor-wrap">
|
||||
<textarea class="editable" id="commentContent" name="commentContent" placeholder="{{rawMsg . "reply"}}"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="command clearfix" style="display: block;">
|
||||
<button class="reply-comment-btn save btn btn-primary" data-comment-id="[[:CommentId]]">{{rawMsg . "comment"}}</button>
|
||||
<a class="cancel reply-cancel btn-link">{{rawMsg . "cancel"}}</a>
|
||||
</div>
|
||||
</form>
|
||||
[[/if]]
|
||||
</div>
|
||||
</li>
|
||||
[[/for]]
|
||||
</script>
|
||||
|
||||
<!-- 评论 -->
|
||||
<div class="comment-box hide">
|
||||
{{if .visitUserInfo.UserId}}
|
||||
<form class="comment-form comment-box-ft" id="commentForm">
|
||||
<div class="clearfix">
|
||||
<div class="avatar-wrap">
|
||||
<img class="avatar" src="{{.visitUserInfo.Logo}}">
|
||||
</div>
|
||||
<div class="editor-wrap">
|
||||
<textarea class="editable" id="commentContent" name="commentContent" placeholder="{{msg . "comment"}}" style="height: 100px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="command clearfix" style="display: block;">
|
||||
<button id="commentBtn" class="reply-comment-btn save btn btn-primary">{{msg . "comment"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
{{else}}
|
||||
<div class="needLogin">
|
||||
<a onclick="goLogin()">{{msg . "signIn"}}</a>, {{msg . "submitComment"}}.
|
||||
<br />
|
||||
没有帐号? <a onclick="goRegister()">{{msg . "signUp"}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="box-header">
|
||||
<span class="counter">
|
||||
<i class="icon icon-comment"></i><span id="commentNum">{{.blog.CommentNum}}</span> {{msg . "comments"}}
|
||||
</span>
|
||||
</div>
|
||||
<ul id="comments">
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="moreComments">
|
||||
<div class="hide comments-more">
|
||||
<a>More...</a>
|
||||
</div>
|
||||
<div class="comments-loading">
|
||||
<img src="/images/loading-32.gif" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{if eq .locale "zh"}}
|
||||
<div id="reportMsg" class="hide">
|
||||
<form class="report-form" name="reportForm">
|
||||
<ul class="options clearfix">
|
||||
<li><label><input required="" value="{{msg . "reportReason1"}}" name="reason" type="radio">{{msg . "reportReason1"}}</label></li>
|
||||
<li><label><input required="" value="{{msg . "reportReason2"}}" name="reason" type="radio">{{msg . "reportReason2"}}</label></li>
|
||||
<li><label><input required="" value="{{msg . "reportReason3"}}" name="reason" type="radio">{{msg . "reportReason3"}}</label></li>
|
||||
<li><label><input required="" value="{{msg . "reportReason4"}}" name="reason" type="radio">{{msg . "reportReason4"}}</label></li>
|
||||
<li><label><input required="" value="" name="reason" type="radio">{{msg . "other"}}</label></li>
|
||||
</ul>
|
||||
<p class="input-container" style="display: none">
|
||||
<input placeholder="{{msg . "reportReason"}}" type="text" name="detail" class="form-control reason-text basic-input" />
|
||||
</p>
|
||||
<p class="footnote"></p>
|
||||
</form>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{end}}
|
||||
|
||||
{{if and $.blogInfo.OpenComment (eq $.blogInfo.CommentType "disqus")}}
|
||||
|
||||
<div id="disqus_thread"></div>
|
||||
<!-- comment -->
|
||||
<script type="text/javascript">
|
||||
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
|
||||
var disqus_shortname = '{{.userBlog.DisqusId}}'; // required: replace example with your forum shortname
|
||||
var disqus_identifier = '{{.userBlog.UserId.Hex}}/{{.blog.NoteId.Hex}}/{{.blog.Title}}'; // 博客链接
|
||||
|
||||
/* * * DON'T EDIT BELOW THIS LINE * * */
|
||||
(function() {
|
||||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
||||
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||
})();
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
||||
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
|
||||
{{end}}
|
@ -1,55 +0,0 @@
|
||||
<div id="footerContainer">
|
||||
{{$userId := .userBlog.UserId.Hex}}
|
||||
<div class="container" id="footer">
|
||||
<div class="col-md-4">
|
||||
<h3>{{msg . "blogNavs"}}</h3>
|
||||
<ul>
|
||||
<li><a href="{{$.blogUrl}}/{{$.userInfo.Username}}">{{msg . "home"}}</a></li>
|
||||
{{range .notebooks}}
|
||||
<li>
|
||||
<a href="{{$.cateUrl}}/{{.NotebookId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
<li><a href="{{$.aboutMeUrl}}">{{msg . "aboutMe"}}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3>{{msg . "latestPosts"}}</h3>
|
||||
<ul>
|
||||
{{range .recentBlogs}}
|
||||
<li title="{{.Title}}"><a href="{{$.blogUrl}}/view/{{.NoteId.Hex}}/">{{.Title}}</a></li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3>{{msg . "quickLinks"}}</h3>
|
||||
<ul>
|
||||
<li><a href="{{$.noteUrl}}">{{msg . "myNote"}}</a></li>
|
||||
<li><a href="{{$.siteUrl}}/login">leanote {{msg . "login"}}</a></li>
|
||||
<li><a href="http://leanote.com" target="_blank">leanote {{msg . "home"}}</a></li>
|
||||
<li><a href="http://lea.leanote.com" target="_blank">lea++</a></li>
|
||||
<li><a href="http://bbs.leanote.com" target="_blank">leanote {{msg . "community"}}</a></li>
|
||||
<li><a href="https://github.com/leanote/leanote" target="_blank">leanote github</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="{{$.jQueryUrl}}"></script>
|
||||
<script src="{{$.bootstrapJsUrl}}"></script>
|
||||
<script src="{{$.siteUrl}}/js/bootstrap-hover-dropdown.js"></script>
|
||||
<script src="{{$.siteUrl}}/js/i18n/blog.{{.locale}}.js"></script>
|
||||
|
||||
<script>
|
||||
// 搜索
|
||||
function search(e) {
|
||||
var keywords = $("#searchInput").val();
|
||||
if(!keywords) {
|
||||
location.href = "{{$.searchUrl}}";
|
||||
} else {
|
||||
var tpl = '<form action="{{$.searchUrl}}" method="get">';
|
||||
tpl += '<input name="keywords" value="' + keywords + '" />';
|
||||
tpl += "</form";
|
||||
$(tpl).submit();
|
||||
}
|
||||
}
|
||||
</script>
|
@ -1,113 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="keywords" content="leanote,leanote.com">
|
||||
<meta name="description" content="leanote, {{msg $ "moto"}}">
|
||||
<meta name="author" content="leanote">
|
||||
|
||||
<title>{{.title}}</title>
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link href="{{$.bootstrapCssUrl}}" rel="stylesheet">
|
||||
<!-- 字体必须同一域 -->
|
||||
<link href="{{$.fontAwesomeUrl}}" rel="stylesheet">
|
||||
<link href="{{$.themeBaseUrl}}/style.css" rel="stylesheet">
|
||||
<link href="{{$.commentCssUrl}}" rel="stylesheet">
|
||||
<script>
|
||||
function log(o) {
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="headerAndNav" >
|
||||
<div id="headerContainer" class="container">
|
||||
<!-- 头部可放博客名, 导航 -->
|
||||
<div id="header">
|
||||
|
||||
{{$username := .userInfo.Username}}
|
||||
<h1>
|
||||
<a href="{{$.indexUrl}}" id="logo">
|
||||
{{if $.blogInfo.Logo}}
|
||||
<img src="{{$.blogInfo.Logo}}" title="{{$.blogInfo.Title}}"/>
|
||||
{{else}}
|
||||
{{$.blogInfo.Title | raw}}
|
||||
{{end}}
|
||||
</a>
|
||||
</h1>
|
||||
<div id="blogDesc">
|
||||
{{$.blogInfo.SubTitle | raw}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Static navbar -->
|
||||
<div class="navbar navbar-default">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="{{.indexUrl}}">
|
||||
{{if $.blogInfo.Logo}}
|
||||
|
||||
<img src="{{$.blogInfo.Logo}}" title="{{$.blogInfo.Title}}"/>
|
||||
{{else}}
|
||||
{{$.blogInfo.Title | raw}}
|
||||
{{end}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
|
||||
<li class="{{if $.curIsIndex}}active{{end}}"><a href="{{.indexUrl}}">主页</a></li>
|
||||
<!-- 分类页 -->
|
||||
{{range $.cates}}
|
||||
<li class="{{if eq .CateId $.curCateId}}active{{end}}">
|
||||
<a href="{{$.cateUrl}}/{{.CateId}}"
|
||||
>{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
<!-- 单页 -->
|
||||
{{range $.singles}}
|
||||
<li class="{{if eq $.curSingleId .SingleId}}active{{end}}">
|
||||
<a href="{{$.singleUrl}}/{{.SingleId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
|
||||
<!-- 归档 -->
|
||||
<li class="{{if $.curIsArchive}}active{{end}}">
|
||||
<a href="{{$.archiveUrl}}">归档</a>
|
||||
</li>
|
||||
<li class="{{if $.curIsTags}}active{{end}}">
|
||||
<a href="{{$.tagsUrl}}">标签</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<form class="navbar-form navbar-right" id="search" onsubmit="search(event);return false;">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="searchIcon" onclick="search(event);"><i class="fa fa-search"></i></span>
|
||||
<input type="text" placeholder="search" id="searchInput" class="form-control" value="{{.keywords}}">
|
||||
</div>
|
||||
</form>
|
||||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var UserInfo = {UserId: "{{$.blogInfo.UserId}}", Email: "{{.userInfo.Email}}", Username: "{{.userInfo.Username}}"};
|
||||
var UserBlogInfo={CanComment: {{.userBlog.CanComment}}, CommentType: "{{.userBlog.CommentType}}"};
|
||||
var indexUrl = "{{$.indexUrl}}";
|
||||
var viewUrl = "{{$.viewUrl}}";
|
||||
var blogUrl = "{{$.blogUrl}}";
|
||||
var staticUrl = "{{$.staticUrl}}"; // blog.leanote.com, life.leanote.com, aaa.com
|
||||
</script>
|
@ -1,9 +0,0 @@
|
||||
<!-- This file is Depreciated -->
|
||||
|
||||
<link href="/public/mdeditor/editor/google-code-prettify/prettify.css" type="text/css" rel="stylesheet">
|
||||
<script src="/public/mdeditor/editor/google-code-prettify/prettify.js"></script>
|
||||
|
||||
<script>
|
||||
$("pre").addClass("prettyprint linenums");
|
||||
prettyPrint();
|
||||
</script>
|
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 109 KiB |
@ -1,39 +0,0 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
|
||||
<div id="posts">
|
||||
{{range $.posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}.</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
Before Width: | Height: | Size: 10 KiB |
@ -1 +0,0 @@
|
||||
aaaaaaaaaaaaaaaaaaa
|
@ -1,27 +0,0 @@
|
||||
{{if gt $.paging.TotalPage 1}}
|
||||
|
||||
<!-- 上一页 -->
|
||||
{{if gt $.paging.CurPage 1}}
|
||||
{{set . "prePageClass" ""}}
|
||||
{{set . "prePageUrl" (urlConcat $.pagingBaseUrl "page" (incr $.paging.CurPage -1)) }}
|
||||
{{else}}
|
||||
{{set . "prePageClass" "disabled"}}
|
||||
{{set . "prePageUrl" "#"}}
|
||||
{{end}}
|
||||
|
||||
<!-- 下一页 -->
|
||||
{{if lt $.paging.CurPage $.paging.TotalPage }}
|
||||
{{set . "nextPageClass" ""}}
|
||||
{{set . "nextPageUrl" (urlConcat $.pagingBaseUrl "page" (incr $.paging.CurPage 1)) }}
|
||||
{{else}}
|
||||
{{set . "nextPageClass" "disabled"}}
|
||||
{{set . "nextPageUrl" "#"}}
|
||||
{{end}}
|
||||
|
||||
{{$.paging.CurPage}}/{{$.paging.TotalPage}}
|
||||
<ul class="pager">
|
||||
<li class="{{$.prePageClass}}"><a href="{{$.prePageUrl}}">上一页</a></li>
|
||||
<li class="{{$.nextPageClass}}"><a href="{{$.nextPageUrl}}">下一页</a></li>
|
||||
</ul>
|
||||
|
||||
{{end}}
|
@ -1,49 +0,0 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>搜索 - {{.keywords}} </h2>
|
||||
</div>
|
||||
|
||||
<div id="posts">
|
||||
{{range .posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}} |
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}</a>
|
||||
</div>
|
||||
|
||||
|
||||
{{else}}
|
||||
<div class="each-post">
|
||||
{{msg . "none"}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
{{template "blog/highlight.html"}}
|
||||
</body>
|
||||
</html>
|
@ -1,52 +0,0 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div id="posts">
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
{{.single.Title}}
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-calendar"></i> {{msg . "updatedTime"}} {{$.single.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg . "createdTime"}} {{$.single.CreatedTime | datetime}}
|
||||
</div>
|
||||
|
||||
<!-- 仅为移动端 -->
|
||||
<div class="mobile-created-time">
|
||||
{{ if $.blogInfo.UserLogo}}
|
||||
<img src="{{$.blogInfo.UserLogo}}" id="userLogo">
|
||||
{{else}}
|
||||
<img src="{{$.siteUrl}}/images/blog/default_avatar.png" id="userLogo">
|
||||
{{end}}
|
||||
{{$.blogInfo.Username}}
|
||||
</div>
|
||||
|
||||
<div class="desc" id="content">
|
||||
{{$.single.Content | raw}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "footer.html" .}}
|
||||
|
||||
{{template "highlight.html"}}
|
||||
<div id="blogNav">
|
||||
<div id="blogNavNav">
|
||||
<i class="fa fa-align-justify" title="文档导航"></i>
|
||||
<span>{{msg . "blogNav"}}</span>
|
||||
</div>
|
||||
<div id="blogNavContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 一些公用的js -->
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/common.js"></script>
|
||||
<script>
|
||||
$(function() {
|
||||
initNav();
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,528 +0,0 @@
|
||||
#posts img {
|
||||
max-width: 100%;
|
||||
}
|
||||
#content * {
|
||||
font-size: 16px;
|
||||
}
|
||||
#content h1 {
|
||||
font-size: 30px;
|
||||
}
|
||||
#content h2 {
|
||||
font-size: 24px;
|
||||
}
|
||||
#content h3 {
|
||||
font-size: 18px;
|
||||
}
|
||||
#content h4 {
|
||||
font-size: 14px;
|
||||
}
|
||||
@-webkit-keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-moz-keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-ms-keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-webkit-keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-moz-keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-ms-keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
a,
|
||||
.btn {
|
||||
-webkit-transition: all 0.2s ease;
|
||||
-moz-transition: all 0.2s ease;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
.btn:focus {
|
||||
outline: none;
|
||||
}
|
||||
ul.dropdown-menu {
|
||||
box-shadow: rgba(0, 0, 0, 0.172549) 0px 6px 12px 0px;
|
||||
}
|
||||
ul.dropdown-menu:before {
|
||||
content: "";
|
||||
width: 20px;
|
||||
height: 12px;
|
||||
position: absolute;
|
||||
top: -12px;
|
||||
right: 20px;
|
||||
background-image: url("../../images/triangle_2x.png");
|
||||
background-size: 20px 12px;
|
||||
}
|
||||
ul.dropdown-menu {
|
||||
display: block;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
}
|
||||
.open ul.dropdown-menu {
|
||||
-webkit-animation: pulldown .2s;
|
||||
animation: pulldown .2s;
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
.created-time .fa {
|
||||
color: #666;
|
||||
}
|
||||
#blogNav {
|
||||
display: none;
|
||||
background-color: #fff;
|
||||
opacity: 0.7;
|
||||
position: fixed;
|
||||
z-index: 10;
|
||||
padding: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
#blogNavContent {
|
||||
overflow-y: auto;
|
||||
max-height: 250px;
|
||||
display: none;
|
||||
-webkit-overflow-scrolling: touch !important;
|
||||
}
|
||||
#blogNavNav {
|
||||
cursor: pointer;
|
||||
}
|
||||
#blogNav a {
|
||||
color: #666;
|
||||
}
|
||||
#blogNav:hover {
|
||||
opacity: 0.9;
|
||||
}
|
||||
#blogNav a:hover {
|
||||
color: #0fb264;
|
||||
}
|
||||
#blogNav ul {
|
||||
padding-left: 20px;
|
||||
}
|
||||
#blogNav ul .nav-h2 {
|
||||
margin-left: 20px;
|
||||
}
|
||||
#blogNav ul .nav-h3 {
|
||||
margin-left: 30px;
|
||||
}
|
||||
#blogNav ul .nav-h4 {
|
||||
margin-left: 40px;
|
||||
}
|
||||
#blogNav ul .nav-h5 {
|
||||
margin-left: 50px;
|
||||
}
|
||||
.mobile-created-time {
|
||||
display: none;
|
||||
}
|
||||
#footer {
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.navbar-brand {
|
||||
display: none;
|
||||
}
|
||||
#themeList label {
|
||||
text-align: center;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
#themeList .preview {
|
||||
display: block;
|
||||
width: 400px;
|
||||
background: #fff;
|
||||
border: 1px solid #ccc;
|
||||
padding: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
src: local('Open Sans Light'), local('OpenSans-Light'), url('../../fonts/open-sans2/DXI1ORHCpsQm3Vp6mXoaTXhCUOGz7vYGh680lGh-uXM.woff') format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url('../../fonts/open-sans2/cJZKeOuBrn4kERxqtaUH3T8E0i7KZn-EPnyo3HZu7kw.woff') format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('Open Sans Bold'), local('OpenSans-Bold'), url('../../fonts/open-sans2/k3k702ZOKiLJc3WVjuplzHhCUOGz7vYGh680lGh-uXM.woff') format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url('../../fonts/open-sans2/xjAJXh38I15wypJXxuGMBobN6UDyHWBl620a-IRfuBk.woff') format('woff');
|
||||
}
|
||||
/*"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue", Helvetica, "Microsoft Yahei", Verdana, Simsun, "Segoe UI", "Segoe UI Web Regular", "Segoe UI Symbol", "BBAlpha Sans", "S60 Sans", Arial, sans-serif;*/
|
||||
::selection {
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
::-moz-selection {
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
::-webkit-selection {
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
*,
|
||||
body {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300;
|
||||
font-size: 14px;
|
||||
}
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300 !important;
|
||||
}
|
||||
a {
|
||||
cursor: pointer;
|
||||
}
|
||||
a:hover {
|
||||
text-decoration: none !important;
|
||||
}
|
||||
#headerContainer {
|
||||
height: 100px;
|
||||
background-color: #fff;
|
||||
}
|
||||
#posts {
|
||||
width: 845px;
|
||||
margin: auto;
|
||||
}
|
||||
#postsContainer {
|
||||
background: #f5f5f5 url("../../images/noise.png");
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
/* header */
|
||||
#header {
|
||||
color: #000000;
|
||||
position: relative;
|
||||
padding: 0 0 20px 0;
|
||||
margin-top: 15px;
|
||||
}
|
||||
#header h1 {
|
||||
margin: 0;
|
||||
font-size: 32px;
|
||||
}
|
||||
#header h1 a {
|
||||
color: #000000;
|
||||
font-size: 32px;
|
||||
}
|
||||
#header h1 a img {
|
||||
height: 40px;
|
||||
}
|
||||
#header #blogDesc {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.navbar {
|
||||
margin-bottom: 0;
|
||||
border-radius: 0;
|
||||
border: none;
|
||||
}
|
||||
.navbar-collapse {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
.navbar-form {
|
||||
padding: 0;
|
||||
}
|
||||
/* posts */
|
||||
#posts {
|
||||
padding-top: 10px;
|
||||
}
|
||||
#posts .each-post {
|
||||
border-bottom: 1px solid #ebeff2;
|
||||
margin-bottom: 10px;
|
||||
padding: 30px;
|
||||
background-color: #fff;
|
||||
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 3px;
|
||||
}
|
||||
#posts .each-post .title {
|
||||
font-size: 32px;
|
||||
color: #0fb264;
|
||||
padding: 0 0 15px 0;
|
||||
}
|
||||
#posts .each-post .title a {
|
||||
font-size: 32px;
|
||||
color: #0fb264;
|
||||
padding: 0 0 15px 0;
|
||||
}
|
||||
#posts .each-post .created-time {
|
||||
border-bottom: 1px solid #eee;
|
||||
padding-bottom: 3px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
#posts .each-post .more {
|
||||
background: #0fb264;
|
||||
padding: 9px 10px;
|
||||
border-radius: 2px;
|
||||
line-height: 1;
|
||||
font-size: 13px;
|
||||
display: inline-block;
|
||||
text-transform: uppercase;
|
||||
margin-top: 15px;
|
||||
margin-bottom: 15px;
|
||||
color: #fff;
|
||||
}
|
||||
#disqus_thread {
|
||||
border-top: 1px solid #eee;
|
||||
padding: 5px 0 0 0;
|
||||
}
|
||||
#search {
|
||||
width: 200px;
|
||||
}
|
||||
#footerContainer {
|
||||
background-color: #ffffff;
|
||||
color: #666666;
|
||||
}
|
||||
#footerContainer #footer a {
|
||||
color: #666666;
|
||||
}
|
||||
#footerContainer #footer ul {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding-left: 20px;
|
||||
}
|
||||
@media screen and (max-width: 600px) {
|
||||
html,
|
||||
body {
|
||||
overflow-x: hidden;
|
||||
background-color: #fbfcf7;
|
||||
}
|
||||
* {
|
||||
font-size: 16px;
|
||||
}
|
||||
#headerContainer,
|
||||
#footerContainer {
|
||||
background-color: #fbfcf7;
|
||||
margin: 10px 0;
|
||||
}
|
||||
#posts .each-post,
|
||||
#postsContainer {
|
||||
background-color: #fbfcf7 !important;
|
||||
}
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
#posts .each-post {
|
||||
padding: 10px;
|
||||
}
|
||||
#posts .each-post .title {
|
||||
font-size: 24px;
|
||||
border-left: 5px solid #65bd77;
|
||||
font-weight: bold;
|
||||
padding: 5px 0;
|
||||
padding-left: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.container {
|
||||
padding-right: 10px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
.created-time {
|
||||
display: none;
|
||||
}
|
||||
.mobile-created-time {
|
||||
display: block;
|
||||
}
|
||||
.mobile-created-time #userLogo {
|
||||
display: inline-block;
|
||||
max-height: 40px;
|
||||
width: 40px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
#content {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.right-section .dropdown,
|
||||
.right-section .btn {
|
||||
display: none !important;
|
||||
}
|
||||
#blogNav {
|
||||
left: initial !important;
|
||||
right: 10px !important;
|
||||
}
|
||||
#postsContainer .container,
|
||||
#footerContainer .container {
|
||||
max-width: 100%;
|
||||
}
|
||||
#postsContainer {
|
||||
margin: 0 !important;
|
||||
max-width: 100%;
|
||||
padding-top: 10px;
|
||||
background: #f5f5f5 url("../../images/noise.png");
|
||||
}
|
||||
#posts {
|
||||
max-width: 100% !important;
|
||||
}
|
||||
#footerContainer #footer a {
|
||||
padding: 3px;
|
||||
}
|
||||
#footerContainer #footer a:hover,
|
||||
#footerContainer #footer a:focus {
|
||||
color: #65bd77;
|
||||
}
|
||||
#headerAndNav {
|
||||
position: initial;
|
||||
text-align: left;
|
||||
width: 100%;
|
||||
border-bottom: 2px dashed #ebeff2;
|
||||
}
|
||||
#headerAndNav #headerContainer {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
padding-top: 30px;
|
||||
}
|
||||
#headerAndNav #header {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
#headerAndNav #header h1 {
|
||||
display: none;
|
||||
}
|
||||
#headerAndNav .navbar-collapse {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
#headerAndNav #blogDesc {
|
||||
border: none;
|
||||
margin-top: 20px;
|
||||
font-size: 24px;
|
||||
}
|
||||
#headerAndNav .navbar-brand {
|
||||
display: inline-block;
|
||||
line-height: 50px;
|
||||
padding: 0;
|
||||
padding-left: 10px;
|
||||
}
|
||||
#headerAndNav .navbar-brand img {
|
||||
height: 40px;
|
||||
}
|
||||
#headerAndNav .navbar .container {
|
||||
width: auto;
|
||||
padding: 0 15px;
|
||||
}
|
||||
#headerAndNav .navbar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
background: #fbfcf7;
|
||||
z-index: 1000;
|
||||
border-bottom: 1px solid #DEDDDF;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), inset 0 1px 0 #ffffff;
|
||||
background-color: #FDFFF5;
|
||||
}
|
||||
#headerAndNav .navbar-nav {
|
||||
margin: 0 10px;
|
||||
}
|
||||
#headerAndNav .navbar-nav a {
|
||||
padding-left: 10px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
#headerAndNav #search {
|
||||
width: 100%;
|
||||
margin: 10px;
|
||||
}
|
||||
#headerAndNav .navbar-form {
|
||||
border: none;
|
||||
}
|
||||
#myTab,
|
||||
.tab-content {
|
||||
padding: 0 10px;
|
||||
}
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>标签 - {{.curTag}} </h2>
|
||||
</div>
|
||||
|
||||
<div id="posts">
|
||||
{{range .posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}} |
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}</a>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="each-post">
|
||||
{{msg . "none"}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
{{template "blog/highlight.html"}}
|
||||
</body>
|
||||
</html>
|
@ -1,26 +0,0 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>标签</h2>
|
||||
</div>
|
||||
<div id="posts">
|
||||
|
||||
<div class="each-post">
|
||||
<ul>
|
||||
{{range $.tags}}
|
||||
<li>
|
||||
<a href="{{$.tagPostsUrl}}/{{.Tag}}">
|
||||
{{.Tag}} <span class="label label-default">{{.Count}}</span>
|
||||
</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,27 +0,0 @@
|
||||
/*
|
||||
以下是本主题的配置, 采用JSON格式
|
||||
其中Name, Version, Author, AuthorUrl是必填项(注意首字大写)
|
||||
你也可以定义其它的配置, 如FriendLinks, 在模板文件使用 $.themeInfo.FriendLinks来获取值
|
||||
|
||||
注意:
|
||||
1) JSON语法严格, 键必须用双引号, 最后不得有空','来结尾
|
||||
2) 以下配置不能包含任何注释, 不然解析会出错!
|
||||
|
||||
请在此解析所有配置
|
||||
* Name 主题名
|
||||
* Version 主题版本
|
||||
* Author 主题的作者
|
||||
* AuthorUrl 作者的博客链接或相关链接
|
||||
|
||||
* FriendLinks 友情链接
|
||||
|
||||
*/
|
||||
{
|
||||
"Name": "leanote default theme",
|
||||
"Version": "1.0",
|
||||
"Author": "leanote.com",
|
||||
"AuthorUrl": "http://leanote.com",
|
||||
"FriendLinks": [
|
||||
{"Title": "leanote", "Url": "http://leanote.com"}
|
||||
]
|
||||
}
|
@ -1,140 +0,0 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div id="posts">
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
{{.post.Title}}
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .post.Tags}}
|
||||
{{blogTags $ .post.Tags}}
|
||||
{{else}}
|
||||
{{msg . "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg . "updatedTime"}} {{$.post.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg . "createdTime"}} {{$.post.CreatedTime | datetime}}
|
||||
</div>
|
||||
|
||||
<!-- 仅为移动端 -->
|
||||
<div class="mobile-created-time">
|
||||
{{ if $.blogInfo.UserLogo}}
|
||||
<img src="{{$.blogInfo.UserLogo}}" id="userLogo">
|
||||
{{else}}
|
||||
<img src="{{$.siteUrl}}/images/blog/default_avatar.png" id="userLogo">
|
||||
{{end}}
|
||||
{{$.blogInfo.Username}}
|
||||
|
||||
{{if .post.Tags}}
|
||||
|
||||
<i class="fa fa-bookmark-o" style="color: #666"></i>
|
||||
{{blogTags $ $.post.Tags}}
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
<div class="desc" id="content">
|
||||
{{if $.post.IsMarkdown }}
|
||||
<div id="markdownContent" style="display: none">
|
||||
<!-- 用textarea装html, 防止得到的值失真 -->
|
||||
<textarea>{{$.post.Content | raw}}</textarea>
|
||||
</div>
|
||||
<div style="padding: 20px; text-align: center">
|
||||
<img src="{{$.themeBaseUrl}}/images/loading-32.gif" />
|
||||
</div>
|
||||
{{else}}
|
||||
{{$.post.Content | raw}}
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
<div class="pre-next-post">
|
||||
<p>
|
||||
上一篇: {{if $.prePost}}<a href="{{$.viewUrl}}/{{$.prePost.NoteId}}">{{$.prePost.Title}}</a>{{else}}无{{end}}
|
||||
</p>
|
||||
<p>
|
||||
下一篇: {{if $.nextPost}}<a href="{{$.viewUrl}}/{{$.nextPost.NoteId}}">{{$.nextPost.Title}}</a>{{else}}无{{end}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- share & comment -->
|
||||
{{template "comment.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "footer.html" .}}
|
||||
|
||||
{{template "highlight.html"}}
|
||||
<div id="blogNav">
|
||||
<div id="blogNavNav">
|
||||
<i class="fa fa-align-justify" title="文档导航"></i>
|
||||
<span>{{msg . "blogNav"}}</span>
|
||||
</div>
|
||||
<div id="blogNavContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 一些在comment.js 需要使用的变量 -->
|
||||
<script>
|
||||
var visitUserInfo = eval("(" + {{.visitUserInfoJson}} + ")");
|
||||
var urlPrefix = "{{$.leanoteUrl}}";
|
||||
var noteId = "{{$.post.NoteId}}";
|
||||
var preLikeNum = +"{{.blog.likeNum}}";
|
||||
var commentNum = +"{{.blog.commentNum}}";
|
||||
</script>
|
||||
|
||||
<!-- 一些公用的js -->
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/common.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/jsrender.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/jquery-cookie-min.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/bootstrap-dialog.min.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/jquery.qrcode.min.js"></script>
|
||||
|
||||
<!-- share && comment -->
|
||||
<script src="{{$.themeBaseUrl}}/view.js"></script>
|
||||
|
||||
<!--
|
||||
markdown
|
||||
调用markdown来解析得到html
|
||||
-->
|
||||
|
||||
{{if $.post.IsMarkdown }}
|
||||
<script src="/public/mdeditor/editor/pagedown/Markdown.Converter.js"></script>
|
||||
<script src="/public/mdeditor/editor/pagedown/Markdown.Sanitizer.js"></script>
|
||||
<script src="/public/mdeditor/editor/pagedown/Markdown.Editor.js"></script>
|
||||
<script src="/public/mdeditor/editor/pagedown/local/Markdown.local.zh.js"></script>
|
||||
<script src="/public/mdeditor/editor/Markdown.Extra.js"></script>
|
||||
|
||||
<!--mathjax-->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ["\\(","\\)"]], processEscapes: true }, messageStyle: "none"});
|
||||
</script>
|
||||
<script src="/public/mdeditor/editor/mathJax.js"></script>
|
||||
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
|
||||
<script>
|
||||
var content = $.trim($("#markdownContent textarea").val());
|
||||
var converter = Markdown.getSanitizingConverter();
|
||||
Markdown.Extra.init(converter, {extensions: ["tables", "fenced_code_gfm", "def_list"]});
|
||||
var html = converter.makeHtml(content);
|
||||
$("#content").html(html);
|
||||
$("pre").addClass("prettyprint linenums");
|
||||
prettyPrint();
|
||||
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"wmd-preview"]);
|
||||
|
||||
initNav();
|
||||
weixin();
|
||||
</script>
|
||||
|
||||
<!-- 不是markdown -->
|
||||
{{else}}
|
||||
<script>
|
||||
$(function() {
|
||||
initNav();
|
||||
weixin();
|
||||
});
|
||||
</script>
|
||||
{{end}}
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,509 +0,0 @@
|
||||
function scrollTo(self, tagName, text) {
|
||||
var iframe = $("#content");
|
||||
var target = iframe.find(tagName + ":contains(" + text + ")");
|
||||
|
||||
// 找到是第几个
|
||||
// 在nav是第几个
|
||||
var navs = $('#blogNavContent [data-a="' + tagName + '-' + encodeURI(text) + '"]');
|
||||
var len = navs.size();
|
||||
for(var i = 0; i < len; ++i) {
|
||||
if(navs[i] == self) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (target.size() >= i+1) {
|
||||
target = target.eq(i);
|
||||
// 之前插入, 防止多行定位不准
|
||||
var top = target.offset().top;
|
||||
if(LEA.isMobile) {
|
||||
top -= 50;
|
||||
}
|
||||
var nowTop = $(document).scrollTop();
|
||||
// 用$("body").scrllTop(10)没反应 firefox下
|
||||
$('html,body').animate({scrollTop: top}, 200);
|
||||
return;
|
||||
}
|
||||
}
|
||||
function genNav() {
|
||||
var $con = $("#content");
|
||||
var html = $con.html();
|
||||
// 构造一棵树
|
||||
// {"h1-title":{h2-title:{}}}
|
||||
var tree = [];//[{title: "xx", children:[{}]}, {title:"xx2"}];
|
||||
var hs = $con.find("h1,h2,h3,h4,h5,h6").toArray();
|
||||
var titles = '<ul>';
|
||||
for(var i = 0; i < hs.length; ++i) {
|
||||
var text = $(hs[i]).text();
|
||||
var tagName = hs[i].tagName.toLowerCase();
|
||||
// scrollTo在page.js中定义
|
||||
titles += '<li class="nav-' + tagName + '"><a data-a="' + tagName + '-' + encodeURI(text)+'" onclick="scrollTo(this, \'' + tagName + '\', \'' + text + '\')">' + text + '</a></li>';
|
||||
}
|
||||
titles += "</ul>";
|
||||
$("#blogNavContent").html(titles);
|
||||
if(!hs.length) {
|
||||
$("#blogNavContent").html(getMsg("none"));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function initNav() {
|
||||
var hasNav = genNav();
|
||||
if(!hasNav) {
|
||||
return;
|
||||
}
|
||||
|
||||
var $title = $(".title");
|
||||
var titlePos = $title.offset();
|
||||
var top = titlePos.top + 10;// - $title.height();
|
||||
// 手机下不要与标题在同一高度
|
||||
if(LEA.isMobile){
|
||||
top += 30;
|
||||
}
|
||||
if(top < 0) {
|
||||
top = 10;
|
||||
}
|
||||
|
||||
var left = $title.width() + titlePos.left - 100;
|
||||
$("#blogNav").css("top", top).css("left", left);
|
||||
$("#blogNav").show();
|
||||
|
||||
$("#blogNavNav").click(function() {
|
||||
var $o = $("#blogNavContent");
|
||||
if($o.is(":hidden")) {
|
||||
$o.show();
|
||||
} else {
|
||||
$o.hide();
|
||||
}
|
||||
});
|
||||
|
||||
var $d = $(document);
|
||||
function reNav() {
|
||||
var vtop = $d.scrollTop();
|
||||
if(vtop <= top) {
|
||||
$("#blogNav").css("top", top-vtop);
|
||||
} else {
|
||||
// 差距很磊了
|
||||
if(LEA.isMobile) {
|
||||
$("#blogNav").css("top", 50);
|
||||
} else {
|
||||
$("#blogNav").css("top", 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
reNav();
|
||||
$(window).scroll(reNav);
|
||||
}
|
||||
|
||||
var C = {
|
||||
info: null,
|
||||
noteId: noteId,
|
||||
preLikeNum: preLikeNum,
|
||||
commentNum: commentNum,
|
||||
likeBtnO: $("#likeBtn"),
|
||||
likeNumO: $("#likeNum"),
|
||||
tLikersO: $("#tLikers"),
|
||||
likersO: $("#likers"),
|
||||
tCommentsO: $("#tComments"),
|
||||
commentsO: $("#comments"),
|
||||
|
||||
commentBtnO: $("#commentBtn"),
|
||||
|
||||
commentsLoadingO: $(".comments-loading"),
|
||||
commentsMoreO: $(".comments-more"),
|
||||
|
||||
commentBoxO: $(".comment-box"),
|
||||
init: function() {
|
||||
var self = this;
|
||||
if(UserBlogInfo.CanComment && UserBlogInfo.CommentType != "disqus") {
|
||||
self.initLikeAndComments();
|
||||
} else {
|
||||
self.initLike();
|
||||
}
|
||||
self.initEvent();
|
||||
self.incReadNum();
|
||||
},
|
||||
incReadNum: function() {
|
||||
var self = this;
|
||||
if(!$.cookie(self.noteId)) {
|
||||
$.cookie(self.noteId, 1);
|
||||
ajaxGet(staticUrl + "/blog/incReadNum", {noteId: self.noteId});
|
||||
}
|
||||
},
|
||||
initLike: function() {
|
||||
var self = this;
|
||||
ajaxGet(staticUrl + "/blog/getLike", {noteId: self.noteId}, function(ret) {
|
||||
self.info = ret;
|
||||
self.toggleLikeBtnActive();
|
||||
self.renderLikers();
|
||||
});
|
||||
},
|
||||
initLikeAndComments: function() {
|
||||
var self = this;
|
||||
ajaxGet(staticUrl + "/blog/getLikeAndComments", {noteId: self.noteId}, function(ret) {
|
||||
self.info = ret;
|
||||
self.toggleLikeBtnActive();
|
||||
self.renderLikers();
|
||||
// 是否需要renderComments?
|
||||
self.info.commentUserInfo = self.info.commentUserInfo || {};
|
||||
// 为了防止第一条评论找不到用户信息情况
|
||||
if(visitUserInfo.UserId) {
|
||||
self.info.commentUserInfo[visitUserInfo.UserId] = visitUserInfo;
|
||||
}
|
||||
self.renderComments();
|
||||
|
||||
self.commentBoxO.removeClass("hide");
|
||||
self.commentsLoadingO.addClass("hide");
|
||||
if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) {
|
||||
self.commentsMoreO.removeClass("hide");
|
||||
self.initMoreComments();
|
||||
}
|
||||
});
|
||||
},
|
||||
initMoreComments: function() {
|
||||
var self = this;
|
||||
self.commentsMoreO.find("a").click(function(){
|
||||
if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) {
|
||||
self.commentsMoreO.addClass("hide");
|
||||
self.commentsLoadingO.removeClass("hide");
|
||||
ajaxGet(staticUrl + "/blog/listComments", {noteId: self.noteId, page: self.info.pageInfo.CurPage+1}, function(ret) {
|
||||
var pageInfo = ret.pageInfo;
|
||||
var comments = ret.comments;
|
||||
var commentUserInfo = ret.commentUserInfo;
|
||||
|
||||
$.extend(self.info.commentUserInfo, commentUserInfo);
|
||||
|
||||
// 渲染之
|
||||
for(var i in comments) {
|
||||
var comment = comments[i];
|
||||
comment = self.parseComment(comment);
|
||||
}
|
||||
var html = self.tCommentsO.render({comments: comments, visitUserInfo: visitUserInfo});
|
||||
self.commentsO.append(html);
|
||||
|
||||
self.info.pageInfo = pageInfo;
|
||||
|
||||
if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) {
|
||||
self.commentsMoreO.removeClass("hide");
|
||||
} else {
|
||||
self.commentsMoreO.addClass("hide");
|
||||
}
|
||||
|
||||
self.commentsLoadingO.addClass("hide");
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
addCommentRender: function(comment){
|
||||
var self = this;
|
||||
comment = self.parseComment(comment);
|
||||
var html = self.tCommentsO.render({blogUrl: blogUrl, comments: [comment], visitUserInfo: visitUserInfo});
|
||||
self.commentsO.prepend(html);
|
||||
var li = self.commentsO.find("li").eq(0);
|
||||
li.hide();
|
||||
li.show(500);
|
||||
li.addClass("item-highlight");
|
||||
setTimeout(function() {
|
||||
li.removeClass("item-highlight");
|
||||
}, 2000);
|
||||
},
|
||||
parseComment: function(comment) {
|
||||
var self = this;
|
||||
var authorUserId = UserInfo.UserId;
|
||||
commentUserInfo = self.info.commentUserInfo;
|
||||
comment.UserInfo = commentUserInfo[comment.UserId];
|
||||
// 是作者自己
|
||||
if(visitUserInfo.UserId == UserInfo.UserId) {
|
||||
comment.IsMyNote = true;
|
||||
}
|
||||
if(comment.UserId == authorUserId) {
|
||||
comment.IsAuthorComment = true;
|
||||
}
|
||||
if(comment.UserId == visitUserInfo.UserId) {
|
||||
comment.IsMyComment = true;
|
||||
}
|
||||
// 不是回复自己
|
||||
if(comment.ToUserId && comment.ToUserId != comment.UserId) {
|
||||
comment.ToUserInfo = commentUserInfo[comment.ToUserId];
|
||||
if(comment.ToUserInfo.UserId == UserInfo.UserId) {
|
||||
comment.ToUserIsAuthor = true;
|
||||
}
|
||||
}
|
||||
comment.PublishDate = getDateDiff(Date.parse(goNowToDatetime(comment.CreatedTime)));
|
||||
return comment;
|
||||
},
|
||||
// 渲染评论
|
||||
renderComments: function() {
|
||||
var self = this;
|
||||
var comments = self.info.comments || [];
|
||||
if(comments.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 整理数据
|
||||
// 回复谁, 是否是作者?
|
||||
// 回复日期, 几天前, 刚刚
|
||||
for(var i in comments) {
|
||||
var comment = comments[i];
|
||||
comment = self.parseComment(comment);
|
||||
}
|
||||
var html = self.tCommentsO.render({blogUrl: blogUrl, comments: comments, visitUserInfo: visitUserInfo});
|
||||
self.commentsO.html(html);
|
||||
},
|
||||
|
||||
// 重新渲染likers
|
||||
reRenderLikers: function(addMe) {
|
||||
var self = this;
|
||||
var likedUsers = self.info.likedUsers || [];
|
||||
for(var i = 0; i < likedUsers.length; ++i) {
|
||||
var user = likedUsers[i];
|
||||
if(user.UserId == visitUserInfo.UserId) {
|
||||
likedUsers.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(addMe) {
|
||||
likedUsers = [visitUserInfo].concat(likedUsers);
|
||||
self.info.likedUsers = likedUsers;
|
||||
}
|
||||
self.renderLikers();
|
||||
},
|
||||
renderLikers: function() {
|
||||
var self = this;
|
||||
var users = self.info.likedUsers || [];
|
||||
var html = self.tLikersO.render({blogUrl: blogUrl, users: users});
|
||||
self.likersO.html(html);
|
||||
},
|
||||
toggleLikeBtnActive: function() {
|
||||
var self = this;
|
||||
if(self.info.isILikeIt) {
|
||||
self.likeBtnO.addClass("active");
|
||||
} else {
|
||||
self.likeBtnO.removeClass("active");
|
||||
}
|
||||
},
|
||||
commentNumO: $("#commentNum"),
|
||||
bindCommentNum: function(fix) {
|
||||
var self = this;
|
||||
self.commentNum += fix;
|
||||
self.commentNumO.text(self.commentNum);
|
||||
},
|
||||
initEvent: function() {
|
||||
var self = this;
|
||||
|
||||
// like or not
|
||||
self.likeBtnO.click(function() {
|
||||
if(!visitUserInfo.UserId) {
|
||||
needLogin();
|
||||
return;
|
||||
}
|
||||
ajaxPost(staticUrl + "/blog/likeBlog", {noteId: self.noteId}, function(ret) {
|
||||
if(ret.Ok) {
|
||||
// like
|
||||
if(ret.Item) {
|
||||
var num = self.preLikeNum+1;
|
||||
} else {
|
||||
var num = self.preLikeNum-1;
|
||||
}
|
||||
self.preLikeNum = num >= 0 ? num : 0;
|
||||
self.likeNumO.text(self.preLikeNum);
|
||||
self.info.isILikeIt = ret.Item;
|
||||
self.toggleLikeBtnActive();
|
||||
|
||||
// 重新render likers
|
||||
// 我是否在列表中
|
||||
self.reRenderLikers(ret.Item);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 显示回复回复
|
||||
$("#comments").on("click", ".comment-reply", function() {
|
||||
var form = $(this).closest("li").find("form");
|
||||
if(form.is(":hidden")) {
|
||||
form.show();
|
||||
form.find("textarea").focus();
|
||||
} else {
|
||||
form.hide();
|
||||
}
|
||||
});
|
||||
$("#comments").on("click", ".reply-cancel", function() {
|
||||
$(this).closest("form").hide();
|
||||
});
|
||||
|
||||
// 回复
|
||||
$(".comment-box").on("click", ".reply-comment-btn", function(e) {
|
||||
e.preventDefault();
|
||||
var commentId = $(this).data("comment-id");
|
||||
var $form = $(this).closest("form");
|
||||
var $content = $form.find("textarea");
|
||||
var content = $.trim($content.val());
|
||||
if(!content) {
|
||||
$content.focus();
|
||||
return;
|
||||
}
|
||||
var t = $(this);
|
||||
t.button("loading");
|
||||
var data = {noteId: self.noteId, toCommentId: commentId, content: content};
|
||||
ajaxPost(staticUrl + "/blog/comment", data, function(ret) {
|
||||
t.button("reset");
|
||||
$content.val("");
|
||||
self.bindCommentNum(1);
|
||||
if(commentId) {
|
||||
$form.hide();
|
||||
}
|
||||
|
||||
if(commentId) {
|
||||
scrollToTarget("#comments", -200);
|
||||
}
|
||||
|
||||
// 添加一个
|
||||
self.addCommentRender(ret.Item);
|
||||
});
|
||||
});
|
||||
|
||||
// 删除
|
||||
$(".comment-box").on("click", ".comment-trash", function(e) {
|
||||
var commentId = $(this).parent().data("comment-id");
|
||||
var t = this;
|
||||
BootstrapDialog.confirm(getMsg("confirmDeleteComment"), function(yes) {
|
||||
if(yes) {
|
||||
ajaxPost(staticUrl + "/blog/deleteComment", {noteId: self.noteId, commentId: commentId}, function(ret) {
|
||||
if(ret.Ok) {
|
||||
var li = $(t).closest("li");
|
||||
li.hide(500); // remove();
|
||||
setTimeout(function() {
|
||||
li.remove();
|
||||
}, 300);
|
||||
|
||||
self.bindCommentNum(-1);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 点zan
|
||||
$(".comment-box").on("click", ".comment-like", function(e) {
|
||||
var commentId = $(this).parent().data("comment-id");
|
||||
var t = this;
|
||||
|
||||
ajaxPost(staticUrl + "/blog/likeComment", {commentId: commentId}, function(re) {
|
||||
if(re.Ok) {
|
||||
var ret = re.Item;
|
||||
if(ret.Num <= 0) {
|
||||
$(t).parent().find(".like-num").addClass("hide");
|
||||
} else {
|
||||
$(t).parent().find(".like-num").removeClass("hide");
|
||||
$(t).parent().find(".like-num-i").text(ret.Num)
|
||||
}
|
||||
if(ret.IsILikeIt) {
|
||||
$(t).find(".like-text").text(getMsg("unlike"));
|
||||
} else {
|
||||
$(t).find(".like-text").text(getMsg('like'));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 举报
|
||||
function report(commentId, noteId, title) {
|
||||
var form = $("#reportMsg").html();
|
||||
var body;
|
||||
var input;
|
||||
var isOver = false;
|
||||
var modal = BootstrapDialog.show({
|
||||
title: title,
|
||||
message: form,
|
||||
nl2br: false,
|
||||
buttons: [{
|
||||
label: getMsg("cancel"),
|
||||
action: function(dialog) {
|
||||
dialog.close();
|
||||
}
|
||||
}, {
|
||||
label: getMsg("confirm"),
|
||||
cssClass: 'btn-primary',
|
||||
action: function(dialog) {
|
||||
if(isOver) {
|
||||
dialog.close();
|
||||
}
|
||||
var val = body.find("input[type='radio']:checked").val();
|
||||
if(!val) {
|
||||
var val = body.find(".input-container input").val();
|
||||
}
|
||||
if(!val) {
|
||||
body.find(".footnote").html(getMsg("chooseReason"));
|
||||
return;
|
||||
}
|
||||
ajaxPost(staticUrl + "/blog/report", {commentId: commentId, noteId: noteId, reason: val}, function(re) {
|
||||
isOver = true;
|
||||
if(reIsOk(re)) {
|
||||
body.html(getMsg("reportSuccess"));
|
||||
} else {
|
||||
body.html(getMsg("error"));
|
||||
}
|
||||
setTimeout(function() {
|
||||
dialog.close();
|
||||
}, 3000);
|
||||
});
|
||||
}
|
||||
}]
|
||||
});
|
||||
body = modal.getModalBody();
|
||||
input = body.find(".input-container");
|
||||
body.find("input[type='radio']").click(function(){
|
||||
if(!$(this).val()) {
|
||||
input.show();
|
||||
input.find("input").focus();
|
||||
} else {
|
||||
input.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
$(".comment-box").on("click", ".comment-report", function() {
|
||||
if(needLogin()) {
|
||||
return;
|
||||
}
|
||||
var commentId = $(this).parent().data("comment-id");
|
||||
report(commentId, self.noteId, getMsg("reportComment?"));
|
||||
});
|
||||
$("#reportBtn").click(function() {
|
||||
if(needLogin()) {
|
||||
return;
|
||||
}
|
||||
report("", self.noteId, getMsg("reportBlog?"));
|
||||
});
|
||||
|
||||
self.initShare();
|
||||
},
|
||||
weixinQRCodeO: $("#weixinQRCode"),
|
||||
initShare: function() {
|
||||
var self = this;
|
||||
$(".btn-weixin").click(function() {
|
||||
if(!self.weixinQRCodeO.html()) {
|
||||
self.weixinQRCodeO.qrcode(viewUrl + "/" + self.noteId);
|
||||
}
|
||||
BootstrapDialog.show({
|
||||
title: getMsg('scanQRCode'),
|
||||
message: self.weixinQRCodeO
|
||||
});
|
||||
});
|
||||
|
||||
$(".btn-share").click(function() {
|
||||
var $this = $(this);
|
||||
var map = {"btn-weibo": shareSinaWeibo, "tencent-weibo": shareTencentWeibo, "qq": shareQQ, "renren": shareRenRen};
|
||||
for(var i in map) {
|
||||
if($this.hasClass(i)) {
|
||||
map[i](self.noteId, document.title);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
C.init();
|
||||
});
|
@ -1,30 +0,0 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>归档 {{if $.curCateTitle}} - {{$.curCateTitle}}{{end}}</h2>
|
||||
</div>
|
||||
<div id="posts">
|
||||
|
||||
<div class="each-post">
|
||||
<ul>
|
||||
{{range $.archives}}
|
||||
<li><span class="archive-year">{{.Year}}</span>
|
||||
<ul>
|
||||
{{range .Posts}}
|
||||
<li>
|
||||
{{.PublicTime|date}} <a href="{{$.viewUrl}}/{{.NoteId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,41 +0,0 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>分类 - {{$.curCateTitle}}</h2>
|
||||
</div>
|
||||
<div id="posts">
|
||||
{{range $.posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}.</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,204 +0,0 @@
|
||||
<!-- 赞 -->
|
||||
<div class="entry-controls clearfix">
|
||||
<div class="vote-section-wrapper clearfix">
|
||||
<button class="btn btn-default btn-zan" id="likeBtn"><i class="fa fa-thumbs-o-up"></i> <span id="likeNum">{{.blog.LikeNum}}</span> {{msg . "like"}}</button>
|
||||
<span class="control-item read-counts"><i class="fa fa-eye"></i> {{if .blog.ReadNum}}{{.blog.ReadNum}}{{else}}1{{end}} {{msg . "viewers"}}</span>
|
||||
</div>
|
||||
<div class="right-section">
|
||||
<div id="weixinQRCode"></div>
|
||||
<!-- google+
|
||||
<g:plusone size=”medium”></g:plusone>
|
||||
-->
|
||||
<button class="btn btn-share btn-default btn-weibo"><i class="fa fa-weibo"></i> {{msg . "sinaWeibo"}}</button>
|
||||
<button class="btn btn-share btn-default btn-weixin"><i class="fa fa-wechat"></i> {{msg . "weixin"}}</button>
|
||||
<div class="dropdown" style="display: inline-block; cursor: pointer; padding: 5px 10px;">
|
||||
<!-- open -->
|
||||
<div class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown">
|
||||
<i class="fa fa-share-square-o"></i>
|
||||
{{msg . "moreShare"}}
|
||||
</div>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="#" class="btn-share tencent-weibo"><i class="fa fa-tencent-weibo"></i> {{msg . "tencentWeibo"}}</a></li>
|
||||
<li><a href="#" class="btn-share qq"><i class="fa fa-qq"></i> {{msg . "qqZone"}}</a></li>
|
||||
<li><a href="#" class="btn-share renren"><i class="fa fa-renren"></i> {{msg . "renren"}}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- 举报 -->
|
||||
{{if eq .locale "zh"}}
|
||||
<div style="display: inline-block">
|
||||
<a id="reportBtn"><i class="fa fa-flag-o"></i> {{msg . "report"}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="voters clearfix" id="likers">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/x-jsrender" id="tLikers">
|
||||
[[for users]]
|
||||
<a id="liker_[[:UserId]]" href="[[:~root.blogUrl]]/[[:Username]]" target="_blank" class="voter">
|
||||
[[if Logo]]
|
||||
<img alt="avatar" class="avatar-small" src="[[:Logo]]">
|
||||
[[else]]
|
||||
<img alt="avatar" class="avatar-small" src="/images/blog/default_avatar.png">
|
||||
[[/if]]
|
||||
</a>
|
||||
[[/for]]
|
||||
</script>
|
||||
{{if and .userBlog.CanComment (not (eq .userBlog.CommentType "disqus"))}}
|
||||
|
||||
<script type="text/x-jsrender" id="tComments">
|
||||
[[for comments]]
|
||||
<li class="comment-item">
|
||||
<!-- 头像 -->
|
||||
<a ui-hovercard="" target="_blank" class="avatar-link" title="[[:UserInfo.Username]]" href="[[:~root.blogUrl]]/[[:UserInfo.Username]]">
|
||||
<img class="avatar" src="[[:UserInfo.Logo]]">
|
||||
</a>
|
||||
<!-- 评论 -->
|
||||
<div class="comment-body">
|
||||
<div class="comment-hd">
|
||||
<a href="[[:~root.blogUrl]]/[[:UserInfo.Username]]" target="_blank" >[[:UserInfo.Username]]</a>
|
||||
[[if IsAuthorComment]]
|
||||
<span>({{msg . "author"}})</span>
|
||||
[[/if]]
|
||||
|
||||
<!-- 回复其它人 -->
|
||||
[[if ToUserInfo]]
|
||||
<span class="in-reply-to">
|
||||
{{rawMsg . "reply"}}
|
||||
<a href="[[:~root.blogUrl]]/[[:ToUserInfo.Username]]">[[:ToUserInfo.Username]]</a>
|
||||
</span>
|
||||
[[if ToUserIsAuthor]]
|
||||
<span>({{msg . "author"}})</span>
|
||||
[[/if]]
|
||||
[[/if]]
|
||||
</div>
|
||||
<div class="comment-content ng-binding" ng-bind-html="comment.content">
|
||||
[[html:Content]]
|
||||
</div>
|
||||
<div class="comment-ft clearfix" data-comment-id="[[:CommentId]]" >
|
||||
<span title="" ui-time="" class="date">[[:PublishDate]] </span>
|
||||
<span class="like-num [[if !LikeNum]]hide[[/if]]" title="[[:LikeNum]] {{rawMsg . "like"}}"><span class="like-num-i">[[:LikeNum]]</span> {{rawMsg . "like"}}</span></span>
|
||||
|
||||
[[if ~root.visitUserInfo.UserId]]
|
||||
[[if IsMyNote && !IsMyComment]]
|
||||
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> {{rawMsg . "delete"}}</a>
|
||||
[[/if]]
|
||||
[[if !IsMyComment]]
|
||||
<a href="javascript:;" class="comment-reply op-link ">
|
||||
<i class="fa fa-reply"></i>
|
||||
{{rawMsg . "reply"}}
|
||||
</a>
|
||||
<a href="javascript:;" class="comment-like op-link"><i class="fa fa-thumbs-o-up"></i> <span class="like-text">[[if IsILikeIt]]{{rawMsg . "unlike"}}[[else]]{{rawMsg . "like"}}[[/if]]</span></a>
|
||||
{{if eq .locale "zh"}}
|
||||
<a href="javascript:;" class="comment-report op-link "><i class="fa fa-flag-o"></i> {{rawMsg . "report"}}</a>
|
||||
{{end}}
|
||||
[[else]]
|
||||
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> {{rawMsg . "delete"}}</a>
|
||||
[[/if]]
|
||||
[[/if]]
|
||||
</div>
|
||||
|
||||
<!-- 回复该评论 -->
|
||||
[[if ~root.visitUserInfo.UserId]]
|
||||
<form class="comment-form comment-box-ft">
|
||||
<div class="clearfix">
|
||||
<div class="avatar-wrap">
|
||||
<img class="avatar" src="[[:~root.visitUserInfo.Logo]]">
|
||||
</div>
|
||||
<div class="editor-wrap">
|
||||
<textarea class="editable" id="commentContent" name="commentContent" placeholder="{{rawMsg . "reply"}}"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="command clearfix" style="display: block;">
|
||||
<button class="reply-comment-btn save btn btn-primary" data-comment-id="[[:CommentId]]">{{rawMsg . "comment"}}</button>
|
||||
<a class="cancel reply-cancel btn-link">{{rawMsg . "cancel"}}</a>
|
||||
</div>
|
||||
</form>
|
||||
[[/if]]
|
||||
</div>
|
||||
</li>
|
||||
[[/for]]
|
||||
</script>
|
||||
|
||||
<!-- 评论 -->
|
||||
<div class="comment-box hide">
|
||||
{{if .visitUserInfo.UserId}}
|
||||
<form class="comment-form comment-box-ft" id="commentForm">
|
||||
<div class="clearfix">
|
||||
<div class="avatar-wrap">
|
||||
<img class="avatar" src="{{.visitUserInfo.Logo}}">
|
||||
</div>
|
||||
<div class="editor-wrap">
|
||||
<textarea class="editable" id="commentContent" name="commentContent" placeholder="{{msg . "comment"}}" style="height: 100px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="command clearfix" style="display: block;">
|
||||
<button id="commentBtn" class="reply-comment-btn save btn btn-primary">{{msg . "comment"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
{{else}}
|
||||
<div class="needLogin">
|
||||
<a onclick="goLogin()">{{msg . "signIn"}}</a>, {{msg . "submitComment"}}.
|
||||
<br />
|
||||
没有帐号? <a onclick="goRegister()">{{msg . "signUp"}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="box-header">
|
||||
<span class="counter">
|
||||
<i class="icon icon-comment"></i><span id="commentNum">{{.blog.CommentNum}}</span> {{msg . "comments"}}
|
||||
</span>
|
||||
</div>
|
||||
<ul id="comments">
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="moreComments">
|
||||
<div class="hide comments-more">
|
||||
<a>More...</a>
|
||||
</div>
|
||||
<div class="comments-loading">
|
||||
<img src="/images/loading-32.gif" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{if eq .locale "zh"}}
|
||||
<div id="reportMsg" class="hide">
|
||||
<form class="report-form" name="reportForm">
|
||||
<ul class="options clearfix">
|
||||
<li><label><input required="" value="{{msg . "reportReason1"}}" name="reason" type="radio">{{msg . "reportReason1"}}</label></li>
|
||||
<li><label><input required="" value="{{msg . "reportReason2"}}" name="reason" type="radio">{{msg . "reportReason2"}}</label></li>
|
||||
<li><label><input required="" value="{{msg . "reportReason3"}}" name="reason" type="radio">{{msg . "reportReason3"}}</label></li>
|
||||
<li><label><input required="" value="{{msg . "reportReason4"}}" name="reason" type="radio">{{msg . "reportReason4"}}</label></li>
|
||||
<li><label><input required="" value="" name="reason" type="radio">{{msg . "other"}}</label></li>
|
||||
</ul>
|
||||
<p class="input-container" style="display: none">
|
||||
<input placeholder="{{msg . "reportReason"}}" type="text" name="detail" class="form-control reason-text basic-input" />
|
||||
</p>
|
||||
<p class="footnote"></p>
|
||||
</form>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{end}}
|
||||
|
||||
{{if and $.blogInfo.OpenComment (eq $.blogInfo.CommentType "disqus")}}
|
||||
|
||||
<div id="disqus_thread"></div>
|
||||
<!-- comment -->
|
||||
<script type="text/javascript">
|
||||
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
|
||||
var disqus_shortname = '{{.userBlog.DisqusId}}'; // required: replace example with your forum shortname
|
||||
var disqus_identifier = '{{.userBlog.UserId.Hex}}/{{.blog.NoteId.Hex}}/{{.blog.Title}}'; // 博客链接
|
||||
|
||||
/* * * DON'T EDIT BELOW THIS LINE * * */
|
||||
(function() {
|
||||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
||||
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||
})();
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
||||
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
|
||||
{{end}}
|
@ -1,55 +0,0 @@
|
||||
<div id="footerContainer">
|
||||
{{$userId := .userBlog.UserId.Hex}}
|
||||
<div class="container" id="footer">
|
||||
<div class="col-md-4">
|
||||
<h3>{{msg . "blogNavs"}}</h3>
|
||||
<ul>
|
||||
<li><a href="{{$.blogUrl}}/{{$.userInfo.Username}}">{{msg . "home"}}</a></li>
|
||||
{{range .notebooks}}
|
||||
<li>
|
||||
<a href="{{$.cateUrl}}/{{.NotebookId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
<li><a href="{{$.aboutMeUrl}}">{{msg . "aboutMe"}}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3>{{msg . "latestPosts"}}</h3>
|
||||
<ul>
|
||||
{{range .recentBlogs}}
|
||||
<li title="{{.Title}}"><a href="{{$.blogUrl}}/view/{{.NoteId.Hex}}/">{{.Title}}</a></li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3>{{msg . "quickLinks"}}</h3>
|
||||
<ul>
|
||||
<li><a href="{{$.noteUrl}}">{{msg . "myNote"}}</a></li>
|
||||
<li><a href="{{$.siteUrl}}/login">leanote {{msg . "login"}}</a></li>
|
||||
<li><a href="http://leanote.com" target="_blank">leanote {{msg . "home"}}</a></li>
|
||||
<li><a href="http://lea.leanote.com" target="_blank">lea++</a></li>
|
||||
<li><a href="http://bbs.leanote.com" target="_blank">leanote {{msg . "community"}}</a></li>
|
||||
<li><a href="https://github.com/leanote/leanote" target="_blank">leanote github</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="{{$.jQueryUrl}}"></script>
|
||||
<script src="{{$.bootstrapJsUrl}}"></script>
|
||||
<script src="{{$.siteUrl}}/js/bootstrap-hover-dropdown.js"></script>
|
||||
<script src="{{$.siteUrl}}/js/i18n/blog.{{.locale}}.js"></script>
|
||||
|
||||
<script>
|
||||
// 搜索
|
||||
function search(e) {
|
||||
var keywords = $("#searchInput").val();
|
||||
if(!keywords) {
|
||||
location.href = "{{$.searchUrl}}";
|
||||
} else {
|
||||
var tpl = '<form action="{{$.searchUrl}}" method="get">';
|
||||
tpl += '<input name="keywords" value="' + keywords + '" />';
|
||||
tpl += "</form";
|
||||
$(tpl).submit();
|
||||
}
|
||||
}
|
||||
</script>
|
@ -1,113 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="keywords" content="leanote,leanote.com">
|
||||
<meta name="description" content="leanote, {{msg $ "moto"}}">
|
||||
<meta name="author" content="leanote">
|
||||
|
||||
<title>我的博客</title>
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link href="{{$.bootstrapCssUrl}}" rel="stylesheet">
|
||||
<!-- 字体必须同一域 -->
|
||||
<link href="{{$.fontAwesomeUrl}}" rel="stylesheet">
|
||||
<link href="{{$.themeBaseUrl}}/style.css" rel="stylesheet">
|
||||
<link href="{{$.commentCssUrl}}" rel="stylesheet">
|
||||
<script>
|
||||
function log(o) {
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="headerAndNav" >
|
||||
<div id="headerContainer" class="container">
|
||||
<!-- 头部可放博客名, 导航 -->
|
||||
<div id="header">
|
||||
|
||||
{{$username := .userInfo.Username}}
|
||||
<h1>
|
||||
<a href="{{$.indexUrl}}" id="logo">
|
||||
{{if $.blogInfo.Logo}}
|
||||
<img src="{{$.blogInfo.Logo}}" title="{{$.blogInfo.Title}}"/>
|
||||
{{else}}
|
||||
{{$.blogInfo.Title | raw}}
|
||||
{{end}}
|
||||
</a>
|
||||
</h1>
|
||||
<div id="blogDesc">
|
||||
{{$.blogInfo.SubTitle | raw}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Static navbar -->
|
||||
<div class="navbar navbar-default">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="{{.indexUrl}}">
|
||||
{{if $.blogInfo.Logo}}
|
||||
|
||||
<img src="{{$.blogInfo.Logo}}" title="{{$.blogInfo.Title}}"/>
|
||||
{{else}}
|
||||
{{$.blogInfo.Title | raw}}
|
||||
{{end}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
|
||||
<li class="{{if $.curIsIndex}}active{{end}}"><a href="{{.indexUrl}}">主页</a></li>
|
||||
<!-- 分类页 -->
|
||||
{{range $.cates}}
|
||||
<li class="{{if eq .CateId $.curCateId}}active{{end}}">
|
||||
<a href="{{$.cateUrl}}/{{.CateId}}"
|
||||
>{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
<!-- 单页 -->
|
||||
{{range $.singles}}
|
||||
<li class="{{if eq $.curSingleId .SingleId}}active{{end}}">
|
||||
<a href="{{$.singleUrl}}/{{.SingleId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
|
||||
<!-- 归档 -->
|
||||
<li class="{{if $.curIsArchive}}active{{end}}">
|
||||
<a href="{{$.archiveUrl}}">归档</a>
|
||||
</li>
|
||||
<li class="{{if $.curIsTags}}active{{end}}">
|
||||
<a href="{{$.tagsUrl}}">标签</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<form class="navbar-form navbar-right" id="search" onsubmit="search(event);return false;">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="searchIcon" onclick="search(event);"><i class="fa fa-search"></i></span>
|
||||
<input type="text" placeholder="search" id="searchInput" class="form-control" value="{{.keywords}}">
|
||||
</div>
|
||||
</form>
|
||||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var UserInfo = {UserId: "{{$.blogInfo.UserId}}", Email: "{{.userInfo.Email}}", Username: "{{.userInfo.Username}}"};
|
||||
var UserBlogInfo={CanComment: {{.userBlog.CanComment}}, CommentType: "{{.userBlog.CommentType}}"};
|
||||
var indexUrl = "{{$.indexUrl}}";
|
||||
var viewUrl = "{{$.viewUrl}}";
|
||||
var blogUrl = "{{$.blogUrl}}";
|
||||
var staticUrl = "{{$.staticUrl}}"; // blog.leanote.com, life.leanote.com, aaa.com
|
||||
</script>
|
@ -1,9 +0,0 @@
|
||||
<!-- This file is Depreciated -->
|
||||
|
||||
<link href="/public/mdeditor/editor/google-code-prettify/prettify.css" type="text/css" rel="stylesheet">
|
||||
<script src="/public/mdeditor/editor/google-code-prettify/prettify.js"></script>
|
||||
|
||||
<script>
|
||||
$("pre").addClass("prettyprint linenums");
|
||||
prettyPrint();
|
||||
</script>
|
Before Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 83 KiB |
@ -1,39 +0,0 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
|
||||
<div id="posts">
|
||||
{{range $.posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}.</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1 +0,0 @@
|
||||
aaaaaaaaaaaaaaaaaaa
|
@ -1,27 +0,0 @@
|
||||
{{if gt $.paging.TotalPage 1}}
|
||||
|
||||
<!-- 上一页 -->
|
||||
{{if gt $.paging.CurPage 1}}
|
||||
{{set . "prePageClass" ""}}
|
||||
{{set . "prePageUrl" (urlConcat $.pagingBaseUrl "page" (incr $.paging.CurPage -1)) }}
|
||||
{{else}}
|
||||
{{set . "prePageClass" "disabled"}}
|
||||
{{set . "prePageUrl" "#"}}
|
||||
{{end}}
|
||||
|
||||
<!-- 下一页 -->
|
||||
{{if lt $.paging.CurPage $.paging.TotalPage }}
|
||||
{{set . "nextPageClass" ""}}
|
||||
{{set . "nextPageUrl" (urlConcat $.pagingBaseUrl "page" (incr $.paging.CurPage 1)) }}
|
||||
{{else}}
|
||||
{{set . "nextPageClass" "disabled"}}
|
||||
{{set . "nextPageUrl" "#"}}
|
||||
{{end}}
|
||||
|
||||
{{$.paging.CurPage}}/{{$.paging.TotalPage}}
|
||||
<ul class="pager">
|
||||
<li class="{{$.prePageClass}}"><a href="{{$.prePageUrl}}">上一页</a></li>
|
||||
<li class="{{$.nextPageClass}}"><a href="{{$.nextPageUrl}}">下一页</a></li>
|
||||
</ul>
|
||||
|
||||
{{end}}
|
@ -1,49 +0,0 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>搜索 - {{.keywords}} </h2>
|
||||
</div>
|
||||
|
||||
<div id="posts">
|
||||
{{range .posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}} |
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}</a>
|
||||
</div>
|
||||
|
||||
|
||||
{{else}}
|
||||
<div class="each-post">
|
||||
{{msg . "none"}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
{{template "blog/highlight.html"}}
|
||||
</body>
|
||||
</html>
|
@ -1,52 +0,0 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div id="posts">
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
{{.single.Title}}
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-calendar"></i> {{msg . "updatedTime"}} {{$.single.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg . "createdTime"}} {{$.single.CreatedTime | datetime}}
|
||||
</div>
|
||||
|
||||
<!-- 仅为移动端 -->
|
||||
<div class="mobile-created-time">
|
||||
{{ if $.blogInfo.UserLogo}}
|
||||
<img src="{{$.blogInfo.UserLogo}}" id="userLogo">
|
||||
{{else}}
|
||||
<img src="{{$.siteUrl}}/images/blog/default_avatar.png" id="userLogo">
|
||||
{{end}}
|
||||
{{$.blogInfo.Username}}
|
||||
</div>
|
||||
|
||||
<div class="desc" id="content">
|
||||
{{$.single.Content | raw}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "footer.html" .}}
|
||||
|
||||
{{template "highlight.html"}}
|
||||
<div id="blogNav">
|
||||
<div id="blogNavNav">
|
||||
<i class="fa fa-align-justify" title="文档导航"></i>
|
||||
<span>{{msg . "blogNav"}}</span>
|
||||
</div>
|
||||
<div id="blogNavContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 一些公用的js -->
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/common.js"></script>
|
||||
<script>
|
||||
$(function() {
|
||||
initNav();
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,542 +0,0 @@
|
||||
#posts img {
|
||||
max-width: 100%;
|
||||
}
|
||||
#content * {
|
||||
font-size: 16px;
|
||||
}
|
||||
#content h1 {
|
||||
font-size: 30px;
|
||||
}
|
||||
#content h2 {
|
||||
font-size: 24px;
|
||||
}
|
||||
#content h3 {
|
||||
font-size: 18px;
|
||||
}
|
||||
#content h4 {
|
||||
font-size: 14px;
|
||||
}
|
||||
@-webkit-keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-moz-keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-ms-keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-webkit-keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-moz-keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-ms-keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
a,
|
||||
.btn {
|
||||
-webkit-transition: all 0.2s ease;
|
||||
-moz-transition: all 0.2s ease;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
.btn:focus {
|
||||
outline: none;
|
||||
}
|
||||
ul.dropdown-menu {
|
||||
box-shadow: rgba(0, 0, 0, 0.172549) 0px 6px 12px 0px;
|
||||
}
|
||||
ul.dropdown-menu:before {
|
||||
content: "";
|
||||
width: 20px;
|
||||
height: 12px;
|
||||
position: absolute;
|
||||
top: -12px;
|
||||
right: 20px;
|
||||
background-image: url("../../images/triangle_2x.png");
|
||||
background-size: 20px 12px;
|
||||
}
|
||||
ul.dropdown-menu {
|
||||
display: block;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
}
|
||||
.open ul.dropdown-menu {
|
||||
-webkit-animation: pulldown .2s;
|
||||
animation: pulldown .2s;
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
.created-time .fa {
|
||||
color: #666;
|
||||
}
|
||||
#blogNav {
|
||||
display: none;
|
||||
background-color: #fff;
|
||||
opacity: 0.7;
|
||||
position: fixed;
|
||||
z-index: 10;
|
||||
padding: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
#blogNavContent {
|
||||
overflow-y: auto;
|
||||
max-height: 250px;
|
||||
display: none;
|
||||
-webkit-overflow-scrolling: touch !important;
|
||||
}
|
||||
#blogNavNav {
|
||||
cursor: pointer;
|
||||
}
|
||||
#blogNav a {
|
||||
color: #666;
|
||||
}
|
||||
#blogNav:hover {
|
||||
opacity: 0.9;
|
||||
}
|
||||
#blogNav a:hover {
|
||||
color: #0fb264;
|
||||
}
|
||||
#blogNav ul {
|
||||
padding-left: 20px;
|
||||
}
|
||||
#blogNav ul .nav-h2 {
|
||||
margin-left: 20px;
|
||||
}
|
||||
#blogNav ul .nav-h3 {
|
||||
margin-left: 30px;
|
||||
}
|
||||
#blogNav ul .nav-h4 {
|
||||
margin-left: 40px;
|
||||
}
|
||||
#blogNav ul .nav-h5 {
|
||||
margin-left: 50px;
|
||||
}
|
||||
.mobile-created-time {
|
||||
display: none;
|
||||
}
|
||||
#footer {
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.navbar-brand {
|
||||
display: none;
|
||||
}
|
||||
#themeList label {
|
||||
text-align: center;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
#themeList .preview {
|
||||
display: block;
|
||||
width: 400px;
|
||||
background: #fff;
|
||||
border: 1px solid #ccc;
|
||||
padding: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
src: local('Open Sans Light'), local('OpenSans-Light'), url('../../fonts/open-sans2/DXI1ORHCpsQm3Vp6mXoaTXhCUOGz7vYGh680lGh-uXM.woff') format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url('../../fonts/open-sans2/cJZKeOuBrn4kERxqtaUH3T8E0i7KZn-EPnyo3HZu7kw.woff') format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('Open Sans Bold'), local('OpenSans-Bold'), url('../../fonts/open-sans2/k3k702ZOKiLJc3WVjuplzHhCUOGz7vYGh680lGh-uXM.woff') format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url('../../fonts/open-sans2/xjAJXh38I15wypJXxuGMBobN6UDyHWBl620a-IRfuBk.woff') format('woff');
|
||||
}
|
||||
/*"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue", Helvetica, "Microsoft Yahei", Verdana, Simsun, "Segoe UI", "Segoe UI Web Regular", "Segoe UI Symbol", "BBAlpha Sans", "S60 Sans", Arial, sans-serif;*/
|
||||
::selection {
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
::-moz-selection {
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
::-webkit-selection {
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
*,
|
||||
body {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300;
|
||||
font-size: 14px;
|
||||
}
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300 !important;
|
||||
}
|
||||
a {
|
||||
cursor: pointer;
|
||||
}
|
||||
a:hover {
|
||||
text-decoration: underline !important;
|
||||
}
|
||||
#headerContainer {
|
||||
height: 230px;
|
||||
background-color: #fff;
|
||||
}
|
||||
#posts {
|
||||
width: 745px;
|
||||
margin: auto;
|
||||
}
|
||||
#postsContainer {
|
||||
background: #f5f5f5 url("../../images/noise.png");
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
/* header */
|
||||
#header {
|
||||
color: #000000;
|
||||
position: relative;
|
||||
padding: 0 0 20px 0;
|
||||
margin-top: 65px;
|
||||
}
|
||||
#header h1 {
|
||||
margin: 0;
|
||||
}
|
||||
#header h1 a {
|
||||
font-size: 48px;
|
||||
font-weight: bold;
|
||||
color: #000000;
|
||||
}
|
||||
#header h1 a img {
|
||||
height: 40px;
|
||||
}
|
||||
#header #blogDesc {
|
||||
font-size: 32px;
|
||||
font-style: italic;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.navbar {
|
||||
background-color: #f7f5e7;
|
||||
margin-bottom: 0;
|
||||
border-radius: 0;
|
||||
border: none;
|
||||
}
|
||||
.nav li a:hover {
|
||||
background-color: #000000 !important;
|
||||
color: #ffffff !important;
|
||||
}
|
||||
.nav li.active a {
|
||||
background-color: #f7f5e7 !important;
|
||||
color: #bc360a !important;
|
||||
}
|
||||
.navbar-collapse {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
.navbar-form {
|
||||
padding: 0;
|
||||
}
|
||||
/* posts */
|
||||
#posts {
|
||||
padding-top: 10px;
|
||||
}
|
||||
#posts .each-post {
|
||||
border-bottom: 1px solid #ebeff2;
|
||||
margin-bottom: 10px;
|
||||
padding: 30px;
|
||||
background-color: #fff;
|
||||
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 3px;
|
||||
}
|
||||
#posts .each-post .title {
|
||||
font-size: 48px;
|
||||
color: #000000;
|
||||
padding: 0 0 15px 0;
|
||||
}
|
||||
#posts .each-post .title a {
|
||||
font-size: 48px;
|
||||
color: #000000;
|
||||
padding: 0 0 15px 0;
|
||||
}
|
||||
#posts .each-post .title a:hover {
|
||||
color: #ea9629;
|
||||
}
|
||||
#posts .each-post .created-time {
|
||||
border-bottom: 1px solid #eee;
|
||||
padding-bottom: 3px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
#posts .each-post .more {
|
||||
background: #000000;
|
||||
padding: 9px 10px;
|
||||
border-radius: 2px;
|
||||
line-height: 1;
|
||||
font-size: 13px;
|
||||
display: inline-block;
|
||||
text-transform: uppercase;
|
||||
margin-top: 15px;
|
||||
margin-bottom: 15px;
|
||||
color: #fff;
|
||||
}
|
||||
#disqus_thread {
|
||||
border-top: 1px solid #eee;
|
||||
padding: 5px 0 0 0;
|
||||
}
|
||||
#search {
|
||||
width: 150px;
|
||||
}
|
||||
#footerContainer {
|
||||
background-color: #ffffff;
|
||||
color: #666666;
|
||||
}
|
||||
#footerContainer #footer a {
|
||||
color: #666666;
|
||||
}
|
||||
#footerContainer #footer ul {
|
||||
list-style: none;
|
||||
margin-bottom: 10px ;
|
||||
padding-left: 20px;
|
||||
}
|
||||
@media screen and (max-width: 600px) {
|
||||
html,
|
||||
body {
|
||||
overflow-x: hidden;
|
||||
background-color: #fbfcf7;
|
||||
}
|
||||
* {
|
||||
font-size: 16px;
|
||||
}
|
||||
#headerContainer,
|
||||
#footerContainer {
|
||||
background-color: #fbfcf7;
|
||||
margin: 10px 0;
|
||||
}
|
||||
#posts .each-post,
|
||||
#postsContainer {
|
||||
background-color: #fbfcf7 !important;
|
||||
}
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
#posts .each-post {
|
||||
padding: 10px;
|
||||
}
|
||||
#posts .each-post .title {
|
||||
font-size: 24px;
|
||||
border-left: 5px solid #65bd77;
|
||||
font-weight: bold;
|
||||
padding: 5px 0;
|
||||
padding-left: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.container {
|
||||
padding-right: 10px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
.created-time {
|
||||
display: none;
|
||||
}
|
||||
.mobile-created-time {
|
||||
display: block;
|
||||
}
|
||||
.mobile-created-time #userLogo {
|
||||
display: inline-block;
|
||||
max-height: 40px;
|
||||
width: 40px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
#content {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.right-section .dropdown,
|
||||
.right-section .btn {
|
||||
display: none !important;
|
||||
}
|
||||
#blogNav {
|
||||
left: initial !important;
|
||||
right: 10px !important;
|
||||
}
|
||||
#postsContainer .container,
|
||||
#footerContainer .container {
|
||||
max-width: 100%;
|
||||
}
|
||||
#postsContainer {
|
||||
margin: 0 !important;
|
||||
max-width: 100%;
|
||||
padding-top: 10px;
|
||||
background: #f5f5f5 url("../../images/noise.png");
|
||||
}
|
||||
#posts {
|
||||
max-width: 100% !important;
|
||||
}
|
||||
#footerContainer #footer a {
|
||||
padding: 3px;
|
||||
}
|
||||
#footerContainer #footer a:hover,
|
||||
#footerContainer #footer a:focus {
|
||||
color: #65bd77;
|
||||
}
|
||||
#headerAndNav {
|
||||
position: initial;
|
||||
text-align: left;
|
||||
width: 100%;
|
||||
border-bottom: 2px dashed #ebeff2;
|
||||
}
|
||||
#headerAndNav #headerContainer {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
padding-top: 30px;
|
||||
}
|
||||
#headerAndNav #header {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
#headerAndNav #header h1 {
|
||||
display: none;
|
||||
}
|
||||
#headerAndNav .navbar-collapse {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
#headerAndNav #blogDesc {
|
||||
border: none;
|
||||
margin-top: 20px;
|
||||
font-size: 24px;
|
||||
}
|
||||
#headerAndNav .navbar-brand {
|
||||
display: inline-block;
|
||||
line-height: 50px;
|
||||
padding: 0;
|
||||
padding-left: 10px;
|
||||
}
|
||||
#headerAndNav .navbar-brand img {
|
||||
height: 40px;
|
||||
}
|
||||
#headerAndNav .navbar .container {
|
||||
width: auto;
|
||||
padding: 0 15px;
|
||||
}
|
||||
#headerAndNav .navbar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
background: #fbfcf7;
|
||||
z-index: 1000;
|
||||
border-bottom: 1px solid #DEDDDF;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), inset 0 1px 0 #ffffff;
|
||||
background-color: #FDFFF5;
|
||||
}
|
||||
#headerAndNav .navbar-nav {
|
||||
margin: 0 10px;
|
||||
}
|
||||
#headerAndNav .navbar-nav a {
|
||||
padding-left: 10px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
#headerAndNav #search {
|
||||
width: 100%;
|
||||
margin: 10px;
|
||||
}
|
||||
#headerAndNav .navbar-form {
|
||||
border: none;
|
||||
}
|
||||
#myTab,
|
||||
.tab-content {
|
||||
padding: 0 10px;
|
||||
}
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>标签 - {{.curTag}} </h2>
|
||||
</div>
|
||||
|
||||
<div id="posts">
|
||||
{{range .posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}} |
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}</a>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="each-post">
|
||||
{{msg . "none"}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
{{template "blog/highlight.html"}}
|
||||
</body>
|
||||
</html>
|
@ -1,26 +0,0 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>标签</h2>
|
||||
</div>
|
||||
<div id="posts">
|
||||
|
||||
<div class="each-post">
|
||||
<ul>
|
||||
{{range $.tags}}
|
||||
<li>
|
||||
<a href="{{$.tagPostsUrl}}/{{.Tag}}">
|
||||
{{.Tag}} <span class="label label-default">{{.Count}}</span>
|
||||
</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,27 +0,0 @@
|
||||
/*
|
||||
以下是本主题的配置, 采用JSON格式
|
||||
其中Name, Version, Author, AuthorUrl是必填项(注意首字大写)
|
||||
你也可以定义其它的配置, 如FriendLinks, 在模板文件使用 $.themeInfo.FriendLinks来获取值
|
||||
|
||||
注意:
|
||||
1) JSON语法严格, 键必须用双引号, 最后不得有空','来结尾
|
||||
2) 以下配置不能包含任何注释, 不然解析会出错!
|
||||
|
||||
请在此解析所有配置
|
||||
* Name 主题名
|
||||
* Version 主题版本
|
||||
* Author 主题的作者
|
||||
* AuthorUrl 作者的博客链接或相关链接
|
||||
|
||||
* FriendLinks 友情链接
|
||||
|
||||
*/
|
||||
{
|
||||
"Name": "leanote default theme",
|
||||
"Version": "1.0",
|
||||
"Author": "leanote.com",
|
||||
"AuthorUrl": "http://leanote.com",
|
||||
"FriendLinks": [
|
||||
{"Title": "leanote", "Url": "http://leanote.com"}
|
||||
]
|
||||
}
|
@ -1,140 +0,0 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div id="posts">
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
{{.post.Title}}
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .post.Tags}}
|
||||
{{blogTags $ .post.Tags}}
|
||||
{{else}}
|
||||
{{msg . "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg . "updatedTime"}} {{$.post.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg . "createdTime"}} {{$.post.CreatedTime | datetime}}
|
||||
</div>
|
||||
|
||||
<!-- 仅为移动端 -->
|
||||
<div class="mobile-created-time">
|
||||
{{ if $.blogInfo.UserLogo}}
|
||||
<img src="{{$.blogInfo.UserLogo}}" id="userLogo">
|
||||
{{else}}
|
||||
<img src="{{$.siteUrl}}/images/blog/default_avatar.png" id="userLogo">
|
||||
{{end}}
|
||||
{{$.blogInfo.Username}}
|
||||
|
||||
{{if .post.Tags}}
|
||||
|
||||
<i class="fa fa-bookmark-o" style="color: #666"></i>
|
||||
{{blogTags $ $.post.Tags}}
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
<div class="desc" id="content">
|
||||
{{if $.post.IsMarkdown }}
|
||||
<div id="markdownContent" style="display: none">
|
||||
<!-- 用textarea装html, 防止得到的值失真 -->
|
||||
<textarea>{{$.post.Content | raw}}</textarea>
|
||||
</div>
|
||||
<div style="padding: 20px; text-align: center">
|
||||
<img src="{{$.themeBaseUrl}}/images/loading-32.gif" />
|
||||
</div>
|
||||
{{else}}
|
||||
{{$.post.Content | raw}}
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
<div class="pre-next-post">
|
||||
<p>
|
||||
上一篇: {{if $.prePost}}<a href="{{$.viewUrl}}/{{$.prePost.NoteId}}">{{$.prePost.Title}}</a>{{else}}无{{end}}
|
||||
</p>
|
||||
<p>
|
||||
下一篇: {{if $.nextPost}}<a href="{{$.viewUrl}}/{{$.nextPost.NoteId}}">{{$.nextPost.Title}}</a>{{else}}无{{end}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- share & comment -->
|
||||
{{template "comment.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "footer.html" .}}
|
||||
|
||||
{{template "highlight.html"}}
|
||||
<div id="blogNav">
|
||||
<div id="blogNavNav">
|
||||
<i class="fa fa-align-justify" title="文档导航"></i>
|
||||
<span>{{msg . "blogNav"}}</span>
|
||||
</div>
|
||||
<div id="blogNavContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 一些在comment.js 需要使用的变量 -->
|
||||
<script>
|
||||
var visitUserInfo = eval("(" + {{.visitUserInfoJson}} + ")");
|
||||
var urlPrefix = "{{$.leanoteUrl}}";
|
||||
var noteId = "{{$.post.NoteId}}";
|
||||
var preLikeNum = +"{{.blog.likeNum}}";
|
||||
var commentNum = +"{{.blog.commentNum}}";
|
||||
</script>
|
||||
|
||||
<!-- 一些公用的js -->
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/common.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/jsrender.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/jquery-cookie-min.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/bootstrap-dialog.min.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/jquery.qrcode.min.js"></script>
|
||||
|
||||
<!-- share && comment -->
|
||||
<script src="{{$.themeBaseUrl}}/view.js"></script>
|
||||
|
||||
<!--
|
||||
markdown
|
||||
调用markdown来解析得到html
|
||||
-->
|
||||
|
||||
{{if $.post.IsMarkdown }}
|
||||
<script src="/public/mdeditor/editor/pagedown/Markdown.Converter.js"></script>
|
||||
<script src="/public/mdeditor/editor/pagedown/Markdown.Sanitizer.js"></script>
|
||||
<script src="/public/mdeditor/editor/pagedown/Markdown.Editor.js"></script>
|
||||
<script src="/public/mdeditor/editor/pagedown/local/Markdown.local.zh.js"></script>
|
||||
<script src="/public/mdeditor/editor/Markdown.Extra.js"></script>
|
||||
|
||||
<!--mathjax-->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ["\\(","\\)"]], processEscapes: true }, messageStyle: "none"});
|
||||
</script>
|
||||
<script src="/public/mdeditor/editor/mathJax.js"></script>
|
||||
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
|
||||
<script>
|
||||
var content = $.trim($("#markdownContent textarea").val());
|
||||
var converter = Markdown.getSanitizingConverter();
|
||||
Markdown.Extra.init(converter, {extensions: ["tables", "fenced_code_gfm", "def_list"]});
|
||||
var html = converter.makeHtml(content);
|
||||
$("#content").html(html);
|
||||
$("pre").addClass("prettyprint linenums");
|
||||
prettyPrint();
|
||||
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"wmd-preview"]);
|
||||
|
||||
initNav();
|
||||
weixin();
|
||||
</script>
|
||||
|
||||
<!-- 不是markdown -->
|
||||
{{else}}
|
||||
<script>
|
||||
$(function() {
|
||||
initNav();
|
||||
weixin();
|
||||
});
|
||||
</script>
|
||||
{{end}}
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,509 +0,0 @@
|
||||
function scrollTo(self, tagName, text) {
|
||||
var iframe = $("#content");
|
||||
var target = iframe.find(tagName + ":contains(" + text + ")");
|
||||
|
||||
// 找到是第几个
|
||||
// 在nav是第几个
|
||||
var navs = $('#blogNavContent [data-a="' + tagName + '-' + encodeURI(text) + '"]');
|
||||
var len = navs.size();
|
||||
for(var i = 0; i < len; ++i) {
|
||||
if(navs[i] == self) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (target.size() >= i+1) {
|
||||
target = target.eq(i);
|
||||
// 之前插入, 防止多行定位不准
|
||||
var top = target.offset().top;
|
||||
if(LEA.isMobile) {
|
||||
top -= 50;
|
||||
}
|
||||
var nowTop = $(document).scrollTop();
|
||||
// 用$("body").scrllTop(10)没反应 firefox下
|
||||
$('html,body').animate({scrollTop: top}, 200);
|
||||
return;
|
||||
}
|
||||
}
|
||||
function genNav() {
|
||||
var $con = $("#content");
|
||||
var html = $con.html();
|
||||
// 构造一棵树
|
||||
// {"h1-title":{h2-title:{}}}
|
||||
var tree = [];//[{title: "xx", children:[{}]}, {title:"xx2"}];
|
||||
var hs = $con.find("h1,h2,h3,h4,h5,h6").toArray();
|
||||
var titles = '<ul>';
|
||||
for(var i = 0; i < hs.length; ++i) {
|
||||
var text = $(hs[i]).text();
|
||||
var tagName = hs[i].tagName.toLowerCase();
|
||||
// scrollTo在page.js中定义
|
||||
titles += '<li class="nav-' + tagName + '"><a data-a="' + tagName + '-' + encodeURI(text)+'" onclick="scrollTo(this, \'' + tagName + '\', \'' + text + '\')">' + text + '</a></li>';
|
||||
}
|
||||
titles += "</ul>";
|
||||
$("#blogNavContent").html(titles);
|
||||
if(!hs.length) {
|
||||
$("#blogNavContent").html(getMsg("none"));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function initNav() {
|
||||
var hasNav = genNav();
|
||||
if(!hasNav) {
|
||||
return;
|
||||
}
|
||||
|
||||
var $title = $(".title");
|
||||
var titlePos = $title.offset();
|
||||
var top = titlePos.top + 10;// - $title.height();
|
||||
// 手机下不要与标题在同一高度
|
||||
if(LEA.isMobile){
|
||||
top += 30;
|
||||
}
|
||||
if(top < 0) {
|
||||
top = 10;
|
||||
}
|
||||
|
||||
var left = $title.width() + titlePos.left - 100;
|
||||
$("#blogNav").css("top", top).css("left", left);
|
||||
$("#blogNav").show();
|
||||
|
||||
$("#blogNavNav").click(function() {
|
||||
var $o = $("#blogNavContent");
|
||||
if($o.is(":hidden")) {
|
||||
$o.show();
|
||||
} else {
|
||||
$o.hide();
|
||||
}
|
||||
});
|
||||
|
||||
var $d = $(document);
|
||||
function reNav() {
|
||||
var vtop = $d.scrollTop();
|
||||
if(vtop <= top) {
|
||||
$("#blogNav").css("top", top-vtop);
|
||||
} else {
|
||||
// 差距很磊了
|
||||
if(LEA.isMobile) {
|
||||
$("#blogNav").css("top", 50);
|
||||
} else {
|
||||
$("#blogNav").css("top", 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
reNav();
|
||||
$(window).scroll(reNav);
|
||||
}
|
||||
|
||||
var C = {
|
||||
info: null,
|
||||
noteId: noteId,
|
||||
preLikeNum: preLikeNum,
|
||||
commentNum: commentNum,
|
||||
likeBtnO: $("#likeBtn"),
|
||||
likeNumO: $("#likeNum"),
|
||||
tLikersO: $("#tLikers"),
|
||||
likersO: $("#likers"),
|
||||
tCommentsO: $("#tComments"),
|
||||
commentsO: $("#comments"),
|
||||
|
||||
commentBtnO: $("#commentBtn"),
|
||||
|
||||
commentsLoadingO: $(".comments-loading"),
|
||||
commentsMoreO: $(".comments-more"),
|
||||
|
||||
commentBoxO: $(".comment-box"),
|
||||
init: function() {
|
||||
var self = this;
|
||||
if(UserBlogInfo.CanComment && UserBlogInfo.CommentType != "disqus") {
|
||||
self.initLikeAndComments();
|
||||
} else {
|
||||
self.initLike();
|
||||
}
|
||||
self.initEvent();
|
||||
self.incReadNum();
|
||||
},
|
||||
incReadNum: function() {
|
||||
var self = this;
|
||||
if(!$.cookie(self.noteId)) {
|
||||
$.cookie(self.noteId, 1);
|
||||
ajaxGet(staticUrl + "/blog/incReadNum", {noteId: self.noteId});
|
||||
}
|
||||
},
|
||||
initLike: function() {
|
||||
var self = this;
|
||||
ajaxGet(staticUrl + "/blog/getLike", {noteId: self.noteId}, function(ret) {
|
||||
self.info = ret;
|
||||
self.toggleLikeBtnActive();
|
||||
self.renderLikers();
|
||||
});
|
||||
},
|
||||
initLikeAndComments: function() {
|
||||
var self = this;
|
||||
ajaxGet(staticUrl + "/blog/getLikeAndComments", {noteId: self.noteId}, function(ret) {
|
||||
self.info = ret;
|
||||
self.toggleLikeBtnActive();
|
||||
self.renderLikers();
|
||||
// 是否需要renderComments?
|
||||
self.info.commentUserInfo = self.info.commentUserInfo || {};
|
||||
// 为了防止第一条评论找不到用户信息情况
|
||||
if(visitUserInfo.UserId) {
|
||||
self.info.commentUserInfo[visitUserInfo.UserId] = visitUserInfo;
|
||||
}
|
||||
self.renderComments();
|
||||
|
||||
self.commentBoxO.removeClass("hide");
|
||||
self.commentsLoadingO.addClass("hide");
|
||||
if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) {
|
||||
self.commentsMoreO.removeClass("hide");
|
||||
self.initMoreComments();
|
||||
}
|
||||
});
|
||||
},
|
||||
initMoreComments: function() {
|
||||
var self = this;
|
||||
self.commentsMoreO.find("a").click(function(){
|
||||
if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) {
|
||||
self.commentsMoreO.addClass("hide");
|
||||
self.commentsLoadingO.removeClass("hide");
|
||||
ajaxGet(staticUrl + "/blog/listComments", {noteId: self.noteId, page: self.info.pageInfo.CurPage+1}, function(ret) {
|
||||
var pageInfo = ret.pageInfo;
|
||||
var comments = ret.comments;
|
||||
var commentUserInfo = ret.commentUserInfo;
|
||||
|
||||
$.extend(self.info.commentUserInfo, commentUserInfo);
|
||||
|
||||
// 渲染之
|
||||
for(var i in comments) {
|
||||
var comment = comments[i];
|
||||
comment = self.parseComment(comment);
|
||||
}
|
||||
var html = self.tCommentsO.render({comments: comments, visitUserInfo: visitUserInfo});
|
||||
self.commentsO.append(html);
|
||||
|
||||
self.info.pageInfo = pageInfo;
|
||||
|
||||
if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) {
|
||||
self.commentsMoreO.removeClass("hide");
|
||||
} else {
|
||||
self.commentsMoreO.addClass("hide");
|
||||
}
|
||||
|
||||
self.commentsLoadingO.addClass("hide");
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
addCommentRender: function(comment){
|
||||
var self = this;
|
||||
comment = self.parseComment(comment);
|
||||
var html = self.tCommentsO.render({blogUrl: blogUrl, comments: [comment], visitUserInfo: visitUserInfo});
|
||||
self.commentsO.prepend(html);
|
||||
var li = self.commentsO.find("li").eq(0);
|
||||
li.hide();
|
||||
li.show(500);
|
||||
li.addClass("item-highlight");
|
||||
setTimeout(function() {
|
||||
li.removeClass("item-highlight");
|
||||
}, 2000);
|
||||
},
|
||||
parseComment: function(comment) {
|
||||
var self = this;
|
||||
var authorUserId = UserInfo.UserId;
|
||||
commentUserInfo = self.info.commentUserInfo;
|
||||
comment.UserInfo = commentUserInfo[comment.UserId];
|
||||
// 是作者自己
|
||||
if(visitUserInfo.UserId == UserInfo.UserId) {
|
||||
comment.IsMyNote = true;
|
||||
}
|
||||
if(comment.UserId == authorUserId) {
|
||||
comment.IsAuthorComment = true;
|
||||
}
|
||||
if(comment.UserId == visitUserInfo.UserId) {
|
||||
comment.IsMyComment = true;
|
||||
}
|
||||
// 不是回复自己
|
||||
if(comment.ToUserId && comment.ToUserId != comment.UserId) {
|
||||
comment.ToUserInfo = commentUserInfo[comment.ToUserId];
|
||||
if(comment.ToUserInfo.UserId == UserInfo.UserId) {
|
||||
comment.ToUserIsAuthor = true;
|
||||
}
|
||||
}
|
||||
comment.PublishDate = getDateDiff(Date.parse(goNowToDatetime(comment.CreatedTime)));
|
||||
return comment;
|
||||
},
|
||||
// 渲染评论
|
||||
renderComments: function() {
|
||||
var self = this;
|
||||
var comments = self.info.comments || [];
|
||||
if(comments.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 整理数据
|
||||
// 回复谁, 是否是作者?
|
||||
// 回复日期, 几天前, 刚刚
|
||||
for(var i in comments) {
|
||||
var comment = comments[i];
|
||||
comment = self.parseComment(comment);
|
||||
}
|
||||
var html = self.tCommentsO.render({blogUrl: blogUrl, comments: comments, visitUserInfo: visitUserInfo});
|
||||
self.commentsO.html(html);
|
||||
},
|
||||
|
||||
// 重新渲染likers
|
||||
reRenderLikers: function(addMe) {
|
||||
var self = this;
|
||||
var likedUsers = self.info.likedUsers || [];
|
||||
for(var i = 0; i < likedUsers.length; ++i) {
|
||||
var user = likedUsers[i];
|
||||
if(user.UserId == visitUserInfo.UserId) {
|
||||
likedUsers.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(addMe) {
|
||||
likedUsers = [visitUserInfo].concat(likedUsers);
|
||||
self.info.likedUsers = likedUsers;
|
||||
}
|
||||
self.renderLikers();
|
||||
},
|
||||
renderLikers: function() {
|
||||
var self = this;
|
||||
var users = self.info.likedUsers || [];
|
||||
var html = self.tLikersO.render({blogUrl: blogUrl, users: users});
|
||||
self.likersO.html(html);
|
||||
},
|
||||
toggleLikeBtnActive: function() {
|
||||
var self = this;
|
||||
if(self.info.isILikeIt) {
|
||||
self.likeBtnO.addClass("active");
|
||||
} else {
|
||||
self.likeBtnO.removeClass("active");
|
||||
}
|
||||
},
|
||||
commentNumO: $("#commentNum"),
|
||||
bindCommentNum: function(fix) {
|
||||
var self = this;
|
||||
self.commentNum += fix;
|
||||
self.commentNumO.text(self.commentNum);
|
||||
},
|
||||
initEvent: function() {
|
||||
var self = this;
|
||||
|
||||
// like or not
|
||||
self.likeBtnO.click(function() {
|
||||
if(!visitUserInfo.UserId) {
|
||||
needLogin();
|
||||
return;
|
||||
}
|
||||
ajaxPost(staticUrl + "/blog/likeBlog", {noteId: self.noteId}, function(ret) {
|
||||
if(ret.Ok) {
|
||||
// like
|
||||
if(ret.Item) {
|
||||
var num = self.preLikeNum+1;
|
||||
} else {
|
||||
var num = self.preLikeNum-1;
|
||||
}
|
||||
self.preLikeNum = num >= 0 ? num : 0;
|
||||
self.likeNumO.text(self.preLikeNum);
|
||||
self.info.isILikeIt = ret.Item;
|
||||
self.toggleLikeBtnActive();
|
||||
|
||||
// 重新render likers
|
||||
// 我是否在列表中
|
||||
self.reRenderLikers(ret.Item);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 显示回复回复
|
||||
$("#comments").on("click", ".comment-reply", function() {
|
||||
var form = $(this).closest("li").find("form");
|
||||
if(form.is(":hidden")) {
|
||||
form.show();
|
||||
form.find("textarea").focus();
|
||||
} else {
|
||||
form.hide();
|
||||
}
|
||||
});
|
||||
$("#comments").on("click", ".reply-cancel", function() {
|
||||
$(this).closest("form").hide();
|
||||
});
|
||||
|
||||
// 回复
|
||||
$(".comment-box").on("click", ".reply-comment-btn", function(e) {
|
||||
e.preventDefault();
|
||||
var commentId = $(this).data("comment-id");
|
||||
var $form = $(this).closest("form");
|
||||
var $content = $form.find("textarea");
|
||||
var content = $.trim($content.val());
|
||||
if(!content) {
|
||||
$content.focus();
|
||||
return;
|
||||
}
|
||||
var t = $(this);
|
||||
t.button("loading");
|
||||
var data = {noteId: self.noteId, toCommentId: commentId, content: content};
|
||||
ajaxPost(staticUrl + "/blog/comment", data, function(ret) {
|
||||
t.button("reset");
|
||||
$content.val("");
|
||||
self.bindCommentNum(1);
|
||||
if(commentId) {
|
||||
$form.hide();
|
||||
}
|
||||
|
||||
if(commentId) {
|
||||
scrollToTarget("#comments", -200);
|
||||
}
|
||||
|
||||
// 添加一个
|
||||
self.addCommentRender(ret.Item);
|
||||
});
|
||||
});
|
||||
|
||||
// 删除
|
||||
$(".comment-box").on("click", ".comment-trash", function(e) {
|
||||
var commentId = $(this).parent().data("comment-id");
|
||||
var t = this;
|
||||
BootstrapDialog.confirm(getMsg("confirmDeleteComment"), function(yes) {
|
||||
if(yes) {
|
||||
ajaxPost(staticUrl + "/blog/deleteComment", {noteId: self.noteId, commentId: commentId}, function(ret) {
|
||||
if(ret.Ok) {
|
||||
var li = $(t).closest("li");
|
||||
li.hide(500); // remove();
|
||||
setTimeout(function() {
|
||||
li.remove();
|
||||
}, 300);
|
||||
|
||||
self.bindCommentNum(-1);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 点zan
|
||||
$(".comment-box").on("click", ".comment-like", function(e) {
|
||||
var commentId = $(this).parent().data("comment-id");
|
||||
var t = this;
|
||||
|
||||
ajaxPost(staticUrl + "/blog/likeComment", {commentId: commentId}, function(re) {
|
||||
if(re.Ok) {
|
||||
var ret = re.Item;
|
||||
if(ret.Num <= 0) {
|
||||
$(t).parent().find(".like-num").addClass("hide");
|
||||
} else {
|
||||
$(t).parent().find(".like-num").removeClass("hide");
|
||||
$(t).parent().find(".like-num-i").text(ret.Num)
|
||||
}
|
||||
if(ret.IsILikeIt) {
|
||||
$(t).find(".like-text").text(getMsg("unlike"));
|
||||
} else {
|
||||
$(t).find(".like-text").text(getMsg('like'));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 举报
|
||||
function report(commentId, noteId, title) {
|
||||
var form = $("#reportMsg").html();
|
||||
var body;
|
||||
var input;
|
||||
var isOver = false;
|
||||
var modal = BootstrapDialog.show({
|
||||
title: title,
|
||||
message: form,
|
||||
nl2br: false,
|
||||
buttons: [{
|
||||
label: getMsg("cancel"),
|
||||
action: function(dialog) {
|
||||
dialog.close();
|
||||
}
|
||||
}, {
|
||||
label: getMsg("confirm"),
|
||||
cssClass: 'btn-primary',
|
||||
action: function(dialog) {
|
||||
if(isOver) {
|
||||
dialog.close();
|
||||
}
|
||||
var val = body.find("input[type='radio']:checked").val();
|
||||
if(!val) {
|
||||
var val = body.find(".input-container input").val();
|
||||
}
|
||||
if(!val) {
|
||||
body.find(".footnote").html(getMsg("chooseReason"));
|
||||
return;
|
||||
}
|
||||
ajaxPost(staticUrl + "/blog/report", {commentId: commentId, noteId: noteId, reason: val}, function(re) {
|
||||
isOver = true;
|
||||
if(reIsOk(re)) {
|
||||
body.html(getMsg("reportSuccess"));
|
||||
} else {
|
||||
body.html(getMsg("error"));
|
||||
}
|
||||
setTimeout(function() {
|
||||
dialog.close();
|
||||
}, 3000);
|
||||
});
|
||||
}
|
||||
}]
|
||||
});
|
||||
body = modal.getModalBody();
|
||||
input = body.find(".input-container");
|
||||
body.find("input[type='radio']").click(function(){
|
||||
if(!$(this).val()) {
|
||||
input.show();
|
||||
input.find("input").focus();
|
||||
} else {
|
||||
input.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
$(".comment-box").on("click", ".comment-report", function() {
|
||||
if(needLogin()) {
|
||||
return;
|
||||
}
|
||||
var commentId = $(this).parent().data("comment-id");
|
||||
report(commentId, self.noteId, getMsg("reportComment?"));
|
||||
});
|
||||
$("#reportBtn").click(function() {
|
||||
if(needLogin()) {
|
||||
return;
|
||||
}
|
||||
report("", self.noteId, getMsg("reportBlog?"));
|
||||
});
|
||||
|
||||
self.initShare();
|
||||
},
|
||||
weixinQRCodeO: $("#weixinQRCode"),
|
||||
initShare: function() {
|
||||
var self = this;
|
||||
$(".btn-weixin").click(function() {
|
||||
if(!self.weixinQRCodeO.html()) {
|
||||
self.weixinQRCodeO.qrcode(viewUrl + "/" + self.noteId);
|
||||
}
|
||||
BootstrapDialog.show({
|
||||
title: getMsg('scanQRCode'),
|
||||
message: self.weixinQRCodeO
|
||||
});
|
||||
});
|
||||
|
||||
$(".btn-share").click(function() {
|
||||
var $this = $(this);
|
||||
var map = {"btn-weibo": shareSinaWeibo, "tencent-weibo": shareTencentWeibo, "qq": shareQQ, "renren": shareRenRen};
|
||||
for(var i in map) {
|
||||
if($this.hasClass(i)) {
|
||||
map[i](self.noteId, document.title);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
C.init();
|
||||
});
|
@ -1,30 +0,0 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>归档 {{if $.curCateTitle}} - {{$.curCateTitle}}{{end}}</h2>
|
||||
</div>
|
||||
<div id="posts">
|
||||
|
||||
<div class="each-post">
|
||||
<ul>
|
||||
{{range $.archives}}
|
||||
<li><span class="archive-year">{{.Year}}</span>
|
||||
<ul>
|
||||
{{range .Posts}}
|
||||
<li>
|
||||
{{.PublicTime|date}} <a href="{{$.viewUrl}}/{{.NoteId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,41 +0,0 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>分类 - {{$.curCateTitle}}</h2>
|
||||
</div>
|
||||
<div id="posts">
|
||||
{{range $.posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}.</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,204 +0,0 @@
|
||||
<!-- 赞 -->
|
||||
<div class="entry-controls clearfix">
|
||||
<div class="vote-section-wrapper clearfix">
|
||||
<button class="btn btn-default btn-zan" id="likeBtn"><i class="fa fa-thumbs-o-up"></i> <span id="likeNum">{{.blog.LikeNum}}</span> {{msg . "like"}}</button>
|
||||
<span class="control-item read-counts"><i class="fa fa-eye"></i> {{if .blog.ReadNum}}{{.blog.ReadNum}}{{else}}1{{end}} {{msg . "viewers"}}</span>
|
||||
</div>
|
||||
<div class="right-section">
|
||||
<div id="weixinQRCode"></div>
|
||||
<!-- google+
|
||||
<g:plusone size=”medium”></g:plusone>
|
||||
-->
|
||||
<button class="btn btn-share btn-default btn-weibo"><i class="fa fa-weibo"></i> {{msg . "sinaWeibo"}}</button>
|
||||
<button class="btn btn-share btn-default btn-weixin"><i class="fa fa-wechat"></i> {{msg . "weixin"}}</button>
|
||||
<div class="dropdown" style="display: inline-block; cursor: pointer; padding: 5px 10px;">
|
||||
<!-- open -->
|
||||
<div class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown">
|
||||
<i class="fa fa-share-square-o"></i>
|
||||
{{msg . "moreShare"}}
|
||||
</div>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="#" class="btn-share tencent-weibo"><i class="fa fa-tencent-weibo"></i> {{msg . "tencentWeibo"}}</a></li>
|
||||
<li><a href="#" class="btn-share qq"><i class="fa fa-qq"></i> {{msg . "qqZone"}}</a></li>
|
||||
<li><a href="#" class="btn-share renren"><i class="fa fa-renren"></i> {{msg . "renren"}}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- 举报 -->
|
||||
{{if eq .locale "zh"}}
|
||||
<div style="display: inline-block">
|
||||
<a id="reportBtn"><i class="fa fa-flag-o"></i> {{msg . "report"}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="voters clearfix" id="likers">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/x-jsrender" id="tLikers">
|
||||
[[for users]]
|
||||
<a id="liker_[[:UserId]]" href="[[:~root.blogUrl]]/[[:Username]]" target="_blank" class="voter">
|
||||
[[if Logo]]
|
||||
<img alt="avatar" class="avatar-small" src="[[:Logo]]">
|
||||
[[else]]
|
||||
<img alt="avatar" class="avatar-small" src="/images/blog/default_avatar.png">
|
||||
[[/if]]
|
||||
</a>
|
||||
[[/for]]
|
||||
</script>
|
||||
{{if and .userBlog.CanComment (not (eq .userBlog.CommentType "disqus"))}}
|
||||
|
||||
<script type="text/x-jsrender" id="tComments">
|
||||
[[for comments]]
|
||||
<li class="comment-item">
|
||||
<!-- 头像 -->
|
||||
<a ui-hovercard="" target="_blank" class="avatar-link" title="[[:UserInfo.Username]]" href="[[:~root.blogUrl]]/[[:UserInfo.Username]]">
|
||||
<img class="avatar" src="[[:UserInfo.Logo]]">
|
||||
</a>
|
||||
<!-- 评论 -->
|
||||
<div class="comment-body">
|
||||
<div class="comment-hd">
|
||||
<a href="[[:~root.blogUrl]]/[[:UserInfo.Username]]" target="_blank" >[[:UserInfo.Username]]</a>
|
||||
[[if IsAuthorComment]]
|
||||
<span>({{msg . "author"}})</span>
|
||||
[[/if]]
|
||||
|
||||
<!-- 回复其它人 -->
|
||||
[[if ToUserInfo]]
|
||||
<span class="in-reply-to">
|
||||
{{rawMsg . "reply"}}
|
||||
<a href="[[:~root.blogUrl]]/[[:ToUserInfo.Username]]">[[:ToUserInfo.Username]]</a>
|
||||
</span>
|
||||
[[if ToUserIsAuthor]]
|
||||
<span>({{msg . "author"}})</span>
|
||||
[[/if]]
|
||||
[[/if]]
|
||||
</div>
|
||||
<div class="comment-content ng-binding" ng-bind-html="comment.content">
|
||||
[[html:Content]]
|
||||
</div>
|
||||
<div class="comment-ft clearfix" data-comment-id="[[:CommentId]]" >
|
||||
<span title="" ui-time="" class="date">[[:PublishDate]] </span>
|
||||
<span class="like-num [[if !LikeNum]]hide[[/if]]" title="[[:LikeNum]] {{rawMsg . "like"}}"><span class="like-num-i">[[:LikeNum]]</span> {{rawMsg . "like"}}</span></span>
|
||||
|
||||
[[if ~root.visitUserInfo.UserId]]
|
||||
[[if IsMyNote && !IsMyComment]]
|
||||
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> {{rawMsg . "delete"}}</a>
|
||||
[[/if]]
|
||||
[[if !IsMyComment]]
|
||||
<a href="javascript:;" class="comment-reply op-link ">
|
||||
<i class="fa fa-reply"></i>
|
||||
{{rawMsg . "reply"}}
|
||||
</a>
|
||||
<a href="javascript:;" class="comment-like op-link"><i class="fa fa-thumbs-o-up"></i> <span class="like-text">[[if IsILikeIt]]{{rawMsg . "unlike"}}[[else]]{{rawMsg . "like"}}[[/if]]</span></a>
|
||||
{{if eq .locale "zh"}}
|
||||
<a href="javascript:;" class="comment-report op-link "><i class="fa fa-flag-o"></i> {{rawMsg . "report"}}</a>
|
||||
{{end}}
|
||||
[[else]]
|
||||
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> {{rawMsg . "delete"}}</a>
|
||||
[[/if]]
|
||||
[[/if]]
|
||||
</div>
|
||||
|
||||
<!-- 回复该评论 -->
|
||||
[[if ~root.visitUserInfo.UserId]]
|
||||
<form class="comment-form comment-box-ft">
|
||||
<div class="clearfix">
|
||||
<div class="avatar-wrap">
|
||||
<img class="avatar" src="[[:~root.visitUserInfo.Logo]]">
|
||||
</div>
|
||||
<div class="editor-wrap">
|
||||
<textarea class="editable" id="commentContent" name="commentContent" placeholder="{{rawMsg . "reply"}}"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="command clearfix" style="display: block;">
|
||||
<button class="reply-comment-btn save btn btn-primary" data-comment-id="[[:CommentId]]">{{rawMsg . "comment"}}</button>
|
||||
<a class="cancel reply-cancel btn-link">{{rawMsg . "cancel"}}</a>
|
||||
</div>
|
||||
</form>
|
||||
[[/if]]
|
||||
</div>
|
||||
</li>
|
||||
[[/for]]
|
||||
</script>
|
||||
|
||||
<!-- 评论 -->
|
||||
<div class="comment-box hide">
|
||||
{{if .visitUserInfo.UserId}}
|
||||
<form class="comment-form comment-box-ft" id="commentForm">
|
||||
<div class="clearfix">
|
||||
<div class="avatar-wrap">
|
||||
<img class="avatar" src="{{.visitUserInfo.Logo}}">
|
||||
</div>
|
||||
<div class="editor-wrap">
|
||||
<textarea class="editable" id="commentContent" name="commentContent" placeholder="{{msg . "comment"}}" style="height: 100px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="command clearfix" style="display: block;">
|
||||
<button id="commentBtn" class="reply-comment-btn save btn btn-primary">{{msg . "comment"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
{{else}}
|
||||
<div class="needLogin">
|
||||
<a onclick="goLogin()">{{msg . "signIn"}}</a>, {{msg . "submitComment"}}.
|
||||
<br />
|
||||
没有帐号? <a onclick="goRegister()">{{msg . "signUp"}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="box-header">
|
||||
<span class="counter">
|
||||
<i class="icon icon-comment"></i><span id="commentNum">{{.blog.CommentNum}}</span> {{msg . "comments"}}
|
||||
</span>
|
||||
</div>
|
||||
<ul id="comments">
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="moreComments">
|
||||
<div class="hide comments-more">
|
||||
<a>More...</a>
|
||||
</div>
|
||||
<div class="comments-loading">
|
||||
<img src="/images/loading-32.gif" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{if eq .locale "zh"}}
|
||||
<div id="reportMsg" class="hide">
|
||||
<form class="report-form" name="reportForm">
|
||||
<ul class="options clearfix">
|
||||
<li><label><input required="" value="{{msg . "reportReason1"}}" name="reason" type="radio">{{msg . "reportReason1"}}</label></li>
|
||||
<li><label><input required="" value="{{msg . "reportReason2"}}" name="reason" type="radio">{{msg . "reportReason2"}}</label></li>
|
||||
<li><label><input required="" value="{{msg . "reportReason3"}}" name="reason" type="radio">{{msg . "reportReason3"}}</label></li>
|
||||
<li><label><input required="" value="{{msg . "reportReason4"}}" name="reason" type="radio">{{msg . "reportReason4"}}</label></li>
|
||||
<li><label><input required="" value="" name="reason" type="radio">{{msg . "other"}}</label></li>
|
||||
</ul>
|
||||
<p class="input-container" style="display: none">
|
||||
<input placeholder="{{msg . "reportReason"}}" type="text" name="detail" class="form-control reason-text basic-input" />
|
||||
</p>
|
||||
<p class="footnote"></p>
|
||||
</form>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{end}}
|
||||
|
||||
{{if and $.blogInfo.OpenComment (eq $.blogInfo.CommentType "disqus")}}
|
||||
|
||||
<div id="disqus_thread"></div>
|
||||
<!-- comment -->
|
||||
<script type="text/javascript">
|
||||
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
|
||||
var disqus_shortname = '{{.userBlog.DisqusId}}'; // required: replace example with your forum shortname
|
||||
var disqus_identifier = '{{.userBlog.UserId.Hex}}/{{.blog.NoteId.Hex}}/{{.blog.Title}}'; // 博客链接
|
||||
|
||||
/* * * DON'T EDIT BELOW THIS LINE * * */
|
||||
(function() {
|
||||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
||||
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||
})();
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
||||
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
|
||||
{{end}}
|
@ -1,55 +0,0 @@
|
||||
<div id="footerContainer">
|
||||
{{$userId := .userBlog.UserId.Hex}}
|
||||
<div class="container" id="footer">
|
||||
<div class="col-md-4">
|
||||
<h3>{{msg . "blogNavs"}}</h3>
|
||||
<ul>
|
||||
<li><a href="{{$.blogUrl}}/{{$.userInfo.Username}}">{{msg . "home"}}</a></li>
|
||||
{{range .notebooks}}
|
||||
<li>
|
||||
<a href="{{$.cateUrl}}/{{.NotebookId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
<li><a href="{{$.aboutMeUrl}}">{{msg . "aboutMe"}}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3>{{msg . "latestPosts"}}</h3>
|
||||
<ul>
|
||||
{{range .recentBlogs}}
|
||||
<li title="{{.Title}}"><a href="{{$.blogUrl}}/view/{{.NoteId.Hex}}/">{{.Title}}</a></li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3>{{msg . "quickLinks"}}</h3>
|
||||
<ul>
|
||||
<li><a href="{{$.noteUrl}}">{{msg . "myNote"}}</a></li>
|
||||
<li><a href="{{$.siteUrl}}/login">leanote {{msg . "login"}}</a></li>
|
||||
<li><a href="http://leanote.com" target="_blank">leanote {{msg . "home"}}</a></li>
|
||||
<li><a href="http://lea.leanote.com" target="_blank">lea++</a></li>
|
||||
<li><a href="http://bbs.leanote.com" target="_blank">leanote {{msg . "community"}}</a></li>
|
||||
<li><a href="https://github.com/leanote/leanote" target="_blank">leanote github</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="{{$.jQueryUrl}}"></script>
|
||||
<script src="{{$.bootstrapJsUrl}}"></script>
|
||||
<script src="{{$.siteUrl}}/js/bootstrap-hover-dropdown.js"></script>
|
||||
<script src="{{$.siteUrl}}/js/i18n/blog.{{.locale}}.js"></script>
|
||||
|
||||
<script>
|
||||
// 搜索
|
||||
function search(e) {
|
||||
var keywords = $("#searchInput").val();
|
||||
if(!keywords) {
|
||||
location.href = "{{$.searchUrl}}";
|
||||
} else {
|
||||
var tpl = '<form action="{{$.searchUrl}}" method="get">';
|
||||
tpl += '<input name="keywords" value="' + keywords + '" />';
|
||||
tpl += "</form";
|
||||
$(tpl).submit();
|
||||
}
|
||||
}
|
||||
</script>
|
@ -1,113 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="keywords" content="leanote,leanote.com">
|
||||
<meta name="description" content="leanote, {{msg $ "moto"}}">
|
||||
<meta name="author" content="leanote">
|
||||
|
||||
<title>{{.title}}</title>
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link href="{{$.bootstrapCssUrl}}" rel="stylesheet">
|
||||
<!-- 字体必须同一域 -->
|
||||
<link href="{{$.fontAwesomeUrl}}" rel="stylesheet">
|
||||
<link href="{{$.themeBaseUrl}}/style.css" rel="stylesheet">
|
||||
<link href="{{$.commentCssUrl}}" rel="stylesheet">
|
||||
<script>
|
||||
function log(o) {
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="headerAndNav" >
|
||||
<div id="headerContainer" class="container">
|
||||
<!-- 头部可放博客名, 导航 -->
|
||||
<div id="header">
|
||||
|
||||
{{$username := .userInfo.Username}}
|
||||
<h1>
|
||||
<a href="{{$.indexUrl}}" id="logo">
|
||||
{{if $.blogInfo.Logo}}
|
||||
<img src="{{$.blogInfo.Logo}}" title="{{$.blogInfo.Title}}"/>
|
||||
{{else}}
|
||||
{{$.blogInfo.Title | raw}}
|
||||
{{end}}
|
||||
</a>
|
||||
</h1>
|
||||
<div id="blogDesc">
|
||||
{{$.blogInfo.SubTitle | raw}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Static navbar -->
|
||||
<div class="navbar navbar-default">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="{{.indexUrl}}">
|
||||
{{if $.blogInfo.Logo}}
|
||||
|
||||
<img src="{{$.blogInfo.Logo}}" title="{{$.blogInfo.Title}}"/>
|
||||
{{else}}
|
||||
{{$.blogInfo.Title | raw}}
|
||||
{{end}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
|
||||
<li class="{{if $.curIsIndex}}active{{end}}"><a href="{{.indexUrl}}">主页</a></li>
|
||||
<!-- 分类页 -->
|
||||
{{range $.cates}}
|
||||
<li class="{{if eq .CateId $.curCateId}}active{{end}}">
|
||||
<a href="{{$.cateUrl}}/{{.CateId}}"
|
||||
>{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
<!-- 单页 -->
|
||||
{{range $.singles}}
|
||||
<li class="{{if eq $.curSingleId .SingleId}}active{{end}}">
|
||||
<a href="{{$.singleUrl}}/{{.SingleId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
|
||||
<!-- 归档 -->
|
||||
<li class="{{if $.curIsArchive}}active{{end}}">
|
||||
<a href="{{$.archiveUrl}}">归档</a>
|
||||
</li>
|
||||
<li class="{{if $.curIsTags}}active{{end}}">
|
||||
<a href="{{$.tagsUrl}}">标签</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<form class="navbar-form navbar-right" id="search" onsubmit="search(event);return false;">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="searchIcon" onclick="search(event);"><i class="fa fa-search"></i></span>
|
||||
<input type="text" placeholder="search" id="searchInput" class="form-control" value="{{.keywords}}">
|
||||
</div>
|
||||
</form>
|
||||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var UserInfo = {UserId: "{{$.blogInfo.UserId}}", Email: "{{.userInfo.Email}}", Username: "{{.userInfo.Username}}"};
|
||||
var UserBlogInfo={CanComment: {{.userBlog.CanComment}}, CommentType: "{{.userBlog.CommentType}}"};
|
||||
var indexUrl = "{{$.indexUrl}}";
|
||||
var viewUrl = "{{$.viewUrl}}";
|
||||
var blogUrl = "{{$.blogUrl}}";
|
||||
var staticUrl = "{{$.staticUrl}}"; // blog.leanote.com, life.leanote.com, aaa.com
|
||||
</script>
|
@ -1,9 +0,0 @@
|
||||
<!-- This file is Depreciated -->
|
||||
|
||||
<link href="/public/mdeditor/editor/google-code-prettify/prettify.css" type="text/css" rel="stylesheet">
|
||||
<script src="/public/mdeditor/editor/google-code-prettify/prettify.js"></script>
|
||||
|
||||
<script>
|
||||
$("pre").addClass("prettyprint linenums");
|
||||
prettyPrint();
|
||||
</script>
|
Before Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 136 KiB |
@ -1,39 +0,0 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
|
||||
<div id="posts">
|
||||
{{range $.posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}.</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1 +0,0 @@
|
||||
aaaaaaaaaaaaaaaaaaa
|
@ -1,27 +0,0 @@
|
||||
{{if gt $.paging.TotalPage 1}}
|
||||
|
||||
<!-- 上一页 -->
|
||||
{{if gt $.paging.CurPage 1}}
|
||||
{{set . "prePageClass" ""}}
|
||||
{{set . "prePageUrl" (urlConcat $.pagingBaseUrl "page" (incr $.paging.CurPage -1)) }}
|
||||
{{else}}
|
||||
{{set . "prePageClass" "disabled"}}
|
||||
{{set . "prePageUrl" "#"}}
|
||||
{{end}}
|
||||
|
||||
<!-- 下一页 -->
|
||||
{{if lt $.paging.CurPage $.paging.TotalPage }}
|
||||
{{set . "nextPageClass" ""}}
|
||||
{{set . "nextPageUrl" (urlConcat $.pagingBaseUrl "page" (incr $.paging.CurPage 1)) }}
|
||||
{{else}}
|
||||
{{set . "nextPageClass" "disabled"}}
|
||||
{{set . "nextPageUrl" "#"}}
|
||||
{{end}}
|
||||
|
||||
{{$.paging.CurPage}}/{{$.paging.TotalPage}}
|
||||
<ul class="pager">
|
||||
<li class="{{$.prePageClass}}"><a href="{{$.prePageUrl}}">上一页</a></li>
|
||||
<li class="{{$.nextPageClass}}"><a href="{{$.nextPageUrl}}">下一页</a></li>
|
||||
</ul>
|
||||
|
||||
{{end}}
|
@ -1,49 +0,0 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>搜索 - {{.keywords}} </h2>
|
||||
</div>
|
||||
|
||||
<div id="posts">
|
||||
{{range .posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}} |
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}</a>
|
||||
</div>
|
||||
|
||||
|
||||
{{else}}
|
||||
<div class="each-post">
|
||||
{{msg . "none"}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
{{template "blog/highlight.html"}}
|
||||
</body>
|
||||
</html>
|
@ -1,52 +0,0 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div id="posts">
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
{{.single.Title}}
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-calendar"></i> {{msg . "updatedTime"}} {{$.single.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg . "createdTime"}} {{$.single.CreatedTime | datetime}}
|
||||
</div>
|
||||
|
||||
<!-- 仅为移动端 -->
|
||||
<div class="mobile-created-time">
|
||||
{{ if $.blogInfo.UserLogo}}
|
||||
<img src="{{$.blogInfo.UserLogo}}" id="userLogo">
|
||||
{{else}}
|
||||
<img src="{{$.siteUrl}}/images/blog/default_avatar.png" id="userLogo">
|
||||
{{end}}
|
||||
{{$.blogInfo.Username}}
|
||||
</div>
|
||||
|
||||
<div class="desc" id="content">
|
||||
{{$.single.Content | raw}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "footer.html" .}}
|
||||
|
||||
{{template "highlight.html"}}
|
||||
<div id="blogNav">
|
||||
<div id="blogNavNav">
|
||||
<i class="fa fa-align-justify" title="文档导航"></i>
|
||||
<span>{{msg . "blogNav"}}</span>
|
||||
</div>
|
||||
<div id="blogNavContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 一些公用的js -->
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/common.js"></script>
|
||||
<script>
|
||||
$(function() {
|
||||
initNav();
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,579 +0,0 @@
|
||||
#posts img {
|
||||
max-width: 100%;
|
||||
}
|
||||
#content * {
|
||||
font-size: 16px;
|
||||
}
|
||||
#content h1 {
|
||||
font-size: 30px;
|
||||
}
|
||||
#content h2 {
|
||||
font-size: 24px;
|
||||
}
|
||||
#content h3 {
|
||||
font-size: 18px;
|
||||
}
|
||||
#content h4 {
|
||||
font-size: 14px;
|
||||
}
|
||||
@-webkit-keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-moz-keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-ms-keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-webkit-keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-moz-keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-ms-keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
a,
|
||||
.btn {
|
||||
-webkit-transition: all 0.2s ease;
|
||||
-moz-transition: all 0.2s ease;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
.btn:focus {
|
||||
outline: none;
|
||||
}
|
||||
ul.dropdown-menu {
|
||||
box-shadow: rgba(0, 0, 0, 0.172549) 0px 6px 12px 0px;
|
||||
}
|
||||
ul.dropdown-menu:before {
|
||||
content: "";
|
||||
width: 20px;
|
||||
height: 12px;
|
||||
position: absolute;
|
||||
top: -12px;
|
||||
right: 20px;
|
||||
background-image: url("../../images/triangle_2x.png");
|
||||
background-size: 20px 12px;
|
||||
}
|
||||
ul.dropdown-menu {
|
||||
display: block;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
}
|
||||
.open ul.dropdown-menu {
|
||||
-webkit-animation: pulldown .2s;
|
||||
animation: pulldown .2s;
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
.created-time .fa {
|
||||
color: #666;
|
||||
}
|
||||
#blogNav {
|
||||
display: none;
|
||||
background-color: #fff;
|
||||
opacity: 0.7;
|
||||
position: fixed;
|
||||
z-index: 10;
|
||||
padding: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
#blogNavContent {
|
||||
overflow-y: auto;
|
||||
max-height: 250px;
|
||||
display: none;
|
||||
-webkit-overflow-scrolling: touch !important;
|
||||
}
|
||||
#blogNavNav {
|
||||
cursor: pointer;
|
||||
}
|
||||
#blogNav a {
|
||||
color: #666;
|
||||
}
|
||||
#blogNav:hover {
|
||||
opacity: 0.9;
|
||||
}
|
||||
#blogNav a:hover {
|
||||
color: #0fb264;
|
||||
}
|
||||
#blogNav ul {
|
||||
padding-left: 20px;
|
||||
}
|
||||
#blogNav ul .nav-h2 {
|
||||
margin-left: 20px;
|
||||
}
|
||||
#blogNav ul .nav-h3 {
|
||||
margin-left: 30px;
|
||||
}
|
||||
#blogNav ul .nav-h4 {
|
||||
margin-left: 40px;
|
||||
}
|
||||
#blogNav ul .nav-h5 {
|
||||
margin-left: 50px;
|
||||
}
|
||||
.mobile-created-time {
|
||||
display: none;
|
||||
}
|
||||
#footer {
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.navbar-brand {
|
||||
display: none;
|
||||
}
|
||||
#themeList label {
|
||||
text-align: center;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
#themeList .preview {
|
||||
display: block;
|
||||
width: 400px;
|
||||
background: #fff;
|
||||
border: 1px solid #ccc;
|
||||
padding: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
src: local('Open Sans Light'), local('OpenSans-Light'), url('../../fonts/open-sans2/DXI1ORHCpsQm3Vp6mXoaTXhCUOGz7vYGh680lGh-uXM.woff') format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url('../../fonts/open-sans2/cJZKeOuBrn4kERxqtaUH3T8E0i7KZn-EPnyo3HZu7kw.woff') format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('Open Sans Bold'), local('OpenSans-Bold'), url('../../fonts/open-sans2/k3k702ZOKiLJc3WVjuplzHhCUOGz7vYGh680lGh-uXM.woff') format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url('../../fonts/open-sans2/xjAJXh38I15wypJXxuGMBobN6UDyHWBl620a-IRfuBk.woff') format('woff');
|
||||
}
|
||||
/*"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue", Helvetica, "Microsoft Yahei", Verdana, Simsun, "Segoe UI", "Segoe UI Web Regular", "Segoe UI Symbol", "BBAlpha Sans", "S60 Sans", Arial, sans-serif;*/
|
||||
::selection {
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
::-moz-selection {
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
::-webkit-selection {
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
*,
|
||||
body {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300;
|
||||
font-size: 14px;
|
||||
}
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300 !important;
|
||||
}
|
||||
a {
|
||||
cursor: pointer;
|
||||
}
|
||||
a:hover {
|
||||
text-decoration: none !important;
|
||||
}
|
||||
#headerAndNav {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 200px;
|
||||
border-right: 1px solid #ebeff2;
|
||||
text-align: right;
|
||||
}
|
||||
#headerContainer {
|
||||
width: 190px;
|
||||
}
|
||||
#headerContainer {
|
||||
background-color: #fff;
|
||||
}
|
||||
#postsContainer {
|
||||
margin-left: 211px;
|
||||
}
|
||||
#postsContainer {
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
#postsContainer .container,
|
||||
#footerContainer .container {
|
||||
width: 800px;
|
||||
}
|
||||
#postsContainer .container {
|
||||
margin-left: 12px;
|
||||
}
|
||||
/* header */
|
||||
#header {
|
||||
color: #000000;
|
||||
padding: 0 0 20px 0;
|
||||
margin-top: 15px;
|
||||
}
|
||||
#header h1 {
|
||||
margin: 0;
|
||||
font-size: 32px;
|
||||
}
|
||||
#header h1 a {
|
||||
color: #000000;
|
||||
font-size: 32px;
|
||||
}
|
||||
#header h1 a img {
|
||||
height: 40px;
|
||||
}
|
||||
#header #blogDesc {
|
||||
margin-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px dashed #ebeff2;
|
||||
font-size: 16px;
|
||||
}
|
||||
#logo {
|
||||
word-wrap: break-word;
|
||||
overflow: hidden;
|
||||
}
|
||||
.navbar {
|
||||
margin-bottom: 0;
|
||||
border-radius: 0;
|
||||
border: none;
|
||||
}
|
||||
.navbar .container {
|
||||
width: 200px;
|
||||
}
|
||||
.navbar-default {
|
||||
background: none;
|
||||
border-color: #e7e7e7;
|
||||
}
|
||||
.navbar-collapse {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
.navbar-form {
|
||||
padding: 0;
|
||||
}
|
||||
.navbar-nav {
|
||||
float: none;
|
||||
}
|
||||
.navbar-nav > li {
|
||||
float: none;
|
||||
}
|
||||
.navbar-default .navbar-nav > .active > a,
|
||||
.navbar-default .navbar-nav > .active > a:hover,
|
||||
.navbar-default .navbar-nav > .active > a:focus {
|
||||
font-weight: bold;
|
||||
background: none;
|
||||
}
|
||||
.navbar-nav > li > a {
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
font-size: 16px;
|
||||
}
|
||||
/* posts */
|
||||
#posts {
|
||||
width: 800px;
|
||||
}
|
||||
#posts .each-post {
|
||||
border-bottom: 1px solid #ebeff2;
|
||||
margin-bottom: 10px;
|
||||
padding: 30px;
|
||||
padding-top: 10px;
|
||||
}
|
||||
#posts .each-post .title {
|
||||
font-size: 32px;
|
||||
color: #0fb264;
|
||||
padding: 0 0 15px 0;
|
||||
}
|
||||
#posts .each-post .title a {
|
||||
font-size: 32px;
|
||||
color: #0fb264;
|
||||
padding: 0 0 15px 0;
|
||||
}
|
||||
#posts .each-post .created-time {
|
||||
border-bottom: 1px dashed #eee;
|
||||
padding-bottom: 3px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
#posts .each-post .more {
|
||||
background: #0fb264;
|
||||
padding: 9px 10px;
|
||||
border-radius: 2px;
|
||||
line-height: 1;
|
||||
font-size: 13px;
|
||||
display: inline-block;
|
||||
text-transform: uppercase;
|
||||
margin-top: 15px;
|
||||
margin-bottom: 15px;
|
||||
color: #fff;
|
||||
}
|
||||
#disqus_thread {
|
||||
border-top: 1px solid #eee;
|
||||
padding: 5px 0 0 0;
|
||||
}
|
||||
#search {
|
||||
width: 170px;
|
||||
padding-right: 15px;
|
||||
}
|
||||
#footerContainer {
|
||||
background-color: #ffffff;
|
||||
color: #666666;
|
||||
}
|
||||
#footerContainer #footer a {
|
||||
color: #666666;
|
||||
}
|
||||
#footerContainer #footer ul {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding-left: 20px;
|
||||
}
|
||||
.tab-content {
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid #ebeff2;
|
||||
}
|
||||
.mce-btn {
|
||||
background: none !important;
|
||||
}
|
||||
@media screen and (max-width: 600px) {
|
||||
html,
|
||||
body {
|
||||
overflow-x: hidden;
|
||||
background-color: #fbfcf7;
|
||||
}
|
||||
* {
|
||||
font-size: 16px;
|
||||
}
|
||||
#headerContainer,
|
||||
#footerContainer {
|
||||
background-color: #fbfcf7;
|
||||
margin: 10px 0;
|
||||
}
|
||||
#posts .each-post,
|
||||
#postsContainer {
|
||||
background-color: #fbfcf7 !important;
|
||||
}
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
#posts .each-post {
|
||||
padding: 10px;
|
||||
}
|
||||
#posts .each-post .title {
|
||||
font-size: 24px;
|
||||
border-left: 5px solid #65bd77;
|
||||
font-weight: bold;
|
||||
padding: 5px 0;
|
||||
padding-left: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.container {
|
||||
padding-right: 10px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
.created-time {
|
||||
display: none;
|
||||
}
|
||||
.mobile-created-time {
|
||||
display: block;
|
||||
}
|
||||
.mobile-created-time #userLogo {
|
||||
display: inline-block;
|
||||
max-height: 40px;
|
||||
width: 40px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
#content {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.right-section .dropdown,
|
||||
.right-section .btn {
|
||||
display: none !important;
|
||||
}
|
||||
#blogNav {
|
||||
left: initial !important;
|
||||
right: 10px !important;
|
||||
}
|
||||
#postsContainer .container,
|
||||
#footerContainer .container {
|
||||
max-width: 100%;
|
||||
}
|
||||
#postsContainer {
|
||||
margin: 0 !important;
|
||||
max-width: 100%;
|
||||
padding-top: 10px;
|
||||
background: #f5f5f5 url("../../images/noise.png");
|
||||
}
|
||||
#posts {
|
||||
max-width: 100% !important;
|
||||
}
|
||||
#footerContainer #footer a {
|
||||
padding: 3px;
|
||||
}
|
||||
#footerContainer #footer a:hover,
|
||||
#footerContainer #footer a:focus {
|
||||
color: #65bd77;
|
||||
}
|
||||
#headerAndNav {
|
||||
position: initial;
|
||||
text-align: left;
|
||||
width: 100%;
|
||||
border-bottom: 2px dashed #ebeff2;
|
||||
}
|
||||
#headerAndNav #headerContainer {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
padding-top: 30px;
|
||||
}
|
||||
#headerAndNav #header {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
#headerAndNav #header h1 {
|
||||
display: none;
|
||||
}
|
||||
#headerAndNav .navbar-collapse {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
#headerAndNav #blogDesc {
|
||||
border: none;
|
||||
margin-top: 20px;
|
||||
font-size: 24px;
|
||||
}
|
||||
#headerAndNav .navbar-brand {
|
||||
display: inline-block;
|
||||
line-height: 50px;
|
||||
padding: 0;
|
||||
padding-left: 10px;
|
||||
}
|
||||
#headerAndNav .navbar-brand img {
|
||||
height: 40px;
|
||||
}
|
||||
#headerAndNav .navbar .container {
|
||||
width: auto;
|
||||
padding: 0 15px;
|
||||
}
|
||||
#headerAndNav .navbar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
background: #fbfcf7;
|
||||
z-index: 1000;
|
||||
border-bottom: 1px solid #DEDDDF;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), inset 0 1px 0 #ffffff;
|
||||
background-color: #FDFFF5;
|
||||
}
|
||||
#headerAndNav .navbar-nav {
|
||||
margin: 0 10px;
|
||||
}
|
||||
#headerAndNav .navbar-nav a {
|
||||
padding-left: 10px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
#headerAndNav #search {
|
||||
width: 100%;
|
||||
margin: 10px;
|
||||
}
|
||||
#headerAndNav .navbar-form {
|
||||
border: none;
|
||||
}
|
||||
#myTab,
|
||||
.tab-content {
|
||||
padding: 0 10px;
|
||||
}
|
||||
}
|
@ -1,47 +0,0 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>标签 - {{.curTag}} </h2>
|
||||
</div>
|
||||
|
||||
<div id="posts">
|
||||
{{range .posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}} |
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}</a>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="each-post">
|
||||
{{msg . "none"}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
{{template "blog/highlight.html"}}
|
||||
</body>
|
||||
</html>
|
@ -1,26 +0,0 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>标签</h2>
|
||||
</div>
|
||||
<div id="posts">
|
||||
|
||||
<div class="each-post">
|
||||
<ul>
|
||||
{{range $.tags}}
|
||||
<li>
|
||||
<a href="{{$.tagPostsUrl}}/{{.Tag}}">
|
||||
{{.Tag}} <span class="label label-default">{{.Count}}</span>
|
||||
</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,27 +0,0 @@
|
||||
/*
|
||||
以下是本主题的配置, 采用JSON格式
|
||||
其中Name, Version, Author, AuthorUrl是必填项(注意首字大写)
|
||||
你也可以定义其它的配置, 如FriendLinks, 在模板文件使用 $.themeInfo.FriendLinks来获取值
|
||||
|
||||
注意:
|
||||
1) JSON语法严格, 键必须用双引号, 最后不得有空','来结尾
|
||||
2) 以下配置不能包含任何注释, 不然解析会出错!
|
||||
|
||||
请在此解析所有配置
|
||||
* Name 主题名
|
||||
* Version 主题版本
|
||||
* Author 主题的作者
|
||||
* AuthorUrl 作者的博客链接或相关链接
|
||||
|
||||
* FriendLinks 友情链接
|
||||
|
||||
*/
|
||||
{
|
||||
"Name": "leanote default theme",
|
||||
"Version": "1.0",
|
||||
"Author": "leanote.com",
|
||||
"AuthorUrl": "http://leanote.com",
|
||||
"FriendLinks": [
|
||||
{"Title": "leanote", "Url": "http://leanote.com"}
|
||||
]
|
||||
}
|
@ -1,140 +0,0 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div id="posts">
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
{{.post.Title}}
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .post.Tags}}
|
||||
{{blogTags $ .post.Tags}}
|
||||
{{else}}
|
||||
{{msg . "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg . "updatedTime"}} {{$.post.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg . "createdTime"}} {{$.post.CreatedTime | datetime}}
|
||||
</div>
|
||||
|
||||
<!-- 仅为移动端 -->
|
||||
<div class="mobile-created-time">
|
||||
{{ if $.blogInfo.UserLogo}}
|
||||
<img src="{{$.blogInfo.UserLogo}}" id="userLogo">
|
||||
{{else}}
|
||||
<img src="{{$.siteUrl}}/images/blog/default_avatar.png" id="userLogo">
|
||||
{{end}}
|
||||
{{$.blogInfo.Username}}
|
||||
|
||||
{{if .post.Tags}}
|
||||
|
||||
<i class="fa fa-bookmark-o" style="color: #666"></i>
|
||||
{{blogTags $ $.post.Tags}}
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
<div class="desc" id="content">
|
||||
{{if $.post.IsMarkdown }}
|
||||
<div id="markdownContent" style="display: none">
|
||||
<!-- 用textarea装html, 防止得到的值失真 -->
|
||||
<textarea>{{$.post.Content | raw}}</textarea>
|
||||
</div>
|
||||
<div style="padding: 20px; text-align: center">
|
||||
<img src="{{$.themeBaseUrl}}/images/loading-32.gif" />
|
||||
</div>
|
||||
{{else}}
|
||||
{{$.post.Content | raw}}
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
<div class="pre-next-post">
|
||||
<p>
|
||||
上一篇: {{if $.prePost}}<a href="{{$.viewUrl}}/{{$.prePost.NoteId}}">{{$.prePost.Title}}</a>{{else}}无{{end}}
|
||||
</p>
|
||||
<p>
|
||||
下一篇: {{if $.nextPost}}<a href="{{$.viewUrl}}/{{$.nextPost.NoteId}}">{{$.nextPost.Title}}</a>{{else}}无{{end}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- share & comment -->
|
||||
{{template "comment.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "footer.html" .}}
|
||||
|
||||
{{template "highlight.html"}}
|
||||
<div id="blogNav">
|
||||
<div id="blogNavNav">
|
||||
<i class="fa fa-align-justify" title="文档导航"></i>
|
||||
<span>{{msg . "blogNav"}}</span>
|
||||
</div>
|
||||
<div id="blogNavContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 一些在comment.js 需要使用的变量 -->
|
||||
<script>
|
||||
var visitUserInfo = eval("(" + {{.visitUserInfoJson}} + ")");
|
||||
var urlPrefix = "{{$.leanoteUrl}}";
|
||||
var noteId = "{{$.post.NoteId}}";
|
||||
var preLikeNum = +"{{.blog.likeNum}}";
|
||||
var commentNum = +"{{.blog.commentNum}}";
|
||||
</script>
|
||||
|
||||
<!-- 一些公用的js -->
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/common.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/jsrender.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/jquery-cookie-min.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/bootstrap-dialog.min.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/jquery.qrcode.min.js"></script>
|
||||
|
||||
<!-- share && comment -->
|
||||
<script src="{{$.themeBaseUrl}}/view.js"></script>
|
||||
|
||||
<!--
|
||||
markdown
|
||||
调用markdown来解析得到html
|
||||
-->
|
||||
|
||||
{{if $.post.IsMarkdown }}
|
||||
<script src="/public/mdeditor/editor/pagedown/Markdown.Converter.js"></script>
|
||||
<script src="/public/mdeditor/editor/pagedown/Markdown.Sanitizer.js"></script>
|
||||
<script src="/public/mdeditor/editor/pagedown/Markdown.Editor.js"></script>
|
||||
<script src="/public/mdeditor/editor/pagedown/local/Markdown.local.zh.js"></script>
|
||||
<script src="/public/mdeditor/editor/Markdown.Extra.js"></script>
|
||||
|
||||
<!--mathjax-->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ["\\(","\\)"]], processEscapes: true }, messageStyle: "none"});
|
||||
</script>
|
||||
<script src="/public/mdeditor/editor/mathJax.js"></script>
|
||||
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
|
||||
<script>
|
||||
var content = $.trim($("#markdownContent textarea").val());
|
||||
var converter = Markdown.getSanitizingConverter();
|
||||
Markdown.Extra.init(converter, {extensions: ["tables", "fenced_code_gfm", "def_list"]});
|
||||
var html = converter.makeHtml(content);
|
||||
$("#content").html(html);
|
||||
$("pre").addClass("prettyprint linenums");
|
||||
prettyPrint();
|
||||
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"wmd-preview"]);
|
||||
|
||||
initNav();
|
||||
weixin();
|
||||
</script>
|
||||
|
||||
<!-- 不是markdown -->
|
||||
{{else}}
|
||||
<script>
|
||||
$(function() {
|
||||
initNav();
|
||||
weixin();
|
||||
});
|
||||
</script>
|
||||
{{end}}
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1,509 +0,0 @@
|
||||
function scrollTo(self, tagName, text) {
|
||||
var iframe = $("#content");
|
||||
var target = iframe.find(tagName + ":contains(" + text + ")");
|
||||
|
||||
// 找到是第几个
|
||||
// 在nav是第几个
|
||||
var navs = $('#blogNavContent [data-a="' + tagName + '-' + encodeURI(text) + '"]');
|
||||
var len = navs.size();
|
||||
for(var i = 0; i < len; ++i) {
|
||||
if(navs[i] == self) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (target.size() >= i+1) {
|
||||
target = target.eq(i);
|
||||
// 之前插入, 防止多行定位不准
|
||||
var top = target.offset().top;
|
||||
if(LEA.isMobile) {
|
||||
top -= 50;
|
||||
}
|
||||
var nowTop = $(document).scrollTop();
|
||||
// 用$("body").scrllTop(10)没反应 firefox下
|
||||
$('html,body').animate({scrollTop: top}, 200);
|
||||
return;
|
||||
}
|
||||
}
|
||||
function genNav() {
|
||||
var $con = $("#content");
|
||||
var html = $con.html();
|
||||
// 构造一棵树
|
||||
// {"h1-title":{h2-title:{}}}
|
||||
var tree = [];//[{title: "xx", children:[{}]}, {title:"xx2"}];
|
||||
var hs = $con.find("h1,h2,h3,h4,h5,h6").toArray();
|
||||
var titles = '<ul>';
|
||||
for(var i = 0; i < hs.length; ++i) {
|
||||
var text = $(hs[i]).text();
|
||||
var tagName = hs[i].tagName.toLowerCase();
|
||||
// scrollTo在page.js中定义
|
||||
titles += '<li class="nav-' + tagName + '"><a data-a="' + tagName + '-' + encodeURI(text)+'" onclick="scrollTo(this, \'' + tagName + '\', \'' + text + '\')">' + text + '</a></li>';
|
||||
}
|
||||
titles += "</ul>";
|
||||
$("#blogNavContent").html(titles);
|
||||
if(!hs.length) {
|
||||
$("#blogNavContent").html(getMsg("none"));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function initNav() {
|
||||
var hasNav = genNav();
|
||||
if(!hasNav) {
|
||||
return;
|
||||
}
|
||||
|
||||
var $title = $(".title");
|
||||
var titlePos = $title.offset();
|
||||
var top = titlePos.top + 10;// - $title.height();
|
||||
// 手机下不要与标题在同一高度
|
||||
if(LEA.isMobile){
|
||||
top += 30;
|
||||
}
|
||||
if(top < 0) {
|
||||
top = 10;
|
||||
}
|
||||
|
||||
var left = $title.width() + titlePos.left - 100;
|
||||
$("#blogNav").css("top", top).css("left", left);
|
||||
$("#blogNav").show();
|
||||
|
||||
$("#blogNavNav").click(function() {
|
||||
var $o = $("#blogNavContent");
|
||||
if($o.is(":hidden")) {
|
||||
$o.show();
|
||||
} else {
|
||||
$o.hide();
|
||||
}
|
||||
});
|
||||
|
||||
var $d = $(document);
|
||||
function reNav() {
|
||||
var vtop = $d.scrollTop();
|
||||
if(vtop <= top) {
|
||||
$("#blogNav").css("top", top-vtop);
|
||||
} else {
|
||||
// 差距很磊了
|
||||
if(LEA.isMobile) {
|
||||
$("#blogNav").css("top", 50);
|
||||
} else {
|
||||
$("#blogNav").css("top", 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
reNav();
|
||||
$(window).scroll(reNav);
|
||||
}
|
||||
|
||||
var C = {
|
||||
info: null,
|
||||
noteId: noteId,
|
||||
preLikeNum: preLikeNum,
|
||||
commentNum: commentNum,
|
||||
likeBtnO: $("#likeBtn"),
|
||||
likeNumO: $("#likeNum"),
|
||||
tLikersO: $("#tLikers"),
|
||||
likersO: $("#likers"),
|
||||
tCommentsO: $("#tComments"),
|
||||
commentsO: $("#comments"),
|
||||
|
||||
commentBtnO: $("#commentBtn"),
|
||||
|
||||
commentsLoadingO: $(".comments-loading"),
|
||||
commentsMoreO: $(".comments-more"),
|
||||
|
||||
commentBoxO: $(".comment-box"),
|
||||
init: function() {
|
||||
var self = this;
|
||||
if(UserBlogInfo.CanComment && UserBlogInfo.CommentType != "disqus") {
|
||||
self.initLikeAndComments();
|
||||
} else {
|
||||
self.initLike();
|
||||
}
|
||||
self.initEvent();
|
||||
self.incReadNum();
|
||||
},
|
||||
incReadNum: function() {
|
||||
var self = this;
|
||||
if(!$.cookie(self.noteId)) {
|
||||
$.cookie(self.noteId, 1);
|
||||
ajaxGet(staticUrl + "/blog/incReadNum", {noteId: self.noteId});
|
||||
}
|
||||
},
|
||||
initLike: function() {
|
||||
var self = this;
|
||||
ajaxGet(staticUrl + "/blog/getLike", {noteId: self.noteId}, function(ret) {
|
||||
self.info = ret;
|
||||
self.toggleLikeBtnActive();
|
||||
self.renderLikers();
|
||||
});
|
||||
},
|
||||
initLikeAndComments: function() {
|
||||
var self = this;
|
||||
ajaxGet(staticUrl + "/blog/getLikeAndComments", {noteId: self.noteId}, function(ret) {
|
||||
self.info = ret;
|
||||
self.toggleLikeBtnActive();
|
||||
self.renderLikers();
|
||||
// 是否需要renderComments?
|
||||
self.info.commentUserInfo = self.info.commentUserInfo || {};
|
||||
// 为了防止第一条评论找不到用户信息情况
|
||||
if(visitUserInfo.UserId) {
|
||||
self.info.commentUserInfo[visitUserInfo.UserId] = visitUserInfo;
|
||||
}
|
||||
self.renderComments();
|
||||
|
||||
self.commentBoxO.removeClass("hide");
|
||||
self.commentsLoadingO.addClass("hide");
|
||||
if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) {
|
||||
self.commentsMoreO.removeClass("hide");
|
||||
self.initMoreComments();
|
||||
}
|
||||
});
|
||||
},
|
||||
initMoreComments: function() {
|
||||
var self = this;
|
||||
self.commentsMoreO.find("a").click(function(){
|
||||
if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) {
|
||||
self.commentsMoreO.addClass("hide");
|
||||
self.commentsLoadingO.removeClass("hide");
|
||||
ajaxGet(staticUrl + "/blog/listComments", {noteId: self.noteId, page: self.info.pageInfo.CurPage+1}, function(ret) {
|
||||
var pageInfo = ret.pageInfo;
|
||||
var comments = ret.comments;
|
||||
var commentUserInfo = ret.commentUserInfo;
|
||||
|
||||
$.extend(self.info.commentUserInfo, commentUserInfo);
|
||||
|
||||
// 渲染之
|
||||
for(var i in comments) {
|
||||
var comment = comments[i];
|
||||
comment = self.parseComment(comment);
|
||||
}
|
||||
var html = self.tCommentsO.render({comments: comments, visitUserInfo: visitUserInfo});
|
||||
self.commentsO.append(html);
|
||||
|
||||
self.info.pageInfo = pageInfo;
|
||||
|
||||
if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) {
|
||||
self.commentsMoreO.removeClass("hide");
|
||||
} else {
|
||||
self.commentsMoreO.addClass("hide");
|
||||
}
|
||||
|
||||
self.commentsLoadingO.addClass("hide");
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
addCommentRender: function(comment){
|
||||
var self = this;
|
||||
comment = self.parseComment(comment);
|
||||
var html = self.tCommentsO.render({blogUrl: blogUrl, comments: [comment], visitUserInfo: visitUserInfo});
|
||||
self.commentsO.prepend(html);
|
||||
var li = self.commentsO.find("li").eq(0);
|
||||
li.hide();
|
||||
li.show(500);
|
||||
li.addClass("item-highlight");
|
||||
setTimeout(function() {
|
||||
li.removeClass("item-highlight");
|
||||
}, 2000);
|
||||
},
|
||||
parseComment: function(comment) {
|
||||
var self = this;
|
||||
var authorUserId = UserInfo.UserId;
|
||||
commentUserInfo = self.info.commentUserInfo;
|
||||
comment.UserInfo = commentUserInfo[comment.UserId];
|
||||
// 是作者自己
|
||||
if(visitUserInfo.UserId == UserInfo.UserId) {
|
||||
comment.IsMyNote = true;
|
||||
}
|
||||
if(comment.UserId == authorUserId) {
|
||||
comment.IsAuthorComment = true;
|
||||
}
|
||||
if(comment.UserId == visitUserInfo.UserId) {
|
||||
comment.IsMyComment = true;
|
||||
}
|
||||
// 不是回复自己
|
||||
if(comment.ToUserId && comment.ToUserId != comment.UserId) {
|
||||
comment.ToUserInfo = commentUserInfo[comment.ToUserId];
|
||||
if(comment.ToUserInfo.UserId == UserInfo.UserId) {
|
||||
comment.ToUserIsAuthor = true;
|
||||
}
|
||||
}
|
||||
comment.PublishDate = getDateDiff(Date.parse(goNowToDatetime(comment.CreatedTime)));
|
||||
return comment;
|
||||
},
|
||||
// 渲染评论
|
||||
renderComments: function() {
|
||||
var self = this;
|
||||
var comments = self.info.comments || [];
|
||||
if(comments.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 整理数据
|
||||
// 回复谁, 是否是作者?
|
||||
// 回复日期, 几天前, 刚刚
|
||||
for(var i in comments) {
|
||||
var comment = comments[i];
|
||||
comment = self.parseComment(comment);
|
||||
}
|
||||
var html = self.tCommentsO.render({blogUrl: blogUrl, comments: comments, visitUserInfo: visitUserInfo});
|
||||
self.commentsO.html(html);
|
||||
},
|
||||
|
||||
// 重新渲染likers
|
||||
reRenderLikers: function(addMe) {
|
||||
var self = this;
|
||||
var likedUsers = self.info.likedUsers || [];
|
||||
for(var i = 0; i < likedUsers.length; ++i) {
|
||||
var user = likedUsers[i];
|
||||
if(user.UserId == visitUserInfo.UserId) {
|
||||
likedUsers.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(addMe) {
|
||||
likedUsers = [visitUserInfo].concat(likedUsers);
|
||||
self.info.likedUsers = likedUsers;
|
||||
}
|
||||
self.renderLikers();
|
||||
},
|
||||
renderLikers: function() {
|
||||
var self = this;
|
||||
var users = self.info.likedUsers || [];
|
||||
var html = self.tLikersO.render({blogUrl: blogUrl, users: users});
|
||||
self.likersO.html(html);
|
||||
},
|
||||
toggleLikeBtnActive: function() {
|
||||
var self = this;
|
||||
if(self.info.isILikeIt) {
|
||||
self.likeBtnO.addClass("active");
|
||||
} else {
|
||||
self.likeBtnO.removeClass("active");
|
||||
}
|
||||
},
|
||||
commentNumO: $("#commentNum"),
|
||||
bindCommentNum: function(fix) {
|
||||
var self = this;
|
||||
self.commentNum += fix;
|
||||
self.commentNumO.text(self.commentNum);
|
||||
},
|
||||
initEvent: function() {
|
||||
var self = this;
|
||||
|
||||
// like or not
|
||||
self.likeBtnO.click(function() {
|
||||
if(!visitUserInfo.UserId) {
|
||||
needLogin();
|
||||
return;
|
||||
}
|
||||
ajaxPost(staticUrl + "/blog/likeBlog", {noteId: self.noteId}, function(ret) {
|
||||
if(ret.Ok) {
|
||||
// like
|
||||
if(ret.Item) {
|
||||
var num = self.preLikeNum+1;
|
||||
} else {
|
||||
var num = self.preLikeNum-1;
|
||||
}
|
||||
self.preLikeNum = num >= 0 ? num : 0;
|
||||
self.likeNumO.text(self.preLikeNum);
|
||||
self.info.isILikeIt = ret.Item;
|
||||
self.toggleLikeBtnActive();
|
||||
|
||||
// 重新render likers
|
||||
// 我是否在列表中
|
||||
self.reRenderLikers(ret.Item);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 显示回复回复
|
||||
$("#comments").on("click", ".comment-reply", function() {
|
||||
var form = $(this).closest("li").find("form");
|
||||
if(form.is(":hidden")) {
|
||||
form.show();
|
||||
form.find("textarea").focus();
|
||||
} else {
|
||||
form.hide();
|
||||
}
|
||||
});
|
||||
$("#comments").on("click", ".reply-cancel", function() {
|
||||
$(this).closest("form").hide();
|
||||
});
|
||||
|
||||
// 回复
|
||||
$(".comment-box").on("click", ".reply-comment-btn", function(e) {
|
||||
e.preventDefault();
|
||||
var commentId = $(this).data("comment-id");
|
||||
var $form = $(this).closest("form");
|
||||
var $content = $form.find("textarea");
|
||||
var content = $.trim($content.val());
|
||||
if(!content) {
|
||||
$content.focus();
|
||||
return;
|
||||
}
|
||||
var t = $(this);
|
||||
t.button("loading");
|
||||
var data = {noteId: self.noteId, toCommentId: commentId, content: content};
|
||||
ajaxPost(staticUrl + "/blog/comment", data, function(ret) {
|
||||
t.button("reset");
|
||||
$content.val("");
|
||||
self.bindCommentNum(1);
|
||||
if(commentId) {
|
||||
$form.hide();
|
||||
}
|
||||
|
||||
if(commentId) {
|
||||
scrollToTarget("#comments", -200);
|
||||
}
|
||||
|
||||
// 添加一个
|
||||
self.addCommentRender(ret.Item);
|
||||
});
|
||||
});
|
||||
|
||||
// 删除
|
||||
$(".comment-box").on("click", ".comment-trash", function(e) {
|
||||
var commentId = $(this).parent().data("comment-id");
|
||||
var t = this;
|
||||
BootstrapDialog.confirm(getMsg("confirmDeleteComment"), function(yes) {
|
||||
if(yes) {
|
||||
ajaxPost(staticUrl + "/blog/deleteComment", {noteId: self.noteId, commentId: commentId}, function(ret) {
|
||||
if(ret.Ok) {
|
||||
var li = $(t).closest("li");
|
||||
li.hide(500); // remove();
|
||||
setTimeout(function() {
|
||||
li.remove();
|
||||
}, 300);
|
||||
|
||||
self.bindCommentNum(-1);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 点zan
|
||||
$(".comment-box").on("click", ".comment-like", function(e) {
|
||||
var commentId = $(this).parent().data("comment-id");
|
||||
var t = this;
|
||||
|
||||
ajaxPost(staticUrl + "/blog/likeComment", {commentId: commentId}, function(re) {
|
||||
if(re.Ok) {
|
||||
var ret = re.Item;
|
||||
if(ret.Num <= 0) {
|
||||
$(t).parent().find(".like-num").addClass("hide");
|
||||
} else {
|
||||
$(t).parent().find(".like-num").removeClass("hide");
|
||||
$(t).parent().find(".like-num-i").text(ret.Num)
|
||||
}
|
||||
if(ret.IsILikeIt) {
|
||||
$(t).find(".like-text").text(getMsg("unlike"));
|
||||
} else {
|
||||
$(t).find(".like-text").text(getMsg('like'));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 举报
|
||||
function report(commentId, noteId, title) {
|
||||
var form = $("#reportMsg").html();
|
||||
var body;
|
||||
var input;
|
||||
var isOver = false;
|
||||
var modal = BootstrapDialog.show({
|
||||
title: title,
|
||||
message: form,
|
||||
nl2br: false,
|
||||
buttons: [{
|
||||
label: getMsg("cancel"),
|
||||
action: function(dialog) {
|
||||
dialog.close();
|
||||
}
|
||||
}, {
|
||||
label: getMsg("confirm"),
|
||||
cssClass: 'btn-primary',
|
||||
action: function(dialog) {
|
||||
if(isOver) {
|
||||
dialog.close();
|
||||
}
|
||||
var val = body.find("input[type='radio']:checked").val();
|
||||
if(!val) {
|
||||
var val = body.find(".input-container input").val();
|
||||
}
|
||||
if(!val) {
|
||||
body.find(".footnote").html(getMsg("chooseReason"));
|
||||
return;
|
||||
}
|
||||
ajaxPost(staticUrl + "/blog/report", {commentId: commentId, noteId: noteId, reason: val}, function(re) {
|
||||
isOver = true;
|
||||
if(reIsOk(re)) {
|
||||
body.html(getMsg("reportSuccess"));
|
||||
} else {
|
||||
body.html(getMsg("error"));
|
||||
}
|
||||
setTimeout(function() {
|
||||
dialog.close();
|
||||
}, 3000);
|
||||
});
|
||||
}
|
||||
}]
|
||||
});
|
||||
body = modal.getModalBody();
|
||||
input = body.find(".input-container");
|
||||
body.find("input[type='radio']").click(function(){
|
||||
if(!$(this).val()) {
|
||||
input.show();
|
||||
input.find("input").focus();
|
||||
} else {
|
||||
input.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
$(".comment-box").on("click", ".comment-report", function() {
|
||||
if(needLogin()) {
|
||||
return;
|
||||
}
|
||||
var commentId = $(this).parent().data("comment-id");
|
||||
report(commentId, self.noteId, getMsg("reportComment?"));
|
||||
});
|
||||
$("#reportBtn").click(function() {
|
||||
if(needLogin()) {
|
||||
return;
|
||||
}
|
||||
report("", self.noteId, getMsg("reportBlog?"));
|
||||
});
|
||||
|
||||
self.initShare();
|
||||
},
|
||||
weixinQRCodeO: $("#weixinQRCode"),
|
||||
initShare: function() {
|
||||
var self = this;
|
||||
$(".btn-weixin").click(function() {
|
||||
if(!self.weixinQRCodeO.html()) {
|
||||
self.weixinQRCodeO.qrcode(viewUrl + "/" + self.noteId);
|
||||
}
|
||||
BootstrapDialog.show({
|
||||
title: getMsg('scanQRCode'),
|
||||
message: self.weixinQRCodeO
|
||||
});
|
||||
});
|
||||
|
||||
$(".btn-share").click(function() {
|
||||
var $this = $(this);
|
||||
var map = {"btn-weibo": shareSinaWeibo, "tencent-weibo": shareTencentWeibo, "qq": shareQQ, "renren": shareRenRen};
|
||||
for(var i in map) {
|
||||
if($this.hasClass(i)) {
|
||||
map[i](self.noteId, document.title);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
C.init();
|
||||
});
|
@ -58,10 +58,10 @@
|
||||
|
||||
<div class="pre-next-post">
|
||||
<p>
|
||||
Pre: {{if $.prePost}}<a href="{{$.postUrl}}/{{$.prePost.UrlTitle}}">{{$.prePost.Title}}</a>{{else}}无{{end}}
|
||||
Pre: {{if $.prePost}}<a href="{{$.postUrl}}/{{$.prePost.UrlTitle}}">{{$.prePost.Title}}</a>{{else}}No Post{{end}}
|
||||
</p>
|
||||
<p>
|
||||
Next: {{if $.nextPost}}<a href="{{$.postUrl}}/{{$.nextPost.UrlTitle}}">{{$.nextPost.Title}}</a>{{else}}无{{end}}
|
||||
Next: {{if $.nextPost}}<a href="{{$.postUrl}}/{{$.nextPost.UrlTitle}}">{{$.nextPost.Title}}</a>{{else}}No Post{{end}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
@ -58,10 +58,10 @@
|
||||
|
||||
<div class="pre-next-post">
|
||||
<p>
|
||||
Pre: {{if $.prePost}}<a href="{{$.postUrl}}/{{$.prePost.UrlTitle}}">{{$.prePost.Title}}</a>{{else}}无{{end}}
|
||||
Pre: {{if $.prePost}}<a href="{{$.postUrl}}/{{$.prePost.UrlTitle}}">{{$.prePost.Title}}</a>{{else}}No Post{{end}}
|
||||
</p>
|
||||
<p>
|
||||
Next: {{if $.nextPost}}<a href="{{$.postUrl}}/{{$.nextPost.UrlTitle}}">{{$.nextPost.Title}}</a>{{else}}无{{end}}
|
||||
Next: {{if $.nextPost}}<a href="{{$.postUrl}}/{{$.nextPost.UrlTitle}}">{{$.nextPost.Title}}</a>{{else}}No Post{{end}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
@ -58,10 +58,10 @@
|
||||
|
||||
<div class="pre-next-post">
|
||||
<p>
|
||||
Pre: {{if $.prePost}}<a href="{{$.postUrl}}/{{$.prePost.UrlTitle}}">{{$.prePost.Title}}</a>{{else}}无{{end}}
|
||||
Pre: {{if $.prePost}}<a href="{{$.postUrl}}/{{$.prePost.UrlTitle}}">{{$.prePost.Title}}</a>{{else}}No Post{{end}}
|
||||
</p>
|
||||
<p>
|
||||
Next: {{if $.nextPost}}<a href="{{$.postUrl}}/{{$.nextPost.UrlTitle}}">{{$.nextPost.Title}}</a>{{else}}无{{end}}
|
||||
Next: {{if $.nextPost}}<a href="{{$.postUrl}}/{{$.nextPost.UrlTitle}}">{{$.nextPost.Title}}</a>{{else}}No Post{{end}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|