member center, blog redesign
This commit is contained in:
app
conf
messages
public
blog
README.md
css
js
bootstrap-dialog.min.jsbootstrap-hover-dropdown.js
ck
common.jsjquery-cookie-min.jsjquery.qrcode.min.jsjsrender.jsshare_comment.jsthemes
README.md
default
404.htmlarchive.htmlcate.htmlfooter.htmlheader.htmlhighlight.html
images
index.htmlpage.htmlpaging.htmlpost.htmlsearch.htmlshare_comment.htmlsingle.htmlstyle.csstag_posts.htmltags.htmltheme.jsonelegant
404.htmlarchive.htmlcate.htmlfooter.htmlheader.htmlhighlight.html
images
index.htmlpaging.htmlpost.htmlsearch.htmlshare_comment.htmlsingle.htmlstyle.csstag_posts.htmltags.htmltheme.jsonnav_fixed
js
member
css
js
ace
ace.jsext-beautify.jsext-chromevox.jsext-elastic_tabstops_lite.jsext-emmet.jsext-error_marker.jsext-keybinding_menu.jsext-language_tools.jsext-linking.jsext-modelist.jsext-old_ie.jsext-prompt.jsext-searchbox.jsext-settings_menu.jsext-spellcheck.jsext-split.jsext-static_highlight.jsext-statusbar.jsext-textarea.jsext-themelist.jsext-whitespace.jskeybinding-emacs.jskeybinding-vim.jsmode-abap.jsmode-actionscript.jsmode-ada.jsmode-apache_conf.jsmode-applescript.jsmode-asciidoc.jsmode-assembly_x86.jsmode-autohotkey.jsmode-batchfile.jsmode-c9search.jsmode-c_cpp.jsmode-cirru.jsmode-clojure.jsmode-cobol.jsmode-coffee.jsmode-coldfusion.jsmode-csharp.jsmode-css.jsmode-curly.jsmode-d.jsmode-dart.jsmode-diff.jsmode-django.jsmode-dockerfile.jsmode-dot.jsmode-ejs.jsmode-erlang.jsmode-forth.jsmode-ftl.jsmode-gherkin.jsmode-glsl.jsmode-golang.jsmode-groovy.jsmode-haml.jsmode-handlebars.jsmode-haskell.jsmode-haxe.jsmode-html.jsmode-html_completions.jsmode-html_ruby.jsmode-ini.jsmode-jack.jsmode-jade.jsmode-java.jsmode-javascript.jsmode-json.jsmode-jsoniq.jsmode-jsp.jsmode-jsx.jsmode-julia.jsmode-latex.jsmode-less.jsmode-liquid.jsmode-lisp.jsmode-livescript.jsmode-logiql.jsmode-lsl.jsmode-lua.jsmode-luapage.jsmode-lucene.jsmode-makefile.jsmode-markdown.jsmode-matlab.jsmode-mel.jsmode-mushcode.jsmode-mushcode_high_rules.jsmode-mysql.jsmode-nix.jsmode-objectivec.jsmode-ocaml.jsmode-pascal.jsmode-perl.jsmode-pgsql.jsmode-php.jsmode-plain_text.jsmode-powershell.jsmode-prolog.jsmode-properties.jsmode-protobuf.jsmode-python.jsmode-r.jsmode-rdoc.jsmode-rhtml.jsmode-ruby.jsmode-rust.jsmode-sass.jsmode-scad.jsmode-scala.jsmode-scheme.jsmode-scss.jsmode-sh.jsmode-sjs.jsmode-smarty.jsmode-snippets.jsmode-soy_template.jsmode-space.jsmode-sql.jsmode-stylus.jsmode-svg.jsmode-tcl.jsmode-tex.jsmode-text.jsmode-textile.jsmode-toml.jsmode-twig.jsmode-typescript.jsmode-vala.jsmode-vbscript.jsmode-velocity.jsmode-verilog.jsmode-vhdl.jsmode-xml.jsmode-xquery.jsmode-yaml.js
jquery.sortable.jsmember.jssnippets
abap.jsactionscript.jsada.jsapache_conf.jsapplescript.jsasciidoc.jsassembly_x86.jsautohotkey.jsbatchfile.jsc9search.jsc_cpp.jscirru.jsclojure.jscobol.jscoffee.jscoldfusion.jscsharp.jscss.jscurly.jsd.jsdart.jsdiff.jsdjango.jsdockerfile.jsdot.jsejs.jserlang.jsforth.jsftl.jsgherkin.jsglsl.jsgolang.jsgroovy.jshaml.jshandlebars.jshaskell.jshaxe.jshtml.jshtml_completions.jshtml_ruby.jsini.jsjack.jsjade.jsjava.jsjavascript.jsjson.jsjsoniq.jsjsp.jsjsx.jsjulia.jslatex.jsless.jsliquid.jslisp.jslivescript.jslogiql.jslsl.jslua.jsluapage.jslucene.jsmakefile.jsmarkdown.jsmatlab.jsmel.jsmushcode.jsmushcode_high_rules.jsmysql.jsnix.jsobjectivec.jsocaml.jspascal.jsperl.jspgsql.jsphp.jsplain_text.jspowershell.jsprolog.jsproperties.jsprotobuf.jspython.jsr.jsrdoc.jsrhtml.jsruby.jsrust.jssass.jsscad.jsscala.jsscheme.jsscss.jssh.jssjs.jssmarty.jssnippets.jssoy_template.jsspace.jssql.jsstylus.jssvg.jstcl.jstex.jstext.jstextile.jstoml.jstwig.jstypescript.jsvala.jsvbscript.jsvelocity.jsverilog.jsvhdl.jsxml.jsxquery.jsyaml.js
theme-ambiance.jstheme-chaos.jstheme-chrome.jstheme-cloud9_day.jstheme-cloud9_night.jstheme-cloud9_night_low_color.jstheme-clouds.jstheme-clouds_midnight.jstheme-cobalt.jstheme-crimson_editor.jstheme-dawn.jstheme-dreamweaver.jstheme-eclipse.jstheme-github.jstheme-idle_fingers.jstheme-katzenmilch.jstheme-kr.jstheme-kuroir.jstheme-merbivore.jstheme-merbivore_soft.jstheme-mono_industrial.jstheme-monokai.jstheme-pastel_on_dark.jstheme-solarized_dark.jstheme-solarized_light.jstheme-terminal.jstheme-textmate.jstheme-tomorrow.jstheme-tomorrow_night.jstheme-tomorrow_night_blue.jstheme-tomorrow_night_bright.jstheme-tomorrow_night_eighties.jstheme-twilight.jstheme-vibrant_ink.jstheme-xcode.jsworker-coffee.jsworker-css.jsworker-html.jsworker-javascript.jsworker-json.jsworker-lua.jsworker-php.jsworker-xquery.js
5
public/blog/README.md
Normal file
5
public/blog/README.md
Normal file
@ -0,0 +1,5 @@
|
||||
博客的默认主题和一些公用的静态文件
|
||||
|
||||
themes 是默认主题, 有3个
|
||||
|
||||
用户自定义的主题不在这里, 在public/upload/userId/thmems下
|
325
public/blog/css/share_comment.css
Normal file
325
public/blog/css/share_comment.css
Normal file
@ -0,0 +1,325 @@
|
||||
.entry-controls {
|
||||
text-align: right;
|
||||
padding-top: 20px;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 10px;
|
||||
border-top: 1px solid #f1f2f3;
|
||||
}
|
||||
.entry-controls .right-section {
|
||||
float: right;
|
||||
color: #9d9e9f;
|
||||
}
|
||||
.entry-controls .right-section a {
|
||||
color: #9d9e9f;
|
||||
}
|
||||
.post-menu-button {
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.ui-menu-button {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
}
|
||||
.entry-controls .control-item {
|
||||
margin-left: 15px;
|
||||
color: #9d9e9f;
|
||||
font-size: 15px;
|
||||
opacity: 1;
|
||||
-webkit-transition: all 0.05s ease-in-out;
|
||||
-moz-transition: all 0.05s ease-in-out;
|
||||
-o-transition: all 0.05s ease-in-out;
|
||||
transition: all 0.05s ease-in-out;
|
||||
}
|
||||
.vote-section-wrapper {
|
||||
display: inline-block;
|
||||
float: left;
|
||||
}
|
||||
.entry-controls .voters {
|
||||
display: block;
|
||||
margin-top: 52px;
|
||||
height: 25px;
|
||||
clear: both;
|
||||
}
|
||||
.entry-controls .voters .more-voters,
|
||||
.entry-controls .voters .voter {
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
position: relative;
|
||||
margin: 0 8px 8px 0;
|
||||
float: left;
|
||||
}
|
||||
.entry-controls .voters .voter > img {
|
||||
float: left;
|
||||
}
|
||||
.avatar-small {
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.comment-box {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: 16px;
|
||||
}
|
||||
.comment-box a {
|
||||
font-size: 16px;
|
||||
}
|
||||
.comment-box .box-header {
|
||||
border-top: 1px solid #f1f2f3;
|
||||
font-size: 15px;
|
||||
color: #9d9e9f;
|
||||
padding: 30px 0 10px;
|
||||
position: relative;
|
||||
}
|
||||
.comment-box .box-header .icon {
|
||||
margin-right: 8px;
|
||||
vertical-align: -3px;
|
||||
}
|
||||
.comment-box .box-header a.comment-options {
|
||||
margin-left: 10px;
|
||||
}
|
||||
@media screen and (max-width: 600px) {
|
||||
.comment-box .box-header {
|
||||
padding-left: 17px;
|
||||
padding-right: 17px;
|
||||
}
|
||||
}
|
||||
.comment-box .load-more {
|
||||
height: 26px;
|
||||
margin-top: 15px;
|
||||
padding-top: 24px;
|
||||
text-align: center;
|
||||
font-size: 15px;
|
||||
border-top: solid 1px #f1f2f3;
|
||||
}
|
||||
.comment-box .load-more a {
|
||||
color: #9d9e9f;
|
||||
}
|
||||
.comment-box .ui-spinner {
|
||||
margin: 0 auto;
|
||||
}
|
||||
.comment-box .ui-spinner.small {
|
||||
position: relative;
|
||||
left: 10px;
|
||||
}
|
||||
.comment-box.empty.cannot-comment {
|
||||
border: 1px solid #dddddd;
|
||||
}
|
||||
.comment-box.cannot-comment .editable,
|
||||
.comment-box.cannot-comment .editable,
|
||||
.comment-box.comment-box.cannot-comment .command,
|
||||
.comment-box.comment-box.cannot-comment .op-link.reply {
|
||||
display: none !important;
|
||||
}
|
||||
.comment-box.empty.cannot-comment .comment-form {
|
||||
margin: 0;
|
||||
}
|
||||
.comment-box.empty.cannot-comment .comment-box-ft {
|
||||
background: #ffffff;
|
||||
}
|
||||
.comment-box.empty.cannot-comment .comment-box-ft,
|
||||
.comment-box .comment-box-ft {
|
||||
position: relative;
|
||||
margin-top: 0px;
|
||||
}
|
||||
.comment-box .avatar {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 20px;
|
||||
float: left;
|
||||
}
|
||||
.comment-box .message {
|
||||
margin-top: 24px;
|
||||
padding: 10px;
|
||||
border-radius: 4px;
|
||||
text-align: center;
|
||||
background: #F7F8F9;
|
||||
color: #9d9e9f;
|
||||
}
|
||||
.comment-item {
|
||||
position: relative;
|
||||
list-style: none;
|
||||
outline: 0;
|
||||
padding: 15px 0;
|
||||
border-bottom: solid 1px #f1f2f3;
|
||||
}
|
||||
.item-highlight * {
|
||||
border-radius: 5px;
|
||||
font-weight: bold;
|
||||
}
|
||||
@media screen and (max-width: 600px) {
|
||||
.comment-item {
|
||||
padding-left: 17px;
|
||||
padding-right: 17px;
|
||||
}
|
||||
}
|
||||
.comment-item > .avatar-link {
|
||||
float: left;
|
||||
margin: 4px 0 0;
|
||||
}
|
||||
.comment-item > .comment-body {
|
||||
margin: 0 0 0 60px;
|
||||
}
|
||||
.comment-item .comment-content {
|
||||
min-height: 22px;
|
||||
font-size: 15px;
|
||||
word-wrap: break-word;
|
||||
padding: 5px 0;
|
||||
}
|
||||
.comment-item .comment-hd,
|
||||
.comment-item .comment-ft {
|
||||
color: #9d9e9f;
|
||||
}
|
||||
.comment-item .comment-hd .desc,
|
||||
.comment-item .comment-ft .desc {
|
||||
font-size: 15px;
|
||||
}
|
||||
.comment-item .comment-ft {
|
||||
font-size: 15px;
|
||||
}
|
||||
.comment-item .op-link {
|
||||
color: #9d9e9f;
|
||||
font-size: 15px;
|
||||
margin-left: 12px;
|
||||
}
|
||||
.comment-item .op-link {
|
||||
visibility: hidden;
|
||||
}
|
||||
@media screen and (max-width: 420px) {
|
||||
.comment-item .op-link .icon {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
.comment-item .like-num {
|
||||
float: right;
|
||||
}
|
||||
.comment-item .like-num.nil {
|
||||
display: none;
|
||||
}
|
||||
.comment-item:hover .op-link {
|
||||
visibility: visible;
|
||||
}
|
||||
.comment-form.comment-reply-form {
|
||||
padding: 20px 0;
|
||||
}
|
||||
.comment-form .row {
|
||||
margin: 0;
|
||||
}
|
||||
.comment-form .editable {
|
||||
padding: 6px 12px;
|
||||
font-size: 16px;
|
||||
min-height: 18px;
|
||||
line-height: 26px;
|
||||
white-space: pre-wrap;
|
||||
width: 100%;
|
||||
color: #222;
|
||||
cursor: text;
|
||||
border: 1px solid #DDD;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) inset;
|
||||
background: #e6eaed;
|
||||
color: #747f8c;
|
||||
}
|
||||
#commentForm {
|
||||
border-top: solid 1px #f1f2f3;
|
||||
padding: 10px 0;
|
||||
}
|
||||
.comment-form .editable:focus {
|
||||
outline: none;
|
||||
border: 1px solid #cccccc;
|
||||
}
|
||||
.comment-form > .command {
|
||||
display: none;
|
||||
margin-top: 20px;
|
||||
padding-bottom: 0;
|
||||
text-align: right;
|
||||
}
|
||||
.comment-form > .command .save {
|
||||
float: right;
|
||||
}
|
||||
.comment-form > .command .cancel {
|
||||
color: #9d9e9f;
|
||||
vertical-align: -7px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.comment-form.expanded .command {
|
||||
display: block;
|
||||
}
|
||||
.comment-form > .avatar + .editable {
|
||||
margin-left: 60px;
|
||||
}
|
||||
#comments {
|
||||
padding: 0;
|
||||
}
|
||||
#comments form {
|
||||
display: none;
|
||||
}
|
||||
@media screen and (max-width: 600px) {
|
||||
.comment-form {
|
||||
padding-left: 17px;
|
||||
padding-right: 17px;
|
||||
}
|
||||
}
|
||||
.btn-zan {
|
||||
border-radius: 50px;
|
||||
}
|
||||
.btn-weibo {
|
||||
border-radius: 50px;
|
||||
color: #d44137;
|
||||
border-color: #d44137;
|
||||
}
|
||||
.btn-weibo:hover {
|
||||
color: #fff;
|
||||
background: #d44137;
|
||||
}
|
||||
.btn-weixin {
|
||||
color: #38ad5a;
|
||||
border-color: #38ad5a;
|
||||
border-radius: 50px;
|
||||
}
|
||||
.btn-weixin:hover {
|
||||
color: #fff;
|
||||
background: #38ad5a;
|
||||
}
|
||||
.reply-comment-btn {
|
||||
width: 100px;
|
||||
}
|
||||
.avatar-wrap {
|
||||
float: left;
|
||||
}
|
||||
.editor-wrap {
|
||||
margin-left: 60px;
|
||||
}
|
||||
#weixinQRCode {
|
||||
text-align: center;
|
||||
}
|
||||
.report-form ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.report-form .options > li {
|
||||
list-style: none;
|
||||
display: block;
|
||||
line-height: 2;
|
||||
color: #666768;
|
||||
}
|
||||
.report-form .options input {
|
||||
margin-right: 10px;
|
||||
vertical-align: 1px;
|
||||
}
|
||||
.footnote {
|
||||
color: red;
|
||||
}
|
||||
#moreComments {
|
||||
padding: 20px 0;
|
||||
text-align: center;
|
||||
}
|
||||
.needLogin {
|
||||
padding: 20px 0;
|
||||
text-align: center;
|
||||
font-size: 18px;
|
||||
border-top: 1px solid #f1f2f3;
|
||||
}
|
||||
.needLogin a {
|
||||
font-size: 18px;
|
||||
}
|
1
public/blog/js/bootstrap-dialog.min.js
vendored
Normal file
1
public/blog/js/bootstrap-dialog.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
111
public/blog/js/bootstrap-hover-dropdown.js
vendored
Normal file
111
public/blog/js/bootstrap-hover-dropdown.js
vendored
Normal file
@ -0,0 +1,111 @@
|
||||
/**
|
||||
* @preserve
|
||||
* Project: Bootstrap Hover Dropdown
|
||||
* Author: Cameron Spear
|
||||
* Version: v2.0.11
|
||||
* Contributors: Mattia Larentis
|
||||
* Dependencies: Bootstrap's Dropdown plugin, jQuery
|
||||
* Description: A simple plugin to enable Bootstrap dropdowns to active on hover and provide a nice user experience.
|
||||
* License: MIT
|
||||
* Homepage: http://cameronspear.com/blog/bootstrap-dropdown-on-hover-plugin/
|
||||
*/
|
||||
;(function ($, window, undefined) {
|
||||
// outside the scope of the jQuery plugin to
|
||||
// keep track of all dropdowns
|
||||
var $allDropdowns = $();
|
||||
|
||||
// if instantlyCloseOthers is true, then it will instantly
|
||||
// shut other nav items when a new one is hovered over
|
||||
$.fn.dropdownHover = function (options) {
|
||||
// don't do anything if touch is supported
|
||||
// (plugin causes some issues on mobile)
|
||||
if('ontouchstart' in document) return this; // don't want to affect chaining
|
||||
|
||||
// the element we really care about
|
||||
// is the dropdown-toggle's parent
|
||||
$allDropdowns = $allDropdowns.add(this.parent());
|
||||
|
||||
return this.each(function () {
|
||||
var $this = $(this),
|
||||
$parent = $this.parent(),
|
||||
defaults = {
|
||||
delay: 500,
|
||||
instantlyCloseOthers: true
|
||||
},
|
||||
data = {
|
||||
delay: $(this).data('delay'),
|
||||
instantlyCloseOthers: $(this).data('close-others')
|
||||
},
|
||||
showEvent = 'show.bs.dropdown',
|
||||
hideEvent = 'hide.bs.dropdown',
|
||||
// shownEvent = 'shown.bs.dropdown',
|
||||
// hiddenEvent = 'hidden.bs.dropdown',
|
||||
settings = $.extend(true, {}, defaults, options, data),
|
||||
timeout;
|
||||
|
||||
$parent.hover(function (event) {
|
||||
// so a neighbor can't open the dropdown
|
||||
if(!$parent.hasClass('open') && !$this.is(event.target)) {
|
||||
// stop this event, stop executing any code
|
||||
// in this callback but continue to propagate
|
||||
return true;
|
||||
}
|
||||
|
||||
openDropdown(event);
|
||||
}, function () {
|
||||
timeout = window.setTimeout(function () {
|
||||
$parent.removeClass('open');
|
||||
$this.trigger(hideEvent);
|
||||
}, settings.delay);
|
||||
});
|
||||
|
||||
// this helps with button groups!
|
||||
$this.hover(function (event) {
|
||||
/*
|
||||
// life
|
||||
// this helps prevent a double event from firing.
|
||||
// see https://github.com/CWSpear/bootstrap-hover-dropdown/issues/55
|
||||
if(!$parent.hasClass('open') && !$parent.is(event.target)) {
|
||||
// stop this event, stop executing any code
|
||||
// in this callback but continue to propagate
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
openDropdown(event);
|
||||
});
|
||||
|
||||
// handle submenus
|
||||
$parent.find('.dropdown-submenu').each(function (){
|
||||
var $this = $(this);
|
||||
var subTimeout;
|
||||
$this.hover(function () {
|
||||
window.clearTimeout(subTimeout);
|
||||
$this.children('.dropdown-menu').show();
|
||||
// always close submenu siblings instantly
|
||||
$this.siblings().children('.dropdown-menu').hide();
|
||||
}, function () {
|
||||
var $submenu = $this.children('.dropdown-menu');
|
||||
subTimeout = window.setTimeout(function () {
|
||||
$submenu.hide();
|
||||
}, settings.delay);
|
||||
});
|
||||
});
|
||||
|
||||
function openDropdown(event) {
|
||||
$allDropdowns.find(':focus').blur();
|
||||
|
||||
if(settings.instantlyCloseOthers === true)
|
||||
$allDropdowns.removeClass('open');
|
||||
|
||||
window.clearTimeout(timeout);
|
||||
$parent.addClass('open');
|
||||
$this.trigger(showEvent);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$(document).ready(function () {
|
||||
// apply dropdownHover to all elements with the data-hover="dropdown" attribute
|
||||
$('[data-hover="dropdown"]').dropdownHover({delay: 100});
|
||||
});
|
||||
})(jQuery, this);
|
1
public/blog/js/ck/common-min.js
vendored
Normal file
1
public/blog/js/ck/common-min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
419
public/blog/js/common.js
Normal file
419
public/blog/js/common.js
Normal file
@ -0,0 +1,419 @@
|
||||
// 返回是否是re.Ok == true
|
||||
function reIsOk(re) {
|
||||
return re && typeof re == "object" && re.Ok;
|
||||
}
|
||||
function showAlert(id, msg, type, id2Focus) {
|
||||
$(id).html(msg).removeClass("alert-danger").removeClass("alert-success").removeClass("alert-warning").addClass("alert-" + type).show();
|
||||
if(id2Focus) {
|
||||
$(id2Focus).focus();
|
||||
}
|
||||
}
|
||||
function hideAlert(id, timeout) {
|
||||
if(timeout) {
|
||||
setTimeout(function() {
|
||||
$(id).hide();
|
||||
}, timeout);
|
||||
} else {
|
||||
$(id).hide();
|
||||
}
|
||||
}
|
||||
function ajaxGet(url, param, func) {
|
||||
$.get(url, param, func);
|
||||
}
|
||||
|
||||
function ajaxPost(url, param, func) {
|
||||
$.post(url, param, func);
|
||||
}
|
||||
//------
|
||||
// jsonp
|
||||
function ajaxGetP(url, param, callback) {
|
||||
ajaxP("GET", url, param, callback)
|
||||
}
|
||||
function ajaxPostP(url, param, callback) {
|
||||
ajaxP("POST", url, param, callback)
|
||||
}
|
||||
function ajaxP(method, url, param, callback) {
|
||||
param = param || {};
|
||||
callback = callback || function() {};
|
||||
$.ajax({
|
||||
dataType: "jsonp",//跨域访问 dataType 必须是jsonp 类型。
|
||||
url: url,
|
||||
type: method,
|
||||
data: param,
|
||||
jsonp: "callback",
|
||||
jsonpCallback: "jsonpCallback",
|
||||
success: callback
|
||||
});
|
||||
}
|
||||
|
||||
//------------------
|
||||
// 分享
|
||||
var windowParam = 'width=700, height=580, top=180, left=320, toolbar=no, menubar=no, scrollbars=no, location=yes, resizable=no, status=no';
|
||||
function getShareUrl() {
|
||||
return location.href;
|
||||
}
|
||||
function getShareTitle(title) {
|
||||
return encodeURI(title + " (来自leanote.com)");
|
||||
}
|
||||
function shareSinaWeibo(noteId, title, pic) {
|
||||
var url = "http://service.weibo.com/share/share.php?title=" + getShareTitle(title) + "&url=" + getShareUrl(noteId);
|
||||
window.open(url, 'Share', windowParam);
|
||||
}
|
||||
function shareTencentWeibo(noteId, title, pic) {
|
||||
var _appkey = '801542571';
|
||||
var url = "http://share.v.t.qq.com/index.php?c=share&a=index&appkey=" + _appkey +"&title=" + getShareTitle(title) + "&url=" + getShareUrl(noteId) +"&pic=" + pic;
|
||||
window.open(url, 'Share', windowParam);
|
||||
}
|
||||
function shareQQ(noteId, title, pic) {
|
||||
var url = 'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=' + getShareUrl(noteId) + '&title=' + title + '&pics=' + pic;
|
||||
window.open(url, 'Share', windowParam);
|
||||
}
|
||||
function shareRenRen(noteId, title, pic) {
|
||||
var url = 'http://widget.renren.com/dialog/share?resourceUrl=' + getShareUrl(noteId) + '&srcUrl=' + getShareUrl(noteId) + '&title=' + getShareTitle(title) + '&pic=' + pic;
|
||||
window.open(url, 'Share', windowParam);
|
||||
}
|
||||
|
||||
// https://twitter.com/intent/tweet?text=&pic=
|
||||
function shareTwitter(noteId, title, pic) {
|
||||
var url = 'https://twitter.com/intent/tweet?text=' + getShareTitle(title) + '&pic=' + pic;
|
||||
window.open(url, 'Share', windowParam);
|
||||
}
|
||||
// http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&t=<?php the_title(); ?>”
|
||||
function shareFacebook(noteId, title, pic) {
|
||||
var url = ' http://www.facebook.com/sharer.php?t=' + getShareTitle(title) + '&pic=' + pic;
|
||||
window.open(url, 'Share', windowParam);
|
||||
}
|
||||
|
||||
|
||||
// go的datetime转成datetime字符串
|
||||
// 2014-01-06T18:29:48.802+08:00 => 2012-12-12 12:12:12 字符串
|
||||
function goNowToDatetime(goNow) {
|
||||
if(!goNow) {
|
||||
return "";
|
||||
}
|
||||
return goNow.substr(0, 10) + " " + goNow.substr(11, 8);
|
||||
}
|
||||
|
||||
// 转成Date()
|
||||
// 2014-01-06T18:29:48.802+08:00 => new Date(year, month, day, hour, minute, second)
|
||||
function goNowToDate(goNow) {
|
||||
if(!goNow) {
|
||||
return "";
|
||||
}
|
||||
var str = goNow.substr(0, 10) + " " + goNow.substr(11, 8);
|
||||
// 2012-12-12 12:12:12
|
||||
var tempStrs = str.split(" ");
|
||||
var dateStrs = tempStrs[0].split("-");
|
||||
var year = parseInt(dateStrs[0], 10);
|
||||
var month = parseInt(dateStrs[1], 10) - 1;
|
||||
var day = parseInt(dateStrs[2], 10);
|
||||
var timeStrs = tempStrs[1].split(":");
|
||||
var hour = parseInt(timeStrs [0], 10);
|
||||
var minute = parseInt(timeStrs[1], 10) - 1;
|
||||
var second = parseInt(timeStrs[2], 10);
|
||||
var date = new Date(year, month, day, hour, minute, second);
|
||||
return date;
|
||||
}
|
||||
|
||||
// 距离现在有多久, 评论时间间隔
|
||||
var diff = {
|
||||
minute : 1000 * 60,
|
||||
hour : 1000 * 60 * 60,
|
||||
day : 1000 * 60 * 60 * 24,
|
||||
halfamonth : 1000 * 60 * 60 * 24 * 15,
|
||||
month : 1000 * 60 * 60 * 24 * 30
|
||||
}
|
||||
function getDateDiff(dateTimeStamp) {
|
||||
var now = new Date().getTime();
|
||||
var diffValue = now - dateTimeStamp;
|
||||
if (diffValue < 0) {
|
||||
return "";
|
||||
}
|
||||
var monthC = diffValue / diff.month;
|
||||
var weekC = diffValue / (7 * diff.day);
|
||||
var dayC = diffValue / diff.day;
|
||||
var hourC = diffValue / diff.hour;
|
||||
var minC = diffValue / diff.minute;
|
||||
if (monthC >= 1) {
|
||||
result = parseInt(monthC) + "个月前";
|
||||
} else if (weekC >= 1) {
|
||||
result = parseInt(weekC) + "周前";
|
||||
} else if (dayC >= 1) {
|
||||
result = parseInt(dayC) + "天前";
|
||||
} else if (hourC >= 1) {
|
||||
result = parseInt(hourC) + "小时前";
|
||||
} else if (minC >= 1) {
|
||||
result = parseInt(minC) + "分钟前";
|
||||
} else {
|
||||
result = "刚刚";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function weixin() {
|
||||
var local=window.location.href;
|
||||
var title = $.trim($(".title").text());
|
||||
var desc = $.trim($("#desc").text());
|
||||
var imgUrl = $("#content img").eq(0).attr('src');
|
||||
window.shareData = {
|
||||
"imgUrl": imgUrl,
|
||||
"timeLineLink":local,
|
||||
"sendFriendLink": local,
|
||||
"weiboLink":local,
|
||||
"tTitle": title,
|
||||
"tContent": desc,
|
||||
"fTitle": title,
|
||||
"fContent": desc,
|
||||
"wContent": desc
|
||||
};
|
||||
document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
|
||||
// 发送给好友
|
||||
WeixinJSBridge.on('menu:share:appmessage', function (argv) {
|
||||
WeixinJSBridge.invoke('sendAppMessage', {
|
||||
"img_url": window.shareData.imgUrl,
|
||||
"img_width": "200",
|
||||
"link": window.shareData.sendFriendLink,
|
||||
"desc": window.shareData.fContent,
|
||||
"title": window.shareData.fTitle
|
||||
}, function (res) {
|
||||
hs_guide('none');
|
||||
_report('send_msg', res.err_msg);
|
||||
})
|
||||
});
|
||||
|
||||
// 分享到朋友圈
|
||||
WeixinJSBridge.on('menu:share:timeline', function (argv) {
|
||||
WeixinJSBridge.invoke('shareTimeline', {
|
||||
"img_url": window.shareData.imgUrl,
|
||||
"img_width": "200",
|
||||
"link": window.shareData.timeLineLink,
|
||||
"desc": window.shareData.tContent,
|
||||
"title": window.shareData.tTitle
|
||||
}, function (res) {
|
||||
hs_guide('none');
|
||||
_report('timeline', res.err_msg);
|
||||
});
|
||||
});
|
||||
|
||||
// 分享到微博
|
||||
WeixinJSBridge.on('menu:share:weibo', function (argv) {
|
||||
WeixinJSBridge.invoke('shareWeibo', {
|
||||
"content": window.shareData.wContent,
|
||||
"url": window.shareData.weiboLink,
|
||||
}, function (res) {
|
||||
hs_guide('none');
|
||||
_report('weibo', res.err_msg);
|
||||
});
|
||||
});
|
||||
}, false);
|
||||
}
|
||||
|
||||
|
||||
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("无");
|
||||
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);
|
||||
}
|
||||
|
||||
//-----------
|
||||
// 分享与评论
|
||||
|
||||
// 得到登录的链接
|
||||
function goLogin(){
|
||||
var loginUrl = siteUrl + '/login?from=' + encodeURI(location.href);
|
||||
location.href = loginUrl;
|
||||
}
|
||||
// 得到注册链接
|
||||
function goRegister() {
|
||||
var registerUrl = siteUrl + '/register?from=' + encodeURI(location.href);
|
||||
location.href = registerUrl;
|
||||
}
|
||||
// 是否需要登录, 评论时用到
|
||||
function needLogin() {
|
||||
if(typeof visitUserInfo == "undefined" || !visitUserInfo || !visitUserInfo.UserId) {
|
||||
// 弹框之
|
||||
var loginUrl = siteUrl + '/login?from=' + encodeURI(location.href);
|
||||
var registerUrl = siteUrl + '/register?from=' + encodeURI(location.href);
|
||||
try {
|
||||
var modal = BootstrapDialog.show({
|
||||
title: "你还未登录",
|
||||
message: '<div class="needLogin" style="border:none"><a href="' + loginUrl + '">立即登录</a>, 发表评论.<br />没有帐号? <a href="' + registerUrl +'">立即注册</a>',
|
||||
nl2br: false
|
||||
});
|
||||
} catch(e) {}
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 定位评论
|
||||
function scrollToTarget(t, fixed) {
|
||||
if(!fixed) {
|
||||
fixed = 0;
|
||||
}
|
||||
var $t = $(t)
|
||||
var targetOffset = $t.offset().top + fixed;
|
||||
$('html,body').animate({scrollTop: targetOffset}, 300);
|
||||
}
|
||||
|
||||
// 得到访问者信息, 因为自定义域名的原因, 需要用jsonp来获取
|
||||
function getCurVisitUserInfo() {
|
||||
|
||||
}
|
||||
// 增加阅读次数
|
||||
function incReadNum(noteId) {
|
||||
if(!$.cookie(noteId)) {
|
||||
$.cookie(noteId, 1);
|
||||
ajaxGet(getCurHostUrl() + "/blog/incReadNum", {noteId: noteId});
|
||||
}
|
||||
}
|
||||
function getCurHostUrl() {
|
||||
return "//" + location.host;
|
||||
}
|
||||
function getLeanoteUrl() {
|
||||
return siteUrl || "http://leanote.com";
|
||||
}
|
||||
// 得到博客统计信息
|
||||
function getPostStat(noteId, callback) {
|
||||
ajaxGet(getCurHostUrl() + "/blog/getPostStat", {noteId: noteId}, callback);
|
||||
}
|
||||
// 得到赞
|
||||
function getLikes(noteId, callback) {
|
||||
ajaxGetP(getLeanoteUrl() + "/blog/getLikes", {noteId: noteId}, callback);
|
||||
}
|
||||
// 得到赞和评论
|
||||
function getLikesAndComments(noteId, callback) {
|
||||
ajaxGetP(getLeanoteUrl() + "/blog/getLikesAndComments", {noteId: noteId}, callback);
|
||||
}
|
||||
// 得到评论
|
||||
function getComments(noteId, page) {
|
||||
ajaxGetP(getLeanoteUrl() + "/blog/listComments", {noteId: noteId, page: page}, callback);
|
||||
}
|
||||
// 点赞
|
||||
function likePost(noteId, callback) {
|
||||
ajaxPostP(getLeanoteUrl() + "/blog/likePost", {noteId: noteId}, callback)
|
||||
}
|
||||
// 提交评论
|
||||
function commentPost(noteId, commentId, content, callback) {
|
||||
var data = {noteId: self.noteId, toCommentId: commentId, content: content};
|
||||
ajaxPostP(getLeanoteUrl() + "/blog/commentPost", data, callback);
|
||||
}
|
||||
// 删除评论
|
||||
function deleteComment(noteId, commentId, callback) {
|
||||
ajaxPostP(getLeanoteUrl() + "/blog/deleteComment", {noteId: noteId, commentId: commentId}, callback);
|
||||
}
|
||||
// 点赞评论
|
||||
function likeComment(commentId, callback) {
|
||||
ajaxPostP(getLeanoteUrl() + "/blog/likeComment", {commentId: commentId}, callback);
|
||||
}
|
||||
|
||||
// 分享与评论结束
|
||||
//------------
|
||||
|
||||
//------------
|
||||
// 手机端
|
||||
var LEA = {isMobile: false};
|
||||
function isMobile() {
|
||||
var u = navigator.userAgent;
|
||||
LEA.isMobile = false;
|
||||
LEA.isMobile = /Mobile|Android|iPhone/i.test(u);
|
||||
if(!LEA.isMobile && $(document).width() <= 600){
|
||||
LEA.isMobile = true
|
||||
}
|
||||
}
|
||||
$(function() {
|
||||
isMobile();
|
||||
});
|
1
public/blog/js/jquery-cookie-min.js
vendored
Normal file
1
public/blog/js/jquery-cookie-min.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
(function(factory){factory(jQuery)})(function($){var pluses=/\+/g;function encode(s){return config.raw?s:encodeURIComponent(s)}function decode(s){return config.raw?s:decodeURIComponent(s)}function stringifyCookieValue(value){return encode(config.json?JSON.stringify(value):String(value))}function parseCookieValue(s){if(s.indexOf('"')===0){s=s.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\")}try{s=decodeURIComponent(s.replace(pluses," "));return config.json?JSON.parse(s):s}catch(e){}}function read(s,converter){var value=config.raw?s:parseCookieValue(s);return $.isFunction(converter)?converter(value):value}var config=$.cookie=function(key,value,options){if(value!==undefined&&!$.isFunction(value)){options=$.extend({},config.defaults,options);if(typeof options.expires==="number"){var days=options.expires,t=options.expires=new Date;t.setTime(+t+days*864e5)}return document.cookie=[encode(key),"=",stringifyCookieValue(value),options.expires?"; expires="+options.expires.toUTCString():"",options.path?"; path="+options.path:"",options.domain?"; domain="+options.domain:"",options.secure?"; secure":""].join("")}var result=key?undefined:{};var cookies=document.cookie?document.cookie.split("; "):[];for(var i=0,l=cookies.length;i<l;i++){var parts=cookies[i].split("=");var name=decode(parts.shift());var cookie=parts.join("=");if(key&&key===name){result=read(cookie,value);break}if(!key&&(cookie=read(cookie))!==undefined){result[name]=cookie}}return result};config.defaults={};$.removeCookie=function(key,options){if($.cookie(key)===undefined){return false}$.cookie(key,"",$.extend({},options,{expires:-1}));return!$.cookie(key)}});
|
28
public/blog/js/jquery.qrcode.min.js
vendored
Normal file
28
public/blog/js/jquery.qrcode.min.js
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
(function(r){r.fn.qrcode=function(h){var s;function u(a){this.mode=s;this.data=a}function o(a,c){this.typeNumber=a;this.errorCorrectLevel=c;this.modules=null;this.moduleCount=0;this.dataCache=null;this.dataList=[]}function q(a,c){if(void 0==a.length)throw Error(a.length+"/"+c);for(var d=0;d<a.length&&0==a[d];)d++;this.num=Array(a.length-d+c);for(var b=0;b<a.length-d;b++)this.num[b]=a[b+d]}function p(a,c){this.totalCount=a;this.dataCount=c}function t(){this.buffer=[];this.length=0}u.prototype={getLength:function(){return this.data.length},
|
||||
write:function(a){for(var c=0;c<this.data.length;c++)a.put(this.data.charCodeAt(c),8)}};o.prototype={addData:function(a){this.dataList.push(new u(a));this.dataCache=null},isDark:function(a,c){if(0>a||this.moduleCount<=a||0>c||this.moduleCount<=c)throw Error(a+","+c);return this.modules[a][c]},getModuleCount:function(){return this.moduleCount},make:function(){if(1>this.typeNumber){for(var a=1,a=1;40>a;a++){for(var c=p.getRSBlocks(a,this.errorCorrectLevel),d=new t,b=0,e=0;e<c.length;e++)b+=c[e].dataCount;
|
||||
for(e=0;e<this.dataList.length;e++)c=this.dataList[e],d.put(c.mode,4),d.put(c.getLength(),j.getLengthInBits(c.mode,a)),c.write(d);if(d.getLengthInBits()<=8*b)break}this.typeNumber=a}this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(a,c){this.moduleCount=4*this.typeNumber+17;this.modules=Array(this.moduleCount);for(var d=0;d<this.moduleCount;d++){this.modules[d]=Array(this.moduleCount);for(var b=0;b<this.moduleCount;b++)this.modules[d][b]=null}this.setupPositionProbePattern(0,0);this.setupPositionProbePattern(this.moduleCount-
|
||||
7,0);this.setupPositionProbePattern(0,this.moduleCount-7);this.setupPositionAdjustPattern();this.setupTimingPattern();this.setupTypeInfo(a,c);7<=this.typeNumber&&this.setupTypeNumber(a);null==this.dataCache&&(this.dataCache=o.createData(this.typeNumber,this.errorCorrectLevel,this.dataList));this.mapData(this.dataCache,c)},setupPositionProbePattern:function(a,c){for(var d=-1;7>=d;d++)if(!(-1>=a+d||this.moduleCount<=a+d))for(var b=-1;7>=b;b++)-1>=c+b||this.moduleCount<=c+b||(this.modules[a+d][c+b]=
|
||||
0<=d&&6>=d&&(0==b||6==b)||0<=b&&6>=b&&(0==d||6==d)||2<=d&&4>=d&&2<=b&&4>=b?!0:!1)},getBestMaskPattern:function(){for(var a=0,c=0,d=0;8>d;d++){this.makeImpl(!0,d);var b=j.getLostPoint(this);if(0==d||a>b)a=b,c=d}return c},createMovieClip:function(a,c,d){a=a.createEmptyMovieClip(c,d);this.make();for(c=0;c<this.modules.length;c++)for(var d=1*c,b=0;b<this.modules[c].length;b++){var e=1*b;this.modules[c][b]&&(a.beginFill(0,100),a.moveTo(e,d),a.lineTo(e+1,d),a.lineTo(e+1,d+1),a.lineTo(e,d+1),a.endFill())}return a},
|
||||
setupTimingPattern:function(){for(var a=8;a<this.moduleCount-8;a++)null==this.modules[a][6]&&(this.modules[a][6]=0==a%2);for(a=8;a<this.moduleCount-8;a++)null==this.modules[6][a]&&(this.modules[6][a]=0==a%2)},setupPositionAdjustPattern:function(){for(var a=j.getPatternPosition(this.typeNumber),c=0;c<a.length;c++)for(var d=0;d<a.length;d++){var b=a[c],e=a[d];if(null==this.modules[b][e])for(var f=-2;2>=f;f++)for(var i=-2;2>=i;i++)this.modules[b+f][e+i]=-2==f||2==f||-2==i||2==i||0==f&&0==i?!0:!1}},setupTypeNumber:function(a){for(var c=
|
||||
j.getBCHTypeNumber(this.typeNumber),d=0;18>d;d++){var b=!a&&1==(c>>d&1);this.modules[Math.floor(d/3)][d%3+this.moduleCount-8-3]=b}for(d=0;18>d;d++)b=!a&&1==(c>>d&1),this.modules[d%3+this.moduleCount-8-3][Math.floor(d/3)]=b},setupTypeInfo:function(a,c){for(var d=j.getBCHTypeInfo(this.errorCorrectLevel<<3|c),b=0;15>b;b++){var e=!a&&1==(d>>b&1);6>b?this.modules[b][8]=e:8>b?this.modules[b+1][8]=e:this.modules[this.moduleCount-15+b][8]=e}for(b=0;15>b;b++)e=!a&&1==(d>>b&1),8>b?this.modules[8][this.moduleCount-
|
||||
b-1]=e:9>b?this.modules[8][15-b-1+1]=e:this.modules[8][15-b-1]=e;this.modules[this.moduleCount-8][8]=!a},mapData:function(a,c){for(var d=-1,b=this.moduleCount-1,e=7,f=0,i=this.moduleCount-1;0<i;i-=2)for(6==i&&i--;;){for(var g=0;2>g;g++)if(null==this.modules[b][i-g]){var n=!1;f<a.length&&(n=1==(a[f]>>>e&1));j.getMask(c,b,i-g)&&(n=!n);this.modules[b][i-g]=n;e--; -1==e&&(f++,e=7)}b+=d;if(0>b||this.moduleCount<=b){b-=d;d=-d;break}}}};o.PAD0=236;o.PAD1=17;o.createData=function(a,c,d){for(var c=p.getRSBlocks(a,
|
||||
c),b=new t,e=0;e<d.length;e++){var f=d[e];b.put(f.mode,4);b.put(f.getLength(),j.getLengthInBits(f.mode,a));f.write(b)}for(e=a=0;e<c.length;e++)a+=c[e].dataCount;if(b.getLengthInBits()>8*a)throw Error("code length overflow. ("+b.getLengthInBits()+">"+8*a+")");for(b.getLengthInBits()+4<=8*a&&b.put(0,4);0!=b.getLengthInBits()%8;)b.putBit(!1);for(;!(b.getLengthInBits()>=8*a);){b.put(o.PAD0,8);if(b.getLengthInBits()>=8*a)break;b.put(o.PAD1,8)}return o.createBytes(b,c)};o.createBytes=function(a,c){for(var d=
|
||||
0,b=0,e=0,f=Array(c.length),i=Array(c.length),g=0;g<c.length;g++){var n=c[g].dataCount,h=c[g].totalCount-n,b=Math.max(b,n),e=Math.max(e,h);f[g]=Array(n);for(var k=0;k<f[g].length;k++)f[g][k]=255&a.buffer[k+d];d+=n;k=j.getErrorCorrectPolynomial(h);n=(new q(f[g],k.getLength()-1)).mod(k);i[g]=Array(k.getLength()-1);for(k=0;k<i[g].length;k++)h=k+n.getLength()-i[g].length,i[g][k]=0<=h?n.get(h):0}for(k=g=0;k<c.length;k++)g+=c[k].totalCount;d=Array(g);for(k=n=0;k<b;k++)for(g=0;g<c.length;g++)k<f[g].length&&
|
||||
(d[n++]=f[g][k]);for(k=0;k<e;k++)for(g=0;g<c.length;g++)k<i[g].length&&(d[n++]=i[g][k]);return d};s=4;for(var j={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,
|
||||
78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(a){for(var c=a<<10;0<=j.getBCHDigit(c)-j.getBCHDigit(j.G15);)c^=j.G15<<j.getBCHDigit(c)-j.getBCHDigit(j.G15);return(a<<10|c)^j.G15_MASK},getBCHTypeNumber:function(a){for(var c=a<<12;0<=j.getBCHDigit(c)-
|
||||
j.getBCHDigit(j.G18);)c^=j.G18<<j.getBCHDigit(c)-j.getBCHDigit(j.G18);return a<<12|c},getBCHDigit:function(a){for(var c=0;0!=a;)c++,a>>>=1;return c},getPatternPosition:function(a){return j.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,c,d){switch(a){case 0:return 0==(c+d)%2;case 1:return 0==c%2;case 2:return 0==d%3;case 3:return 0==(c+d)%3;case 4:return 0==(Math.floor(c/2)+Math.floor(d/3))%2;case 5:return 0==c*d%2+c*d%3;case 6:return 0==(c*d%2+c*d%3)%2;case 7:return 0==(c*d%3+(c+d)%2)%2;default:throw Error("bad maskPattern:"+
|
||||
a);}},getErrorCorrectPolynomial:function(a){for(var c=new q([1],0),d=0;d<a;d++)c=c.multiply(new q([1,l.gexp(d)],0));return c},getLengthInBits:function(a,c){if(1<=c&&10>c)switch(a){case 1:return 10;case 2:return 9;case s:return 8;case 8:return 8;default:throw Error("mode:"+a);}else if(27>c)switch(a){case 1:return 12;case 2:return 11;case s:return 16;case 8:return 10;default:throw Error("mode:"+a);}else if(41>c)switch(a){case 1:return 14;case 2:return 13;case s:return 16;case 8:return 12;default:throw Error("mode:"+
|
||||
a);}else throw Error("type:"+c);},getLostPoint:function(a){for(var c=a.getModuleCount(),d=0,b=0;b<c;b++)for(var e=0;e<c;e++){for(var f=0,i=a.isDark(b,e),g=-1;1>=g;g++)if(!(0>b+g||c<=b+g))for(var h=-1;1>=h;h++)0>e+h||c<=e+h||0==g&&0==h||i==a.isDark(b+g,e+h)&&f++;5<f&&(d+=3+f-5)}for(b=0;b<c-1;b++)for(e=0;e<c-1;e++)if(f=0,a.isDark(b,e)&&f++,a.isDark(b+1,e)&&f++,a.isDark(b,e+1)&&f++,a.isDark(b+1,e+1)&&f++,0==f||4==f)d+=3;for(b=0;b<c;b++)for(e=0;e<c-6;e++)a.isDark(b,e)&&!a.isDark(b,e+1)&&a.isDark(b,e+
|
||||
2)&&a.isDark(b,e+3)&&a.isDark(b,e+4)&&!a.isDark(b,e+5)&&a.isDark(b,e+6)&&(d+=40);for(e=0;e<c;e++)for(b=0;b<c-6;b++)a.isDark(b,e)&&!a.isDark(b+1,e)&&a.isDark(b+2,e)&&a.isDark(b+3,e)&&a.isDark(b+4,e)&&!a.isDark(b+5,e)&&a.isDark(b+6,e)&&(d+=40);for(e=f=0;e<c;e++)for(b=0;b<c;b++)a.isDark(b,e)&&f++;a=Math.abs(100*f/c/c-50)/5;return d+10*a}},l={glog:function(a){if(1>a)throw Error("glog("+a+")");return l.LOG_TABLE[a]},gexp:function(a){for(;0>a;)a+=255;for(;256<=a;)a-=255;return l.EXP_TABLE[a]},EXP_TABLE:Array(256),
|
||||
LOG_TABLE:Array(256)},m=0;8>m;m++)l.EXP_TABLE[m]=1<<m;for(m=8;256>m;m++)l.EXP_TABLE[m]=l.EXP_TABLE[m-4]^l.EXP_TABLE[m-5]^l.EXP_TABLE[m-6]^l.EXP_TABLE[m-8];for(m=0;255>m;m++)l.LOG_TABLE[l.EXP_TABLE[m]]=m;q.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var c=Array(this.getLength()+a.getLength()-1),d=0;d<this.getLength();d++)for(var b=0;b<a.getLength();b++)c[d+b]^=l.gexp(l.glog(this.get(d))+l.glog(a.get(b)));return new q(c,0)},mod:function(a){if(0>
|
||||
this.getLength()-a.getLength())return this;for(var c=l.glog(this.get(0))-l.glog(a.get(0)),d=Array(this.getLength()),b=0;b<this.getLength();b++)d[b]=this.get(b);for(b=0;b<a.getLength();b++)d[b]^=l.gexp(l.glog(a.get(b))+c);return(new q(d,0)).mod(a)}};p.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],
|
||||
[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,
|
||||
116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,
|
||||
43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,
|
||||
3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,
|
||||
55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,
|
||||
45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];p.getRSBlocks=function(a,c){var d=p.getRsBlockTable(a,c);if(void 0==d)throw Error("bad rs block @ typeNumber:"+a+"/errorCorrectLevel:"+c);for(var b=d.length/3,e=[],f=0;f<b;f++)for(var h=d[3*f+0],g=d[3*f+1],j=d[3*f+2],l=0;l<h;l++)e.push(new p(g,j));return e};p.getRsBlockTable=function(a,c){switch(c){case 1:return p.RS_BLOCK_TABLE[4*(a-1)+0];case 0:return p.RS_BLOCK_TABLE[4*(a-1)+1];case 3:return p.RS_BLOCK_TABLE[4*
|
||||
(a-1)+2];case 2:return p.RS_BLOCK_TABLE[4*(a-1)+3]}};t.prototype={get:function(a){return 1==(this.buffer[Math.floor(a/8)]>>>7-a%8&1)},put:function(a,c){for(var d=0;d<c;d++)this.putBit(1==(a>>>c-d-1&1))},getLengthInBits:function(){return this.length},putBit:function(a){var c=Math.floor(this.length/8);this.buffer.length<=c&&this.buffer.push(0);a&&(this.buffer[c]|=128>>>this.length%8);this.length++}};"string"===typeof h&&(h={text:h});h=r.extend({},{render:"canvas",width:256,height:256,typeNumber:-1,
|
||||
correctLevel:2,background:"#ffffff",foreground:"#000000"},h);return this.each(function(){var a;if("canvas"==h.render){a=new o(h.typeNumber,h.correctLevel);a.addData(h.text);a.make();var c=document.createElement("canvas");c.width=h.width;c.height=h.height;for(var d=c.getContext("2d"),b=h.width/a.getModuleCount(),e=h.height/a.getModuleCount(),f=0;f<a.getModuleCount();f++)for(var i=0;i<a.getModuleCount();i++){d.fillStyle=a.isDark(f,i)?h.foreground:h.background;var g=Math.ceil((i+1)*b)-Math.floor(i*b),
|
||||
j=Math.ceil((f+1)*b)-Math.floor(f*b);d.fillRect(Math.round(i*b),Math.round(f*e),g,j)}}else{a=new o(h.typeNumber,h.correctLevel);a.addData(h.text);a.make();c=r("<table></table>").css("width",h.width+"px").css("height",h.height+"px").css("border","0px").css("border-collapse","collapse").css("background-color",h.background);d=h.width/a.getModuleCount();b=h.height/a.getModuleCount();for(e=0;e<a.getModuleCount();e++){f=r("<tr></tr>").css("height",b+"px").appendTo(c);for(i=0;i<a.getModuleCount();i++)r("<td></td>").css("width",
|
||||
d+"px").css("background-color",a.isDark(e,i)?h.foreground:h.background).appendTo(f)}}a=c;jQuery(a).appendTo(this)})}})(jQuery);
|
1626
public/blog/js/jsrender.js
Normal file
1626
public/blog/js/jsrender.js
Normal file
File diff suppressed because it is too large
Load Diff
372
public/blog/js/share_comment.js
Normal file
372
public/blog/js/share_comment.js
Normal file
@ -0,0 +1,372 @@
|
||||
// leanote blog share & comment
|
||||
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(blogInfo.OpenComment && blogInfo.CommentType != "disqus") {
|
||||
self.initLikesAndComments();
|
||||
} else {
|
||||
self.initLikes();
|
||||
}
|
||||
self.initEvent();
|
||||
self.incReadNum();
|
||||
|
||||
//
|
||||
},
|
||||
|
||||
// 博客的统计信息
|
||||
getPostStat: function() {
|
||||
|
||||
},
|
||||
// 增加阅读量
|
||||
incReadNum: function() {
|
||||
incReadNum(self.noteId);
|
||||
},
|
||||
initLikes: function() {
|
||||
var self = this;
|
||||
getLikes(self.noteId, function(ret) {
|
||||
if(reIsOk(ret)) {
|
||||
ret = ret.Item;
|
||||
self.info = ret;
|
||||
self.toggleLikeBtnActive();
|
||||
self.renderLikers();
|
||||
self.visitUserInfo = self.info.visitUserInfo || {};
|
||||
}
|
||||
});
|
||||
},
|
||||
initLikesAndComments: function() {
|
||||
var self = this;
|
||||
getLikesAndComments(self.noteId, function(ret) {
|
||||
if(reIsOk(ret)) {
|
||||
ret = ret.Item;
|
||||
self.info = ret;
|
||||
self.toggleLikeBtnActive();
|
||||
self.renderLikers();
|
||||
// 是否需要renderComments?
|
||||
self.info.commentUserInfo = self.info.commentUserInfo || {};
|
||||
self.visitUserInfo = self.info.visitUserInfo || {};
|
||||
// 为了防止第一条评论找不到用户信息情况
|
||||
if(self.visitUserInfo.UserId) {
|
||||
self.info.commentUserInfo[self.visitUserInfo.UserId] = self.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();
|
||||
}
|
||||
|
||||
// 是否已经登录?
|
||||
if(self.visitUserInfo.UserId) {
|
||||
$("#commentForm").removeClass("hide");
|
||||
$("#visitUserLogo").attr("src", self.visitUserInfo.Logo);
|
||||
} else {
|
||||
$("#noLoginContainer").removeClass("hide");
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
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");
|
||||
getComments(self.noteId, 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: self.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({comments: [comment], visitUserInfo: self.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 = blogInfo.UserId;
|
||||
commentUserInfo = self.info.commentUserInfo;
|
||||
comment.UserInfo = commentUserInfo[comment.UserId];
|
||||
// 是作者自己
|
||||
if(self.visitUserInfo.UserId == authorUserId) {
|
||||
comment.IsMyNote = true;
|
||||
}
|
||||
if(comment.UserId == authorUserId) {
|
||||
comment.IsAuthorComment = true;
|
||||
}
|
||||
if(comment.UserId == self.visitUserInfo.UserId) {
|
||||
comment.IsMyComment = true;
|
||||
}
|
||||
// 不是回复自己
|
||||
if(comment.ToUserId && comment.ToUserId != comment.UserId) {
|
||||
comment.ToUserInfo = commentUserInfo[comment.ToUserId];
|
||||
if(comment.ToUserInfo.UserId == authorUserId) {
|
||||
comment.ToUserIsAuthor = true;
|
||||
}
|
||||
}
|
||||
comment.PublishDate = getDateDiff(goNowToDate(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({comments: comments, visitUserInfo: self.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 == self.visitUserInfo.UserId) {
|
||||
likedUsers.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(addMe) {
|
||||
likedUsers = [self.visitUserInfo].concat(likedUsers);
|
||||
self.info.likedUsers = likedUsers;
|
||||
}
|
||||
self.renderLikers();
|
||||
},
|
||||
renderLikers: function() {
|
||||
var self = this;
|
||||
var users = self.info.likedUsers || [];
|
||||
var html = self.tLikersO.render({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(!self.visitUserInfo.UserId) {
|
||||
needLogin();
|
||||
return;
|
||||
}
|
||||
likePost(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};
|
||||
commentPost(self.noteId, commentId, content, 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;
|
||||
try {
|
||||
BootstrapDialog.confirm("确定删除该评论?", function(yes) {
|
||||
if(yes) {
|
||||
deleteComment(noteId, commentId, function(ret) {
|
||||
if(ret.Ok) {
|
||||
var li = $(t).closest("li");
|
||||
li.hide(500); // remove();
|
||||
setTimeout(function() {
|
||||
li.remove();
|
||||
}, 300);
|
||||
|
||||
self.bindCommentNum(-1);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} catch(e) {}
|
||||
});
|
||||
|
||||
// 点zan
|
||||
$(".comment-box").on("click", ".comment-like", function(e) {
|
||||
var commentId = $(this).parent().data("comment-id");
|
||||
var t = this;
|
||||
|
||||
likeComment(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("取消赞");
|
||||
} else {
|
||||
$(t).find(".like-text").text("赞");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
$(".comment-box").on("click", ".comment-report", function() {
|
||||
if(needLogin()) {
|
||||
return;
|
||||
}
|
||||
var commentId = $(this).parent().data("comment-id");
|
||||
report(commentId, self.noteId, "举报评论?");
|
||||
});
|
||||
self.initShare();
|
||||
},
|
||||
weixinQRCodeO: $("#weixinQRCode"),
|
||||
initShare: function() {
|
||||
var self = this;
|
||||
$(".btn-weixin").click(function() {
|
||||
if(!self.weixinQRCodeO.html()) {
|
||||
self.weixinQRCodeO.qrcode(location.href);
|
||||
}
|
||||
BootstrapDialog.show({
|
||||
title: "打开微信扫一扫二维码",
|
||||
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
public/blog/themes/README.md
Normal file
1
public/blog/themes/README.md
Normal file
@ -0,0 +1 @@
|
||||
这里面是leanote默认主题
|
47
public/blog/themes/default/404.html
Normal file
47
public/blog/themes/default/404.html
Normal file
@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh">
|
||||
<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">
|
||||
<title>404</title>
|
||||
|
||||
<link href="/css/bootstrap.css" rel="stylesheet">
|
||||
<link href="/css/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet">
|
||||
<link href="/css/index.css" rel="stylesheet">
|
||||
<style>
|
||||
html, body {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body id="boxBody">
|
||||
<section id="box">
|
||||
<div>
|
||||
<div>
|
||||
<h1 class="h text-white animated fadeInDownBig">life-404</h1>
|
||||
</div>
|
||||
<div id="errorBox">
|
||||
<p class="error-info">
|
||||
This page cann't found.
|
||||
</p>
|
||||
|
||||
<div class="list-group m-b-sm bg-white m-b-lg">
|
||||
<a href="javascript:history.go(-1);" class="list-group-item"><!-- <i class="fa fa-chevron-right icon-muted"> --></i> <i class="fa fa-fw fa-arrow-left icon-muted"></i> Back </a>
|
||||
<a href="/index" class="list-group-item"><!-- <i class="fa fa-chevron-right icon-muted"> --></i> <i class="fa fa-fw fa-home icon-muted"></i> Goto homepage </a>
|
||||
<a href="/note" class="list-group-item"><!-- <i class="fa fa-chevron-right icon-muted"> --></i> <i class="fa fa-fw fa-file-o icon-muted"></i> My note</a>
|
||||
<a class="list-group-item" href="mailto:leanote@leanote.com">
|
||||
<span class="badge">leanote@leanote.com</span>
|
||||
<i class="fa fa-fw fa-envelope-o icon-muted"></i> Contact Us </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div id="boxFooter">
|
||||
<p>
|
||||
<a href="/index">leanote</a> © 2014
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
30
public/blog/themes/default/archive.html
Normal file
30
public/blog/themes/default/archive.html
Normal file
@ -0,0 +1,30 @@
|
||||
{{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>
|
||||
{{dateFormat .PublicTime "2006-01-02"}} <a href="{{$.postUrl}}/{{.NoteId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
42
public/blog/themes/default/cate.html
Normal file
42
public/blog/themes/default/cate.html
Normal file
@ -0,0 +1,42 @@
|
||||
{{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="{{$.postUrl}}/{{.NoteId}}" title="全文">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
无
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" $}}
|
||||
{{template "highlight.html" $}}
|
||||
|
||||
</body>
|
||||
</html>
|
51
public/blog/themes/default/footer.html
Normal file
51
public/blog/themes/default/footer.html
Normal file
@ -0,0 +1,51 @@
|
||||
<div id="footerContainer">
|
||||
{{$userId := $.blogInfo.UserId}}
|
||||
<div class="container" id="footer">
|
||||
<div class="col-md-4">
|
||||
<h3>导航</h3>
|
||||
<ul>
|
||||
<li><a href="{{$.indexUrl}}">主页</a></li>
|
||||
{{range $.cates}}
|
||||
<li>
|
||||
<a href="{{$.cateUrl}}/{{.CateId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3>最近发表</h3>
|
||||
<ul>
|
||||
{{range .recentPosts}}
|
||||
<li title="{{.Title}}"><a href="{{$.postUrl}}/{{.NoteId}}/">{{.Title}}</a></li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3>友情链接 </h3>
|
||||
<ul>
|
||||
{{if $.themeInfo.FriendLinks}}
|
||||
{{range $.themeInfo.FriendLinks}}
|
||||
<li><a href="{{.Url}}" target="_blank">{{.Title}}</a></li>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="{{$.jQueryUrl}}"></script>
|
||||
<script src="{{$.bootstrapJsUrl}}"></script>
|
||||
<script src="{{$.siteUrl}}/js/bootstrap-hover-dropdown.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>
|
120
public/blog/themes/default/header.html
Normal file
120
public/blog/themes/default/header.html
Normal file
@ -0,0 +1,120 @@
|
||||
<!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, not only a notebook">
|
||||
<meta name="author" content="leanote">
|
||||
|
||||
<title>
|
||||
{{if $.curIsIndex}}
|
||||
{{$.blogInfo.Title}}
|
||||
{{else if $.curIsCate}}
|
||||
分类-{{$.curCateTitle}}
|
||||
{{else if $.curIsView}}
|
||||
{{$.post.Title}}
|
||||
{{else if $.curIsSearch}}
|
||||
搜索-{{$.keywords}}
|
||||
{{else if $.curIsTags}}
|
||||
我的标签
|
||||
{{else if $.curIsTagPosts}}
|
||||
标签-{{$.curTag}}
|
||||
{{else}}
|
||||
我的博客
|
||||
{{end}}
|
||||
|
||||
</title>
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link href="{{$.bootstrapCssUrl}}" rel="stylesheet">
|
||||
<!-- 字体必须同一域 -->
|
||||
<link href="{{$.fontAwesomeUrl}}" rel="stylesheet">
|
||||
<link href="{{$.themeBaseUrl}}/style.css" 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>
|
6
public/blog/themes/default/highlight.html
Normal file
6
public/blog/themes/default/highlight.html
Normal file
@ -0,0 +1,6 @@
|
||||
<link href="{{$.prettifyCssUrl}}" type="text/css" rel="stylesheet"/>
|
||||
<script src="{{$.prettifyJsUrl}}"></script>
|
||||
<script>
|
||||
$("pre").addClass("prettyprint linenums");
|
||||
prettyPrint();
|
||||
</script>
|
BIN
public/blog/themes/default/images/leanote-icon.jpg
Normal file
BIN
public/blog/themes/default/images/leanote-icon.jpg
Normal file
Binary file not shown.
After ![]() (image error) Size: 25 KiB |
BIN
public/blog/themes/default/images/loading-32.gif
Normal file
BIN
public/blog/themes/default/images/loading-32.gif
Normal file
Binary file not shown.
After ![]() (image error) Size: 4.7 KiB |
BIN
public/blog/themes/default/images/noise.png
Normal file
BIN
public/blog/themes/default/images/noise.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 10 KiB |
BIN
public/blog/themes/default/images/screenshot.png
Normal file
BIN
public/blog/themes/default/images/screenshot.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 109 KiB |
BIN
public/blog/themes/default/images/triangle_2x.png
Normal file
BIN
public/blog/themes/default/images/triangle_2x.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 629 B |
39
public/blog/themes/default/index.html
Normal file
39
public/blog/themes/default/index.html
Normal file
@ -0,0 +1,39 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
|
||||
<div id="posts">
|
||||
{{range $.posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.postUrl}}/{{.NoteId}}" title="全文">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
无
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
{{template "footer.html" $}}
|
||||
{{template "highlight.html" $}}
|
||||
|
||||
</body>
|
||||
</html>
|
1
public/blog/themes/default/page.html
Normal file
1
public/blog/themes/default/page.html
Normal file
@ -0,0 +1 @@
|
||||
aaaaaaaaaaaaaaaaaaa
|
27
public/blog/themes/default/paging.html
Normal file
27
public/blog/themes/default/paging.html
Normal file
@ -0,0 +1,27 @@
|
||||
{{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}}
|
143
public/blog/themes/default/post.html
Normal file
143
public/blog/themes/default/post.html
Normal file
@ -0,0 +1,143 @@
|
||||
{{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}}
|
||||
无
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> 更新 {{$.post.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> 创建 {{$.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="{{$.postUrl}}/{{$.prePost.NoteId}}">{{$.prePost.Title}}</a>{{else}}无{{end}}
|
||||
</p>
|
||||
<p>
|
||||
下一篇: {{if $.nextPost}}<a href="{{$.postUrl}}/{{$.nextPost.NoteId}}">{{$.nextPost.Title}}</a>{{else}}无{{end}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- share & comment -->
|
||||
{{template "share_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>文档导航</span>
|
||||
</div>
|
||||
<div id="blogNavContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 一些在share_comment.js 需要使用的变量 -->
|
||||
<script>
|
||||
var siteUrl = "{{$.siteUrl}}"; // common.js需要
|
||||
// 以下 share_comment.js需要
|
||||
var blogInfo={UserId: "{{$.blogInfo.UserId}}", OpenComment: {{$.blogInfo.OpenComment}}, CommentType: "{{$.blogInfo.CommentType}}"};
|
||||
var noteId = "{{$.post.NoteId}}"; //
|
||||
var preLikeNum = +"{{$.post.LikeNum}}";
|
||||
var commentNum = +"{{$.post.CommentNum}}";
|
||||
</script>
|
||||
|
||||
<!-- 共享与评论css -->
|
||||
<link href="{{$.shareCommentCssUrl}}" rel="stylesheet">
|
||||
<!-- 一些公用的js -->
|
||||
<script src="{{$.blogCommonJsUrl}}"></script>
|
||||
<script src="{{$.siteUrl}}/public/blog/js/jsrender.js"></script>
|
||||
<script src="{{$.siteUrl}}/public/blog/js/jquery-cookie-min.js"></script>
|
||||
<script src="{{$.siteUrl}}/public/blog/js/bootstrap-dialog.min.js"></script>
|
||||
<script src="{{$.siteUrl}}/public/blog/js/jquery.qrcode.min.js"></script>
|
||||
<!-- share && comment -->
|
||||
<script src="{{$.shareCommentJsUrl}}"></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>
|
49
public/blog/themes/default/search.html
Normal file
49
public/blog/themes/default/search.html
Normal file
@ -0,0 +1,49 @@
|
||||
{{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="{{$.postUrl}}/{{.NoteId}}" title="全文">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
无
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}} |
|
||||
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
|
||||
</div>
|
||||
|
||||
|
||||
{{else}}
|
||||
<div class="each-post">
|
||||
无
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" $}}
|
||||
{{template "highlight.html" $}}
|
||||
</body>
|
||||
</html>
|
172
public/blog/themes/default/share_comment.html
Normal file
172
public/blog/themes/default/share_comment.html
Normal file
@ -0,0 +1,172 @@
|
||||
<!-- 赞 -->
|
||||
<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">{{$.post.LikeNum}}</span> 赞</button>
|
||||
<span class="control-item read-counts"><i class="fa fa-eye"></i> {{if $.post.ReadNum}}{{$.post.ReadNum}}{{else}}1{{end}} 人读过</span>
|
||||
</div>
|
||||
<div class="right-section">
|
||||
<div id="weixinQRCode"></div>
|
||||
<button class="btn btn-share btn-default btn-weibo"><i class="fa fa-weibo"></i> 新浪微博</button>
|
||||
<button class="btn btn-share btn-default btn-weixin"><i class="fa fa-wechat"></i> 微信</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>
|
||||
更多分享
|
||||
</div>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="#" class="btn-share tencent-weibo"><i class="fa fa-tencent-weibo"></i> 腾讯微博</a></li>
|
||||
<li><a href="#" class="btn-share qq"><i class="fa fa-qq"></i> QQ空间</a></li>
|
||||
<li><a href="#" class="btn-share renren"><i class="fa fa-renren"></i> 人人网</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="voters clearfix" id="likers">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/x-jsrender" id="tLikers">
|
||||
[[for users]]
|
||||
<a id="liker_[[:UserId]]" title="[[:BlogTitle]]" href="[[:BlogUrl]]" 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 $.blogInfo.OpenComment (not (eq $.blogInfo.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="[[:UserInfo.BlogUrl]]">
|
||||
<img class="avatar" src="[[:UserInfo.Logo]]">
|
||||
</a>
|
||||
<!-- 评论 -->
|
||||
<div class="comment-body">
|
||||
<div class="comment-hd">
|
||||
<a href="[[:UserInfo.BlogUrl]]" target="_blank" >[[:UserInfo.Username]]</a>
|
||||
[[if IsAuthorComment]]
|
||||
<span>(作者)</span>
|
||||
[[/if]]
|
||||
|
||||
<!-- 回复其它人 -->
|
||||
[[if ToUserInfo]]
|
||||
<span class="in-reply-to">
|
||||
回复
|
||||
<a href="[[:ToUserInfo.BlogUrl]]">[[:ToUserInfo.Username]]</a>
|
||||
</span>
|
||||
[[if ToUserIsAuthor]]
|
||||
<span>(作者)</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]] 赞"><span class="like-num-i">[[:LikeNum]]</span> 赞</span></span>
|
||||
|
||||
[[if ~root.visitUserInfo.UserId]]
|
||||
[[if IsMyNote && !IsMyComment]]
|
||||
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> 删除</a>
|
||||
[[/if]]
|
||||
[[if !IsMyComment]]
|
||||
<a href="javascript:;" class="comment-reply op-link ">
|
||||
<i class="fa fa-reply"></i>
|
||||
回复
|
||||
</a>
|
||||
<a href="javascript:;" class="comment-like op-link"><i class="fa fa-thumbs-o-up"></i> <span class="like-text">[[if IsILikeIt]]取消赞[[else]]赞[[/if]]</span></a>
|
||||
[[else]]
|
||||
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> 删除</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="回复"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="command clearfix" style="display: block;">
|
||||
<button class="reply-comment-btn save btn btn-primary" data-comment-id="[[:CommentId]]">提交评论</button>
|
||||
<a class="cancel reply-cancel btn-link">取消</a>
|
||||
</div>
|
||||
</form>
|
||||
[[/if]]
|
||||
</div>
|
||||
</li>
|
||||
[[/for]]
|
||||
</script>
|
||||
|
||||
<!-- 评论 -->
|
||||
<div class="comment-box hide">
|
||||
<form class="comment-form comment-box-ft hide" id="commentForm">
|
||||
<div class="clearfix">
|
||||
<div class="avatar-wrap">
|
||||
<img class="avatar" id="visitUserLogo">
|
||||
</div>
|
||||
<div class="editor-wrap">
|
||||
<textarea class="editable" id="commentContent" name="commentContent" placeholder="评论" style="height: 100px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="command clearfix" style="display: block;">
|
||||
<button id="commentBtn" class="reply-comment-btn save btn btn-primary">提交评论</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="needLogin hide" id="noLoginContainer">
|
||||
<a onclick="goLogin()">立即登录</a>, 发表评论.
|
||||
<br />
|
||||
没有帐号? <a onclick="goRegister()">立即注册</a>
|
||||
</div>
|
||||
<div class="box-header">
|
||||
<span class="counter">
|
||||
<i class="icon icon-comment"></i><span id="commentNum">{{$.post.CommentNum}}</span> 条评论
|
||||
</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>
|
||||
{{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 = '{{.blogInfo.DisqusId}}'; // required: replace example with your forum shortname
|
||||
var disqus_identifier = '{{.blogInfo.UserId}}/{{$.post.NoteId}}/{{$.post.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}}
|
53
public/blog/themes/default/single.html
Normal file
53
public/blog/themes/default/single.html
Normal file
@ -0,0 +1,53 @@
|
||||
{{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> 更新 {{$.single.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> 创建 {{$.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>文档导航</span>
|
||||
</div>
|
||||
<div id="blogNavContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 一些公用的js -->
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/common.js"></script>
|
||||
<script>
|
||||
$(function() {
|
||||
initNav();
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
505
public/blog/themes/default/style.css
Normal file
505
public/blog/themes/default/style.css
Normal file
@ -0,0 +1,505 @@
|
||||
#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;
|
||||
}
|
||||
|
||||
/*"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;
|
||||
}
|
||||
}
|
47
public/blog/themes/default/tag_posts.html
Normal file
47
public/blog/themes/default/tag_posts.html
Normal file
@ -0,0 +1,47 @@
|
||||
{{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="{{$.postUrl}}/{{.NoteId}}" title="全文">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
无
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}} |
|
||||
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="each-post">
|
||||
无
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" $}}
|
||||
{{template "highlight.html" $}}
|
||||
</body>
|
||||
</html>
|
26
public/blog/themes/default/tags.html
Normal file
26
public/blog/themes/default/tags.html
Normal file
@ -0,0 +1,26 @@
|
||||
{{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}} {{.Count}}
|
||||
</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
27
public/blog/themes/default/theme.json
Normal file
27
public/blog/themes/default/theme.json
Normal file
@ -0,0 +1,27 @@
|
||||
/*
|
||||
以下是本主题的配置, 采用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"}
|
||||
]
|
||||
}
|
47
public/blog/themes/elegant/404.html
Normal file
47
public/blog/themes/elegant/404.html
Normal file
@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh">
|
||||
<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">
|
||||
<title>404</title>
|
||||
|
||||
<link href="/css/bootstrap.css" rel="stylesheet">
|
||||
<link href="/css/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet">
|
||||
<link href="/css/index.css" rel="stylesheet">
|
||||
<style>
|
||||
html, body {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body id="boxBody">
|
||||
<section id="box">
|
||||
<div>
|
||||
<div>
|
||||
<h1 class="h text-white animated fadeInDownBig">life-404</h1>
|
||||
</div>
|
||||
<div id="errorBox">
|
||||
<p class="error-info">
|
||||
This page cann't found.
|
||||
</p>
|
||||
|
||||
<div class="list-group m-b-sm bg-white m-b-lg">
|
||||
<a href="javascript:history.go(-1);" class="list-group-item"><!-- <i class="fa fa-chevron-right icon-muted"> --></i> <i class="fa fa-fw fa-arrow-left icon-muted"></i> Back </a>
|
||||
<a href="/index" class="list-group-item"><!-- <i class="fa fa-chevron-right icon-muted"> --></i> <i class="fa fa-fw fa-home icon-muted"></i> Goto homepage </a>
|
||||
<a href="/note" class="list-group-item"><!-- <i class="fa fa-chevron-right icon-muted"> --></i> <i class="fa fa-fw fa-file-o icon-muted"></i> My note</a>
|
||||
<a class="list-group-item" href="mailto:leanote@leanote.com">
|
||||
<span class="badge">leanote@leanote.com</span>
|
||||
<i class="fa fa-fw fa-envelope-o icon-muted"></i> Contact Us </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div id="boxFooter">
|
||||
<p>
|
||||
<a href="/index">leanote</a> © 2014
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
30
public/blog/themes/elegant/archive.html
Normal file
30
public/blog/themes/elegant/archive.html
Normal file
@ -0,0 +1,30 @@
|
||||
{{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>
|
||||
{{dateFormat .PublicTime "2006-01-02"}} <a href="{{$.postUrl}}/{{.NoteId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
42
public/blog/themes/elegant/cate.html
Normal file
42
public/blog/themes/elegant/cate.html
Normal file
@ -0,0 +1,42 @@
|
||||
{{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="{{$.postUrl}}/{{.NoteId}}" title="全文">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
无
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" $}}
|
||||
{{template "highlight.html" $}}
|
||||
|
||||
</body>
|
||||
</html>
|
51
public/blog/themes/elegant/footer.html
Normal file
51
public/blog/themes/elegant/footer.html
Normal file
@ -0,0 +1,51 @@
|
||||
<div id="footerContainer">
|
||||
{{$userId := $.blogInfo.UserId}}
|
||||
<div class="container" id="footer">
|
||||
<div class="col-md-4">
|
||||
<h3>导航</h3>
|
||||
<ul>
|
||||
<li><a href="{{$.indexUrl}}">主页</a></li>
|
||||
{{range $.cates}}
|
||||
<li>
|
||||
<a href="{{$.cateUrl}}/{{.CateId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3>最近发表</h3>
|
||||
<ul>
|
||||
{{range .recentPosts}}
|
||||
<li title="{{.Title}}"><a href="{{$.postUrl}}/{{.NoteId}}/">{{.Title}}</a></li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3>友情链接 </h3>
|
||||
<ul>
|
||||
{{if $.themeInfo.FriendLinks}}
|
||||
{{range $.themeInfo.FriendLinks}}
|
||||
<li><a href="{{.Url}}" target="_blank">{{.Title}}</a></li>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="{{$.jQueryUrl}}"></script>
|
||||
<script src="{{$.bootstrapJsUrl}}"></script>
|
||||
<script src="{{$.siteUrl}}/js/bootstrap-hover-dropdown.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>
|
122
public/blog/themes/elegant/header.html
Normal file
122
public/blog/themes/elegant/header.html
Normal file
@ -0,0 +1,122 @@
|
||||
<!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, not only a notebook">
|
||||
<meta name="author" content="leanote">
|
||||
|
||||
<title>
|
||||
{{if $.curIsIndex}}
|
||||
{{$.blogInfo.Title}}
|
||||
{{else if $.curIsCate}}
|
||||
分类-{{$.curCateTitle}}
|
||||
{{else if $.curIsSearch}}
|
||||
搜索-{{$.keywords}}
|
||||
{{else if $.curIsTags}}
|
||||
我的标签
|
||||
{{else if $.curIsTagPosts}}
|
||||
标签-{{$.curTag}}
|
||||
{{else if $.curIsPost}}
|
||||
{{$.post.Title}}
|
||||
{{else if $.curIsSingle}}
|
||||
{{$.single.Title}}
|
||||
{{else if $.curIsArchive}}
|
||||
归档
|
||||
{{end}}
|
||||
|
||||
</title>
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link href="{{$.bootstrapCssUrl}}" rel="stylesheet">
|
||||
<!-- 字体必须同一域 -->
|
||||
<link href="{{$.fontAwesomeUrl}}" rel="stylesheet">
|
||||
<link href="{{$.themeBaseUrl}}/style.css" 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>
|
6
public/blog/themes/elegant/highlight.html
Normal file
6
public/blog/themes/elegant/highlight.html
Normal file
@ -0,0 +1,6 @@
|
||||
<link href="{{$.prettifyCssUrl}}" type="text/css" rel="stylesheet"/>
|
||||
<script src="{{$.prettifyJsUrl}}"></script>
|
||||
<script>
|
||||
$("pre").addClass("prettyprint linenums");
|
||||
prettyPrint();
|
||||
</script>
|
BIN
public/blog/themes/elegant/images/loading-32.gif
Normal file
BIN
public/blog/themes/elegant/images/loading-32.gif
Normal file
Binary file not shown.
After ![]() (image error) Size: 4.7 KiB |
BIN
public/blog/themes/elegant/images/noise.png
Normal file
BIN
public/blog/themes/elegant/images/noise.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 10 KiB |
BIN
public/blog/themes/elegant/images/screenshot.png
Normal file
BIN
public/blog/themes/elegant/images/screenshot.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 83 KiB |
BIN
public/blog/themes/elegant/images/triangle_2x.png
Normal file
BIN
public/blog/themes/elegant/images/triangle_2x.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 629 B |
39
public/blog/themes/elegant/index.html
Normal file
39
public/blog/themes/elegant/index.html
Normal file
@ -0,0 +1,39 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
|
||||
<div id="posts">
|
||||
{{range $.posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.postUrl}}/{{.NoteId}}" title="全文">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
无
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
{{template "footer.html" $}}
|
||||
{{template "highlight.html" $}}
|
||||
|
||||
</body>
|
||||
</html>
|
27
public/blog/themes/elegant/paging.html
Normal file
27
public/blog/themes/elegant/paging.html
Normal file
@ -0,0 +1,27 @@
|
||||
{{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}}
|
143
public/blog/themes/elegant/post.html
Normal file
143
public/blog/themes/elegant/post.html
Normal file
@ -0,0 +1,143 @@
|
||||
{{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}}
|
||||
无
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> 更新 {{$.post.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> 创建 {{$.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="{{$.postUrl}}/{{$.prePost.NoteId}}">{{$.prePost.Title}}</a>{{else}}无{{end}}
|
||||
</p>
|
||||
<p>
|
||||
下一篇: {{if $.nextPost}}<a href="{{$.postUrl}}/{{$.nextPost.NoteId}}">{{$.nextPost.Title}}</a>{{else}}无{{end}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- share & comment -->
|
||||
{{template "share_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>文档导航</span>
|
||||
</div>
|
||||
<div id="blogNavContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 一些在share_comment.js 需要使用的变量 -->
|
||||
<script>
|
||||
var siteUrl = "{{$.siteUrl}}"; // common.js需要
|
||||
// 以下 share_comment.js需要
|
||||
var blogInfo={UserId: "{{$.blogInfo.UserId}}", OpenComment: {{$.blogInfo.OpenComment}}, CommentType: "{{$.blogInfo.CommentType}}"};
|
||||
var noteId = "{{$.post.NoteId}}"; //
|
||||
var preLikeNum = +"{{$.post.LikeNum}}";
|
||||
var commentNum = +"{{$.post.CommentNum}}";
|
||||
</script>
|
||||
|
||||
<!-- 共享与评论css -->
|
||||
<link href="{{$.shareCommentCssUrl}}" rel="stylesheet">
|
||||
<!-- 一些公用的js -->
|
||||
<script src="{{$.blogCommonJsUrl}}"></script>
|
||||
<script src="{{$.siteUrl}}/public/blog/js/jsrender.js"></script>
|
||||
<script src="{{$.siteUrl}}/public/blog/js/jquery-cookie-min.js"></script>
|
||||
<script src="{{$.siteUrl}}/public/blog/js/bootstrap-dialog.min.js"></script>
|
||||
<script src="{{$.siteUrl}}/public/blog/js/jquery.qrcode.min.js"></script>
|
||||
<!-- share && comment -->
|
||||
<script src="{{$.shareCommentJsUrl}}"></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>
|
49
public/blog/themes/elegant/search.html
Normal file
49
public/blog/themes/elegant/search.html
Normal file
@ -0,0 +1,49 @@
|
||||
{{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="{{$.postUrl}}/{{.NoteId}}" title="全文">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
无
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}} |
|
||||
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
|
||||
</div>
|
||||
|
||||
|
||||
{{else}}
|
||||
<div class="each-post">
|
||||
无
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" $}}
|
||||
{{template "highlight.html" $}}
|
||||
</body>
|
||||
</html>
|
172
public/blog/themes/elegant/share_comment.html
Normal file
172
public/blog/themes/elegant/share_comment.html
Normal file
@ -0,0 +1,172 @@
|
||||
<!-- 赞 -->
|
||||
<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">{{$.post.LikeNum}}</span> 赞</button>
|
||||
<span class="control-item read-counts"><i class="fa fa-eye"></i> {{if $.post.ReadNum}}{{$.post.ReadNum}}{{else}}1{{end}} 人读过</span>
|
||||
</div>
|
||||
<div class="right-section">
|
||||
<div id="weixinQRCode"></div>
|
||||
<button class="btn btn-share btn-default btn-weibo"><i class="fa fa-weibo"></i> 新浪微博</button>
|
||||
<button class="btn btn-share btn-default btn-weixin"><i class="fa fa-wechat"></i> 微信</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>
|
||||
更多分享
|
||||
</div>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="#" class="btn-share tencent-weibo"><i class="fa fa-tencent-weibo"></i> 腾讯微博</a></li>
|
||||
<li><a href="#" class="btn-share qq"><i class="fa fa-qq"></i> QQ空间</a></li>
|
||||
<li><a href="#" class="btn-share renren"><i class="fa fa-renren"></i> 人人网</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="voters clearfix" id="likers">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/x-jsrender" id="tLikers">
|
||||
[[for users]]
|
||||
<a id="liker_[[:UserId]]" title="[[:BlogTitle]]" href="[[:BlogUrl]]" 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 $.blogInfo.OpenComment (not (eq $.blogInfo.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="[[:UserInfo.BlogUrl]]">
|
||||
<img class="avatar" src="[[:UserInfo.Logo]]">
|
||||
</a>
|
||||
<!-- 评论 -->
|
||||
<div class="comment-body">
|
||||
<div class="comment-hd">
|
||||
<a href="[[:UserInfo.BlogUrl]]" target="_blank" >[[:UserInfo.Username]]</a>
|
||||
[[if IsAuthorComment]]
|
||||
<span>(作者)</span>
|
||||
[[/if]]
|
||||
|
||||
<!-- 回复其它人 -->
|
||||
[[if ToUserInfo]]
|
||||
<span class="in-reply-to">
|
||||
回复
|
||||
<a href="[[:ToUserInfo.BlogUrl]]">[[:ToUserInfo.Username]]</a>
|
||||
</span>
|
||||
[[if ToUserIsAuthor]]
|
||||
<span>(作者)</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]] 赞"><span class="like-num-i">[[:LikeNum]]</span> 赞</span></span>
|
||||
|
||||
[[if ~root.visitUserInfo.UserId]]
|
||||
[[if IsMyNote && !IsMyComment]]
|
||||
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> 删除</a>
|
||||
[[/if]]
|
||||
[[if !IsMyComment]]
|
||||
<a href="javascript:;" class="comment-reply op-link ">
|
||||
<i class="fa fa-reply"></i>
|
||||
回复
|
||||
</a>
|
||||
<a href="javascript:;" class="comment-like op-link"><i class="fa fa-thumbs-o-up"></i> <span class="like-text">[[if IsILikeIt]]取消赞[[else]]赞[[/if]]</span></a>
|
||||
[[else]]
|
||||
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> 删除</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="回复"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="command clearfix" style="display: block;">
|
||||
<button class="reply-comment-btn save btn btn-primary" data-comment-id="[[:CommentId]]">提交评论</button>
|
||||
<a class="cancel reply-cancel btn-link">取消</a>
|
||||
</div>
|
||||
</form>
|
||||
[[/if]]
|
||||
</div>
|
||||
</li>
|
||||
[[/for]]
|
||||
</script>
|
||||
|
||||
<!-- 评论 -->
|
||||
<div class="comment-box hide">
|
||||
<form class="comment-form comment-box-ft hide" id="commentForm">
|
||||
<div class="clearfix">
|
||||
<div class="avatar-wrap">
|
||||
<img class="avatar" id="visitUserLogo">
|
||||
</div>
|
||||
<div class="editor-wrap">
|
||||
<textarea class="editable" id="commentContent" name="commentContent" placeholder="评论" style="height: 100px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="command clearfix" style="display: block;">
|
||||
<button id="commentBtn" class="reply-comment-btn save btn btn-primary">提交评论</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="needLogin hide" id="noLoginContainer">
|
||||
<a onclick="goLogin()">立即登录</a>, 发表评论.
|
||||
<br />
|
||||
没有帐号? <a onclick="goRegister()">立即注册</a>
|
||||
</div>
|
||||
<div class="box-header">
|
||||
<span class="counter">
|
||||
<i class="icon icon-comment"></i><span id="commentNum">{{$.post.CommentNum}}</span> 条评论
|
||||
</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>
|
||||
{{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 = '{{.blogInfo.DisqusId}}'; // required: replace example with your forum shortname
|
||||
var disqus_identifier = '{{.blogInfo.UserId}}/{{$.post.NoteId}}/{{$.post.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}}
|
53
public/blog/themes/elegant/single.html
Normal file
53
public/blog/themes/elegant/single.html
Normal file
@ -0,0 +1,53 @@
|
||||
{{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> 更新 {{$.single.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> 创建 {{$.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>文档导航</span>
|
||||
</div>
|
||||
<div id="blogNavContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 一些公用的js -->
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/common.js"></script>
|
||||
<script>
|
||||
$(function() {
|
||||
initNav();
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
519
public/blog/themes/elegant/style.css
Normal file
519
public/blog/themes/elegant/style.css
Normal file
@ -0,0 +1,519 @@
|
||||
#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;
|
||||
}
|
||||
|
||||
/*"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;
|
||||
}
|
||||
}
|
47
public/blog/themes/elegant/tag_posts.html
Normal file
47
public/blog/themes/elegant/tag_posts.html
Normal file
@ -0,0 +1,47 @@
|
||||
{{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="{{$.postUrl}}/{{.NoteId}}" title="全文">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
无
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}} |
|
||||
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="each-post">
|
||||
无
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" $}}
|
||||
{{template "highlight.html" $}}
|
||||
</body>
|
||||
</html>
|
26
public/blog/themes/elegant/tags.html
Normal file
26
public/blog/themes/elegant/tags.html
Normal file
@ -0,0 +1,26 @@
|
||||
{{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}} {{.Count}}
|
||||
</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
31
public/blog/themes/elegant/theme.json
Normal file
31
public/blog/themes/elegant/theme.json
Normal file
@ -0,0 +1,31 @@
|
||||
/*
|
||||
以下是本主题的配置, 采用JSON格式
|
||||
其中Name, Version, Author, AuthorUrl是必填项(注意首字大写)
|
||||
你也可以定义其它的配置, 如FriendLinks, 在模板文件使用 $.themeInfo.FriendLinks来获取值
|
||||
|
||||
注意:
|
||||
1) JSON语法严格, 键必须用双引号, 最后不得有空','来结尾
|
||||
2) 以下配置不能包含任何注释, 不然解析会出错!
|
||||
|
||||
请在此解析所有配置
|
||||
* Name 主题名
|
||||
* Version 主题版本
|
||||
* Author 主题的作者
|
||||
* AuthorUrl 作者的博客链接或相关链接
|
||||
|
||||
* FriendLinks 友情链接
|
||||
|
||||
*/
|
||||
{
|
||||
"Name": "leanote-elegant",
|
||||
"Version": "1.0",
|
||||
"Author": "leanote.com",
|
||||
"AuthorUrl": "http://leanote.com",
|
||||
"FriendLinks": [
|
||||
{"Title": "我的笔记", "Url": "http://leanote.com/note"},
|
||||
{"Title": "leanote home", "Url": "http://leanote.com"},
|
||||
{"Title": "leanote 社区", "Url": "http://bbs.leanote.com"},
|
||||
{"Title": "lea++", "Url": "http://lea.leanote.com"},
|
||||
{"Title": "leanote github", "Url": "https://github.com/leanote/leanote"}
|
||||
]
|
||||
}
|
47
public/blog/themes/nav_fixed/404.html
Normal file
47
public/blog/themes/nav_fixed/404.html
Normal file
@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh">
|
||||
<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">
|
||||
<title>404</title>
|
||||
|
||||
<link href="/css/bootstrap.css" rel="stylesheet">
|
||||
<link href="/css/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet">
|
||||
<link href="/css/index.css" rel="stylesheet">
|
||||
<style>
|
||||
html, body {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body id="boxBody">
|
||||
<section id="box">
|
||||
<div>
|
||||
<div>
|
||||
<h1 class="h text-white animated fadeInDownBig">life-404</h1>
|
||||
</div>
|
||||
<div id="errorBox">
|
||||
<p class="error-info">
|
||||
This page cann't found.
|
||||
</p>
|
||||
|
||||
<div class="list-group m-b-sm bg-white m-b-lg">
|
||||
<a href="javascript:history.go(-1);" class="list-group-item"><!-- <i class="fa fa-chevron-right icon-muted"> --></i> <i class="fa fa-fw fa-arrow-left icon-muted"></i> Back </a>
|
||||
<a href="/index" class="list-group-item"><!-- <i class="fa fa-chevron-right icon-muted"> --></i> <i class="fa fa-fw fa-home icon-muted"></i> Goto homepage </a>
|
||||
<a href="/note" class="list-group-item"><!-- <i class="fa fa-chevron-right icon-muted"> --></i> <i class="fa fa-fw fa-file-o icon-muted"></i> My note</a>
|
||||
<a class="list-group-item" href="mailto:leanote@leanote.com">
|
||||
<span class="badge">leanote@leanote.com</span>
|
||||
<i class="fa fa-fw fa-envelope-o icon-muted"></i> Contact Us </a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div id="boxFooter">
|
||||
<p>
|
||||
<a href="/index">leanote</a> © 2014
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
30
public/blog/themes/nav_fixed/archive.html
Normal file
30
public/blog/themes/nav_fixed/archive.html
Normal file
@ -0,0 +1,30 @@
|
||||
{{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>
|
||||
{{dateFormat .PublicTime "2006-01-02"}} <a href="{{$.postUrl}}/{{.NoteId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
42
public/blog/themes/nav_fixed/cate.html
Normal file
42
public/blog/themes/nav_fixed/cate.html
Normal file
@ -0,0 +1,42 @@
|
||||
{{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="{{$.postUrl}}/{{.NoteId}}" title="全文">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
无
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" $}}
|
||||
{{template "highlight.html" $}}
|
||||
|
||||
</body>
|
||||
</html>
|
51
public/blog/themes/nav_fixed/footer.html
Normal file
51
public/blog/themes/nav_fixed/footer.html
Normal file
@ -0,0 +1,51 @@
|
||||
<div id="footerContainer">
|
||||
{{$userId := $.blogInfo.UserId}}
|
||||
<div class="container" id="footer">
|
||||
<div class="col-md-4">
|
||||
<h3>导航</h3>
|
||||
<ul>
|
||||
<li><a href="{{$.indexUrl}}">主页</a></li>
|
||||
{{range $.cates}}
|
||||
<li>
|
||||
<a href="{{$.cateUrl}}/{{.CateId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3>最近发表</h3>
|
||||
<ul>
|
||||
{{range .recentPosts}}
|
||||
<li title="{{.Title}}"><a href="{{$.postUrl}}/{{.NoteId}}/">{{.Title}}</a></li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3>友情链接 </h3>
|
||||
<ul>
|
||||
{{if $.themeInfo.FriendLinks}}
|
||||
{{range $.themeInfo.FriendLinks}}
|
||||
<li><a href="{{.Url}}" target="_blank">{{.Title}}</a></li>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="{{$.jQueryUrl}}"></script>
|
||||
<script src="{{$.bootstrapJsUrl}}"></script>
|
||||
<script src="{{$.siteUrl}}/js/bootstrap-hover-dropdown.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>
|
120
public/blog/themes/nav_fixed/header.html
Normal file
120
public/blog/themes/nav_fixed/header.html
Normal file
@ -0,0 +1,120 @@
|
||||
<!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, not only a notebook">
|
||||
<meta name="author" content="leanote">
|
||||
|
||||
<title>
|
||||
{{if $.curIsIndex}}
|
||||
{{$.blogInfo.Title}}
|
||||
{{else if $.curIsCate}}
|
||||
分类-{{$.curCateTitle}}
|
||||
{{else if $.curIsView}}
|
||||
{{$.post.Title}}
|
||||
{{else if $.curIsSearch}}
|
||||
搜索-{{$.keywords}}
|
||||
{{else if $.curIsTags}}
|
||||
我的标签
|
||||
{{else if $.curIsTagPosts}}
|
||||
标签-{{$.curTag}}
|
||||
{{else}}
|
||||
我的博客
|
||||
{{end}}
|
||||
|
||||
</title>
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link href="{{$.bootstrapCssUrl}}" rel="stylesheet">
|
||||
<!-- 字体必须同一域 -->
|
||||
<link href="{{$.fontAwesomeUrl}}" rel="stylesheet">
|
||||
<link href="{{$.themeBaseUrl}}/style.css" 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>
|
6
public/blog/themes/nav_fixed/highlight.html
Normal file
6
public/blog/themes/nav_fixed/highlight.html
Normal file
@ -0,0 +1,6 @@
|
||||
<link href="{{$.prettifyCssUrl}}" type="text/css" rel="stylesheet"/>
|
||||
<script src="{{$.prettifyJsUrl}}"></script>
|
||||
<script>
|
||||
$("pre").addClass("prettyprint linenums");
|
||||
prettyPrint();
|
||||
</script>
|
BIN
public/blog/themes/nav_fixed/images/loading-32.gif
Normal file
BIN
public/blog/themes/nav_fixed/images/loading-32.gif
Normal file
Binary file not shown.
After ![]() (image error) Size: 4.7 KiB |
BIN
public/blog/themes/nav_fixed/images/noise.png
Normal file
BIN
public/blog/themes/nav_fixed/images/noise.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 10 KiB |
BIN
public/blog/themes/nav_fixed/images/screenshot.png
Normal file
BIN
public/blog/themes/nav_fixed/images/screenshot.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 136 KiB |
BIN
public/blog/themes/nav_fixed/images/triangle_2x.png
Normal file
BIN
public/blog/themes/nav_fixed/images/triangle_2x.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 629 B |
39
public/blog/themes/nav_fixed/index.html
Normal file
39
public/blog/themes/nav_fixed/index.html
Normal file
@ -0,0 +1,39 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
|
||||
<div id="posts">
|
||||
{{range $.posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.postUrl}}/{{.NoteId}}" title="全文">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
无
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
{{template "footer.html" $}}
|
||||
{{template "highlight.html" $}}
|
||||
|
||||
</body>
|
||||
</html>
|
27
public/blog/themes/nav_fixed/paging.html
Normal file
27
public/blog/themes/nav_fixed/paging.html
Normal file
@ -0,0 +1,27 @@
|
||||
{{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}}
|
143
public/blog/themes/nav_fixed/post.html
Normal file
143
public/blog/themes/nav_fixed/post.html
Normal file
@ -0,0 +1,143 @@
|
||||
{{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}}
|
||||
无
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> 更新 {{$.post.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> 创建 {{$.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="{{$.postUrl}}/{{$.prePost.NoteId}}">{{$.prePost.Title}}</a>{{else}}无{{end}}
|
||||
</p>
|
||||
<p>
|
||||
下一篇: {{if $.nextPost}}<a href="{{$.postUrl}}/{{$.nextPost.NoteId}}">{{$.nextPost.Title}}</a>{{else}}无{{end}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- share & comment -->
|
||||
{{template "share_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>文档导航</span>
|
||||
</div>
|
||||
<div id="blogNavContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 一些在share_comment.js 需要使用的变量 -->
|
||||
<script>
|
||||
var siteUrl = "{{$.siteUrl}}"; // common.js需要
|
||||
// 以下 share_comment.js需要
|
||||
var blogInfo={UserId: "{{$.blogInfo.UserId}}", OpenComment: {{$.blogInfo.OpenComment}}, CommentType: "{{$.blogInfo.CommentType}}"};
|
||||
var noteId = "{{$.post.NoteId}}"; //
|
||||
var preLikeNum = +"{{$.post.LikeNum}}";
|
||||
var commentNum = +"{{$.post.CommentNum}}";
|
||||
</script>
|
||||
|
||||
<!-- 共享与评论css -->
|
||||
<link href="{{$.shareCommentCssUrl}}" rel="stylesheet">
|
||||
<!-- 一些公用的js -->
|
||||
<script src="{{$.blogCommonJsUrl}}"></script>
|
||||
<script src="{{$.siteUrl}}/public/blog/js/jsrender.js"></script>
|
||||
<script src="{{$.siteUrl}}/public/blog/js/jquery-cookie-min.js"></script>
|
||||
<script src="{{$.siteUrl}}/public/blog/js/bootstrap-dialog.min.js"></script>
|
||||
<script src="{{$.siteUrl}}/public/blog/js/jquery.qrcode.min.js"></script>
|
||||
<!-- share && comment -->
|
||||
<script src="{{$.shareCommentJsUrl}}"></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>
|
49
public/blog/themes/nav_fixed/search.html
Normal file
49
public/blog/themes/nav_fixed/search.html
Normal file
@ -0,0 +1,49 @@
|
||||
{{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="{{$.postUrl}}/{{.NoteId}}" title="全文">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
无
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}} |
|
||||
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
|
||||
</div>
|
||||
|
||||
|
||||
{{else}}
|
||||
<div class="each-post">
|
||||
无
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" $}}
|
||||
{{template "highlight.html" $}}
|
||||
</body>
|
||||
</html>
|
172
public/blog/themes/nav_fixed/share_comment.html
Normal file
172
public/blog/themes/nav_fixed/share_comment.html
Normal file
@ -0,0 +1,172 @@
|
||||
<!-- 赞 -->
|
||||
<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">{{$.post.LikeNum}}</span> 赞</button>
|
||||
<span class="control-item read-counts"><i class="fa fa-eye"></i> {{if $.post.ReadNum}}{{$.post.ReadNum}}{{else}}1{{end}} 人读过</span>
|
||||
</div>
|
||||
<div class="right-section">
|
||||
<div id="weixinQRCode"></div>
|
||||
<button class="btn btn-share btn-default btn-weibo"><i class="fa fa-weibo"></i> 新浪微博</button>
|
||||
<button class="btn btn-share btn-default btn-weixin"><i class="fa fa-wechat"></i> 微信</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>
|
||||
更多分享
|
||||
</div>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="#" class="btn-share tencent-weibo"><i class="fa fa-tencent-weibo"></i> 腾讯微博</a></li>
|
||||
<li><a href="#" class="btn-share qq"><i class="fa fa-qq"></i> QQ空间</a></li>
|
||||
<li><a href="#" class="btn-share renren"><i class="fa fa-renren"></i> 人人网</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="voters clearfix" id="likers">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/x-jsrender" id="tLikers">
|
||||
[[for users]]
|
||||
<a id="liker_[[:UserId]]" title="[[:BlogTitle]]" href="[[:BlogUrl]]" 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 $.blogInfo.OpenComment (not (eq $.blogInfo.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="[[:UserInfo.BlogUrl]]">
|
||||
<img class="avatar" src="[[:UserInfo.Logo]]">
|
||||
</a>
|
||||
<!-- 评论 -->
|
||||
<div class="comment-body">
|
||||
<div class="comment-hd">
|
||||
<a href="[[:UserInfo.BlogUrl]]" target="_blank" >[[:UserInfo.Username]]</a>
|
||||
[[if IsAuthorComment]]
|
||||
<span>(作者)</span>
|
||||
[[/if]]
|
||||
|
||||
<!-- 回复其它人 -->
|
||||
[[if ToUserInfo]]
|
||||
<span class="in-reply-to">
|
||||
回复
|
||||
<a href="[[:ToUserInfo.BlogUrl]]">[[:ToUserInfo.Username]]</a>
|
||||
</span>
|
||||
[[if ToUserIsAuthor]]
|
||||
<span>(作者)</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]] 赞"><span class="like-num-i">[[:LikeNum]]</span> 赞</span></span>
|
||||
|
||||
[[if ~root.visitUserInfo.UserId]]
|
||||
[[if IsMyNote && !IsMyComment]]
|
||||
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> 删除</a>
|
||||
[[/if]]
|
||||
[[if !IsMyComment]]
|
||||
<a href="javascript:;" class="comment-reply op-link ">
|
||||
<i class="fa fa-reply"></i>
|
||||
回复
|
||||
</a>
|
||||
<a href="javascript:;" class="comment-like op-link"><i class="fa fa-thumbs-o-up"></i> <span class="like-text">[[if IsILikeIt]]取消赞[[else]]赞[[/if]]</span></a>
|
||||
[[else]]
|
||||
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> 删除</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="回复"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="command clearfix" style="display: block;">
|
||||
<button class="reply-comment-btn save btn btn-primary" data-comment-id="[[:CommentId]]">提交评论</button>
|
||||
<a class="cancel reply-cancel btn-link">取消</a>
|
||||
</div>
|
||||
</form>
|
||||
[[/if]]
|
||||
</div>
|
||||
</li>
|
||||
[[/for]]
|
||||
</script>
|
||||
|
||||
<!-- 评论 -->
|
||||
<div class="comment-box hide">
|
||||
<form class="comment-form comment-box-ft hide" id="commentForm">
|
||||
<div class="clearfix">
|
||||
<div class="avatar-wrap">
|
||||
<img class="avatar" id="visitUserLogo">
|
||||
</div>
|
||||
<div class="editor-wrap">
|
||||
<textarea class="editable" id="commentContent" name="commentContent" placeholder="评论" style="height: 100px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="command clearfix" style="display: block;">
|
||||
<button id="commentBtn" class="reply-comment-btn save btn btn-primary">提交评论</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="needLogin hide" id="noLoginContainer">
|
||||
<a onclick="goLogin()">立即登录</a>, 发表评论.
|
||||
<br />
|
||||
没有帐号? <a onclick="goRegister()">立即注册</a>
|
||||
</div>
|
||||
<div class="box-header">
|
||||
<span class="counter">
|
||||
<i class="icon icon-comment"></i><span id="commentNum">{{$.post.CommentNum}}</span> 条评论
|
||||
</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>
|
||||
{{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 = '{{.blogInfo.DisqusId}}'; // required: replace example with your forum shortname
|
||||
var disqus_identifier = '{{.blogInfo.UserId}}/{{$.post.NoteId}}/{{$.post.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}}
|
53
public/blog/themes/nav_fixed/single.html
Normal file
53
public/blog/themes/nav_fixed/single.html
Normal file
@ -0,0 +1,53 @@
|
||||
{{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> 更新 {{$.single.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> 创建 {{$.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>文档导航</span>
|
||||
</div>
|
||||
<div id="blogNavContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 一些公用的js -->
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/common.js"></script>
|
||||
<script>
|
||||
$(function() {
|
||||
initNav();
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
556
public/blog/themes/nav_fixed/style.css
Normal file
556
public/blog/themes/nav_fixed/style.css
Normal file
@ -0,0 +1,556 @@
|
||||
#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;
|
||||
}
|
||||
|
||||
/*"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;
|
||||
}
|
||||
}
|
47
public/blog/themes/nav_fixed/tag_posts.html
Normal file
47
public/blog/themes/nav_fixed/tag_posts.html
Normal file
@ -0,0 +1,47 @@
|
||||
{{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="{{$.postUrl}}/{{.NoteId}}" title="全文">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
无
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}} |
|
||||
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.postUrl}}/{{.NoteId}}" title="全文">查看</a>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="each-post">
|
||||
无
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" $}}
|
||||
{{template "highlight.html" $}}
|
||||
</body>
|
||||
</html>
|
26
public/blog/themes/nav_fixed/tags.html
Normal file
26
public/blog/themes/nav_fixed/tags.html
Normal file
@ -0,0 +1,26 @@
|
||||
{{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}} {{.Count}}
|
||||
</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
27
public/blog/themes/nav_fixed/theme.json
Normal file
27
public/blog/themes/nav_fixed/theme.json
Normal file
@ -0,0 +1,27 @@
|
||||
/*
|
||||
以下是本主题的配置, 采用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"}
|
||||
]
|
||||
}
|
142
public/blog/themes/nav_fixed/view.html
Normal file
142
public/blog/themes/nav_fixed/view.html
Normal file
@ -0,0 +1,142 @@
|
||||
{{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>文档导航</span>
|
||||
</div>
|
||||
<div id="blogNavContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 一些在share_comment.js 需要使用的变量 -->
|
||||
<script>
|
||||
var siteUrl = "{{$.siteUrl}}"; // common.js需要
|
||||
// 以下 share_comment.js需要
|
||||
var blogInfo={UserId: "{{$.blogInfo.UserId}}", OpenComment: {{$.blogInfo.OpenComment}}, CommentType: "{{$.blogInfo.CommentType}}"};
|
||||
var noteId = "{{$.post.NoteId}}"; //
|
||||
var preLikeNum = +"{{$.post.LikeNum}}";
|
||||
var commentNum = +"{{$.post.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}}/share_comment.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>
|
Reference in New Issue
Block a user