Merge branch 'dev-life'
Conflicts: app/init.go public/js/common-min.js public/js/common.js
No files matched your search
@@ -62,7 +62,7 @@ func (c Attach) uploadAttach(noteId string) (re info.Re) {
|
||||
maxFileSize = 1000
|
||||
}
|
||||
if(float64(len(data)) > maxFileSize * float64(1024*1024)) {
|
||||
resultMsg = fmt.Sprintf("附件大于%vM", maxFileSize)
|
||||
resultMsg = fmt.Sprintf("The file's size is bigger than %vM", maxFileSize)
|
||||
return re
|
||||
}
|
||||
|
||||
@@ -100,11 +100,15 @@ func (c Attach) uploadAttach(noteId string) (re info.Re) {
|
||||
id := bson.NewObjectId();
|
||||
fileInfo.AttachId = id
|
||||
fileId = id.Hex()
|
||||
Ok = attachService.AddAttach(fileInfo)
|
||||
Ok, resultMsg = attachService.AddAttach(fileInfo)
|
||||
if resultMsg != "" {
|
||||
resultMsg = c.Message(resultMsg)
|
||||
}
|
||||
|
||||
fileInfo.Path = ""; // 不要返回
|
||||
resultMsg = "success"
|
||||
|
||||
if Ok {
|
||||
resultMsg = "success"
|
||||
}
|
||||
return re
|
||||
}
|
||||
|
||||
|
||||
@@ -91,18 +91,19 @@ func (c Auth) Demo() revel.Result {
|
||||
|
||||
//--------
|
||||
// 注册
|
||||
func (c Auth) Register(from string) revel.Result {
|
||||
func (c Auth) Register(from, iu string) revel.Result {
|
||||
if !configService.IsOpenRegister() {
|
||||
return c.Redirect("/index")
|
||||
}
|
||||
c.SetLocale()
|
||||
c.RenderArgs["from"] = from
|
||||
c.RenderArgs["iu"] = iu
|
||||
|
||||
c.RenderArgs["title"] = c.Message("register")
|
||||
c.RenderArgs["subTitle"] = c.Message("register")
|
||||
return c.RenderTemplate("home/register.html")
|
||||
}
|
||||
func (c Auth) DoRegister(email, pwd string) revel.Result {
|
||||
func (c Auth) DoRegister(email, pwd, iu string) revel.Result {
|
||||
if !configService.IsOpenRegister() {
|
||||
return c.Redirect("/index")
|
||||
}
|
||||
@@ -117,7 +118,7 @@ func (c Auth) DoRegister(email, pwd string) revel.Result {
|
||||
}
|
||||
|
||||
// 注册
|
||||
re.Ok, re.Msg = authService.Register(email, pwd)
|
||||
re.Ok, re.Msg = authService.Register(email, pwd, iu)
|
||||
|
||||
// 注册成功, 则立即登录之
|
||||
if re.Ok {
|
||||
|
||||
@@ -193,12 +193,13 @@ func (c BaseController) SetLocale() string {
|
||||
}
|
||||
|
||||
// 设置userInfo
|
||||
func (c BaseController) SetUserInfo() {
|
||||
func (c BaseController) SetUserInfo() info.User {
|
||||
userInfo := c.GetUserInfo()
|
||||
c.RenderArgs["userInfo"] = userInfo
|
||||
if(userInfo.Username == configService.GetAdminUsername()) {
|
||||
c.RenderArgs["isAdmin"] = true
|
||||
}
|
||||
return userInfo
|
||||
}
|
||||
|
||||
// life
|
||||
@@ -224,6 +225,7 @@ func (c BaseController) RenderTemplateStr(templatePath string) string {
|
||||
// 为了msg
|
||||
// msg-v1-v2-v3
|
||||
func (c BaseController) RenderRe(re info.Re) revel.Result {
|
||||
oldMsg := re.Msg
|
||||
if re.Msg != "" {
|
||||
if(strings.Contains(re.Msg, "-")) {
|
||||
msgAndValues := strings.Split(re.Msg, "-")
|
||||
@@ -241,5 +243,8 @@ func (c BaseController) RenderRe(re info.Re) revel.Result {
|
||||
re.Msg = c.Message(re.Msg)
|
||||
}
|
||||
}
|
||||
if strings.HasPrefix(re.Msg, "???") {
|
||||
re.Msg = oldMsg
|
||||
}
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
@@ -57,6 +57,9 @@ func (c Blog) render(templateName string, themePath string) revel.Result {
|
||||
isPreview = true
|
||||
themePath = themePath2.(string)
|
||||
c.setPreviewUrl()
|
||||
|
||||
// 因为common的themeInfo是从UserBlog.ThemeId来取的, 所以这里要fugai下
|
||||
c.RenderArgs["themeInfo"] = c.RenderArgs["themeInfoPreview"];
|
||||
}
|
||||
return blog.RenderTemplate(templateName, c.RenderArgs, revel.BasePath+"/"+themePath, isPreview)
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"fmt"
|
||||
"strconv"
|
||||
// "strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -85,7 +85,7 @@ func (c File) uploadImage(from, albumId string) (re info.Re) {
|
||||
var fileUrlPath = ""
|
||||
var fileId = ""
|
||||
var resultCode = 0 // 1表示正常
|
||||
var resultMsg = "内部错误" // 错误信息
|
||||
var resultMsg = "error" // 错误信息
|
||||
var Ok = false
|
||||
|
||||
defer func() {
|
||||
@@ -120,7 +120,7 @@ func (c File) uploadImage(from, albumId string) (re info.Re) {
|
||||
} else {
|
||||
_, ext = SplitFilename(filename)
|
||||
if(ext != ".gif" && ext != ".jpg" && ext != ".png" && ext != ".bmp" && ext != ".jpeg") {
|
||||
resultMsg = "不是图片"
|
||||
resultMsg = "Please upload image"
|
||||
return re
|
||||
}
|
||||
}
|
||||
@@ -147,7 +147,7 @@ func (c File) uploadImage(from, albumId string) (re info.Re) {
|
||||
// > 2M?
|
||||
if(float64(len(data)) > maxFileSize * float64(1024*1024)) {
|
||||
resultCode = 0
|
||||
resultMsg = fmt.Sprintf("图片大于%vM", maxFileSize)
|
||||
resultMsg = fmt.Sprintf("The file Size is bigger than %vM", maxFileSize)
|
||||
return re
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ func (c File) uploadImage(from, albumId string) (re info.Re) {
|
||||
filesize := GetFilesize(toPathGif)
|
||||
fileUrlPath += "/" + filename
|
||||
resultCode = 1
|
||||
resultMsg = "上传成功!"
|
||||
resultMsg = "Upload Success!"
|
||||
|
||||
// File
|
||||
fileInfo := info.File{Name: filename,
|
||||
@@ -178,7 +178,8 @@ func (c File) uploadImage(from, albumId string) (re info.Re) {
|
||||
fileId = "public/upload/" + c.GetUserId() + "/images/logo/" + filename
|
||||
}
|
||||
|
||||
Ok = fileService.AddImage(fileInfo, albumId, c.GetUserId())
|
||||
Ok, resultMsg = fileService.AddImage(fileInfo, albumId, c.GetUserId(), from == "" || from == "pasteImage")
|
||||
resultMsg = c.Message(resultMsg)
|
||||
|
||||
fileInfo.Path = ""; // 不要返回
|
||||
re.Item = fileInfo
|
||||
@@ -203,55 +204,6 @@ func (c File) DeleteImage(fileId string) revel.Result {
|
||||
re.Ok, re.Msg = fileService.DeleteImage(c.GetUserId(), fileId)
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
// update image uploader to leaui image,
|
||||
// scan all user's images and insert into db
|
||||
func (c File) UpgradeLeauiImage() revel.Result {
|
||||
re := info.NewRe()
|
||||
|
||||
if ok, _ := revel.Config.Bool("upgradeLeauiImage"); !ok {
|
||||
re.Msg = "Not allowed"
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
uploadPath := revel.BasePath + "/public/upload";
|
||||
userIds := ListDir(uploadPath)
|
||||
if userIds == nil {
|
||||
re.Msg = "no user"
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
msg := "";
|
||||
|
||||
for _, userId := range userIds {
|
||||
dirPath := uploadPath + "/" + userId + "/images"
|
||||
images := ListDir(dirPath)
|
||||
if images == nil {
|
||||
msg += userId + " no images "
|
||||
continue;
|
||||
}
|
||||
|
||||
hadImages := fileService.GetAllImageNamesMap(userId)
|
||||
|
||||
i := 0
|
||||
for _, filename := range images {
|
||||
if _, ok := hadImages[filename]; !ok {
|
||||
fileUrlPath := "/upload/" + userId + "/images/" + filename
|
||||
fileInfo := info.File{Name: filename,
|
||||
Title: filename,
|
||||
Path: fileUrlPath,
|
||||
Size: GetFilesize(dirPath + "/" + filename)}
|
||||
fileService.AddImage(fileInfo, "", userId)
|
||||
i++
|
||||
}
|
||||
}
|
||||
msg += userId + ": " + strconv.Itoa(len(images)) + " -- " + strconv.Itoa(i) + " images "
|
||||
}
|
||||
|
||||
re.Msg = msg
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
//-----------
|
||||
|
||||
// 输出image
|
||||
@@ -267,15 +219,15 @@ func (c File) OutputImage(noteId, fileId string) revel.Result {
|
||||
}
|
||||
|
||||
// 协作时复制图片到owner
|
||||
// 需要计算对方大小
|
||||
func (c File) CopyImage(userId, fileId, toUserId string) revel.Result {
|
||||
re := info.NewRe()
|
||||
|
||||
re.Ok, re.Id = fileService.CopyImage(userId, fileId, toUserId)
|
||||
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
// 复制外网的图片, 成公共图片 放在/upload下
|
||||
// 都要好好的计算大小
|
||||
func (c File) CopyHttpImage(src string) revel.Result {
|
||||
re := info.NewRe()
|
||||
fileUrlPath := "upload/" + c.GetUserId() + "/images"
|
||||
@@ -302,29 +254,7 @@ func (c File) CopyHttpImage(src string) revel.Result {
|
||||
|
||||
re.Id = id.Hex()
|
||||
re.Item = fileInfo.Path
|
||||
re.Ok = fileService.AddImage(fileInfo, "", c.GetUserId())
|
||||
re.Ok, re.Msg = fileService.AddImage(fileInfo, "", c.GetUserId(), true)
|
||||
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
//------------
|
||||
// 过时 已弃用!
|
||||
func (c File) UploadImage(renderHtml string) revel.Result {
|
||||
if renderHtml == "" {
|
||||
renderHtml = "file/image.html"
|
||||
}
|
||||
|
||||
re := c.uploadImage("", "");
|
||||
|
||||
c.RenderArgs["fileUrlPath"] = configService.GetSiteUrl() + re.Id
|
||||
c.RenderArgs["resultCode"] = re.Code
|
||||
c.RenderArgs["resultMsg"] = re.Msg
|
||||
|
||||
return c.RenderTemplate(renderHtml)
|
||||
}
|
||||
|
||||
// 已弃用
|
||||
func (c File) UploadImageJson(from, noteId string) revel.Result {
|
||||
re := c.uploadImage(from, "");
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
@@ -22,9 +22,8 @@ type Note struct {
|
||||
// 笔记首页, 判断是否已登录
|
||||
// 已登录, 得到用户基本信息(notebook, shareNotebook), 跳转到index.html中
|
||||
// 否则, 转向登录页面
|
||||
func (c Note) Index() revel.Result {
|
||||
func (c Note) Index(noteId string) revel.Result {
|
||||
c.SetLocale()
|
||||
|
||||
userInfo := c.GetUserInfo()
|
||||
|
||||
userId := userInfo.UserId.Hex()
|
||||
@@ -43,22 +42,78 @@ func (c Note) Index() revel.Result {
|
||||
// 还需要按时间排序(DESC)得到notes
|
||||
notes := []info.Note{}
|
||||
noteContent := info.NoteContent{}
|
||||
|
||||
if len(notebooks) > 0 {
|
||||
// _, notes = noteService.ListNotes(c.GetUserId(), "", false, c.GetPage(), pageSize, defaultSortField, false, false);
|
||||
// 变成最新
|
||||
_, notes = noteService.ListNotes(c.GetUserId(), "", false, c.GetPage(), 50, defaultSortField, false, false);
|
||||
if len(notes) > 0 {
|
||||
noteContent = noteService.GetNoteContent(notes[0].NoteId.Hex(), userId)
|
||||
// noteId是否存在
|
||||
// 是否传入了正确的noteId
|
||||
hasRightNoteId := false
|
||||
if IsObjectId(noteId) {
|
||||
note := noteService.GetNoteById(noteId)
|
||||
var noteOwner = note.UserId.Hex()
|
||||
noteContent = noteService.GetNoteContent(noteId, noteOwner)
|
||||
|
||||
if note.NoteId != "" {
|
||||
hasRightNoteId = true
|
||||
c.RenderArgs["curNoteId"] = noteId
|
||||
c.RenderArgs["curNotebookId"] = note.NotebookId.Hex()
|
||||
|
||||
// 打开的是共享的笔记, 那么判断是否是共享给我的默认笔记
|
||||
if noteOwner != c.GetUserId() {
|
||||
if shareService.HasReadPerm(noteOwner, c.GetUserId(), noteId) {
|
||||
// 不要获取notebook下的笔记
|
||||
// 在前端下发请求
|
||||
c.RenderArgs["curSharedNoteNotebookId"] = note.NotebookId.Hex()
|
||||
c.RenderArgs["curSharedUserId"] = noteOwner;
|
||||
// 没有读写权限
|
||||
} else {
|
||||
hasRightNoteId = false
|
||||
}
|
||||
} else {
|
||||
_, notes = noteService.ListNotes(c.GetUserId(), note.NotebookId.Hex(), false, c.GetPage(), 50, defaultSortField, false, false);
|
||||
|
||||
// 如果指定了某笔记, 则该笔记放在首位
|
||||
lenNotes := len(notes)
|
||||
if lenNotes > 1 {
|
||||
notes2 := make([]info.Note, len(notes))
|
||||
notes2[0] = note
|
||||
i := 1
|
||||
for _, note := range notes {
|
||||
if note.NoteId.Hex() != noteId {
|
||||
if i == lenNotes { // 防止越界
|
||||
break;
|
||||
}
|
||||
notes2[i] = note
|
||||
i++
|
||||
}
|
||||
}
|
||||
notes = notes2
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 得到最近的笔记
|
||||
_, latestNotes := noteService.ListNotes(c.GetUserId(), "", false, c.GetPage(), 50, defaultSortField, false, false);
|
||||
c.RenderArgs["latestNotes"] = latestNotes
|
||||
}
|
||||
|
||||
// 没有传入笔记
|
||||
// 那么得到最新笔记
|
||||
if !hasRightNoteId {
|
||||
_, notes = noteService.ListNotes(c.GetUserId(), "", false, c.GetPage(), 50, defaultSortField, false, false);
|
||||
if len(notes) > 0 {
|
||||
noteContent = noteService.GetNoteContent(notes[0].NoteId.Hex(), userId)
|
||||
c.RenderArgs["curNoteId"] = notes[0].NoteId.Hex()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 当然, 还需要得到第一个notes的content
|
||||
//...
|
||||
Log(configService.GetAdminUsername())
|
||||
c.RenderArgs["isAdmin"] = configService.GetAdminUsername() == userInfo.Username
|
||||
|
||||
c.RenderArgs["userInfo"] = userInfo
|
||||
c.RenderArgs["notebooks"] = notebooks
|
||||
c.RenderArgs["shareNotebooks"] = shareNotebooks
|
||||
c.RenderArgs["shareNotebooks"] = shareNotebooks // note信息在notes列表中
|
||||
c.RenderArgs["sharedUserInfos"] = sharedUserInfos
|
||||
|
||||
c.RenderArgs["notes"] = notes
|
||||
@@ -69,6 +124,9 @@ func (c Note) Index() revel.Result {
|
||||
|
||||
c.RenderArgs["globalConfigs"] = configService.GetGlobalConfigForUser()
|
||||
|
||||
|
||||
// return c.RenderTemplate("note/note.html")
|
||||
|
||||
if isDev, _ := revel.Config.Bool("mode.dev"); isDev {
|
||||
return c.RenderTemplate("note/note-dev.html")
|
||||
} else {
|
||||
|
||||
@@ -33,6 +33,8 @@ func (c Preview) getPreviewThemeAbsolutePath(themeId string) bool {
|
||||
theme := themeService.GetTheme(c.GetUserId(), themeId)
|
||||
|
||||
c.RenderArgs["isPreview"] = true
|
||||
c.RenderArgs["themeId"] = themeId
|
||||
c.RenderArgs["themeInfoPreview"] = theme.Info
|
||||
c.RenderArgs["themePath"] = theme.Path
|
||||
if theme.Path == "" {
|
||||
return false
|
||||
|
||||
@@ -44,7 +44,7 @@ func (c AdminUser) Register(email, pwd string) revel.Result {
|
||||
}
|
||||
|
||||
// 注册
|
||||
re.Ok, re.Msg = authService.Register(email, pwd)
|
||||
re.Ok, re.Msg = authService.Register(email, pwd, "")
|
||||
|
||||
return c.RenderRe(re)
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package member
|
||||
|
||||
import (
|
||||
"github.com/revel/revel"
|
||||
. "github.com/leanote/leanote/app/lea"
|
||||
"github.com/leanote/leanote/app/info"
|
||||
"os"
|
||||
"io/ioutil"
|
||||
"time"
|
||||
"fmt"
|
||||
"github.com/leanote/leanote/app/info"
|
||||
. "github.com/leanote/leanote/app/lea"
|
||||
"github.com/revel/revel"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
// "github.com/leanote/leanote/app/lea/blog"
|
||||
"time"
|
||||
// "github.com/leanote/leanote/app/lea/blog"
|
||||
)
|
||||
|
||||
// 博客管理
|
||||
@@ -34,26 +34,25 @@ func (c MemberBlog) common() info.UserBlog {
|
||||
return userBlog
|
||||
}
|
||||
|
||||
|
||||
// 得到sorterField 和 isAsc
|
||||
// okSorter = ['email', 'username']
|
||||
func (c MemberBlog) getSorter(sorterField string, isAsc bool, okSorter []string) (string, bool){
|
||||
func (c MemberBlog) getSorter(sorterField string, isAsc bool, okSorter []string) (string, bool) {
|
||||
sorter := ""
|
||||
c.Params.Bind(&sorter, "sorter")
|
||||
if sorter == "" {
|
||||
return sorterField, isAsc;
|
||||
return sorterField, isAsc
|
||||
}
|
||||
|
||||
// sorter形式 email-up, email-down
|
||||
s2 := strings.Split(sorter, "-")
|
||||
if len(s2) != 2 {
|
||||
return sorterField, isAsc;
|
||||
return sorterField, isAsc
|
||||
}
|
||||
|
||||
// 必须是可用的sorter
|
||||
if okSorter != nil && len(okSorter) > 0 {
|
||||
if !InArray(okSorter, s2[0]) {
|
||||
return sorterField, isAsc;
|
||||
return sorterField, isAsc
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,11 +63,12 @@ func (c MemberBlog) getSorter(sorterField string, isAsc bool, okSorter []string)
|
||||
isAsc = false
|
||||
}
|
||||
c.RenderArgs["sorter"] = sorter
|
||||
return sorterField, isAsc;
|
||||
return sorterField, isAsc
|
||||
}
|
||||
|
||||
// 博客列表
|
||||
var userPageSize = 15
|
||||
|
||||
func (c MemberBlog) Index(sorter, keywords string) revel.Result {
|
||||
userId := c.GetUserId()
|
||||
userInfo := userService.GetUserInfo(userId)
|
||||
@@ -76,8 +76,8 @@ func (c MemberBlog) Index(sorter, keywords string) revel.Result {
|
||||
|
||||
c.RenderArgs["title"] = "Posts"
|
||||
pageNumber := c.GetPage()
|
||||
sorterField, isAsc := c.getSorter("CreatedTime", false, []string{"title", "urlTitle", "updatedTime", "publicTime", "createdTime"});
|
||||
pageInfo, blogs := blogService.ListAllBlogs(c.GetUserId(), "", keywords, false, pageNumber, userPageSize, sorterField, isAsc);
|
||||
sorterField, isAsc := c.getSorter("CreatedTime", false, []string{"title", "urlTitle", "updatedTime", "publicTime", "createdTime"})
|
||||
pageInfo, blogs := blogService.ListAllBlogs(c.GetUserId(), "", keywords, false, pageNumber, userPageSize, sorterField, isAsc)
|
||||
c.RenderArgs["pageInfo"] = pageInfo
|
||||
c.RenderArgs["blogs"] = blogs
|
||||
c.RenderArgs["keywords"] = keywords
|
||||
@@ -85,7 +85,7 @@ func (c MemberBlog) Index(sorter, keywords string) revel.Result {
|
||||
userAndBlog := userService.GetUserAndBlog(c.GetUserId())
|
||||
c.RenderArgs["userAndBlog"] = userAndBlog
|
||||
|
||||
return c.RenderTemplate("member/blog/list.html");
|
||||
return c.RenderTemplate("member/blog/list.html")
|
||||
}
|
||||
|
||||
// 修改笔记的urlTitle
|
||||
@@ -95,17 +95,16 @@ func (c MemberBlog) UpdateBlogUrlTitle(noteId, urlTitle string) revel.Result {
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
|
||||
// 修改笔记的urlTitle
|
||||
func (c MemberBlog) UpdateBlogAbstract(noteId string) revel.Result {
|
||||
c.RenderArgs["title"] = "Update Post Abstract"
|
||||
note := noteService.GetNoteAndContent(noteId, c.GetUserId());
|
||||
note := noteService.GetNoteAndContent(noteId, c.GetUserId())
|
||||
if !note.Note.IsBlog {
|
||||
return c.E404();
|
||||
return c.E404()
|
||||
}
|
||||
c.RenderArgs["note"] = note
|
||||
c.RenderArgs["noteId"] = noteId
|
||||
return c.RenderTemplate("member/blog/update_abstract.html");
|
||||
return c.RenderTemplate("member/blog/update_abstract.html")
|
||||
}
|
||||
func (c MemberBlog) DoUpdateBlogAbstract(noteId, imgSrc, desc, abstract string) revel.Result {
|
||||
|
||||
@@ -118,23 +117,18 @@ func (c MemberBlog) DoUpdateBlogAbstract(noteId, imgSrc, desc, abstract string)
|
||||
func (c MemberBlog) Base() revel.Result {
|
||||
c.common()
|
||||
c.RenderArgs["title"] = "Blog Base Info"
|
||||
return c.RenderTemplate("member/blog/base.html");
|
||||
return c.RenderTemplate("member/blog/base.html")
|
||||
}
|
||||
func (c MemberBlog) Comment() revel.Result {
|
||||
c.common()
|
||||
c.RenderArgs["title"] = "Comment"
|
||||
return c.RenderTemplate("member/blog/comment.html");
|
||||
}
|
||||
func (c MemberBlog) Domain() revel.Result {
|
||||
c.common()
|
||||
c.RenderArgs["title"] = "Domain"
|
||||
return c.RenderTemplate("member/blog/domain.html");
|
||||
return c.RenderTemplate("member/blog/comment.html")
|
||||
}
|
||||
|
||||
func (c MemberBlog) Paging() revel.Result {
|
||||
c.common()
|
||||
c.RenderArgs["title"] = "Paging"
|
||||
return c.RenderTemplate("member/blog/paging.html");
|
||||
return c.RenderTemplate("member/blog/paging.html")
|
||||
}
|
||||
|
||||
func (c MemberBlog) Cate() revel.Result {
|
||||
@@ -147,7 +141,7 @@ func (c MemberBlog) Cate() revel.Result {
|
||||
notebooksMap[each.NotebookId.Hex()] = each
|
||||
}
|
||||
|
||||
var i = 0;
|
||||
var i = 0
|
||||
notebooks2 := make([]info.Notebook, len(notebooks))
|
||||
|
||||
// 先要保证已有的是正确的排序
|
||||
@@ -172,7 +166,7 @@ func (c MemberBlog) Cate() revel.Result {
|
||||
}
|
||||
c.RenderArgs["notebooks"] = notebooks2
|
||||
|
||||
return c.RenderTemplate("member/blog/cate.html");
|
||||
return c.RenderTemplate("member/blog/cate.html")
|
||||
}
|
||||
|
||||
// 修改分类排序
|
||||
@@ -199,9 +193,10 @@ func (c MemberBlog) AddOrUpdateSingle(singleId string) revel.Result {
|
||||
c.RenderArgs["title"] = "Add Single"
|
||||
c.RenderArgs["singleId"] = singleId
|
||||
if singleId != "" {
|
||||
c.RenderArgs["title"] = "Update Single"
|
||||
c.RenderArgs["single"] = blogService.GetSingle(singleId)
|
||||
}
|
||||
return c.RenderTemplate("member/blog/add_single.html");
|
||||
return c.RenderTemplate("member/blog/add_single.html")
|
||||
}
|
||||
func (c MemberBlog) SortSingles(singleIds []string) revel.Result {
|
||||
re := info.NewRe()
|
||||
@@ -227,7 +222,7 @@ func (c MemberBlog) Single() revel.Result {
|
||||
c.RenderArgs["title"] = "Cate"
|
||||
c.RenderArgs["singles"] = blogService.GetSingles(c.GetUserId())
|
||||
|
||||
return c.RenderTemplate("member/blog/single.html");
|
||||
return c.RenderTemplate("member/blog/single.html")
|
||||
}
|
||||
|
||||
// 主题
|
||||
@@ -240,11 +235,12 @@ func (c MemberBlog) Theme() revel.Result {
|
||||
c.RenderArgs["optionThemes"] = themeService.GetDefaultThemes()
|
||||
|
||||
c.RenderArgs["title"] = "Theme"
|
||||
return c.RenderTemplate("member/blog/theme.html");
|
||||
return c.RenderTemplate("member/blog/theme.html")
|
||||
}
|
||||
|
||||
// 编辑主题
|
||||
var baseTpls = []string{"header.html", "footer.html", "index.html", "cate.html", "search.html", "post.html", "single.html", "tags.html", "tag_posts.html", "archive.html", "share_comment.html", "404.html", "theme.json", "style.css", "blog.js"}
|
||||
|
||||
func (c MemberBlog) UpdateTheme(themeId string, isNew int) revel.Result {
|
||||
// 查看用户是否有该theme, 若没有则复制default之
|
||||
// 得到主题的文件列表
|
||||
@@ -265,6 +261,9 @@ func (c MemberBlog) UpdateTheme(themeId string, isNew int) revel.Result {
|
||||
userId := c.GetUserId()
|
||||
|
||||
theme := themeService.GetTheme(userId, themeId)
|
||||
if theme.ThemeId == "" {
|
||||
return c.E404()
|
||||
}
|
||||
c.RenderArgs["theme"] = theme
|
||||
|
||||
path := revel.BasePath + "/" + theme.Path
|
||||
@@ -279,7 +278,7 @@ func (c MemberBlog) UpdateTheme(themeId string, isNew int) revel.Result {
|
||||
// 得到没有的tpls
|
||||
for _, t := range tpls {
|
||||
if t == "images" {
|
||||
continue;
|
||||
continue
|
||||
}
|
||||
if !tplMap[t] {
|
||||
myTpls = append(myTpls, t)
|
||||
@@ -288,7 +287,7 @@ func (c MemberBlog) UpdateTheme(themeId string, isNew int) revel.Result {
|
||||
|
||||
c.RenderArgs["myTpls"] = myTpls
|
||||
|
||||
return c.RenderTemplate("member/blog/update_theme.html");
|
||||
return c.RenderTemplate("member/blog/update_theme.html")
|
||||
}
|
||||
|
||||
// 得到文件内容
|
||||
@@ -302,7 +301,7 @@ func (c MemberBlog) GetTplContent(themeId string, filename string) revel.Result
|
||||
func (c MemberBlog) UpdateTplContent(themeId, filename, content string) revel.Result {
|
||||
re := info.NewRe()
|
||||
re.Ok, re.Msg = themeService.UpdateTplContent(c.GetUserId(), themeId, filename, content)
|
||||
return c.RenderJson(re)
|
||||
return c.RenderRe(re)
|
||||
}
|
||||
|
||||
func (c MemberBlog) DeleteTpl(themeId, filename string) revel.Result {
|
||||
@@ -331,7 +330,7 @@ func (c MemberBlog) DeleteThemeImage(themeId, filename string) revel.Result {
|
||||
|
||||
// 上传主题图片
|
||||
func (c MemberBlog) UploadThemeImage(themeId string) revel.Result {
|
||||
re := c.uploadImage(themeId);
|
||||
re := c.uploadImage(themeId)
|
||||
c.RenderArgs["fileUrlPath"] = re.Id
|
||||
c.RenderArgs["resultCode"] = re.Code
|
||||
c.RenderArgs["resultMsg"] = re.Msg
|
||||
@@ -339,7 +338,7 @@ func (c MemberBlog) UploadThemeImage(themeId string) revel.Result {
|
||||
}
|
||||
func (c MemberBlog) uploadImage(themeId string) (re info.Re) {
|
||||
var fileId = ""
|
||||
var resultCode = 0 // 1表示正常
|
||||
var resultCode = 0 // 1表示正常
|
||||
var resultMsg = "内部错误" // 错误信息
|
||||
var Ok = false
|
||||
|
||||
@@ -364,10 +363,10 @@ func (c MemberBlog) uploadImage(themeId string) (re info.Re) {
|
||||
// 生成新的文件名
|
||||
filename := handel.Filename
|
||||
|
||||
var ext string;
|
||||
var ext string
|
||||
|
||||
_, ext = SplitFilename(filename)
|
||||
if(ext != ".gif" && ext != ".jpg" && ext != ".png" && ext != ".bmp" && ext != ".jpeg") {
|
||||
if ext != ".gif" && ext != ".jpg" && ext != ".png" && ext != ".bmp" && ext != ".jpeg" {
|
||||
resultMsg = "不是图片"
|
||||
return re
|
||||
}
|
||||
@@ -380,13 +379,13 @@ func (c MemberBlog) uploadImage(themeId string) (re info.Re) {
|
||||
}
|
||||
|
||||
// > 2M?
|
||||
if(len(data) > 5 * 1024 * 1024) {
|
||||
if len(data) > 5*1024*1024 {
|
||||
resultCode = 0
|
||||
resultMsg = "图片大于2M"
|
||||
return re
|
||||
}
|
||||
|
||||
toPath := dir + "/" + filename;
|
||||
toPath := dir + "/" + filename
|
||||
err = ioutil.WriteFile(toPath, data, 0777)
|
||||
if err != nil {
|
||||
LogJ(err)
|
||||
@@ -406,18 +405,21 @@ func (c MemberBlog) ActiveTheme(themeId string) revel.Result {
|
||||
re.Ok = themeService.ActiveTheme(c.GetUserId(), themeId)
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
// 删除主题
|
||||
func (c MemberBlog) DeleteTheme(themeId string) revel.Result {
|
||||
re := info.NewRe()
|
||||
re.Ok = themeService.DeleteTheme(c.GetUserId(), themeId)
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
// 管理员公开主题
|
||||
func (c MemberBlog) PublicTheme(themeId string) revel.Result {
|
||||
re := info.NewRe()
|
||||
re.Ok = themeService.PublicTheme(c.GetUserId(), themeId)
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
// 导出
|
||||
func (c MemberBlog) ExportTheme(themeId string) revel.Result {
|
||||
re := info.NewRe()
|
||||
@@ -427,10 +429,10 @@ func (c MemberBlog) ExportTheme(themeId string) revel.Result {
|
||||
return c.RenderText("error...")
|
||||
}
|
||||
fw, err := os.Open(path)
|
||||
if err != nil {
|
||||
if err != nil {
|
||||
return c.RenderText("error")
|
||||
}
|
||||
return c.RenderBinary(fw, GetFilename(path), revel.Attachment, time.Now()) // revel.Attachment
|
||||
}
|
||||
return c.RenderBinary(fw, GetFilename(path), revel.Attachment, time.Now()) // revel.Attachment
|
||||
}
|
||||
|
||||
// 导入主题
|
||||
@@ -455,9 +457,9 @@ func (c MemberBlog) ImportTheme() revel.Result {
|
||||
// 生成新的文件名
|
||||
filename := handel.Filename
|
||||
|
||||
var ext string;
|
||||
var ext string
|
||||
_, ext = SplitFilename(filename)
|
||||
if(ext != ".zip") {
|
||||
if ext != ".zip" {
|
||||
re.Msg = "请上传zip文件"
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
@@ -469,12 +471,12 @@ func (c MemberBlog) ImportTheme() revel.Result {
|
||||
}
|
||||
|
||||
// > 10M?
|
||||
if(len(data) > 10 * 1024 * 1024) {
|
||||
if len(data) > 10*1024*1024 {
|
||||
re.Msg = "文件大于10M"
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
toPath := dir + "/" + filename;
|
||||
toPath := dir + "/" + filename
|
||||
err = ioutil.WriteFile(toPath, data, 0777)
|
||||
if err != nil {
|
||||
re.Msg = fmt.Sprintf("%v", err)
|
||||
@@ -482,10 +484,8 @@ func (c MemberBlog) ImportTheme() revel.Result {
|
||||
}
|
||||
|
||||
// 上传好后, 增加之
|
||||
themeService.ImportTheme(c.GetUserId(), toPath)
|
||||
|
||||
re.Ok = true
|
||||
return c.RenderJson(re)
|
||||
re.Ok, re.Msg = themeService.ImportTheme(c.GetUserId(), toPath)
|
||||
return c.RenderRe(re)
|
||||
}
|
||||
|
||||
// 安装
|
||||
@@ -494,11 +494,13 @@ func (c MemberBlog) InstallTheme(themeId string) revel.Result {
|
||||
re.Ok = themeService.InstallTheme(c.GetUserId(), themeId)
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
// 新建主题
|
||||
func (c MemberBlog) NewTheme() revel.Result {
|
||||
_, themeId := themeService.NewTheme(c.GetUserId())
|
||||
return c.Redirect("/member/blog/updateTheme?isNew=1&themeId=" + themeId)
|
||||
}
|
||||
|
||||
//-----------
|
||||
//
|
||||
func (c MemberBlog) SetUserBlogBase(userBlog info.UserBlogBase) revel.Result {
|
||||
@@ -516,6 +518,7 @@ func (c MemberBlog) SetUserBlogStyle(userBlog info.UserBlogStyle) revel.Result {
|
||||
re.Ok = blogService.UpdateUserBlogStyle(c.GetUserId(), userBlog)
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
func (c MemberBlog) SetUserBlogPaging(perPageSize int, sortField string, isAsc bool) revel.Result {
|
||||
re := info.NewRe()
|
||||
re.Ok, re.Msg = blogService.UpdateUserBlogPaging(c.GetUserId(), perPageSize, sortField, isAsc)
|
||||
|
||||
@@ -35,7 +35,7 @@ func (c MemberGroup) UpdateGroupTitle(groupId, title string) revel.Result {
|
||||
func (c MemberGroup) DeleteGroup(groupId string) revel.Result {
|
||||
re := info.NewRe()
|
||||
re.Ok, re.Msg = groupService.DeleteGroup(c.GetUserId(), groupId)
|
||||
return c.RenderJson(re)
|
||||
return c.RenderRe(re)
|
||||
}
|
||||
|
||||
// 添加用户
|
||||
|
||||
@@ -128,6 +128,7 @@ func init() {
|
||||
revel.InterceptFunc(AuthInterceptor, revel.BEFORE, &MemberIndex{})
|
||||
revel.InterceptFunc(AuthInterceptor, revel.BEFORE, &MemberUser{})
|
||||
revel.InterceptFunc(AuthInterceptor, revel.BEFORE, &MemberBlog{})
|
||||
revel.InterceptFunc(AuthInterceptor, revel.BEFORE, &MemberGroup{})
|
||||
revel.OnAppStart(func() {
|
||||
})
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package db
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/revel/revel"
|
||||
. "github.com/leanote/leanote/app/lea"
|
||||
"gopkg.in/mgo.v2"
|
||||
"gopkg.in/mgo.v2/bson"
|
||||
)
|
||||
@@ -56,12 +57,15 @@ var Themes *mgo.Collection
|
||||
var Sessions *mgo.Collection
|
||||
|
||||
// 初始化时连接数据库
|
||||
func Init() {
|
||||
var url string
|
||||
var ok bool
|
||||
func Init(url, dbname string) {
|
||||
ok := true
|
||||
config := revel.Config
|
||||
url, ok = config.String("db.url")
|
||||
dbname, _ := config.String("db.dbname")
|
||||
if url == "" {
|
||||
url, ok = config.String("db.url")
|
||||
}
|
||||
if dbname == "" {
|
||||
dbname, _ = config.String("db.dbname")
|
||||
}
|
||||
if !ok {
|
||||
host, _ := revel.Config.String("db.host")
|
||||
port, _ := revel.Config.String("db.port")
|
||||
@@ -73,6 +77,7 @@ func Init() {
|
||||
}
|
||||
url = "mongodb://" + usernameAndPassword + host + ":" + port + "/" + dbname
|
||||
}
|
||||
Log(url)
|
||||
|
||||
// [mongodb://][user:pass@]host1[:port1][,host2[:port2],...][/database][?options]
|
||||
// mongodb://myuser:mypass@localhost:40001,otherhost:40001/mydb
|
||||
|
||||
@@ -41,7 +41,7 @@ type User struct {
|
||||
ImageSize int `bson:"ImageSize" json:"-"` // 图片大小
|
||||
AttachNum int `bson:"AttachNum" json:"-"` // 附件数量
|
||||
AttachSize int `bson:"AttachSize" json:"-"` // 附件大小
|
||||
PerAttachSize int `bson:"PerAttachSize" json:"-"` // 单个附件大小
|
||||
FromUserId bson.ObjectId `FromUserId,omitempty` // 邀请的用户
|
||||
|
||||
AccountType string `bson:"AccountType" json:"-"` // normal(为空), premium
|
||||
AccountStartTime time.Time `bson:"AccountStartTime" json:"-"` // 开始日期
|
||||
|
||||
@@ -112,6 +112,7 @@ func init() {
|
||||
}
|
||||
|
||||
// tags
|
||||
// 2014/12/30 标签添加链接
|
||||
revel.TemplateFuncs["blogTags"] = func(renderArgs map[string]interface{}, tags []string) template.HTML {
|
||||
if tags == nil || len(tags) == 0 {
|
||||
return ""
|
||||
@@ -119,18 +120,74 @@ func init() {
|
||||
locale, _ := renderArgs[revel.CurrentLocaleRenderArg].(string)
|
||||
tagStr := ""
|
||||
lenTags := len(tags)
|
||||
|
||||
tagPostUrl, _ := renderArgs["tagPostsUrl"].(string)
|
||||
|
||||
for i, tag := range tags {
|
||||
str := revel.Message(locale, tag)
|
||||
var classes = "label"
|
||||
if strings.HasPrefix(str, "???") {
|
||||
str = tag
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
tagStr += str
|
||||
if i != lenTags-1 {
|
||||
tagStr += ","
|
||||
=======
|
||||
if InArray([]string{"red", "blue", "yellow", "green"}, tag) {
|
||||
classes += " label-" + tag
|
||||
} else {
|
||||
classes += " label-default"
|
||||
}
|
||||
|
||||
classes += " label-post"
|
||||
var url = tagPostUrl + "/" + url.QueryEscape(tag)
|
||||
tagStr += "<a class=\"" + classes + "\" href=\"" + url + "\">" + str + "</a>";
|
||||
if i != lenTags - 1 {
|
||||
tagStr += " "
|
||||
>>>>>>> dev-life
|
||||
}
|
||||
}
|
||||
return template.HTML(tagStr)
|
||||
}
|
||||
|
||||
// lea++
|
||||
revel.TemplateFuncs["blogTagsLea"] = func(renderArgs map[string]interface{}, tags []string, isRecommend bool) template.HTML {
|
||||
if tags == nil || len(tags) == 0 {
|
||||
return ""
|
||||
}
|
||||
locale, _ := renderArgs[revel.CurrentLocaleRenderArg].(string)
|
||||
tagStr := ""
|
||||
lenTags := len(tags)
|
||||
|
||||
tagPostUrl := "http://lea.leanote.com/"
|
||||
if isRecommend {
|
||||
tagPostUrl += "?tag=";
|
||||
} else {
|
||||
tagPostUrl += "latest?tag=";
|
||||
}
|
||||
|
||||
for i, tag := range tags {
|
||||
str := revel.Message(locale, tag)
|
||||
var classes = "label"
|
||||
if strings.HasPrefix(str, "???") {
|
||||
str = tag
|
||||
}
|
||||
if InArray([]string{"red", "blue", "yellow", "green"}, tag) {
|
||||
classes += " label-" + tag
|
||||
} else {
|
||||
classes += " label-default"
|
||||
}
|
||||
classes += " label-post"
|
||||
var url = tagPostUrl + url.QueryEscape(tag)
|
||||
tagStr += "<a class=\"" + classes + "\" href=\"" + url + "\">" + str + "</a>";
|
||||
if i != lenTags - 1 {
|
||||
tagStr += " "
|
||||
}
|
||||
}
|
||||
return template.HTML(tagStr)
|
||||
}
|
||||
|
||||
/*
|
||||
revel.TemplateFuncs["blogTags"] = func(tags []string) template.HTML {
|
||||
if tags == nil || len(tags) == 0 {
|
||||
@@ -312,7 +369,7 @@ func init() {
|
||||
// init Email
|
||||
revel.OnAppStart(func() {
|
||||
// 数据库
|
||||
db.Init()
|
||||
db.Init("", "")
|
||||
// email配置
|
||||
InitEmail()
|
||||
InitVd()
|
||||
@@ -324,4 +381,5 @@ func init() {
|
||||
member.InitService()
|
||||
service.ConfigS.InitGlobalConfigs()
|
||||
})
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package lea
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/revel/revel"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func Log(i interface{}) {
|
||||
@@ -13,3 +14,13 @@ func LogJ(i interface{}) {
|
||||
b, _ := json.MarshalIndent(i, "", " ")
|
||||
revel.INFO.Println(string(b))
|
||||
}
|
||||
|
||||
// 为test用
|
||||
func L(i interface{}) {
|
||||
fmt.Println(i)
|
||||
}
|
||||
|
||||
func LJ(i interface{}) {
|
||||
b, _ := json.MarshalIndent(i, "", " ")
|
||||
fmt.Println(string(b))
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
)
|
||||
|
||||
/*
|
||||
用golang exec 总是说找不到uglifyjs命令, 需要全部路径
|
||||
而且node, npm要在/usr/bin下, 已建ln
|
||||
@@ -31,7 +32,7 @@ import (
|
||||
//var jss = []string{"js/jquery-cookie", "js/bootstrap"}
|
||||
var jss = []string{"js/jquery-cookie", "js/bootstrap",
|
||||
"js/common", "js/app/note", "js/app/tag", "js/app/notebook", "js/app/share",
|
||||
"js/object_id", "js/ZeroClipboard/ZeroClipboard"}
|
||||
"js/object_id"}
|
||||
|
||||
var base1 = "/Users/life/Documents/Go/package2/src/github.com/leanote/leanote/"
|
||||
var base = "/Users/life/Documents/Go/package2/src/github.com/leanote/leanote/public/"
|
||||
@@ -52,7 +53,7 @@ func compressJs(filename string) {
|
||||
to := base + filename + "-min.js"
|
||||
cmd := exec.Command(cmdPath, source, "-o", to)
|
||||
_, err := cmd.CombinedOutput()
|
||||
|
||||
fmt.Println(source);
|
||||
cmdError(err)
|
||||
}
|
||||
|
||||
@@ -80,7 +81,10 @@ func combineJs() {
|
||||
// 改note-dev->note
|
||||
func dev() {
|
||||
// 即替换note.js->note-min.js
|
||||
m := map[string]string{"note.js": "note-min.js",
|
||||
m := map[string]string{"tinymce.dev.js": "tinymce.min.js",
|
||||
"tinymce.js": "tinymce.min.js",
|
||||
"jquery.ztree.all-3.5.js": "jquery.ztree.all-3.5-min.js",
|
||||
"note.js": "note-min.js",
|
||||
"app.js": "app-min.js",
|
||||
"page.js": "page-min.js",
|
||||
"common.js": "common-min.js",
|
||||
@@ -88,6 +92,7 @@ func dev() {
|
||||
"share.js": "share-min.js",
|
||||
"tag.js": "tag-min.js",
|
||||
"main.js": "main-min.js",
|
||||
"jquery.slimscroll.js": "jquery.slimscroll-min.js",
|
||||
"jquery.contextmenu.js": "jquery.contextmenu-min.js",
|
||||
"editor/editor.js": "editor/editor-min.js",
|
||||
"/public/mdeditor/editor/scrollLink.js": "/public/mdeditor/editor/scrollLink-min.js",
|
||||
@@ -111,12 +116,21 @@ func tinymce() {
|
||||
// cmd := exec.Command("/Users/life/Documents/eclipse-workspace/go/leanote_release/tinymce-master/node_modules/jake/bin/cli.js", "minify", "bundle[themes:modern,plugins:table,paste,advlist,autolink,link,image,lists,charmap,hr,searchreplace,visualblocks,visualchars,code,nav,tabfocus,contextmenu,directionality,codemirror,codesyntax,textcolor,fullpage]")
|
||||
cmd := exec.Command("/Users/life/Documents/eclipse-workspace/go/leanote_release/tinymce-master/node_modules/jake/bin/cli.js", "minify")
|
||||
cmd.Dir = "/Users/life/Documents/eclipse-workspace/go/leanote_release/tinymce-master"
|
||||
c, err := cmd.CombinedOutput()
|
||||
|
||||
// 必须要先删除
|
||||
cmd2 := exec.Command("/bin/sh", "-c", "rm " + cmd.Dir + "/js/tinymce/tinymce.dev.js")
|
||||
cmd2.CombinedOutput()
|
||||
cmd2 = exec.Command("/bin/sh", "-c", "rm " + cmd.Dir + "/js/tinymce/tinymce.jquery.dev.js")
|
||||
c, _ := cmd2.CombinedOutput()
|
||||
fmt.Println(string(c))
|
||||
c, _ = cmd.CombinedOutput()
|
||||
fmt.Println(string(c))
|
||||
cmdError(err)
|
||||
}
|
||||
|
||||
func main() {
|
||||
// 压缩tinymce
|
||||
tinymce()
|
||||
|
||||
dev();
|
||||
|
||||
// 其它零散的需要压缩的js
|
||||
@@ -133,6 +147,10 @@ func main() {
|
||||
"mdeditor/editor/underscore",
|
||||
"mdeditor/editor/mathJax",
|
||||
"js/jQuery-slimScroll-1.3.0/jquery.slimscroll",
|
||||
"js/app/editor_drop_paste",
|
||||
"js/app/attachment_upload",
|
||||
"js/jquery.ztree.all-3.5",
|
||||
"js/jQuery-slimScroll-1.3.0/jquery.slimscroll",
|
||||
}
|
||||
|
||||
for _, js := range otherJss {
|
||||
@@ -142,6 +160,4 @@ func main() {
|
||||
// 先压缩后合并
|
||||
combineJs()
|
||||
|
||||
// 压缩tinymce
|
||||
tinymce()
|
||||
}
|
||||
@@ -15,16 +15,16 @@ type AttachService struct {
|
||||
}
|
||||
|
||||
// add attach
|
||||
func (this *AttachService) AddAttach(attach info.Attach) bool {
|
||||
func (this *AttachService) AddAttach(attach info.Attach) (ok bool, msg string) {
|
||||
attach.CreatedTime = time.Now()
|
||||
ok := db.Insert(db.Attachs, attach)
|
||||
ok = db.Insert(db.Attachs, attach)
|
||||
|
||||
if ok {
|
||||
// 更新笔记的attachs num
|
||||
this.updateNoteAttachNum(attach.NoteId, 1)
|
||||
}
|
||||
|
||||
return ok
|
||||
return
|
||||
}
|
||||
|
||||
// 更新笔记的附件个数
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
// "github.com/leanote/leanote/app/db"
|
||||
"github.com/leanote/leanote/app/info"
|
||||
// "github.com/revel/revel"
|
||||
"strings"
|
||||
. "github.com/leanote/leanote/app/lea"
|
||||
"fmt"
|
||||
"strconv"
|
||||
@@ -17,6 +18,8 @@ type AuthService struct {
|
||||
|
||||
// pwd已md5了
|
||||
func (this *AuthService) Login(emailOrUsername, pwd string) info.User {
|
||||
emailOrUsername = strings.Trim(emailOrUsername, " ")
|
||||
// pwd = strings.Trim(pwd, " ")
|
||||
userInfo := userService.LoginGetUserInfo(emailOrUsername, Md5(pwd))
|
||||
return userInfo
|
||||
}
|
||||
@@ -32,12 +35,16 @@ func (this *AuthService) Login(emailOrUsername, pwd string) info.User {
|
||||
// 1. 添加用户
|
||||
// 2. 将leanote共享给我
|
||||
// [ok]
|
||||
func (this *AuthService) Register(email, pwd string) (bool, string) {
|
||||
func (this *AuthService) Register(email, pwd, fromUserId string) (bool, string) {
|
||||
// 用户是否已存在
|
||||
if userService.IsExistsUser(email) {
|
||||
return false, "userHasBeenRegistered-" + email
|
||||
}
|
||||
user := info.User{UserId: bson.NewObjectId(), Email: email, Username: email, Pwd: Md5(pwd)}
|
||||
if fromUserId != "" && IsObjectId(fromUserId) {
|
||||
user.FromUserId = bson.ObjectIdHex(fromUserId)
|
||||
}
|
||||
LogJ(user)
|
||||
return this.register(user)
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ type FileService struct {
|
||||
}
|
||||
|
||||
// add Image
|
||||
func (this *FileService) AddImage(image info.File, albumId, userId string) bool {
|
||||
func (this *FileService) AddImage(image info.File, albumId, userId string, needCheckSize bool) (ok bool, msg string) {
|
||||
image.CreatedTime = time.Now()
|
||||
if albumId != "" {
|
||||
image.AlbumId = bson.ObjectIdHex(albumId)
|
||||
@@ -27,7 +27,8 @@ func (this *FileService) AddImage(image info.File, albumId, userId string) bool
|
||||
}
|
||||
image.UserId = bson.ObjectIdHex(userId)
|
||||
|
||||
return db.Insert(db.Files, image)
|
||||
ok = db.Insert(db.Files, image)
|
||||
return
|
||||
}
|
||||
|
||||
// list images
|
||||
@@ -147,7 +148,16 @@ func (this *FileService) GetFile(userId, fileId string) string {
|
||||
return path
|
||||
}
|
||||
|
||||
// 2014/12/28 修复, 如果是分享给用户组, 那就不行, 这里可以实现
|
||||
for _, noteId := range noteIds {
|
||||
note := noteService.GetNoteById(noteId.Hex())
|
||||
if shareService.HasReadPerm(note.UserId.Hex(), userId, noteId.Hex()) {
|
||||
return path;
|
||||
}
|
||||
}
|
||||
/*
|
||||
// 若有共享给我的笔记?
|
||||
// 对该笔记可读?
|
||||
if db.Has(db.ShareNotes, bson.M{"ToUserId": bson.ObjectIdHex(userId), "NoteId": bson.M{"$in": noteIds}}) {
|
||||
return path
|
||||
}
|
||||
@@ -166,6 +176,7 @@ func (this *FileService) GetFile(userId, fileId string) string {
|
||||
return path
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
// 可能是刚复制到owner上, 但内容又没有保存, 所以没有note->imageId的映射, 此时看是否有fromFileId
|
||||
@@ -222,7 +233,7 @@ func (this *FileService) CopyImage(userId, fileId, toUserId string) (bool, strin
|
||||
id := bson.NewObjectId();
|
||||
fileInfo.FileId = id
|
||||
fileId = id.Hex()
|
||||
Ok := this.AddImage(fileInfo, "", toUserId)
|
||||
Ok, _ := this.AddImage(fileInfo, "", toUserId, false)
|
||||
|
||||
if Ok {
|
||||
return Ok, id.Hex()
|
||||
|
||||
@@ -27,9 +27,12 @@ func (this *GroupService) AddGroup(userId, title string) (bool, info.Group) {
|
||||
// 删除分组
|
||||
// 判断是否有好友
|
||||
func (this *GroupService) DeleteGroup(userId, groupId string) (ok bool, msg string) {
|
||||
/*
|
||||
if db.Has(db.GroupUsers, bson.M{"GroupId": bson.ObjectIdHex(groupId)}) {
|
||||
return false, "hasUsers"
|
||||
return false, "groupHasUsers"
|
||||
}
|
||||
*/
|
||||
db.DeleteAll(db.GroupUsers, bson.M{"GroupId": bson.ObjectIdHex(groupId)})
|
||||
return db.DeleteByIdAndUserId(db.Groups, groupId, userId), ""
|
||||
|
||||
// TODO 删除分组后, 在shareNote, shareNotebook中也要删除
|
||||
|
||||
@@ -33,7 +33,8 @@ func (this *NoteContentHistoryService) AddHistory(noteId, userId string, eachHis
|
||||
// TODO
|
||||
l := len(history.Histories)
|
||||
if l >= maxSize {
|
||||
history.Histories = history.Histories[l-maxSize:]
|
||||
// history.Histories = history.Histories[l-maxSize:] // BUG, 致使都是以前的
|
||||
history.Histories = history.Histories[:maxSize]
|
||||
}
|
||||
newHistory := []info.EachHistory{eachHistory}
|
||||
newHistory = append(newHistory, history.Histories...) // 在开头加了, 最近的在最前
|
||||
|
||||
@@ -49,6 +49,7 @@ func (this *ShareService) getOrQ(userId string) bson.M {
|
||||
return q
|
||||
}
|
||||
|
||||
// 得到共享给我的笔记本和用户(谁共享给了我)
|
||||
func (this *ShareService) GetShareNotebooks(userId string) (info.ShareNotebooksByUser, []info.User) {
|
||||
// 得到共享给我的用户s信息
|
||||
// 得到我参与的组织
|
||||
@@ -60,7 +61,7 @@ func (this *ShareService) GetShareNotebooks(userId string) (info.ShareNotebooksB
|
||||
db.Distinct(db.ShareNotes, q, "UserId", &userIds1)
|
||||
|
||||
userIds2 := []bson.ObjectId{}
|
||||
db.Distinct(db.ShareNotebooks, q, "UserId", &userIds1)
|
||||
db.Distinct(db.ShareNotebooks, q, "UserId", &userIds2) // BUG之前是userId1, 2014/12/29
|
||||
|
||||
userIds := append(userIds1, userIds2...)
|
||||
userInfos := userService.GetUserInfosOrderBySeq(userIds);
|
||||
|
||||
@@ -13,6 +13,7 @@ import (
|
||||
"fmt"
|
||||
"html/template"
|
||||
"regexp"
|
||||
"io/ioutil"
|
||||
"encoding/json"
|
||||
)
|
||||
|
||||
@@ -127,7 +128,8 @@ func (this *ThemeService) CopyDefaultTheme(userBlog info.UserBlog) (ok bool, the
|
||||
// 设为active true
|
||||
func (this *ThemeService) NewThemeForFirst(userBlog info.UserBlog) (ok bool, themeId string) {
|
||||
ok, themeId = this.CopyDefaultTheme(userBlog)
|
||||
db.UpdateByQField(db.Themes, bson.M{"_id": bson.ObjectIdHex(themeId)}, "IsActive", true)
|
||||
this.ActiveTheme(userBlog.UserId.Hex(), themeId)
|
||||
// db.UpdateByQField(db.Themes, bson.M{"_id": bson.ObjectIdHex(themeId)}, "IsActive", true)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -285,11 +287,15 @@ func (this *ThemeService) GetThemePath(userId, themeId string) string {
|
||||
}
|
||||
// 更新模板内容
|
||||
func (this *ThemeService) UpdateTplContent(userId, themeId, filename, content string) (ok bool, msg string) {
|
||||
path := this.GetThemeAbsolutePath(userId, themeId) + "/" + filename
|
||||
basePath := this.GetThemeAbsolutePath(userId, themeId)
|
||||
path := basePath + "/" + filename
|
||||
if strings.Contains(filename, ".html") {
|
||||
// 模板
|
||||
if ok, msg = this.mustTpl(filename, content); ok {
|
||||
ok = PutFileStrContent(path, content)
|
||||
Log(">>")
|
||||
if ok, msg = this.ValidateTheme(basePath, filename, content); ok {
|
||||
// 模板
|
||||
if ok, msg = this.mustTpl(filename, content); ok {
|
||||
ok = PutFileStrContent(path, content)
|
||||
}
|
||||
}
|
||||
return
|
||||
} else if filename == "theme.json" {
|
||||
@@ -410,6 +416,11 @@ func (this *ThemeService) ImportTheme(userId, path string) (ok bool, msg string)
|
||||
DeleteFile(targetPath)
|
||||
return
|
||||
}
|
||||
// 主题验证
|
||||
if ok, msg = this.ValidateTheme(targetPath, "", ""); !ok {
|
||||
DeleteFile(targetPath)
|
||||
return
|
||||
}
|
||||
// 解压成功, 那么新建之
|
||||
// 保存到数据库中
|
||||
theme, _ := this.getThemeConfig(targetPath)
|
||||
@@ -505,5 +516,119 @@ func (this *ThemeService) InstallTheme(userId, themeId string) (ok bool) {
|
||||
|
||||
ok = db.Insert(db.Themes, theme)
|
||||
|
||||
// 激活之
|
||||
this.ActiveTheme(userId, themeId);
|
||||
|
||||
return ok
|
||||
}
|
||||
|
||||
// 验证主题是否全法, 存在循环引用?
|
||||
// filename, newContent 表示在修改模板时要判断模板修改时是否有错误
|
||||
func (this *ThemeService) ValidateTheme(path string, filename, newContent string) (ok bool, msg string) {
|
||||
Log("theme Path")
|
||||
Log(path)
|
||||
// 建立一个有向图
|
||||
// 将该path下的所有文件提出, 得到文件的引用情况
|
||||
files := ListDir(path)
|
||||
LogJ(files);
|
||||
size := len(files)
|
||||
if(size > 100) {
|
||||
ok = false;
|
||||
msg = "tooManyFiles"
|
||||
return
|
||||
}
|
||||
/*
|
||||
111111111
|
||||
111000000
|
||||
*/
|
||||
vector := make([][]int, size)
|
||||
for i := 0; i < size; i++ {
|
||||
vector[i] = make([]int, size)
|
||||
}
|
||||
fileIndexMap := map[string]int{} // fileName => index
|
||||
fileContent := map[string]string{} // fileName => content
|
||||
index := 0
|
||||
// 得到文件内容, 和建立索引, 每个文件都有一个index, 对应数组位置
|
||||
for _, t := range files {
|
||||
if !strings.Contains(t, ".html") {
|
||||
continue;
|
||||
}
|
||||
if t != filename {
|
||||
fileBytes, err := ioutil.ReadFile(path + "/" + t)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
|
||||
fileIndexMap[t] = index;
|
||||
// html内容
|
||||
fileStr := string(fileBytes)
|
||||
fileContent[t] = fileStr
|
||||
} else {
|
||||
fileIndexMap[t] = index
|
||||
fileContent[t] = newContent
|
||||
}
|
||||
index++
|
||||
}
|
||||
// 分析文件内容, 建立有向图
|
||||
reg, _ := regexp.Compile("{{ *template \"(.+?\\.html)\".*}}")
|
||||
for filename, content := range fileContent {
|
||||
thisIndex := fileIndexMap[filename]
|
||||
finds := reg.FindAllStringSubmatch(content, -1) // 子匹配
|
||||
LogJ(finds)
|
||||
// Log(content)
|
||||
if finds != nil && len(finds) > 0 {
|
||||
for _, includes := range finds {
|
||||
include := includes[1]
|
||||
includeIndex, has := fileIndexMap[include]
|
||||
Log(includeIndex)
|
||||
Log("??")
|
||||
Log(has)
|
||||
if has {
|
||||
vector[thisIndex][includeIndex] = 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LogJ(vector)
|
||||
LogJ(fileIndexMap)
|
||||
// 建立图后, 判断是否有环
|
||||
if this.hasRound(vector, index) {
|
||||
ok = false
|
||||
msg = "themeValidHasRoundInclude"
|
||||
} else {
|
||||
ok = true
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// 检测有向图是否有环, DFS
|
||||
func (this *ThemeService) hasRound(vector [][]int, size int) (ok bool) {
|
||||
for i := 0; i < size; i++ {
|
||||
visited := make([]int, size)
|
||||
if this.hasRoundEach(vector, i, size, visited) {
|
||||
Log(">>")
|
||||
Log(i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// 从每个节点出发, 判断是否有环
|
||||
func (this *ThemeService) hasRoundEach(vector [][]int, index int, size int, visited []int) (ok bool) {
|
||||
if visited[index] > 0 {
|
||||
Log("<")
|
||||
Log(index)
|
||||
return true
|
||||
}
|
||||
visited[index] = 1;
|
||||
// 遍历它的孩子
|
||||
for i := 0; i < size; i++ {
|
||||
if vector[index][i] > 0 {
|
||||
return this.hasRoundEach(vector, i, size, visited);
|
||||
}
|
||||
}
|
||||
visited[index] = 0;
|
||||
return false;
|
||||
}
|
||||
@@ -369,7 +369,7 @@ func (this *UserService) ThirdAddUser(userId, email, pwd string) (ok bool, msg s
|
||||
// 宽度
|
||||
func (this *UserService)UpdateColumnWidth(userId string, notebookWidth, noteListWidth, mdEditorWidth int) bool {
|
||||
return db.UpdateByQMap(db.Users, bson.M{"_id": bson.ObjectIdHex(userId)},
|
||||
bson.M{"NotebookWidth": notebookWidth, "NoteListWidth": noteListWidth, "mdEditorWidth": mdEditorWidth})
|
||||
bson.M{"NotebookWidth": notebookWidth, "NoteListWidth": noteListWidth, "MdEditorWidth": mdEditorWidth})
|
||||
}
|
||||
// 左侧是否隐藏
|
||||
func (this *UserService)UpdateLeftIsMin(userId string, leftIsMin bool) bool {
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
{{template "home/header_box.html" .}}
|
||||
|
||||
<section id="box">
|
||||
<div>
|
||||
<div>
|
||||
<h1 class="h text-white animated fadeInDownBig">ERROR!</h1>
|
||||
</div>
|
||||
<div id="errorBox">
|
||||
<p class="error-info">
|
||||
Sorry, you(not we) got an error. This error is just showing in blog preview for test.
|
||||
</p>
|
||||
|
||||
<div class="list-group m-b-sm bg-white m-b-lg">
|
||||
|
||||
{{with .Error}}
|
||||
<div id="header" class="block">
|
||||
<h1>
|
||||
{{.Title}}
|
||||
</h1>
|
||||
<p>
|
||||
{{if .SourceType}}
|
||||
The {{.SourceType}} <strong>{{.Path}}</strong> does not compile: <strong>{{.Description}}</strong>
|
||||
{{else}}
|
||||
{{.Description}}
|
||||
{{end}}
|
||||
</p>
|
||||
</div>
|
||||
{{if .Path}}
|
||||
<div id="source" class="block">
|
||||
<h2>In {{.Path}}
|
||||
{{if .Line}}
|
||||
(around {{if .Line}}line {{.Line}}{{end}}{{if .Column}} column {{.Column}}{{end}})
|
||||
{{end}}
|
||||
</h2>
|
||||
{{range .ContextSource}}
|
||||
<div class="line {{if .IsError}}error{{end}}">
|
||||
<span class="lineNumber">{{.Line}}:</span>
|
||||
<pre>{{.Source}}</pre>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
{{if .MetaError}}
|
||||
<div id="source" class="block">
|
||||
<h2>Additionally, an error occurred while handling this error.</h2>
|
||||
<div class="line error">
|
||||
{{.MetaError}}
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div id="boxFooter">
|
||||
<p>
|
||||
<a href="/index">leanote</a> © 2014
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -100,7 +100,9 @@ $(function() {
|
||||
$("#registerBtn").html("{{msg . "ing"}}...").addClass("disabled");
|
||||
// hideMsg();
|
||||
|
||||
$.post("/doRegister", {email: email, pwd: pwd}, function(e) {
|
||||
var iu = "{{.iu}}";
|
||||
|
||||
$.post("/doRegister", {email: email, pwd: pwd, iu: iu}, function(e) {
|
||||
$("#registerBtn").html("{{msg . "register"}}").removeClass("disabled");
|
||||
if(e.Ok) {
|
||||
$("#registerBtn").html("{{msg . "registerSuccessAndRdirectToNote"}}");
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"> <h3 class="m-b-none">
|
||||
{{if .page}}
|
||||
修改页面
|
||||
{{if .single}}
|
||||
{{msg . "updateSingle"}}
|
||||
{{else}}
|
||||
添加页面
|
||||
{{msg . "addSingle"}}
|
||||
{{end}}
|
||||
</h3></div>
|
||||
|
||||
@@ -16,18 +16,18 @@
|
||||
<div class="alert alert-danger" id="baseMsg" style="display: none"></div>
|
||||
<input type="hidden" id="singleId" value="{{.single.SingleId.Hex}}" />
|
||||
<div class="form-group">
|
||||
<label>标题</label>
|
||||
<label>{{msg . "title"}}</label>
|
||||
<input type="text" class="form-control" id="title" name="title"
|
||||
value="{{.single.Title}}"
|
||||
data-rules='[
|
||||
{rule: "required", msg: "请输入页面标题"},
|
||||
{rule: "required", msg: "{{msg . "inputSingleTitle"}}"},
|
||||
]'
|
||||
data-msg_target="#baseMsg"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="content1">内容</label>
|
||||
<label for="content1">{{msg . "content"}}</label>
|
||||
<div id="popularToolbar"></div>
|
||||
<textarea id="content1" name="content">{{.single.Content}}</textarea>
|
||||
</div>
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
</div>
|
||||
{{template "member/footer.html" .}}
|
||||
<script type="text/javascript" src="/tinymce/tinymce.min.js"></script>
|
||||
<script type="text/javascript" src="/tinymce/tinymce.js"></script>
|
||||
<script>
|
||||
var urlPrefix = "{{.siteUrl}}";
|
||||
$(function() {
|
||||
@@ -55,7 +55,7 @@ $(function() {
|
||||
skin : "custom",
|
||||
plugins : [
|
||||
"advlist autolink link leanote_image lists charmap hr ",
|
||||
"searchreplace visualblocks visualchars leanote_code tabfocus",
|
||||
"searchreplace visualblocks visualchars tabfocus",
|
||||
"table contextmenu directionality textcolor paste fullpage textcolor"],
|
||||
toolbar1 : "formatselect |fontselect fontsizeselect| forecolor backcolor | bold italic underline strikethrough | bullist numlist |",
|
||||
menubar : false,
|
||||
|
||||
@@ -1,29 +1,26 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "baseInfoSet"}}</h3></div>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg $ "basicInfoSet"}}</h3></div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-10">
|
||||
<div class="col-sm-8">
|
||||
<div id="formData">
|
||||
<section class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="alert alert-danger" id="baseMsg" style="display: none"></div>
|
||||
<div class="form-horizontal" role="form" id="userBlogForm">
|
||||
<div role="form" id="userBlogForm">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="title" class="col-sm-2 control-label">{{msg . "blogName"}}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="Title" name="Title"
|
||||
<label for="title" >{{msg . "blogName"}}</label>
|
||||
<input type="text" class="form-control" id="Title" name="Title"
|
||||
placeholder="eg: leanote's blog"
|
||||
value="{{if .userBlog.Title}}{{.userBlog.Title}}{{else}}{{.userInfo.Email}} 's blog{{end}}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="logo" class="col-sm-2 control-label">{{msg . "blogLogo"}}</label>
|
||||
<div class="col-sm-10">
|
||||
<label for="logo">{{msg . "blogLogo"}}</label>
|
||||
<input type="hidden" name="Logo" id="Logo"
|
||||
value="{{.userBlog.Logo}}" />
|
||||
<form id="formLogo" action="{{$.siteUrl}}/file/uploadBlogLogo" method="post"
|
||||
<form id="formLogo" action="/file/uploadBlogLogo" method="post"
|
||||
enctype="multipart/form-data" target="logoTarget">
|
||||
<input type="file" class="form-control" id="logo2" name="file"
|
||||
onChange='$("#formLogo").submit();' />
|
||||
@@ -37,16 +34,13 @@
|
||||
</div>
|
||||
</form>
|
||||
<iframe id="logoTarget" name="logoTarget" src="#" style="display: none"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="subTitle" class="col-sm-2 control-label">{{msg . "blogDesc"}}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="SubTitle"
|
||||
<label for="subTitle">{{msg . "blogDesc"}}</label>
|
||||
<input type="text" class="form-control" id="SubTitle"
|
||||
name="SubTitle" value="{{.userBlog.SubTitle}}"
|
||||
placeholder="eg: leanote, Not Just A Notebook">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
@@ -1,29 +1,37 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"> <h3 class="m-b-none">(笔记本)分类</h3></div>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "cate"}}</h3></div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
<section class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
分类是公开为博客的笔记本
|
||||
{{msg . "cateIsPublicNotebook"}}
|
||||
<br />
|
||||
拖动可排序
|
||||
{{if .notebooks}}
|
||||
{{msg . "dragAndSort"}}
|
||||
<ul class="list-group gutter list-group-lg list-group-sp sortable">
|
||||
{{range .notebooks}}
|
||||
<li class="list-group-item" draggable="true" data-id="{{.NotebookId.Hex}}">
|
||||
<span class="pull-left media-xs"><i class="fa fa-sort text-muted fa m-r-sm"></i></span>
|
||||
<div class="pull-right" style="margin-right: 10px">
|
||||
固定链接: /cate/<input data-id="{{.NotebookId.Hex}}" class="url-title" type="text" value="{{if .UrlTitle}}{{.UrlTitle|decodeUrlValue}}{{else}}{{.NotebookId.Hex}}{{end}}"/>
|
||||
{{msg $ "permanentLink"}}: /cate/<input data-id="{{.NotebookId.Hex}}" class="url-title" type="text" value="{{if .UrlTitle}}{{.UrlTitle|decodeUrlValue}}{{else}}{{.NotebookId.Hex}}{{end}}"/>
|
||||
</div>
|
||||
{{.Title}}
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
{{else}}
|
||||
{{msg . "noCates"}}
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{if .notebooks}}
|
||||
<footer class="panel-footer text-right bg-light lter">
|
||||
<button type="submit" id="baseBtn" class="btn btn-success">{{msg . "submit"}}</button>
|
||||
<button type="submit" id="baseBtn" class="btn btn-success">{{msg . "saveSort"}}</button>
|
||||
</footer>
|
||||
{{end}}
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<input type="radio"
|
||||
name="commentType"
|
||||
value="default"
|
||||
{{if or (not .userBlog.CommentType) (eq .userBlog.CommentType "default")}}checked="checked"{{end}} > Default
|
||||
{{if or (not .userBlog.CommentType) (eq .userBlog.CommentType "default")}}checked="checked"{{end}} > {{msg $ "defaultComment"}}
|
||||
</label>
|
||||
|
||||
<label>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"><h3 class="m-b-none">文章列表</h3></div>
|
||||
<div class="m-b-md"><h3 class="m-b-none">{{msg . "postList"}}</h3></div>
|
||||
<style>
|
||||
.url-title {
|
||||
width: 260px;
|
||||
@@ -13,7 +13,7 @@
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<div class="input-group search-group">
|
||||
<input type="text" class="input-sm form-control" placeholder="Title" id="keywords" value="{{.keywords}}" />
|
||||
<input type="text" class="input-sm form-control" placeholder="{{msg . "title"}}" id="keywords" value="{{.keywords}}" />
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-sm btn-default" type="button" data-url="/member/blog/index">Search</button>
|
||||
</span>
|
||||
@@ -40,7 +40,7 @@
|
||||
style="width: 300px"
|
||||
{{sorterTh $url "urlTitle" .sorter}}
|
||||
>
|
||||
固定链接
|
||||
{{msg $ "permanentLink"}}
|
||||
<span class="th-sort">
|
||||
<i class="fa fa-sort-down"></i>
|
||||
<i class="fa fa-sort-up"></i>
|
||||
@@ -50,7 +50,7 @@
|
||||
<th
|
||||
{{sorterTh $url "publicTime" .sorter}}
|
||||
>
|
||||
发布日期
|
||||
{{msg . "publicTime"}}
|
||||
<span class="th-sort">
|
||||
<i class="fa fa-sort-down"></i>
|
||||
<i class="fa fa-sort-up"></i>
|
||||
@@ -61,7 +61,7 @@
|
||||
<th
|
||||
{{sorterTh $url "updatedTime" .sorter}}
|
||||
>
|
||||
更新日期
|
||||
{{msg . "updatedTime"}}
|
||||
<span class="th-sort">
|
||||
<i class="fa fa-sort-down"></i>
|
||||
<i class="fa fa-sort-up"></i>
|
||||
@@ -71,7 +71,7 @@
|
||||
<th
|
||||
{{sorterTh $url "createdTime" .sorter}}
|
||||
>
|
||||
创建日期
|
||||
{{msg . "createdTime"}}
|
||||
<span class="th-sort">
|
||||
<i class="fa fa-sort-down"></i>
|
||||
<i class="fa fa-sort-up"></i>
|
||||
@@ -114,13 +114,13 @@
|
||||
|
||||
<a
|
||||
{{if .HasSelfDefined}}
|
||||
title="已设置"
|
||||
title="{{msg $ "hasSelfDefined"}}"
|
||||
class="btn btn-sm btn-success"
|
||||
{{else}}
|
||||
title="未设置"
|
||||
title="{{msg $ "noSelfDefined"}}"
|
||||
class="btn btn-sm btn-default"
|
||||
{{end}}
|
||||
href="/member/blog/updateBlogAbstract?noteId={{.NoteId.Hex}}">摘要设置</a>
|
||||
href="/member/blog/updateBlogAbstract?noteId={{.NoteId.Hex}}">{{msg $ "setAbstract"}}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"> <h3 class="m-b-none">分页与排序设置</h3></div>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg $ "pagingAndSort"}}</h3></div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
@@ -8,43 +8,35 @@
|
||||
<div class="panel-body">
|
||||
<div class="alert alert-danger" id="domainMsg" style="display: none"></div>
|
||||
|
||||
<form class="form-horizontal" role="form" id="dataFrom">
|
||||
|
||||
<form role="form" id="dataFrom">
|
||||
<div class="form-group">
|
||||
<label for="perPageSize" class="col-sm-2 control-label">每页记录数</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control"
|
||||
<label for="perPageSize">{{msg . "perPageSize"}}</label>
|
||||
<input type="text" class="form-control"
|
||||
placeholder="10"
|
||||
id="perPageSize"
|
||||
name="perPageSize"
|
||||
value="{{.userBlog.PerPageSize}}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="perPageSize" class="col-sm-2 control-label">排序字段</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control"
|
||||
id="sortField"
|
||||
name="sortField"
|
||||
value="">
|
||||
<option value="PublicTime" {{if eq $.userBlog.SortField "PublicTime"}}selected{{end}}>公开为博客时间</option>
|
||||
<option value="CreatedTime" {{if eq $.userBlog.SortField "CreatedTimeTime"}}selected{{end}}>创建时间</option>
|
||||
<option value="UpdatedTime" {{if eq $.userBlog.SortField "UpdatedTime"}}selected{{end}}>更新时间</option>
|
||||
<option value="Title" {{if eq $.userBlog.SortField "Title"}}selected{{end}}>标题</option>
|
||||
</select>
|
||||
</div>
|
||||
<label for="perPageSize" >{{msg . "sortField"}}</label>
|
||||
<select class="form-control"
|
||||
id="sortField"
|
||||
name="sortField"
|
||||
value="">
|
||||
<option value="PublicTime" {{if eq $.userBlog.SortField "PublicTime"}}selected{{end}}>{{msg $ "publicTime"}}</option>
|
||||
<option value="CreatedTime" {{if eq $.userBlog.SortField "CreatedTimeTime"}}selected{{end}}>{{msg $ "createdTime"}}</option>
|
||||
<option value="UpdatedTime" {{if eq $.userBlog.SortField "UpdatedTime"}}selected{{end}}>{{msg $ "updatedTime"}}</option>
|
||||
<option value="Title" {{if eq $.userBlog.SortField "Title"}}selected{{end}}>{{msg . "title"}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">排序类型</label>
|
||||
<div class="col-sm-10" style="margin-top: 5px;">
|
||||
<label><input type="radio" name="isAsc" value="0" {{if not .userBlog.IsAsc}}checked{{end}}> 降序</label>
|
||||
<label><input type="radio" name="isAsc" value="1" {{if .userBlog.IsAsc}}checked{{end}}> 升序</label>
|
||||
<label>{{msg $ "sortType"}}</label>
|
||||
<div>
|
||||
<label><input type="radio" name="isAsc" value="0" {{if not .userBlog.IsAsc}}checked{{end}}> {{msg . "desc"}}</label>
|
||||
<label><input type="radio" name="isAsc" value="1" {{if .userBlog.IsAsc}}checked{{end}}> {{msg . "asc"}}</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<footer class="panel-footer text-right bg-light lter">
|
||||
<button type="submit" id="baseBtn" class="btn btn-success">{{msg . "submit"}}</button>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"> <h3 class="m-b-none">单页面</h3></div>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "single"}}</h3></div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
<section class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<p>
|
||||
您可以添加多个单页面
|
||||
<a href="/member/blog/addOrUpdateSingle" id="addBtn" class="btn btn-success">添加页面</a>
|
||||
{{msg $ "singleTips"}}
|
||||
<a href="/member/blog/addOrUpdateSingle" id="addBtn" class="btn btn-success">{{msg $ "addSingle"}}</a>
|
||||
</p>
|
||||
<ul class="list-group gutter list-group-lg list-group-sp sortable">
|
||||
{{range .singles}}
|
||||
@@ -18,7 +18,7 @@
|
||||
<a href="#"><i class="fa fa-times icon-muted fa-fw page-delete" data-id="{{.SingleId}}"></i></a>
|
||||
</span>
|
||||
<div class="pull-right" style="margin-right: 10px">
|
||||
固定链接: /single/<input data-id="{{.SingleId}}" class="url-title" type="text" value="{{if .UrlTitle}}{{.UrlTitle|decodeUrlValue}}{{else}}{{.SingleId}}{{end}}"/>
|
||||
{{msg $ "permanentLink"}}: /single/<input data-id="{{.SingleId}}" class="url-title" type="text" value="{{if .UrlTitle}}{{.UrlTitle|decodeUrlValue}}{{else}}{{.SingleId}}{{end}}"/>
|
||||
</div>
|
||||
<div class="clear">
|
||||
{{.Title}}
|
||||
@@ -29,7 +29,7 @@
|
||||
</div>
|
||||
{{if .singles}}
|
||||
<footer class="panel-footer text-right bg-light lter">
|
||||
<button type="submit" id="baseBtn" class="btn btn-success">保存排序</button>
|
||||
<button type="submit" id="baseBtn" class="btn btn-success">{{msg . "saveSort"}}</button>
|
||||
</footer>
|
||||
{{end}}
|
||||
</section>
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
</div>
|
||||
{{template "member/footer.html" .}}
|
||||
<script type="text/javascript" src="{{.siteUrl}}/public/member/js/jquery.sortable.js"></script>
|
||||
<script type="text/javascript" src="/public/member/js/jquery.sortable.js"></script>
|
||||
<script>
|
||||
$(function() {
|
||||
$("#baseBtn").click(function(){
|
||||
|
||||
@@ -2,9 +2,13 @@
|
||||
<div class="m-b-md clearfix">
|
||||
<h3 class="m-b-none">
|
||||
{{msg . "themeSet"}}
|
||||
<small>(<a href="http://blog.leanote.com/post/545f1a5c380782565e000000" target="_blank">{{msg . "needHelp"}}</a>)</small>
|
||||
<small>
|
||||
(<a href="http://blog.leanote.com/post/545f1a5c380782565e000000" target="_blank">{{msg . "needHelp"}}</a>
|
||||
<a target="_blank" href="https://github.com/leanote/leanote/wiki/leanote-blog-theme-api">Leanote Blog Theme Api</a>)
|
||||
</small>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 theme-container">
|
||||
<section class="panel panel-default">
|
||||
@@ -12,9 +16,9 @@
|
||||
<div>
|
||||
<form id="uploadAvatar" method="post" action="/member/blog/importTheme" enctype="multipart/form-data">
|
||||
<div id="dropAvatar" class="dropzone">
|
||||
<a class="btn btn-default btn-new" href="/member/blog/newTheme"><span class="fa fa-plus"></span> 新建主题</a>
|
||||
<a class="btn btn-default btn-new" href="/member/blog/newTheme"><span class="fa fa-plus"></span> {{msg . "addTheme"}}</a>
|
||||
<a class="btn btn-success btn-choose-file">
|
||||
<span class="fa fa-upload"></span> 导入主题(.zip)
|
||||
<span class="fa fa-upload"></span> {{msg . "importTheme"}}(.zip)
|
||||
</a>
|
||||
<input type="file" name="file" multiple/>
|
||||
<div id="avatarUploadMsg"></div>
|
||||
@@ -22,10 +26,10 @@
|
||||
</form>
|
||||
</div>
|
||||
<p>
|
||||
当前主题:
|
||||
{{msg . "currentTheme"}}:
|
||||
</p>
|
||||
<ul class="themes">
|
||||
<li class="theme">
|
||||
<div class="themes clearfix">
|
||||
<div class="theme pull-left">
|
||||
<a class="choose-theme" data-method="put" href="#" rel="nofollow">
|
||||
<div class="theme-thumb thumb active-theme">
|
||||
<img src="/{{.activeTheme.Path}}/images/screenshot.png" alt="preview">
|
||||
@@ -37,17 +41,26 @@
|
||||
</span>
|
||||
<div class="theme-btns">
|
||||
<div class="btn-group" data-id="{{.activeTheme.ThemeId.Hex}}">
|
||||
<a class="btn btn-default btn-sm btn-export"><span class="fa fa-download"></span> 导出</a>
|
||||
<a class="btn btn-default btn-sm" href="{{$.siteUrl}}/preview?themeId={{.activeTheme.ThemeId.Hex}}" target="_blank"><span class="fa fa-eye"></span> 预览</a>
|
||||
<a class="btn btn-primary btn-sm" target="_blank" href="/member/blog/updateTheme?themeId={{if .activeTheme.ThemeId}}{{.activeTheme.ThemeId.Hex}}{{end}}"><span class="fa fa-pencil"></span> 编辑</a>
|
||||
<a class="btn btn-default btn-sm btn-export"><span class="fa fa-download"></span> {{msg $ "export"}}</a>
|
||||
<!-- 必须是自己的主题 -->
|
||||
{{if .activeTheme.ThemeId}}
|
||||
<a class="btn btn-default btn-sm" href="{{$.siteUrl}}/preview?themeId={{.activeTheme.ThemeId.Hex}}" target="_blank"><span class="fa fa-eye"></span> {{msg $ "preview"}}</a>
|
||||
{{end}}
|
||||
<a class="btn btn-primary btn-sm" target="_blank" href="/member/blog/updateTheme?themeId={{if .activeTheme.ThemeId}}{{.activeTheme.ThemeId.Hex}}{{end}}"><span class="fa fa-pencil"></span> {{msg $ "edit"}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{{if .activeTheme.Info.Desc}}
|
||||
<!-- 描述 -->
|
||||
<div class="pull-left theme-desc">
|
||||
{{.activeTheme.Info.Desc|raw}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
<p>
|
||||
我的其它主题:
|
||||
{{msg . "myOtherThemes"}}:
|
||||
</p>
|
||||
<ul class="themes">
|
||||
{{range $.otherThemes}}
|
||||
@@ -56,6 +69,11 @@
|
||||
<a class="choose-theme" data-method="put" href="#" rel="nofollow">
|
||||
<div class="theme-thumb thumb">
|
||||
<img src="/{{.Path}}/images/screenshot.png" alt="preview">
|
||||
{{if .Info.Desc}}
|
||||
<div class="theme-desc-mask">
|
||||
{{.Info.Desc|raw}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<span class="theme-title">{{.Name}}</span>
|
||||
</a>
|
||||
@@ -64,11 +82,11 @@
|
||||
</span>
|
||||
<div class="theme-btns">
|
||||
<div class="btn-group" data-id="{{.ThemeId.Hex}}">
|
||||
<a class="btn btn-default btn-sm btn-delete" data-loading-text="..."><span class="fa fa-remove"></span> 删除</a>
|
||||
<a class="btn btn-default btn-sm btn-export"><span class="fa fa-download"></span> 导出</a>
|
||||
<a class="btn btn-default btn-sm" href="{{$.siteUrl}}/preview?themeId={{.ThemeId.Hex}}" target="_blank"><span class="fa fa-eye"></span> 预览</a>
|
||||
<a class="btn btn-default btn-sm" target="_blank" href="/member/blog/updateTheme?themeId={{.ThemeId.Hex}}"><span class="fa fa-pencil"></span> 编辑</a>
|
||||
<a class="btn btn-primary btn-sm btn-active" data-loading-text="..."><span class="fa fa-check"></span> 使用</a>
|
||||
<a class="btn btn-default btn-sm btn-delete" data-loading-text="..."><span class="fa fa-remove"></span> {{msg $ "delete"}}</a>
|
||||
<a class="btn btn-default btn-sm btn-export"><span class="fa fa-download"></span> {{msg $ "export"}}</a>
|
||||
<a class="btn btn-default btn-sm" href="{{$.siteUrl}}/preview?themeId={{.ThemeId.Hex}}" target="_blank"><span class="fa fa-eye"></span> {{msg $ "preview"}}</a>
|
||||
<a class="btn btn-default btn-sm" target="_blank" href="/member/blog/updateTheme?themeId={{.ThemeId.Hex}}"><span class="fa fa-pencil"></span> {{msg $ "edit"}}</a>
|
||||
<a class="btn btn-primary btn-sm btn-active" data-loading-text="..."><span class="fa fa-check"></span> {{msg $ "use"}}</a>
|
||||
{{if $.isAdmin}}
|
||||
<a class="btn btn-default btn-sm btn-public" data-loading-text="...">
|
||||
{{if .IsDefault}}
|
||||
@@ -83,13 +101,13 @@
|
||||
</li>
|
||||
{{end}}
|
||||
{{else}}
|
||||
无
|
||||
{{msg $ "none"}}
|
||||
{{end}}
|
||||
</ul>
|
||||
|
||||
<hr />
|
||||
<p>
|
||||
leanote主题市场:
|
||||
{{msg . "leanoteThemeMarket"}}:
|
||||
</p>
|
||||
<ul class="themes">
|
||||
{{range $.optionThemes}}
|
||||
@@ -97,6 +115,11 @@
|
||||
<a class="choose-theme" data-method="put" href="#" rel="nofollow">
|
||||
<div class="theme-thumb thumb">
|
||||
<img src="/{{.Path}}/images/screenshot.png" alt="preview">
|
||||
{{if .Info.Desc}}
|
||||
<div class="theme-desc-mask">
|
||||
{{.Info.Desc|raw}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<span class="theme-title">{{.Name}}</span>
|
||||
</a>
|
||||
@@ -104,7 +127,7 @@
|
||||
By: <a href="{{.AuthorUrl}}" target="_blank">{{.Author}}</a>
|
||||
</span>
|
||||
<p class="theme-btns" data-id="{{.ThemeId.Hex}}">
|
||||
<a class="btn btn-primary btn-sm btn-install"><span class="fa fa-gear"></span> 安装</a>
|
||||
<a class="btn btn-primary btn-sm btn-install"><span class="fa fa-gear"></span> {{msg $ "install"}}</a>
|
||||
</p>
|
||||
</li>
|
||||
{{end}}
|
||||
|
||||
@@ -73,9 +73,9 @@ $(function() {
|
||||
skin : "custom",
|
||||
plugins : [
|
||||
"advlist autolink link leanote_image lists charmap hr ",
|
||||
"searchreplace visualblocks visualchars leanote_code tabfocus",
|
||||
"searchreplace visualblocks visualchars tabfocus",
|
||||
"table contextmenu directionality textcolor paste fullpage textcolor"],
|
||||
toolbar1 : "formatselect |fontselect fontsizeselect| forecolor backcolor | bold italic underline strikethrough | bullist numlist | leanote_code",
|
||||
toolbar1 : "formatselect |fontselect fontsizeselect| forecolor backcolor | bold italic underline strikethrough | bullist numlist",
|
||||
menubar : false,
|
||||
statusbar : false,
|
||||
font_formats : "Arial=arial,helvetica,sans-serif;"
|
||||
|
||||
@@ -2,13 +2,18 @@
|
||||
<div class="m-b-md">
|
||||
<h3 class="m-b-none">
|
||||
{{if .isNew}}
|
||||
新建主题
|
||||
{{msg $ "addTheme"}}
|
||||
{{else}}
|
||||
编辑主题
|
||||
{{msg $ "updateTheme"}}
|
||||
-
|
||||
{{.theme.Name}}
|
||||
{{end}}
|
||||
<a class="btn btn-default" href="{{$.siteUrl}}/preview?themeId={{.themeId}}" target="_blank"><span class="fa fa-eye"></span> 预览</a>
|
||||
<a class="btn btn-default" href="{{$.siteUrl}}/preview?themeId={{.themeId}}" target="_blank"><span class="fa fa-eye"></span> {{msg . "preview"}}</a>
|
||||
|
||||
<small>
|
||||
(<a href="http://blog.leanote.com/post/545f1a5c380782565e000000" target="_blank">{{msg . "needHelp"}}</a>
|
||||
<a target="_blank" href="https://github.com/leanote/leanote/wiki/leanote-blog-theme-api">Leanote Blog Theme Api</a>)
|
||||
</small>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
@@ -42,7 +47,7 @@
|
||||
<div class="col-sm-4">
|
||||
<section class="panel panel-default">
|
||||
<header class="panel-heading">
|
||||
模板, 样式, 脚本:
|
||||
{{msg . "tplStyleScript"}}:
|
||||
</header>
|
||||
<div class="panel-body" style="height:430px;overflow: auto;">
|
||||
|
||||
@@ -58,14 +63,14 @@
|
||||
</div>
|
||||
</div>
|
||||
<footer class="panel-footer text-right bg-light lter">
|
||||
<a class="btn btn-default" id="newFile">新建文件</a>
|
||||
<a class="btn btn-default" id="newFile">{{msg . "newFile"}}</a>
|
||||
</footer>
|
||||
</section>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<section class="panel panel-default">
|
||||
<header class="panel-heading">
|
||||
当前文件: <span id="curTpl">header.html</span>
|
||||
{{msg . "currentFile"}}: <span id="curTpl">header.html</span>
|
||||
<span id="msg"></span>
|
||||
</header>
|
||||
<div class="panel-body">
|
||||
@@ -82,7 +87,7 @@
|
||||
<div class="col-sm-12">
|
||||
<section class="panel panel-default">
|
||||
<header class="panel-heading">
|
||||
图片: images/
|
||||
{{msg . "image"}}: images/
|
||||
</header>
|
||||
<div class="panel-body">
|
||||
<ul class="image-list" id="imageList">
|
||||
@@ -102,7 +107,7 @@
|
||||
</div>
|
||||
|
||||
{{template "member/footer.html" .}}
|
||||
<script src="/public/member/js/ace/ace.js" type="text/javascript"></script>
|
||||
<script src="/public/libs/ace/ace.js" type="text/javascript"></script>
|
||||
<script>
|
||||
var editor = ace.edit("tplContent");
|
||||
editor.setTheme("ace/theme/tomorrow");
|
||||
@@ -118,7 +123,7 @@ var theme = {
|
||||
saveBtnO: $("#saveBtn"),
|
||||
newFileO: $("#newFile"),
|
||||
curTpl: "",
|
||||
tplInfos: {"header.html": "头部", "footer.html": "底部", "index.html": "首页", "cate.html": "分类页", "search.html": "搜索页", "single.html": "单页", "archive.html": "归档页", "post.html": "文章页", "tags.html": "标签页", "tag_posts.html": "标签文章页", "share_comment.html": "分享评论", "404.html":"404", "theme.json": "主题配置", "paging.html": "分页", "highlight.html": "高亮"},
|
||||
tplInfos: {"header.html": "{{msg . "header"}}", "footer.html": "{{msg . "footer"}}", "index.html": "{{msg . "header"}}", "cate.html": "{{msg . "cate"}}", "search.html": "{{msg . "search"}}", "single.html": "{{msg . "single"}}", "archive.html": "{{msg . "archive"}}", "post.html": "{{msg . "post"}}", "tags.html": "{{msg . "tags"}}", "tag_posts.html": "{{msg . "tag_posts"}}", "share_comment.html": "{{msg . "share_comment"}}", "404.html":"404", "theme.json": "{{msg . "themeJson"}}", "paging.html": "{{msg . "paging"}}", "highlight.html": "{{msg . "highlight"}}"},
|
||||
init: function() {
|
||||
var self = this;
|
||||
self.showTplInfo();
|
||||
@@ -183,11 +188,11 @@ var theme = {
|
||||
info = self.tplInfos[file];
|
||||
if(!info) {
|
||||
if(file.indexOf(".css") > 0) {
|
||||
info = "样式";
|
||||
info = "{{msg . "style"}}";
|
||||
} else if(file.indexOf(".js") > 0) {
|
||||
info = "脚本";
|
||||
info = "{{msg . "script"}}";
|
||||
} else if(file.indexOf(".html") > 0) {
|
||||
info = "模板";
|
||||
info = "{{msg . "tpl"}}";
|
||||
}
|
||||
} else {
|
||||
$(this).find(".remove-file").remove();
|
||||
@@ -209,7 +214,7 @@ var theme = {
|
||||
if(t) {
|
||||
t.button("loading");
|
||||
}
|
||||
self.msgO.html("正在保存...");
|
||||
self.msgO.html("...");
|
||||
ajaxPost("/member/blog/updateTplContent", {themeId: themeId, filename: self.curTpl, content: content}, function(re) {
|
||||
if(t) {
|
||||
t.button("reset");
|
||||
@@ -217,7 +222,7 @@ var theme = {
|
||||
if(reIsOk(re)) {
|
||||
self.cache[filename] = content;
|
||||
// art.tips("Success");
|
||||
self.msgO.html("保存成功")
|
||||
self.msgO.html("{{msg . "saveSuccess"}}")
|
||||
setTimeout(function() {
|
||||
self.msgO.html("");
|
||||
}, 3000);
|
||||
|
||||
@@ -8,17 +8,19 @@
|
||||
width: 200px;
|
||||
}
|
||||
</style>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">项目组/成员</h3></div>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "group"}}</h3></div>
|
||||
|
||||
<p>
|
||||
<a class="btn btn-default btn-add-group"><span class="fa fa-plus"></span> 新建分组</a>
|
||||
<a class="btn btn-default btn-add-group"><span class="fa fa-plus"></span> {{msg . "newGroup"}}</a>
|
||||
</p>
|
||||
|
||||
|
||||
<script type="text/x-jsrender" id="tUser">
|
||||
<li class="list-group-item" data-id="[[:UserId]]">
|
||||
[[:Username]] [[if Email != Username]]([[:Email]])[[/if]]
|
||||
<span class="fa fa-remove pull-right text-xs m-t-sm"></span>
|
||||
<a title="{{msg . "deleteMember"}}" class="delete-user">
|
||||
<span class="fa fa-remove pull-right text-xs m-t-sm"></span>
|
||||
</a>
|
||||
</li>
|
||||
</script>
|
||||
|
||||
@@ -30,7 +32,7 @@
|
||||
<div class="clear">
|
||||
<div class="h3 m-t-xs m-b-xs text-white">
|
||||
<input type="text" data-ever="[[:Title]]" value="[[:Title]]" class="group-title" />
|
||||
<a title="删除分组" class="delete-group">
|
||||
<a title="{{msg . "deleteGroup"}}" class="delete-group">
|
||||
<i class="fa fa-remove text-white pull-right text-xs m-t-sm"></i>
|
||||
</a>
|
||||
</div>
|
||||
@@ -39,7 +41,7 @@
|
||||
</header>
|
||||
<ul class="list-group no-radius">
|
||||
<li class="list-group-item">
|
||||
<input type="text" class="add-user-input form-control" placeholder="输入用户名或邮箱添加成员" />
|
||||
<input type="text" class="add-user-input form-control" placeholder="{{msg . "addMemberTips"}}" />
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
@@ -57,7 +59,7 @@
|
||||
<div class="clear">
|
||||
<div class="h3 m-t-xs m-b-xs text-white">
|
||||
<input type="text" data-ever="{{.Title}}" value="{{.Title}}" class="group-title" />
|
||||
<a title="删除分组" class="delete-group">
|
||||
<a title="{{msg $ "deleteGroup"}}" class="delete-group">
|
||||
<i class="fa fa-remove text-white pull-right text-xs m-t-sm"></i>
|
||||
</a>
|
||||
</div>
|
||||
@@ -69,13 +71,13 @@
|
||||
{{range .Users}}
|
||||
<li class="list-group-item" data-id="{{.UserId.Hex}}">
|
||||
{{.Username}} {{if not (eq .Email .Username)}}({{.Email}}){{end}}
|
||||
<a title="删除成员" class="delete-user">
|
||||
<a title="{{msg $ "deleteMember"}}" class="delete-user">
|
||||
<span class="fa fa-remove pull-right text-xs m-t-sm"></span>
|
||||
</a>
|
||||
</li>
|
||||
{{end}}
|
||||
<li class="list-group-item">
|
||||
<input type="text" class="add-user-input form-control" placeholder="输入用户名或邮箱添加成员" />
|
||||
<input type="text" class="add-user-input form-control" placeholder="{{msg $ "addMemberTips"}}" />
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
@@ -85,7 +87,7 @@
|
||||
</div>
|
||||
|
||||
{{template "member/footer.html" .}}
|
||||
<script src="http://leanote.com/public/blog/js/jsrender.js"></script>
|
||||
<script src="/public/blog/js/jsrender.js"></script>
|
||||
<script>
|
||||
var group = {
|
||||
tGroupO: $("#tGroup"),
|
||||
@@ -111,7 +113,7 @@ var group = {
|
||||
addGroupEvent: function() {
|
||||
var self = this;
|
||||
$('.btn-add-group').click(function() {
|
||||
ajaxPost("/member/group/addGroup", {title: "分组名"}, function(re) {
|
||||
ajaxPost("/member/group/addGroup", {title: "Group Title"}, function(re) {
|
||||
if(reIsOk(re)) {
|
||||
var group = re.Item;
|
||||
self.groupsO.prepend(self.tGroupO.render(group))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{.userInfo.Username}}, 欢迎来到leanote</h3></div>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{.userInfo.Username}}, {{msg . "welcomeToLeanote"}}.</h3></div>
|
||||
|
||||
<section class="panel panel-default">
|
||||
<div class="row m-l-none m-r-none bg-light lter">
|
||||
@@ -26,11 +26,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 最新动态 -->
|
||||
<section class="panel panel-default">
|
||||
<h4 class="font-thin padder">
|
||||
Leanote 动态
|
||||
{{msg . "leanoteEvents"}}
|
||||
</h4>
|
||||
<ul class="list-group" id="eventsList"></ul>
|
||||
</section>
|
||||
|
||||
@@ -26,45 +26,47 @@
|
||||
</i>
|
||||
</span>
|
||||
<span>
|
||||
帐户信息
|
||||
{{msg . "accountInfo"}}
|
||||
</span>
|
||||
</a>
|
||||
<!-- 导航列表 -->
|
||||
<ul class="nav lt">
|
||||
{{if $.userInfo.Email}}
|
||||
<li>
|
||||
<a href="/member/user/username">
|
||||
<span>
|
||||
用户名
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/member/user/avatar">
|
||||
<span>
|
||||
头像
|
||||
{{msg . "avatar"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
{{if $.userInfo.Email}}
|
||||
<li>
|
||||
<a href="/member/user/username">
|
||||
<span>
|
||||
{{msg . "username"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/member/user/email">
|
||||
<span>
|
||||
邮箱
|
||||
{{msg . "email"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/member/user/password">
|
||||
<span>
|
||||
密码
|
||||
{{msg . "password"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{{else}}
|
||||
<li>
|
||||
<a href="/member/user/add_account">
|
||||
<a href="/member/user/addAccount">
|
||||
<span>
|
||||
添加leanote帐户
|
||||
{{msg . "addLeanoteAccount"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -85,14 +87,14 @@
|
||||
</i>
|
||||
</span>
|
||||
<span>
|
||||
博客
|
||||
{{msg . "blog"}}
|
||||
</span>
|
||||
</a>
|
||||
<ul class="nav lt">
|
||||
<li>
|
||||
<a href="/member/blog/index">
|
||||
<span>
|
||||
文章列表
|
||||
{{msg . "postList"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -100,42 +102,43 @@
|
||||
<li>
|
||||
<a href="/member/blog/base">
|
||||
<span>
|
||||
基本信息
|
||||
{{msg . "basicInfoSet"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/member/blog/comment">
|
||||
<span>
|
||||
评论
|
||||
{{msg . "comment"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/member/blog/cate">
|
||||
<span>
|
||||
分类
|
||||
{{msg . "cate"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/member/blog/single">
|
||||
<span>
|
||||
单页面
|
||||
{{msg . "single"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/member/blog/paging">
|
||||
<span>
|
||||
分页与排序设置
|
||||
{{msg . "pagingAndSort"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/member/blog/theme">
|
||||
<span>
|
||||
主题
|
||||
{{msg . "theme"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -149,7 +152,7 @@
|
||||
</b>
|
||||
</i>
|
||||
<span>
|
||||
项目组/成员
|
||||
{{msg . "group"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
</a>
|
||||
</li>
|
||||
<li class="hidden-xs">
|
||||
<a href="/blog/{{$.session.Username}}" class="dk" target="_blank">
|
||||
<a href="http://blog.leanote.com/{{$.session.Username}}" class="dk" target="_blank">
|
||||
{{msg . "myBlog"}}
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"> <h3 class="m-b-none">用户名设置</h3></div>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "addLeanoteAccount"}}</h3></div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-6">
|
||||
<div class="col-sm-8">
|
||||
<form id="formData">
|
||||
<section class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{{template "member/top.html" .}}
|
||||
|
||||
<div class="m-b-md"> <h3 class="m-b-none">头像设置</h3></div>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "avatar"}}</h3></div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-6">
|
||||
<div class="col-sm-8">
|
||||
<form id="uploadAvatar" method="post" action="/file/uploadAvatar" enctype="multipart/form-data">
|
||||
<section class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
@@ -14,7 +14,7 @@
|
||||
<img src="{{if .userInfo.Logo}}{{.userInfo.Logo}}{{else}}/images/blog/default_avatar.png{{end}}" id="avatar"/>
|
||||
</div>
|
||||
<a class="btn btn-success btn-choose-file">
|
||||
<span class="fa fa-upload"></span> Choose Image
|
||||
<span class="fa fa-upload"></span> {{msg . "chooseImage"}}
|
||||
</a>
|
||||
<input type="file" name="file" multiple/>
|
||||
</div>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"> <h3 class="m-b-none">邮箱设置</h3></div>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "email"}}</h3></div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-6">
|
||||
<div class="col-sm-8">
|
||||
<form id="formData">
|
||||
<section class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"> <h3 class="m-b-none">用户名设置</h3></div>
|
||||
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "password"}}</h3></div>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-6">
|
||||
<div class="col-sm-8">
|
||||
<form id="formData">
|
||||
<section class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"> <h3 class="m-b-none">用户名设置</h3></div>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "username"}}</h3></div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-6">
|
||||
<div class="col-sm-8">
|
||||
<form id="formData">
|
||||
<section class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
|
||||
@@ -12,17 +12,19 @@
|
||||
|
||||
<link href="/css/bootstrap.css" rel="stylesheet" />
|
||||
<!-- 先加载, 没有样式, 宽度不定 -->
|
||||
<link rel="stylesheet" href="tinymce/skins/custom/skin.min.css" rel="stylesheet"/>
|
||||
|
||||
<link rel="stylesheet" href="/tinymce/skins/custom/skin.min.css" rel="stylesheet"/>
|
||||
<!-- leanote css -->
|
||||
<link href="css/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet" />
|
||||
<link href="css/zTreeStyle/zTreeStyle.css" rel="stylesheet" />
|
||||
<link href="/css/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet" />
|
||||
<link href="/css/zTreeStyle/zTreeStyle.css" rel="stylesheet" />
|
||||
<!-- mdeditor -->
|
||||
<link href="/public/dist/themes/default.css" rel="stylesheet" />
|
||||
|
||||
<script>
|
||||
var hash = location.hash;
|
||||
if(hash == "#writing") {
|
||||
var files = '<link rel="stylesheet" href="css/theme/writting-overwrite.css" type="text/css" id="themeLink" />';
|
||||
if(hash.indexOf("writing") >= 0) {
|
||||
var files = '<link rel="stylesheet" href="/css/theme/writting-overwrite.css" type="text/css" id="themeLink" />';
|
||||
} else {
|
||||
var files ='<link rel="stylesheet" href="css/theme/{{if .userInfo.Theme}}{{.userInfo.Theme}}{{else}}default{{end}}.css" type="text/css" id="themeLink" />';
|
||||
var files ='<link rel="stylesheet" href="/css/theme/{{if .userInfo.Theme}}{{.userInfo.Theme}}{{else}}default{{end}}.css" type="text/css" id="themeLink" />';
|
||||
}
|
||||
document.write(files);
|
||||
</script>
|
||||
@@ -169,7 +171,7 @@ function log(o) {
|
||||
{{if .isAdmin}}
|
||||
<li role="presentation" class="divider"></li>
|
||||
<li role="presentation">
|
||||
<a target="_blank" title="{{msg . "amdin"}}" href="/admin/index">
|
||||
<a target="_blank" title="{{msg . "admin"}}" href="/admin/index">
|
||||
<i class="fa fa-dashboard"></i>
|
||||
<span>{{msg . "admin"}}</span>
|
||||
</a>
|
||||
@@ -184,6 +186,12 @@ function log(o) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pull-right top-nav writting-hide lea-blog">
|
||||
<a target="_blank" href="http://lea.leanote.com">
|
||||
lea++
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="pull-right top-nav writting-hide" id="myBlog">
|
||||
<a target="_blank" href="{{$.blogUrl}}/{{.userInfo.Username}}">
|
||||
{{msg . "myBlog"}}
|
||||
@@ -327,6 +335,11 @@ function log(o) {
|
||||
<div class="noteSplit" id="notebookSplitter"></div>
|
||||
|
||||
<div id="noteAndEditor">
|
||||
<div id="noteAndEditorMask">
|
||||
<img src="/images/loading-24.gif"/>
|
||||
<br />
|
||||
loading...
|
||||
</div>
|
||||
<div id="noteList">
|
||||
<div class="clearfix" id="notesAndSort" style="position: relative">
|
||||
<div class="pull-left">
|
||||
@@ -411,11 +424,11 @@ function log(o) {
|
||||
<span id="noteReadTags"></span>
|
||||
|
||||
<!-- 修改时间 -->
|
||||
<i class="fa fa-calendar"></i>{{msg . "update"}}
|
||||
<i class="fa fa-clock-o"></i>{{msg . "update"}}
|
||||
<span id="noteReadUpdatedTime"></span>
|
||||
|
||||
<!-- 修改时间 -->
|
||||
<i class="fa fa-calendar"></i>{{msg . "create"}}
|
||||
<i class="fa fa-clock-o"></i>{{msg . "create"}}
|
||||
<span id="noteReadCreatedTime"></span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -544,12 +557,12 @@ function log(o) {
|
||||
</a>
|
||||
</div>
|
||||
<div class="editorBg"></div>
|
||||
<div id="leanoteNav">
|
||||
<div id="leanoteNav" class="leanoteNav">
|
||||
<h1>
|
||||
<i class="fa fa-align-justify" title="文档导航"></i>
|
||||
<i class="fa fa-align-justify" title="{{msg . "nav"}}"></i>
|
||||
<span>{{msg . "nav"}}</span>
|
||||
</h1>
|
||||
<div id="leanoteNavContent">
|
||||
<div id="leanoteNavContent" class="leanoteNavContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -570,9 +583,85 @@ function log(o) {
|
||||
</div>
|
||||
|
||||
<div id="mdEditor">
|
||||
|
||||
|
||||
<div class="layout-wrapper-l1">
|
||||
<div class="layout-wrapper-l2">
|
||||
<div class="navbar navbar-default">
|
||||
<div class="navbar-inner" id="wmd-button-bar">
|
||||
<ul class="nav left-buttons">
|
||||
<li class="wmd-button-group1 btn-group"></li>
|
||||
</ul>
|
||||
<ul class="nav left-buttons">
|
||||
<li class="wmd-button-group2 btn-group"></li>
|
||||
</ul>
|
||||
<ul class="nav left-buttons">
|
||||
<li class="wmd-button-group3 btn-group"></li>
|
||||
</ul>
|
||||
<ul class="nav left-buttons">
|
||||
<li class="wmd-button-group5 btn-group"></li>
|
||||
</ul>
|
||||
<!-- 帮助 -->
|
||||
<ul class="nav left-buttons">
|
||||
<li class="wmd-button-group6 btn-group">
|
||||
<li class="wmd-button btn btn-success" id="wmd-help-button" title="Markdown syntax" style="left: 0px; display: none;"><span style="display: none; background-position: 0px 0px;"></span><i class="fa fa-question-circle"></i></li>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!--
|
||||
<ul class="nav pull-right right-buttons">
|
||||
<li class="offline-status hide">
|
||||
<div class="text-danger">
|
||||
<i class="icon-attention-circled"></i>offline
|
||||
</div>
|
||||
</li>
|
||||
<li class="extension-buttons"></li>
|
||||
</ul>
|
||||
<ul class="nav pull-right title-container">
|
||||
<li><div class="working-indicator"></div></li>
|
||||
<li><a class="btn btn-success file-title-navbar" href="#"
|
||||
title="Rename document"> </a></li>
|
||||
<li><div class="input-file-title-container"><input type="text"
|
||||
class="col-sm-4 form-control hide input-file-title"
|
||||
placeholder="Document title" /></div></li>
|
||||
</ul>
|
||||
-->
|
||||
</div>
|
||||
<div class="editorBg"></div>
|
||||
</div>
|
||||
<div class="layout-wrapper-l3">
|
||||
<div id="left-column">
|
||||
<pre id="wmd-input" class="form-control"><div class="editor-content mousetrap" contenteditable=true></div><div class="editor-margin"></div></pre>
|
||||
</div>
|
||||
<div id="right-column">
|
||||
<div class="preview-panel panel-open" id="preview-panel">
|
||||
<div id="mdSplitter2" class="layout-resizer layout-resizer-preview open" style="-webkit-user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); touch-action: none;"></div>
|
||||
<div class="layout-toggler layout-toggler-preview btn btn-info open" title="Toggle preview" data-open="1"><i class="fa fa-angle-right"></i></div>
|
||||
<div class="preview-container">
|
||||
<div id="preview-contents">
|
||||
<div id="wmd-preview" class="preview-content"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="extension-preview-buttons">
|
||||
<div id="leanoteNavMd" class="leanoteNav">
|
||||
<h1>
|
||||
<i class="fa fa-align-justify" title="{{msg . "nav"}}"></i>
|
||||
<span>{{msg . "nav"}}</span>
|
||||
</h1>
|
||||
<div id="leanoteNavContentMd" class="leanoteNavContent table-of-contents">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="wmd-button-bar" class="hide"></div>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<div id="wmd-button-bar" id="mdBar"></div>
|
||||
<div class="editorBg"></div>
|
||||
<!-- 为了scroll -->
|
||||
|
||||
<div class="clearfix" id="mdEditorPreview">
|
||||
<div id="left-column">
|
||||
@@ -588,11 +677,59 @@ function log(o) {
|
||||
</div>
|
||||
</div>
|
||||
<textarea id="md-section-helper"></textarea>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- mdEditor -->
|
||||
<!-- v2 -->
|
||||
<div class="modal fade modal-insert-link">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">Hyperlink</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Please provide the link URL and an optional title:</p>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="icon-globe"></i></span><input
|
||||
id="input-insert-link" type="text" class="col-sm-5 form-control"
|
||||
placeholder='http://example.com/ "optional title"' />
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a href="#" class="btn btn-default" data-dismiss="modal">Cancel</a>
|
||||
<a href="#" class="btn btn-primary action-insert-link"
|
||||
data-dismiss="modal">OK</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 插入图片 -->
|
||||
<div class="modal fade modal-insert-image">
|
||||
<div class="modal-dialog" style="width: 840px">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">Image</h4>
|
||||
</div>
|
||||
<div class="modal-body" style="padding-top: 0; padding-bottom: 0">
|
||||
<iframe name="mdImageManager" style="width: 100%; height: 350px" scrolling="no" id="leauiIfrForMD" src="" frameborder="0"></iframe>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a href="#" class="btn btn-default"
|
||||
data-dismiss="modal">Cancel</a> <a href="#"
|
||||
class="btn btn-primary action-insert-image" data-dismiss="modal">Insert Image</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- v1 -->
|
||||
<!-- Hidden Popup Modal -->
|
||||
<div class="modal fade bs-modal-sm" id="editorDialog" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-sm">
|
||||
@@ -737,17 +874,22 @@ function log(o) {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="js/jquery-1.9.0.min.js"></script>
|
||||
<script src="js/jquery.ztree.all-3.5.js"></script>
|
||||
<script src="js/i18n/msg.{{.locale}}.js"></script>
|
||||
<script src="js/common.js"></script>
|
||||
<script src="/js/jquery-1.9.0.min.js"></script>
|
||||
<script src="/js/jquery.ztree.all-3.5.js"></script>
|
||||
<script src="/js/i18n/msg.{{.locale}}.js"></script>
|
||||
<script src="/js/common.js"></script>
|
||||
<script>
|
||||
var UrlPrefix = "{{.siteUrl}}"; // 为了发weibo
|
||||
var UrlPrefix = '{{.siteUrl}}'; // 为了发weibo
|
||||
var UserInfo = {{.userInfo|jsonJs}};
|
||||
var notebooks = {{.notebooks|jsonJs}};
|
||||
var shareNotebooks = {{.shareNotebooks|jsonJs}};
|
||||
var sharedUserInfos = {{.sharedUserInfos|jsonJs}};
|
||||
var notes = {{.notes|jsonJs}}
|
||||
var curNoteId = '{{.curNoteId}}';
|
||||
var curNotebookId = '{{.curNotebookId}}';
|
||||
var curSharedNoteNotebookId = '{{.curSharedNoteNotebookId}}';
|
||||
var curSharedUserId = '{{.curSharedUserId}}';
|
||||
var notes = {{.notes|jsonJs}};
|
||||
var latestNotes = {{if .latestNotes}}{{.latestNotes|jsonJs}}{{else}}[]{{end}};
|
||||
var noteContentJson = {{.noteContentJson|jsonJs}};
|
||||
var tagsJson = {{.tags|jsonJs}};
|
||||
LEA.locale = "{{.locale}}";
|
||||
@@ -755,44 +897,33 @@ var GlobalConfigs = {{.globalConfigs|jsonJs}}; // 2014/11/9 beta2
|
||||
</script>
|
||||
|
||||
<!-- 渲染view -->
|
||||
<script src="tinymce/tinymce.js"></script>
|
||||
<script src="js/app/page.js"></script>
|
||||
<script src="/tinymce/tinymce.js"></script>
|
||||
<script src="/public/libs/ace/ace.js"></script>
|
||||
<script src="/js/app/page.js"></script>
|
||||
<script src="/js/jQuery-slimScroll-1.3.0/jquery.slimscroll.js"></script>
|
||||
<script src="/js/contextmenu/jquery.contextmenu.js"></script>
|
||||
<script src="js/jquery-cookie.js"></script>
|
||||
<script src="js/bootstrap-min.js"></script>
|
||||
<script src="js/app/note.js"></script>
|
||||
<script src="js/app/tag.js"></script>
|
||||
<script src="js/app/notebook.js"></script>
|
||||
<script src="js/app/share.js"></script>
|
||||
<script src="js/object_id-min.js"></script>
|
||||
<script src="js/ZeroClipboard/ZeroClipboard-min.js"></script>
|
||||
<script src="/js/bootstrap-min.js"></script>
|
||||
<script src="/js/app/note.js"></script>
|
||||
<script src="/js/app/tag.js"></script>
|
||||
<script src="/js/app/notebook.js"></script>
|
||||
<script src="/js/app/share.js"></script>
|
||||
<script src="/js/object_id-min.js"></script>
|
||||
<script>
|
||||
Notebook.renderNotebooks(notebooks);
|
||||
Share.renderShareNotebooks(sharedUserInfos, shareNotebooks);
|
||||
|
||||
Note.setNoteCache(noteContentJson);
|
||||
Note.renderNotes(notes);
|
||||
if(!isEmpty(notes)) {
|
||||
Note.changeNote(notes[0].NoteId);
|
||||
}
|
||||
|
||||
// Note.chanteNote设置content
|
||||
// Note.renderNoteContent(noteContentJson)
|
||||
|
||||
Tag.renderTagNav(tagsJson);
|
||||
|
||||
// init notebook后才调用
|
||||
initSlimScroll();
|
||||
initPage();
|
||||
</script>
|
||||
|
||||
<!-- context-menu -->
|
||||
<link rel="stylesheet" href="/js/contextmenu/css/contextmenu.css" type="text/css" />
|
||||
<!-- code -->
|
||||
<link href="/public/mdeditor/editor/google-code-prettify/prettify.css" rel="stylesheet" />
|
||||
<!-- js version 2.0 use require.js -->
|
||||
|
||||
<!-- v2 use require.js, mdeditor -->
|
||||
<script>
|
||||
window.baseDir = '/public/dist';
|
||||
window.require = {
|
||||
baseUrl: window.baseDir,
|
||||
deps: ['main']
|
||||
};
|
||||
</script>
|
||||
<script src="/js/require.js"></script>
|
||||
<script src="/js/main.js"></script>
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -12,17 +12,19 @@
|
||||
|
||||
<link href="/css/bootstrap.css" rel="stylesheet" />
|
||||
<!-- 先加载, 没有样式, 宽度不定 -->
|
||||
<link rel="stylesheet" href="tinymce/skins/custom/skin.min.css" rel="stylesheet"/>
|
||||
|
||||
<link rel="stylesheet" href="/tinymce/skins/custom/skin.min.css" rel="stylesheet"/>
|
||||
<!-- leanote css -->
|
||||
<link href="css/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet" />
|
||||
<link href="css/zTreeStyle/zTreeStyle.css" rel="stylesheet" />
|
||||
<link href="/css/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet" />
|
||||
<link href="/css/zTreeStyle/zTreeStyle.css" rel="stylesheet" />
|
||||
<!-- mdeditor -->
|
||||
<link href="/public/dist/themes/default.css" rel="stylesheet" />
|
||||
|
||||
<script>
|
||||
var hash = location.hash;
|
||||
if(hash == "#writing") {
|
||||
var files = '<link rel="stylesheet" href="css/theme/writting-overwrite.css" type="text/css" id="themeLink" />';
|
||||
if(hash.indexOf("writing") >= 0) {
|
||||
var files = '<link rel="stylesheet" href="/css/theme/writting-overwrite.css" type="text/css" id="themeLink" />';
|
||||
} else {
|
||||
var files ='<link rel="stylesheet" href="css/theme/{{if .userInfo.Theme}}{{.userInfo.Theme}}{{else}}default{{end}}.css" type="text/css" id="themeLink" />';
|
||||
var files ='<link rel="stylesheet" href="/css/theme/{{if .userInfo.Theme}}{{.userInfo.Theme}}{{else}}default{{end}}.css" type="text/css" id="themeLink" />';
|
||||
}
|
||||
document.write(files);
|
||||
</script>
|
||||
@@ -169,7 +171,7 @@ function log(o) {
|
||||
{{if .isAdmin}}
|
||||
<li role="presentation" class="divider"></li>
|
||||
<li role="presentation">
|
||||
<a target="_blank" title="{{msg . "amdin"}}" href="/admin/index">
|
||||
<a target="_blank" title="{{msg . "admin"}}" href="/admin/index">
|
||||
<i class="fa fa-dashboard"></i>
|
||||
<span>{{msg . "admin"}}</span>
|
||||
</a>
|
||||
@@ -184,6 +186,12 @@ function log(o) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pull-right top-nav writting-hide lea-blog">
|
||||
<a target="_blank" href="http://lea.leanote.com">
|
||||
lea++
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="pull-right top-nav writting-hide" id="myBlog">
|
||||
<a target="_blank" href="{{$.blogUrl}}/{{.userInfo.Username}}">
|
||||
{{msg . "myBlog"}}
|
||||
@@ -327,6 +335,11 @@ function log(o) {
|
||||
<div class="noteSplit" id="notebookSplitter"></div>
|
||||
|
||||
<div id="noteAndEditor">
|
||||
<div id="noteAndEditorMask">
|
||||
<img src="/images/loading-24.gif"/>
|
||||
<br />
|
||||
loading...
|
||||
</div>
|
||||
<div id="noteList">
|
||||
<div class="clearfix" id="notesAndSort" style="position: relative">
|
||||
<div class="pull-left">
|
||||
@@ -411,11 +424,11 @@ function log(o) {
|
||||
<span id="noteReadTags"></span>
|
||||
|
||||
<!-- 修改时间 -->
|
||||
<i class="fa fa-calendar"></i>{{msg . "update"}}
|
||||
<i class="fa fa-clock-o"></i>{{msg . "update"}}
|
||||
<span id="noteReadUpdatedTime"></span>
|
||||
|
||||
<!-- 修改时间 -->
|
||||
<i class="fa fa-calendar"></i>{{msg . "create"}}
|
||||
<i class="fa fa-clock-o"></i>{{msg . "create"}}
|
||||
<span id="noteReadCreatedTime"></span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -544,12 +557,12 @@ function log(o) {
|
||||
</a>
|
||||
</div>
|
||||
<div class="editorBg"></div>
|
||||
<div id="leanoteNav">
|
||||
<div id="leanoteNav" class="leanoteNav">
|
||||
<h1>
|
||||
<i class="fa fa-align-justify" title="文档导航"></i>
|
||||
<i class="fa fa-align-justify" title="{{msg . "nav"}}"></i>
|
||||
<span>{{msg . "nav"}}</span>
|
||||
</h1>
|
||||
<div id="leanoteNavContent">
|
||||
<div id="leanoteNavContent" class="leanoteNavContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -570,9 +583,85 @@ function log(o) {
|
||||
</div>
|
||||
|
||||
<div id="mdEditor">
|
||||
|
||||
|
||||
<div class="layout-wrapper-l1">
|
||||
<div class="layout-wrapper-l2">
|
||||
<div class="navbar navbar-default">
|
||||
<div class="navbar-inner" id="wmd-button-bar">
|
||||
<ul class="nav left-buttons">
|
||||
<li class="wmd-button-group1 btn-group"></li>
|
||||
</ul>
|
||||
<ul class="nav left-buttons">
|
||||
<li class="wmd-button-group2 btn-group"></li>
|
||||
</ul>
|
||||
<ul class="nav left-buttons">
|
||||
<li class="wmd-button-group3 btn-group"></li>
|
||||
</ul>
|
||||
<ul class="nav left-buttons">
|
||||
<li class="wmd-button-group5 btn-group"></li>
|
||||
</ul>
|
||||
<!-- 帮助 -->
|
||||
<ul class="nav left-buttons">
|
||||
<li class="wmd-button-group6 btn-group">
|
||||
<li class="wmd-button btn btn-success" id="wmd-help-button" title="Markdown syntax" style="left: 0px; display: none;"><span style="display: none; background-position: 0px 0px;"></span><i class="fa fa-question-circle"></i></li>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!--
|
||||
<ul class="nav pull-right right-buttons">
|
||||
<li class="offline-status hide">
|
||||
<div class="text-danger">
|
||||
<i class="icon-attention-circled"></i>offline
|
||||
</div>
|
||||
</li>
|
||||
<li class="extension-buttons"></li>
|
||||
</ul>
|
||||
<ul class="nav pull-right title-container">
|
||||
<li><div class="working-indicator"></div></li>
|
||||
<li><a class="btn btn-success file-title-navbar" href="#"
|
||||
title="Rename document"> </a></li>
|
||||
<li><div class="input-file-title-container"><input type="text"
|
||||
class="col-sm-4 form-control hide input-file-title"
|
||||
placeholder="Document title" /></div></li>
|
||||
</ul>
|
||||
-->
|
||||
</div>
|
||||
<div class="editorBg"></div>
|
||||
</div>
|
||||
<div class="layout-wrapper-l3">
|
||||
<div id="left-column">
|
||||
<pre id="wmd-input" class="form-control"><div class="editor-content mousetrap" contenteditable=true></div><div class="editor-margin"></div></pre>
|
||||
</div>
|
||||
<div id="right-column">
|
||||
<div class="preview-panel panel-open" id="preview-panel">
|
||||
<div id="mdSplitter2" class="layout-resizer layout-resizer-preview open" style="-webkit-user-select: none; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); touch-action: none;"></div>
|
||||
<div class="layout-toggler layout-toggler-preview btn btn-info open" title="Toggle preview" data-open="1"><i class="fa fa-angle-right"></i></div>
|
||||
<div class="preview-container">
|
||||
<div id="preview-contents">
|
||||
<div id="wmd-preview" class="preview-content"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="extension-preview-buttons">
|
||||
<div id="leanoteNavMd" class="leanoteNav">
|
||||
<h1>
|
||||
<i class="fa fa-align-justify" title="{{msg . "nav"}}"></i>
|
||||
<span>{{msg . "nav"}}</span>
|
||||
</h1>
|
||||
<div id="leanoteNavContentMd" class="leanoteNavContent table-of-contents">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="wmd-button-bar" class="hide"></div>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<div id="wmd-button-bar" id="mdBar"></div>
|
||||
<div class="editorBg"></div>
|
||||
<!-- 为了scroll -->
|
||||
|
||||
<div class="clearfix" id="mdEditorPreview">
|
||||
<div id="left-column">
|
||||
@@ -588,11 +677,59 @@ function log(o) {
|
||||
</div>
|
||||
</div>
|
||||
<textarea id="md-section-helper"></textarea>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- mdEditor -->
|
||||
<!-- v2 -->
|
||||
<div class="modal fade modal-insert-link">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">Hyperlink</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>Please provide the link URL and an optional title:</p>
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon"><i class="icon-globe"></i></span><input
|
||||
id="input-insert-link" type="text" class="col-sm-5 form-control"
|
||||
placeholder='http://example.com/ "optional title"' />
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a href="#" class="btn btn-default" data-dismiss="modal">Cancel</a>
|
||||
<a href="#" class="btn btn-primary action-insert-link"
|
||||
data-dismiss="modal">OK</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 插入图片 -->
|
||||
<div class="modal fade modal-insert-image">
|
||||
<div class="modal-dialog" style="width: 840px">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">Image</h4>
|
||||
</div>
|
||||
<div class="modal-body" style="padding-top: 0; padding-bottom: 0">
|
||||
<iframe name="mdImageManager" style="width: 100%; height: 350px" scrolling="no" id="leauiIfrForMD" src="" frameborder="0"></iframe>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a href="#" class="btn btn-default"
|
||||
data-dismiss="modal">Cancel</a> <a href="#"
|
||||
class="btn btn-primary action-insert-image" data-dismiss="modal">Insert Image</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- v1 -->
|
||||
<!-- Hidden Popup Modal -->
|
||||
<div class="modal fade bs-modal-sm" id="editorDialog" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-sm">
|
||||
@@ -737,17 +874,22 @@ function log(o) {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="js/jquery-1.9.0.min.js"></script>
|
||||
<script src="js/jquery.ztree.all-3.5.js"></script>
|
||||
<script src="js/i18n/msg.{{.locale}}.js"></script>
|
||||
<script src="js/common-min.js"></script>
|
||||
<script src="/js/jquery-1.9.0.min.js"></script>
|
||||
<script src="/js/jquery.ztree.all-3.5-min.js"></script>
|
||||
<script src="/js/i18n/msg.{{.locale}}.js"></script>
|
||||
<script src="/js/common-min.js"></script>
|
||||
<script>
|
||||
var UrlPrefix = "{{.siteUrl}}"; // 为了发weibo
|
||||
var UrlPrefix = '{{.siteUrl}}'; // 为了发weibo
|
||||
var UserInfo = {{.userInfo|jsonJs}};
|
||||
var notebooks = {{.notebooks|jsonJs}};
|
||||
var shareNotebooks = {{.shareNotebooks|jsonJs}};
|
||||
var sharedUserInfos = {{.sharedUserInfos|jsonJs}};
|
||||
var notes = {{.notes|jsonJs}}
|
||||
var curNoteId = '{{.curNoteId}}';
|
||||
var curNotebookId = '{{.curNotebookId}}';
|
||||
var curSharedNoteNotebookId = '{{.curSharedNoteNotebookId}}';
|
||||
var curSharedUserId = '{{.curSharedUserId}}';
|
||||
var notes = {{.notes|jsonJs}};
|
||||
var latestNotes = {{if .latestNotes}}{{.latestNotes|jsonJs}}{{else}}[]{{end}};
|
||||
var noteContentJson = {{.noteContentJson|jsonJs}};
|
||||
var tagsJson = {{.tags|jsonJs}};
|
||||
LEA.locale = "{{.locale}}";
|
||||
@@ -755,44 +897,33 @@ var GlobalConfigs = {{.globalConfigs|jsonJs}}; // 2014/11/9 beta2
|
||||
</script>
|
||||
|
||||
<!-- 渲染view -->
|
||||
<script src="tinymce/tinymce.js"></script>
|
||||
<script src="js/app/page-min.js"></script>
|
||||
<script src="/js/jQuery-slimScroll-1.3.0/jquery.slimscroll.js"></script>
|
||||
<script src="/tinymce/tinymce.min.js"></script>
|
||||
<script src="/public/libs/ace/ace.js"></script>
|
||||
<script src="/js/app/page-min.js"></script>
|
||||
<script src="/js/jQuery-slimScroll-1.3.0/jquery.slimscroll-min.js"></script>
|
||||
<script src="/js/contextmenu/jquery.contextmenu-min.js"></script>
|
||||
<script src="js/jquery-cookie.js"></script>
|
||||
<script src="js/bootstrap-min.js"></script>
|
||||
<script src="js/app/note-min.js"></script>
|
||||
<script src="js/app/tag-min.js"></script>
|
||||
<script src="js/app/notebook-min.js"></script>
|
||||
<script src="js/app/share-min.js"></script>
|
||||
<script src="js/object_id-min.js"></script>
|
||||
<script src="js/ZeroClipboard/ZeroClipboard-min.js"></script>
|
||||
<script src="/js/bootstrap-min.js"></script>
|
||||
<script src="/js/app/note-min.js"></script>
|
||||
<script src="/js/app/tag-min.js"></script>
|
||||
<script src="/js/app/notebook-min.js"></script>
|
||||
<script src="/js/app/share-min.js"></script>
|
||||
<script src="/js/object_id-min.js"></script>
|
||||
<script>
|
||||
Notebook.renderNotebooks(notebooks);
|
||||
Share.renderShareNotebooks(sharedUserInfos, shareNotebooks);
|
||||
|
||||
Note.setNoteCache(noteContentJson);
|
||||
Note.renderNotes(notes);
|
||||
if(!isEmpty(notes)) {
|
||||
Note.changeNote(notes[0].NoteId);
|
||||
}
|
||||
|
||||
// Note.chanteNote设置content
|
||||
// Note.renderNoteContent(noteContentJson)
|
||||
|
||||
Tag.renderTagNav(tagsJson);
|
||||
|
||||
// init notebook后才调用
|
||||
initSlimScroll();
|
||||
initPage();
|
||||
</script>
|
||||
|
||||
<!-- context-menu -->
|
||||
<link rel="stylesheet" href="/js/contextmenu/css/contextmenu.css" type="text/css" />
|
||||
<!-- code -->
|
||||
<link href="/public/mdeditor/editor/google-code-prettify/prettify.css" rel="stylesheet" />
|
||||
<!-- js version 2.0 use require.js -->
|
||||
|
||||
<!-- v2 use require.js, mdeditor -->
|
||||
<script>
|
||||
window.baseDir = '/public/dist';
|
||||
window.require = {
|
||||
baseUrl: window.baseDir,
|
||||
deps: ['main']
|
||||
};
|
||||
</script>
|
||||
<script src="/js/require.js"></script>
|
||||
<script src="/js/main-min.js"></script>
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -79,7 +79,7 @@ myBlog=Blog
|
||||
history=Histories
|
||||
save=Save
|
||||
editorTips=Tips
|
||||
editorTipsInfo=<h4>1. Short cuts</h4>ctrl+shift+c Toggle code <br /> ctrl+shift+i Insert/edit image <h4>2. shift+enter Get out of current block</h4> eg. <img src="/images/outofcode.png" style="width: 90px"/> in this situation you can use shift+enter to get out of current code block.
|
||||
editorTipsInfo=<h4>1. Short cuts</h4>ctrl+shift+c Toggle code<h4>2. shift+enter Get out of current block</h4> eg. <img src="/images/outofcode.png" style="width: 90px"/> in this situation you can use shift+enter to get out of current code block.
|
||||
newNote=New note
|
||||
newMarkdownNote=New Markdown Note
|
||||
noNoteNewNoteTips=The notebook is empty, why not...
|
||||
@@ -129,9 +129,12 @@ themeSetting=Theme
|
||||
setAvatar=Avatar
|
||||
logout=Logout
|
||||
basicInfo=Basic
|
||||
basicInfoSet=Blog Basic Setting
|
||||
updateEmail=Update email
|
||||
usernameSetting=Update username
|
||||
username=Username
|
||||
avatar=Avatar
|
||||
chooseImage=Choose Image
|
||||
oldPassword=Old password
|
||||
newPassword=New password
|
||||
admin=Admin
|
||||
@@ -144,7 +147,7 @@ uploadImage=Upload image
|
||||
|
||||
# blog
|
||||
aboutMe=About me
|
||||
blogSet=Set blog
|
||||
blogSet=Blog Settings
|
||||
|
||||
# index
|
||||
discussion=Discussion
|
||||
@@ -235,6 +238,7 @@ subDomainExisted=Sub domain is already existed
|
||||
domainNotPointToLeanote=The custom domin hasn't pointed to d.leanote.com
|
||||
errorPerPageSize=Page size is error
|
||||
errorSortField=Sort Field is error
|
||||
themeValidHasRoundInclude=WARNING: Templates have circular references!
|
||||
|
||||
# lea++
|
||||
leaDesc=leanote blog platform
|
||||
@@ -243,8 +247,94 @@ latest=Latest
|
||||
|
||||
# 用户中心
|
||||
memberCenter=Member Center
|
||||
userNotExists=该成员沿未注册
|
||||
hasUsers=已存在该成员
|
||||
userNotExists=The user is not exists
|
||||
hasUsers=The user already exists
|
||||
|
||||
# yu
|
||||
service=Service
|
||||
imageSizeOver=Sorry, you have no image opacity, please <a href="/service">upgrade your account</a>.
|
||||
attachSizeOver=Sorry, you have no attachment opacity, please <a href="/service">upgrade your account</a>.
|
||||
|
||||
|
||||
#memeber
|
||||
welcomeToLeanote=Welcome
|
||||
accountInfo=Account Info
|
||||
accountType=Account Type
|
||||
premiumAccountType=Premium
|
||||
normalAccountType=Normal
|
||||
imageSize=Image Opacity
|
||||
attachSize=Attachment Opacity
|
||||
upgrade=Upgrade My Account
|
||||
leanoteEvents=Leanote News
|
||||
addLeanoteAccount=New Leanote Account
|
||||
defaultComment=Default leanote comment system
|
||||
upgradeAccountTips=I want to using a custom domain for my blog, <a class="btn btn-default" href="/service">Upgrade My Account</a>
|
||||
cateIsPublicNotebook=Category is the published notebooks
|
||||
dragAndSort=Drag it to sort
|
||||
permanentLink=Permanent Link
|
||||
cate=Category
|
||||
noCates=No Category
|
||||
single=Single Page
|
||||
singleTips=You can add many single pages
|
||||
addSingle=New single page
|
||||
updateSingle=Update single page
|
||||
inputSingleTitle=Single page title is required
|
||||
saveSort=Save sequencing
|
||||
pagingAndSort=Paging And Sort Settings
|
||||
perPageSize=Per page size
|
||||
sortField=Sorter field
|
||||
sortType=Sorter type
|
||||
publicTime=Published time
|
||||
createdTime=Created time
|
||||
updatedTime=Updated time
|
||||
desc=Desc
|
||||
asc=Asc
|
||||
postList=Post List
|
||||
hasSelfDefined=Has defined
|
||||
noSelfDefined=Not defined
|
||||
setAbstract=Abstract settings
|
||||
title=Title
|
||||
content=Content
|
||||
|
||||
addTheme=New theme
|
||||
importTheme=Import theme
|
||||
exportTheme=Export theme
|
||||
export=Export
|
||||
preview=Preview
|
||||
edit=Edit
|
||||
use=Use
|
||||
install=Install
|
||||
currentTheme=Current theme
|
||||
myOtherThemes=My other themes
|
||||
leanoteThemeMarket=Leanote theme market
|
||||
updateTheme=Update Theme
|
||||
tplStyleScript=template, style, script
|
||||
newFile=New file
|
||||
image=Image
|
||||
currentFile=Current file
|
||||
tpl=Template
|
||||
style=Style
|
||||
script=Script
|
||||
header=Header
|
||||
footer=Footer
|
||||
index=Home
|
||||
cate=Category
|
||||
search=Search
|
||||
single=Single Page
|
||||
archive=Archive
|
||||
post=Post
|
||||
tags=Tags
|
||||
tag_posts=Tag's posts
|
||||
share_comment=Comments
|
||||
themeJson=Theme settings
|
||||
paging=Paging
|
||||
highlight=Code highlight
|
||||
|
||||
group=Group
|
||||
newGroup=New group
|
||||
deleteGroup=Delete group
|
||||
addMemberTips=Input username or email to add member
|
||||
deleteMember=Delete member
|
||||
|
||||
# error
|
||||
notFound=This page cann't found.
|
||||
@@ -100,7 +100,7 @@ myBlog=我的博客
|
||||
history=历史记录
|
||||
save=保存
|
||||
editorTips=帮助
|
||||
editorTipsInfo=<h4>1. 快捷键</h4>ctrl+shift+c 代码块切换 <br /> ctrl+shift+i 插入/修改图片<h4>2. shift+enter 跳出当前区域</h4>比如在代码块中<img src="/images/outofcode.png" style="width: 90px"/>按shift+enter可跳出当前代码块.
|
||||
editorTipsInfo=<h4>1. 快捷键</h4>ctrl+shift+c 代码块切换 <h4>2. shift+enter 跳出当前区域</h4>比如在代码块中<img src="/images/outofcode.png" style="width: 90px"/>按shift+enter可跳出当前代码块.
|
||||
newNote=新建笔记
|
||||
newMarkdownNote=新建Markdown笔记
|
||||
noNoteNewNoteTips=该笔记本下空空如也...何不
|
||||
@@ -150,9 +150,12 @@ themeSetting=主题设置
|
||||
setAvatar=头像设置
|
||||
logout=退出
|
||||
basicInfo=基本信息
|
||||
basicInfoSet=博客基本设置
|
||||
updateEmail=修改Email
|
||||
usernameSetting=用户名设置
|
||||
username=用户名
|
||||
avatar=头像
|
||||
chooseImage=选择图片
|
||||
oldPassword=旧密码
|
||||
newPassword=新密码
|
||||
admin=后台管理
|
||||
@@ -261,6 +264,7 @@ subDomainExisted=博客子域名已存在
|
||||
domainNotPointToLeanote=该域名还未指向 d.leanote.com, 请稍后再试
|
||||
errorPerPageSize=每页记录数至少为1
|
||||
errorSortField=排序类型错误
|
||||
themeValidHasRoundInclude=警告: 模板存在循环引用问题!
|
||||
|
||||
# lea++
|
||||
leaDesc=leanote博客平台
|
||||
@@ -272,5 +276,91 @@ memberCenter=用户中心
|
||||
userNotExists=该成员沿未注册
|
||||
hasUsers=已存在该成员
|
||||
|
||||
# yu
|
||||
service=服务
|
||||
imageSizeOver=对不起, 您的图片容量不足, 请<a href="/service">升级您的帐户</a>
|
||||
attachSizeOver=对不起, 您的附件容量不足, 请<a href="/service">升级您的帐户</a>
|
||||
|
||||
#memeber
|
||||
welcomeToLeanote=欢迎来到leanote
|
||||
accountInfo=帐户信息
|
||||
accountType=帐户类型
|
||||
premiumAccountType=彩色套餐
|
||||
normalAccountType=共享套餐
|
||||
imageSize=图片空间
|
||||
attachSize=附件空间
|
||||
upgrade=升级套餐
|
||||
leanoteEvents=Leanote动态
|
||||
addLeanoteAccount=新建Leanote帐户
|
||||
defaultComment=默认leanote评论系统
|
||||
upgradeAccountTips=Leanote支持绑定自己的域名到博客上, 请 <a class="btn btn-default" href="/service">升级您的帐户</a>
|
||||
cateIsPublicNotebook=分类是公开为博客的笔记本
|
||||
dragAndSort=拖动可排序
|
||||
permanentLink=固定链接
|
||||
cate=分类
|
||||
noCates=无分类
|
||||
single=单页面
|
||||
singleTips=您可以添加多个单页面
|
||||
addSingle=添加单页面
|
||||
updateSingle=修改单页面
|
||||
inputSingleTitle=请输入单页面标题
|
||||
saveSort=保存排序
|
||||
pagingAndSort=分页与排序设置
|
||||
perPageSize=每页记录数
|
||||
sortField=排序字段
|
||||
sortType=排序类型
|
||||
publicTime=发表时间
|
||||
createdTime=创建时间
|
||||
updatedTime=更新时间
|
||||
desc=降序
|
||||
asc=升序
|
||||
postList=文章列表
|
||||
hasSelfDefined=已设置
|
||||
noSelfDefined=未设置
|
||||
setAbstract=摘要设置
|
||||
title=标题
|
||||
content=内容
|
||||
|
||||
addTheme=添加主题
|
||||
importTheme=导入主题
|
||||
exportTheme=导出主题
|
||||
export=导出
|
||||
preview=预览
|
||||
edit=编辑
|
||||
use=使用
|
||||
install=安装
|
||||
currentTheme=当前主题
|
||||
myOtherThemes=我的其它主题
|
||||
leanoteThemeMarket=Leanote主题市场
|
||||
updateTheme=编辑主题
|
||||
tplStyleScript=模板, 样式, 脚本
|
||||
newFile=新建文件
|
||||
image=图片
|
||||
currentFile=当前文件
|
||||
tpl=模板
|
||||
style=样式
|
||||
script=脚本
|
||||
header=头部
|
||||
footer=底部
|
||||
index=首页
|
||||
cate=分类页
|
||||
search=搜索页
|
||||
single=单页
|
||||
archive=归档页
|
||||
post=文章页
|
||||
tags=标签页
|
||||
tag_posts=标签文章页
|
||||
share_comment=分享评论
|
||||
themeJson=主题配置
|
||||
paging=分页
|
||||
highlight=高亮
|
||||
|
||||
group=用户组
|
||||
newGroup=新建组
|
||||
deleteGroup=删除组
|
||||
addMemberTips=输入用户名或邮箱添加成员
|
||||
deleteMember=删除成员
|
||||
|
||||
|
||||
# 必须要加这个, 奇怪
|
||||
[CN]
|
||||
@@ -165,7 +165,8 @@ if(typeof art != "undefined") {
|
||||
title: false,
|
||||
cancel: false,
|
||||
fixed: true,
|
||||
lock: true,
|
||||
top: 0,
|
||||
// lock: true,
|
||||
opacity: 0.3
|
||||
})
|
||||
.content('<div style="padding: 0 1em;">' + content + '</div>')
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
function reIsOk(e){return e&&"object"==typeof e&&e.Ok}function showAlert(e,t,n,o){$(e).html(t).removeClass("alert-danger").removeClass("alert-success").removeClass("alert-warning").addClass("alert-"+n).show(),o&&$(o).focus()}function hideAlert(e,t){t?setTimeout(function(){$(e).hide()},t):$(e).hide()}function ajaxGet(e,t,n){$.get(e,t,n)}function ajaxPost(e,t,n){$.post(e,t,n)}function ajaxGetP(e,t,n){ajaxP("GET",e,t,n)}function ajaxPostP(e,t,n){ajaxP("POST",e,t,n)}function ajaxP(e,t,n,o){n=n||{},o=o||function(){},$.ajax({dataType:"jsonp",url:t,type:e,data:n,jsonp:"callback",jsonpCallback:"jsonpCallback",success:o})}function getShareUrl(){return location.href}function getShareTitle(e){return encodeURI(e+" (来自leanote.com)")}function shareSinaWeibo(e,t,n){var o="http://service.weibo.com/share/share.php?title="+getShareTitle(t)+"&url="+getShareUrl(e);window.open(o,"Share",windowParam)}function shareTencentWeibo(e,t,n){var o="801542571",i="http://share.v.t.qq.com/index.php?c=share&a=index&appkey="+o+"&title="+getShareTitle(t)+"&url="+getShareUrl(e)+"&pic="+n;window.open(i,"Share",windowParam)}function shareQQ(e,t,n){var o="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+getShareUrl(e)+"&title="+t+"&pics="+n;window.open(o,"Share",windowParam)}function shareRenRen(e,t,n){var o="http://widget.renren.com/dialog/share?resourceUrl="+getShareUrl(e)+"&srcUrl="+getShareUrl(e)+"&title="+getShareTitle(t)+"&pic="+n;window.open(o,"Share",windowParam)}function shareTwitter(e,t,n){var o="https://twitter.com/intent/tweet?text="+getShareTitle(t)+"&pic="+n;window.open(o,"Share",windowParam)}function shareFacebook(e,t,n){var o=" http://www.facebook.com/sharer.php?t="+getShareTitle(t)+"&pic="+n;window.open(o,"Share",windowParam)}function goNowToDatetime(e){return e?e.substr(0,10)+" "+e.substr(11,8):""}function goNowToDate(e){if(!e)return"";var t=e.substr(0,10)+" "+e.substr(11,8),n=t.split(" "),o=n[0].split("-"),i=parseInt(o[0],10),a=parseInt(o[1],10)-1,r=parseInt(o[2],10),s=n[1].split(":"),l=parseInt(s[0],10),c=parseInt(s[1],10)-1,d=parseInt(s[2],10),f=new Date(i,a,r,l,c,d);return f}function getDateDiff(e){var t=(new Date).getTime(),n=t-e;if(0>n)return"";var o=n/diff.month,i=n/(7*diff.day),a=n/diff.day,r=n/diff.hour,s=parseInt(n/diff.minute);return result=o>=1?parseInt(o)+"个月前":i>=1?parseInt(i)+"周前":a>=1?parseInt(a)+"天前":r>=1?parseInt(r)+"小时前":s>1?s+"分钟前":"刚刚"}function weixin(){var e=window.location.href,t=$.trim($(".title").text()),n=$.trim($("#desc").text()),o=$("#content img").eq(0).attr("src");window.shareData={imgUrl:o,timeLineLink:e,sendFriendLink:e,weiboLink:e,tTitle:t,tContent:n,fTitle:t,fContent:n,wContent:n},document.addEventListener("WeixinJSBridgeReady",function i(){WeixinJSBridge.on("menu:share:appmessage",function(e){WeixinJSBridge.invoke("sendAppMessage",{img_url:window.shareData.imgUrl,img_width:"200",link:window.shareData.sendFriendLink,desc:window.shareData.fContent,title:window.shareData.fTitle},function(e){hs_guide("none"),_report("send_msg",e.err_msg)})}),WeixinJSBridge.on("menu:share:timeline",function(e){WeixinJSBridge.invoke("shareTimeline",{img_url:window.shareData.imgUrl,img_width:"200",link:window.shareData.timeLineLink,desc:window.shareData.tContent,title:window.shareData.tTitle},function(e){hs_guide("none"),_report("timeline",e.err_msg)})}),WeixinJSBridge.on("menu:share:weibo",function(e){WeixinJSBridge.invoke("shareWeibo",{content:window.shareData.wContent,url:window.shareData.weiboLink},function(e){hs_guide("none"),_report("weibo",e.err_msg)})})},!1)}function scrollTo(e,t,n){for(var o=$("#content"),i=o.find(t+":contains("+n+")"),a=$('#blogNavContent [data-a="'+t+"-"+encodeURI(n)+'"]'),r=a.size(),s=0;r>s&&a[s]!=e;++s);if(i.size()>=s+1){i=i.eq(s);var l=i.offset().top;LEA.isMobile&&(l-=50);var c=$(document).scrollTop();return void $("html,body").animate({scrollTop:l},200)}}function genNav(){for(var e=$("#content"),t=e.html(),n=[],o=e.find("h1,h2,h3,h4,h5,h6").toArray(),i="<ul>",a=0;a<o.length;++a){var r=$(o[a]).text(),s=o[a].tagName.toLowerCase();i+='<li class="nav-'+s+'"><a data-a="'+s+"-"+encodeURI(r)+'" onclick="scrollTo(this, \''+s+"', '"+r+"')\">"+r+"</a></li>"}return i+="</ul>",$("#blogNavContent").html(i),o.length?!0:($("#blogNavContent").html("无"),!1)}function initNav(){function e(){var e=r.scrollTop();i>=e?$("#blogNav").css("top",i-e):LEA.isMobile?$("#blogNav").css("top",50):$("#blogNav").css("top",10)}var t=genNav();if(t){var n=$(".title"),o=n.offset(),i=o.top+10;LEA.isMobile&&(i+=30),0>i&&(i=10);var a=n.width()+o.left-100;$("#blogNav").css("top",i).css("left",a),$("#blogNav").show(),$("#blogNavNav").click(function(){var e=$("#blogNavContent");e.is(":hidden")?e.show():e.hide()});var r=$(document);e(),$(window).scroll(e)}}function goLogin(){var e=siteUrl+"/login?from="+encodeURI(location.href);location.href=e}function goRegister(){var e=siteUrl+"/register?from="+encodeURI(location.href);location.href=e}function needLogin(){if("undefined"==typeoLine truncated
|
||||
@@ -355,10 +355,10 @@ function getCurVisitUserInfo() {
|
||||
}
|
||||
// 增加阅读次数
|
||||
function incReadNum(noteId) {
|
||||
if(!$.cookie(noteId)) {
|
||||
$.cookie(noteId, 1);
|
||||
//if(!$.cookie(noteId)) {
|
||||
// $.cookie(noteId, 1);
|
||||
ajaxGet(getCurHostUrl() + "/blog/incReadNum", {noteId: noteId});
|
||||
}
|
||||
//}
|
||||
}
|
||||
function getCurHostUrl() {
|
||||
return "//" + location.host;
|
||||
|
||||
@@ -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>
|
||||
{{.PublicTime|date}} <a href="{{$.viewUrl}}/{{.NoteId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,41 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>分类 - {{$.curCateTitle}}</h2>
|
||||
</div>
|
||||
<div id="posts">
|
||||
{{range $.posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}.</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,204 @@
|
||||
<!-- 赞 -->
|
||||
<div class="entry-controls clearfix">
|
||||
<div class="vote-section-wrapper clearfix">
|
||||
<button class="btn btn-default btn-zan" id="likeBtn"><i class="fa fa-thumbs-o-up"></i> <span id="likeNum">{{.blog.LikeNum}}</span> {{msg . "like"}}</button>
|
||||
<span class="control-item read-counts"><i class="fa fa-eye"></i> {{if .blog.ReadNum}}{{.blog.ReadNum}}{{else}}1{{end}} {{msg . "viewers"}}</span>
|
||||
</div>
|
||||
<div class="right-section">
|
||||
<div id="weixinQRCode"></div>
|
||||
<!-- google+
|
||||
<g:plusone size=”medium”></g:plusone>
|
||||
-->
|
||||
<button class="btn btn-share btn-default btn-weibo"><i class="fa fa-weibo"></i> {{msg . "sinaWeibo"}}</button>
|
||||
<button class="btn btn-share btn-default btn-weixin"><i class="fa fa-wechat"></i> {{msg . "weixin"}}</button>
|
||||
<div class="dropdown" style="display: inline-block; cursor: pointer; padding: 5px 10px;">
|
||||
<!-- open -->
|
||||
<div class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown">
|
||||
<i class="fa fa-share-square-o"></i>
|
||||
{{msg . "moreShare"}}
|
||||
</div>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="#" class="btn-share tencent-weibo"><i class="fa fa-tencent-weibo"></i> {{msg . "tencentWeibo"}}</a></li>
|
||||
<li><a href="#" class="btn-share qq"><i class="fa fa-qq"></i> {{msg . "qqZone"}}</a></li>
|
||||
<li><a href="#" class="btn-share renren"><i class="fa fa-renren"></i> {{msg . "renren"}}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- 举报 -->
|
||||
{{if eq .locale "zh"}}
|
||||
<div style="display: inline-block">
|
||||
<a id="reportBtn"><i class="fa fa-flag-o"></i> {{msg . "report"}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="voters clearfix" id="likers">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/x-jsrender" id="tLikers">
|
||||
[[for users]]
|
||||
<a id="liker_[[:UserId]]" href="[[:~root.blogUrl]]/[[:Username]]" target="_blank" class="voter">
|
||||
[[if Logo]]
|
||||
<img alt="avatar" class="avatar-small" src="[[:Logo]]">
|
||||
[[else]]
|
||||
<img alt="avatar" class="avatar-small" src="/images/blog/default_avatar.png">
|
||||
[[/if]]
|
||||
</a>
|
||||
[[/for]]
|
||||
</script>
|
||||
{{if and .userBlog.CanComment (not (eq .userBlog.CommentType "disqus"))}}
|
||||
|
||||
<script type="text/x-jsrender" id="tComments">
|
||||
[[for comments]]
|
||||
<li class="comment-item">
|
||||
<!-- 头像 -->
|
||||
<a ui-hovercard="" target="_blank" class="avatar-link" title="[[:UserInfo.Username]]" href="[[:~root.blogUrl]]/[[:UserInfo.Username]]">
|
||||
<img class="avatar" src="[[:UserInfo.Logo]]">
|
||||
</a>
|
||||
<!-- 评论 -->
|
||||
<div class="comment-body">
|
||||
<div class="comment-hd">
|
||||
<a href="[[:~root.blogUrl]]/[[:UserInfo.Username]]" target="_blank" >[[:UserInfo.Username]]</a>
|
||||
[[if IsAuthorComment]]
|
||||
<span>({{msg . "author"}})</span>
|
||||
[[/if]]
|
||||
|
||||
<!-- 回复其它人 -->
|
||||
[[if ToUserInfo]]
|
||||
<span class="in-reply-to">
|
||||
{{rawMsg . "reply"}}
|
||||
<a href="[[:~root.blogUrl]]/[[:ToUserInfo.Username]]">[[:ToUserInfo.Username]]</a>
|
||||
</span>
|
||||
[[if ToUserIsAuthor]]
|
||||
<span>({{msg . "author"}})</span>
|
||||
[[/if]]
|
||||
[[/if]]
|
||||
</div>
|
||||
<div class="comment-content ng-binding" ng-bind-html="comment.content">
|
||||
[[html:Content]]
|
||||
</div>
|
||||
<div class="comment-ft clearfix" data-comment-id="[[:CommentId]]" >
|
||||
<span title="" ui-time="" class="date">[[:PublishDate]] </span>
|
||||
<span class="like-num [[if !LikeNum]]hide[[/if]]" title="[[:LikeNum]] {{rawMsg . "like"}}"><span class="like-num-i">[[:LikeNum]]</span> {{rawMsg . "like"}}</span></span>
|
||||
|
||||
[[if ~root.visitUserInfo.UserId]]
|
||||
[[if IsMyNote && !IsMyComment]]
|
||||
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> {{rawMsg . "delete"}}</a>
|
||||
[[/if]]
|
||||
[[if !IsMyComment]]
|
||||
<a href="javascript:;" class="comment-reply op-link ">
|
||||
<i class="fa fa-reply"></i>
|
||||
{{rawMsg . "reply"}}
|
||||
</a>
|
||||
<a href="javascript:;" class="comment-like op-link"><i class="fa fa-thumbs-o-up"></i> <span class="like-text">[[if IsILikeIt]]{{rawMsg . "unlike"}}[[else]]{{rawMsg . "like"}}[[/if]]</span></a>
|
||||
{{if eq .locale "zh"}}
|
||||
<a href="javascript:;" class="comment-report op-link "><i class="fa fa-flag-o"></i> {{rawMsg . "report"}}</a>
|
||||
{{end}}
|
||||
[[else]]
|
||||
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> {{rawMsg . "delete"}}</a>
|
||||
[[/if]]
|
||||
[[/if]]
|
||||
</div>
|
||||
|
||||
<!-- 回复该评论 -->
|
||||
[[if ~root.visitUserInfo.UserId]]
|
||||
<form class="comment-form comment-box-ft">
|
||||
<div class="clearfix">
|
||||
<div class="avatar-wrap">
|
||||
<img class="avatar" src="[[:~root.visitUserInfo.Logo]]">
|
||||
</div>
|
||||
<div class="editor-wrap">
|
||||
<textarea class="editable" id="commentContent" name="commentContent" placeholder="{{rawMsg . "reply"}}"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="command clearfix" style="display: block;">
|
||||
<button class="reply-comment-btn save btn btn-primary" data-comment-id="[[:CommentId]]">{{rawMsg . "comment"}}</button>
|
||||
<a class="cancel reply-cancel btn-link">{{rawMsg . "cancel"}}</a>
|
||||
</div>
|
||||
</form>
|
||||
[[/if]]
|
||||
</div>
|
||||
</li>
|
||||
[[/for]]
|
||||
</script>
|
||||
|
||||
<!-- 评论 -->
|
||||
<div class="comment-box hide">
|
||||
{{if .visitUserInfo.UserId}}
|
||||
<form class="comment-form comment-box-ft" id="commentForm">
|
||||
<div class="clearfix">
|
||||
<div class="avatar-wrap">
|
||||
<img class="avatar" src="{{.visitUserInfo.Logo}}">
|
||||
</div>
|
||||
<div class="editor-wrap">
|
||||
<textarea class="editable" id="commentContent" name="commentContent" placeholder="{{msg . "comment"}}" style="height: 100px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="command clearfix" style="display: block;">
|
||||
<button id="commentBtn" class="reply-comment-btn save btn btn-primary">{{msg . "comment"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
{{else}}
|
||||
<div class="needLogin">
|
||||
<a onclick="goLogin()">{{msg . "signIn"}}</a>, {{msg . "submitComment"}}.
|
||||
<br />
|
||||
没有帐号? <a onclick="goRegister()">{{msg . "signUp"}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="box-header">
|
||||
<span class="counter">
|
||||
<i class="icon icon-comment"></i><span id="commentNum">{{.blog.CommentNum}}</span> {{msg . "comments"}}
|
||||
</span>
|
||||
</div>
|
||||
<ul id="comments">
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="moreComments">
|
||||
<div class="hide comments-more">
|
||||
<a>More...</a>
|
||||
</div>
|
||||
<div class="comments-loading">
|
||||
<img src="/images/loading-32.gif" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{if eq .locale "zh"}}
|
||||
<div id="reportMsg" class="hide">
|
||||
<form class="report-form" name="reportForm">
|
||||
<ul class="options clearfix">
|
||||
<li><label><input required="" value="{{msg . "reportReason1"}}" name="reason" type="radio">{{msg . "reportReason1"}}</label></li>
|
||||
<li><label><input required="" value="{{msg . "reportReason2"}}" name="reason" type="radio">{{msg . "reportReason2"}}</label></li>
|
||||
<li><label><input required="" value="{{msg . "reportReason3"}}" name="reason" type="radio">{{msg . "reportReason3"}}</label></li>
|
||||
<li><label><input required="" value="{{msg . "reportReason4"}}" name="reason" type="radio">{{msg . "reportReason4"}}</label></li>
|
||||
<li><label><input required="" value="" name="reason" type="radio">{{msg . "other"}}</label></li>
|
||||
</ul>
|
||||
<p class="input-container" style="display: none">
|
||||
<input placeholder="{{msg . "reportReason"}}" type="text" name="detail" class="form-control reason-text basic-input" />
|
||||
</p>
|
||||
<p class="footnote"></p>
|
||||
</form>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{end}}
|
||||
|
||||
{{if and $.blogInfo.OpenComment (eq $.blogInfo.CommentType "disqus")}}
|
||||
|
||||
<div id="disqus_thread"></div>
|
||||
<!-- comment -->
|
||||
<script type="text/javascript">
|
||||
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
|
||||
var disqus_shortname = '{{.userBlog.DisqusId}}'; // required: replace example with your forum shortname
|
||||
var disqus_identifier = '{{.userBlog.UserId.Hex}}/{{.blog.NoteId.Hex}}/{{.blog.Title}}'; // 博客链接
|
||||
|
||||
/* * * DON'T EDIT BELOW THIS LINE * * */
|
||||
(function() {
|
||||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
||||
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||
})();
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
||||
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
|
||||
{{end}}
|
||||
@@ -0,0 +1,55 @@
|
||||
<div id="footerContainer">
|
||||
{{$userId := .userBlog.UserId.Hex}}
|
||||
<div class="container" id="footer">
|
||||
<div class="col-md-4">
|
||||
<h3>{{msg . "blogNavs"}}</h3>
|
||||
<ul>
|
||||
<li><a href="{{$.blogUrl}}/{{$.userInfo.Username}}">{{msg . "home"}}</a></li>
|
||||
{{range .notebooks}}
|
||||
<li>
|
||||
<a href="{{$.cateUrl}}/{{.NotebookId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
<li><a href="{{$.aboutMeUrl}}">{{msg . "aboutMe"}}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3>{{msg . "latestPosts"}}</h3>
|
||||
<ul>
|
||||
{{range .recentBlogs}}
|
||||
<li title="{{.Title}}"><a href="{{$.blogUrl}}/view/{{.NoteId.Hex}}/">{{.Title}}</a></li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3>{{msg . "quickLinks"}}</h3>
|
||||
<ul>
|
||||
<li><a href="{{$.noteUrl}}">{{msg . "myNote"}}</a></li>
|
||||
<li><a href="{{$.siteUrl}}/login">leanote {{msg . "login"}}</a></li>
|
||||
<li><a href="http://leanote.com" target="_blank">leanote {{msg . "home"}}</a></li>
|
||||
<li><a href="http://lea.leanote.com" target="_blank">lea++</a></li>
|
||||
<li><a href="http://bbs.leanote.com" target="_blank">leanote {{msg . "community"}}</a></li>
|
||||
<li><a href="https://github.com/leanote/leanote" target="_blank">leanote github</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="{{$.jQueryUrl}}"></script>
|
||||
<script src="{{$.bootstrapJsUrl}}"></script>
|
||||
<script src="{{$.siteUrl}}/js/bootstrap-hover-dropdown.js"></script>
|
||||
<script src="{{$.siteUrl}}/js/i18n/blog.{{.locale}}.js"></script>
|
||||
|
||||
<script>
|
||||
// 搜索
|
||||
function search(e) {
|
||||
var keywords = $("#searchInput").val();
|
||||
if(!keywords) {
|
||||
location.href = "{{$.searchUrl}}";
|
||||
} else {
|
||||
var tpl = '<form action="{{$.searchUrl}}" method="get">';
|
||||
tpl += '<input name="keywords" value="' + keywords + '" />';
|
||||
tpl += "</form";
|
||||
$(tpl).submit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,113 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="keywords" content="leanote,leanote.com">
|
||||
<meta name="description" content="leanote, {{msg $ "moto"}}">
|
||||
<meta name="author" content="leanote">
|
||||
|
||||
<title>{{.title}}</title>
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link href="{{$.bootstrapCssUrl}}" rel="stylesheet">
|
||||
<!-- 字体必须同一域 -->
|
||||
<link href="{{$.fontAwesomeUrl}}" rel="stylesheet">
|
||||
<link href="{{$.themeBaseUrl}}/style.css" rel="stylesheet">
|
||||
<link href="{{$.commentCssUrl}}" rel="stylesheet">
|
||||
<script>
|
||||
function log(o) {
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="headerAndNav" >
|
||||
<div id="headerContainer" class="container">
|
||||
<!-- 头部可放博客名, 导航 -->
|
||||
<div id="header">
|
||||
|
||||
{{$username := .userInfo.Username}}
|
||||
<h1>
|
||||
<a href="{{$.indexUrl}}" id="logo">
|
||||
{{if $.blogInfo.Logo}}
|
||||
<img src="{{$.blogInfo.Logo}}" title="{{$.blogInfo.Title}}"/>
|
||||
{{else}}
|
||||
{{$.blogInfo.Title | raw}}
|
||||
{{end}}
|
||||
</a>
|
||||
</h1>
|
||||
<div id="blogDesc">
|
||||
{{$.blogInfo.SubTitle | raw}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Static navbar -->
|
||||
<div class="navbar navbar-default">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="{{.indexUrl}}">
|
||||
{{if $.blogInfo.Logo}}
|
||||
|
||||
<img src="{{$.blogInfo.Logo}}" title="{{$.blogInfo.Title}}"/>
|
||||
{{else}}
|
||||
{{$.blogInfo.Title | raw}}
|
||||
{{end}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
|
||||
<li class="{{if $.curIsIndex}}active{{end}}"><a href="{{.indexUrl}}">主页</a></li>
|
||||
<!-- 分类页 -->
|
||||
{{range $.cates}}
|
||||
<li class="{{if eq .CateId $.curCateId}}active{{end}}">
|
||||
<a href="{{$.cateUrl}}/{{.CateId}}"
|
||||
>{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
<!-- 单页 -->
|
||||
{{range $.singles}}
|
||||
<li class="{{if eq $.curSingleId .SingleId}}active{{end}}">
|
||||
<a href="{{$.singleUrl}}/{{.SingleId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
|
||||
<!-- 归档 -->
|
||||
<li class="{{if $.curIsArchive}}active{{end}}">
|
||||
<a href="{{$.archiveUrl}}">归档</a>
|
||||
</li>
|
||||
<li class="{{if $.curIsTags}}active{{end}}">
|
||||
<a href="{{$.tagsUrl}}">标签</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<form class="navbar-form navbar-right" id="search" onsubmit="search(event);return false;">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="searchIcon" onclick="search(event);"><i class="fa fa-search"></i></span>
|
||||
<input type="text" placeholder="search" id="searchInput" class="form-control" value="{{.keywords}}">
|
||||
</div>
|
||||
</form>
|
||||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var UserInfo = {UserId: "{{$.blogInfo.UserId}}", Email: "{{.userInfo.Email}}", Username: "{{.userInfo.Username}}"};
|
||||
var UserBlogInfo={CanComment: {{.userBlog.CanComment}}, CommentType: "{{.userBlog.CommentType}}"};
|
||||
var indexUrl = "{{$.indexUrl}}";
|
||||
var viewUrl = "{{$.viewUrl}}";
|
||||
var blogUrl = "{{$.blogUrl}}";
|
||||
var staticUrl = "{{$.staticUrl}}"; // blog.leanote.com, life.leanote.com, aaa.com
|
||||
</script>
|
||||
@@ -0,0 +1,9 @@
|
||||
<!-- This file is Depreciated -->
|
||||
|
||||
<link href="/public/mdeditor/editor/google-code-prettify/prettify.css" type="text/css" rel="stylesheet">
|
||||
<script src="/public/mdeditor/editor/google-code-prettify/prettify.js"></script>
|
||||
|
||||
<script>
|
||||
$("pre").addClass("prettyprint linenums");
|
||||
prettyPrint();
|
||||
</script>
|
||||
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 109 KiB |
@@ -0,0 +1,39 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
|
||||
<div id="posts">
|
||||
{{range $.posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}.</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
After Width: | Height: | Size: 11 KiB |
@@ -0,0 +1 @@
|
||||
aaaaaaaaaaaaaaaaaaa
|
||||
@@ -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}}
|
||||
@@ -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="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}} |
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}</a>
|
||||
</div>
|
||||
|
||||
|
||||
{{else}}
|
||||
<div class="each-post">
|
||||
{{msg . "none"}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
{{template "blog/highlight.html"}}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,52 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div id="posts">
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
{{.single.Title}}
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-calendar"></i> {{msg . "updatedTime"}} {{$.single.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg . "createdTime"}} {{$.single.CreatedTime | datetime}}
|
||||
</div>
|
||||
|
||||
<!-- 仅为移动端 -->
|
||||
<div class="mobile-created-time">
|
||||
{{ if $.blogInfo.UserLogo}}
|
||||
<img src="{{$.blogInfo.UserLogo}}" id="userLogo">
|
||||
{{else}}
|
||||
<img src="{{$.siteUrl}}/images/blog/default_avatar.png" id="userLogo">
|
||||
{{end}}
|
||||
{{$.blogInfo.Username}}
|
||||
</div>
|
||||
|
||||
<div class="desc" id="content">
|
||||
{{$.single.Content | raw}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "footer.html" .}}
|
||||
|
||||
{{template "highlight.html"}}
|
||||
<div id="blogNav">
|
||||
<div id="blogNavNav">
|
||||
<i class="fa fa-align-justify" title="文档导航"></i>
|
||||
<span>{{msg . "blogNav"}}</span>
|
||||
</div>
|
||||
<div id="blogNavContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 一些公用的js -->
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/common.js"></script>
|
||||
<script>
|
||||
$(function() {
|
||||
initNav();
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,528 @@
|
||||
#posts img {
|
||||
max-width: 100%;
|
||||
}
|
||||
#content * {
|
||||
font-size: 16px;
|
||||
}
|
||||
#content h1 {
|
||||
font-size: 30px;
|
||||
}
|
||||
#content h2 {
|
||||
font-size: 24px;
|
||||
}
|
||||
#content h3 {
|
||||
font-size: 18px;
|
||||
}
|
||||
#content h4 {
|
||||
font-size: 14px;
|
||||
}
|
||||
@-webkit-keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-moz-keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-ms-keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-webkit-keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-moz-keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-ms-keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
a,
|
||||
.btn {
|
||||
-webkit-transition: all 0.2s ease;
|
||||
-moz-transition: all 0.2s ease;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
.btn:focus {
|
||||
outline: none;
|
||||
}
|
||||
ul.dropdown-menu {
|
||||
box-shadow: rgba(0, 0, 0, 0.172549) 0px 6px 12px 0px;
|
||||
}
|
||||
ul.dropdown-menu:before {
|
||||
content: "";
|
||||
width: 20px;
|
||||
height: 12px;
|
||||
position: absolute;
|
||||
top: -12px;
|
||||
right: 20px;
|
||||
background-image: url("../../images/triangle_2x.png");
|
||||
background-size: 20px 12px;
|
||||
}
|
||||
ul.dropdown-menu {
|
||||
display: block;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
}
|
||||
.open ul.dropdown-menu {
|
||||
-webkit-animation: pulldown .2s;
|
||||
animation: pulldown .2s;
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
.created-time .fa {
|
||||
color: #666;
|
||||
}
|
||||
#blogNav {
|
||||
display: none;
|
||||
background-color: #fff;
|
||||
opacity: 0.7;
|
||||
position: fixed;
|
||||
z-index: 10;
|
||||
padding: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
#blogNavContent {
|
||||
overflow-y: auto;
|
||||
max-height: 250px;
|
||||
display: none;
|
||||
-webkit-overflow-scrolling: touch !important;
|
||||
}
|
||||
#blogNavNav {
|
||||
cursor: pointer;
|
||||
}
|
||||
#blogNav a {
|
||||
color: #666;
|
||||
}
|
||||
#blogNav:hover {
|
||||
opacity: 0.9;
|
||||
}
|
||||
#blogNav a:hover {
|
||||
color: #0fb264;
|
||||
}
|
||||
#blogNav ul {
|
||||
padding-left: 20px;
|
||||
}
|
||||
#blogNav ul .nav-h2 {
|
||||
margin-left: 20px;
|
||||
}
|
||||
#blogNav ul .nav-h3 {
|
||||
margin-left: 30px;
|
||||
}
|
||||
#blogNav ul .nav-h4 {
|
||||
margin-left: 40px;
|
||||
}
|
||||
#blogNav ul .nav-h5 {
|
||||
margin-left: 50px;
|
||||
}
|
||||
.mobile-created-time {
|
||||
display: none;
|
||||
}
|
||||
#footer {
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.navbar-brand {
|
||||
display: none;
|
||||
}
|
||||
#themeList label {
|
||||
text-align: center;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
#themeList .preview {
|
||||
display: block;
|
||||
width: 400px;
|
||||
background: #fff;
|
||||
border: 1px solid #ccc;
|
||||
padding: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
src: local('Open Sans Light'), local('OpenSans-Light'), url('../../fonts/open-sans2/DXI1ORHCpsQm3Vp6mXoaTXhCUOGz7vYGh680lGh-uXM.woff') format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url('../../fonts/open-sans2/cJZKeOuBrn4kERxqtaUH3T8E0i7KZn-EPnyo3HZu7kw.woff') format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('Open Sans Bold'), local('OpenSans-Bold'), url('../../fonts/open-sans2/k3k702ZOKiLJc3WVjuplzHhCUOGz7vYGh680lGh-uXM.woff') format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url('../../fonts/open-sans2/xjAJXh38I15wypJXxuGMBobN6UDyHWBl620a-IRfuBk.woff') format('woff');
|
||||
}
|
||||
/*"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue", Helvetica, "Microsoft Yahei", Verdana, Simsun, "Segoe UI", "Segoe UI Web Regular", "Segoe UI Symbol", "BBAlpha Sans", "S60 Sans", Arial, sans-serif;*/
|
||||
::selection {
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
::-moz-selection {
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
::-webkit-selection {
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
*,
|
||||
body {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300;
|
||||
font-size: 14px;
|
||||
}
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300 !important;
|
||||
}
|
||||
a {
|
||||
cursor: pointer;
|
||||
}
|
||||
a:hover {
|
||||
text-decoration: none !important;
|
||||
}
|
||||
#headerContainer {
|
||||
height: 100px;
|
||||
background-color: #fff;
|
||||
}
|
||||
#posts {
|
||||
width: 845px;
|
||||
margin: auto;
|
||||
}
|
||||
#postsContainer {
|
||||
background: #f5f5f5 url("../../images/noise.png");
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
/* header */
|
||||
#header {
|
||||
color: #000000;
|
||||
position: relative;
|
||||
padding: 0 0 20px 0;
|
||||
margin-top: 15px;
|
||||
}
|
||||
#header h1 {
|
||||
margin: 0;
|
||||
font-size: 32px;
|
||||
}
|
||||
#header h1 a {
|
||||
color: #000000;
|
||||
font-size: 32px;
|
||||
}
|
||||
#header h1 a img {
|
||||
height: 40px;
|
||||
}
|
||||
#header #blogDesc {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.navbar {
|
||||
margin-bottom: 0;
|
||||
border-radius: 0;
|
||||
border: none;
|
||||
}
|
||||
.navbar-collapse {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
.navbar-form {
|
||||
padding: 0;
|
||||
}
|
||||
/* posts */
|
||||
#posts {
|
||||
padding-top: 10px;
|
||||
}
|
||||
#posts .each-post {
|
||||
border-bottom: 1px solid #ebeff2;
|
||||
margin-bottom: 10px;
|
||||
padding: 30px;
|
||||
background-color: #fff;
|
||||
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 3px;
|
||||
}
|
||||
#posts .each-post .title {
|
||||
font-size: 32px;
|
||||
color: #0fb264;
|
||||
padding: 0 0 15px 0;
|
||||
}
|
||||
#posts .each-post .title a {
|
||||
font-size: 32px;
|
||||
color: #0fb264;
|
||||
padding: 0 0 15px 0;
|
||||
}
|
||||
#posts .each-post .created-time {
|
||||
border-bottom: 1px solid #eee;
|
||||
padding-bottom: 3px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
#posts .each-post .more {
|
||||
background: #0fb264;
|
||||
padding: 9px 10px;
|
||||
border-radius: 2px;
|
||||
line-height: 1;
|
||||
font-size: 13px;
|
||||
display: inline-block;
|
||||
text-transform: uppercase;
|
||||
margin-top: 15px;
|
||||
margin-bottom: 15px;
|
||||
color: #fff;
|
||||
}
|
||||
#disqus_thread {
|
||||
border-top: 1px solid #eee;
|
||||
padding: 5px 0 0 0;
|
||||
}
|
||||
#search {
|
||||
width: 200px;
|
||||
}
|
||||
#footerContainer {
|
||||
background-color: #ffffff;
|
||||
color: #666666;
|
||||
}
|
||||
#footerContainer #footer a {
|
||||
color: #666666;
|
||||
}
|
||||
#footerContainer #footer ul {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding-left: 20px;
|
||||
}
|
||||
@media screen and (max-width: 600px) {
|
||||
html,
|
||||
body {
|
||||
overflow-x: hidden;
|
||||
background-color: #fbfcf7;
|
||||
}
|
||||
* {
|
||||
font-size: 16px;
|
||||
}
|
||||
#headerContainer,
|
||||
#footerContainer {
|
||||
background-color: #fbfcf7;
|
||||
margin: 10px 0;
|
||||
}
|
||||
#posts .each-post,
|
||||
#postsContainer {
|
||||
background-color: #fbfcf7 !important;
|
||||
}
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
#posts .each-post {
|
||||
padding: 10px;
|
||||
}
|
||||
#posts .each-post .title {
|
||||
font-size: 24px;
|
||||
border-left: 5px solid #65bd77;
|
||||
font-weight: bold;
|
||||
padding: 5px 0;
|
||||
padding-left: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.container {
|
||||
padding-right: 10px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
.created-time {
|
||||
display: none;
|
||||
}
|
||||
.mobile-created-time {
|
||||
display: block;
|
||||
}
|
||||
.mobile-created-time #userLogo {
|
||||
display: inline-block;
|
||||
max-height: 40px;
|
||||
width: 40px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
#content {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.right-section .dropdown,
|
||||
.right-section .btn {
|
||||
display: none !important;
|
||||
}
|
||||
#blogNav {
|
||||
left: initial !important;
|
||||
right: 10px !important;
|
||||
}
|
||||
#postsContainer .container,
|
||||
#footerContainer .container {
|
||||
max-width: 100%;
|
||||
}
|
||||
#postsContainer {
|
||||
margin: 0 !important;
|
||||
max-width: 100%;
|
||||
padding-top: 10px;
|
||||
background: #f5f5f5 url("../../images/noise.png");
|
||||
}
|
||||
#posts {
|
||||
max-width: 100% !important;
|
||||
}
|
||||
#footerContainer #footer a {
|
||||
padding: 3px;
|
||||
}
|
||||
#footerContainer #footer a:hover,
|
||||
#footerContainer #footer a:focus {
|
||||
color: #65bd77;
|
||||
}
|
||||
#headerAndNav {
|
||||
position: initial;
|
||||
text-align: left;
|
||||
width: 100%;
|
||||
border-bottom: 2px dashed #ebeff2;
|
||||
}
|
||||
#headerAndNav #headerContainer {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
padding-top: 30px;
|
||||
}
|
||||
#headerAndNav #header {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
#headerAndNav #header h1 {
|
||||
display: none;
|
||||
}
|
||||
#headerAndNav .navbar-collapse {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
#headerAndNav #blogDesc {
|
||||
border: none;
|
||||
margin-top: 20px;
|
||||
font-size: 24px;
|
||||
}
|
||||
#headerAndNav .navbar-brand {
|
||||
display: inline-block;
|
||||
line-height: 50px;
|
||||
padding: 0;
|
||||
padding-left: 10px;
|
||||
}
|
||||
#headerAndNav .navbar-brand img {
|
||||
height: 40px;
|
||||
}
|
||||
#headerAndNav .navbar .container {
|
||||
width: auto;
|
||||
padding: 0 15px;
|
||||
}
|
||||
#headerAndNav .navbar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
background: #fbfcf7;
|
||||
z-index: 1000;
|
||||
border-bottom: 1px solid #DEDDDF;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), inset 0 1px 0 #ffffff;
|
||||
background-color: #FDFFF5;
|
||||
}
|
||||
#headerAndNav .navbar-nav {
|
||||
margin: 0 10px;
|
||||
}
|
||||
#headerAndNav .navbar-nav a {
|
||||
padding-left: 10px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
#headerAndNav #search {
|
||||
width: 100%;
|
||||
margin: 10px;
|
||||
}
|
||||
#headerAndNav .navbar-form {
|
||||
border: none;
|
||||
}
|
||||
#myTab,
|
||||
.tab-content {
|
||||
padding: 0 10px;
|
||||
}
|
||||
}
|
||||
@@ -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="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}} |
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}</a>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="each-post">
|
||||
{{msg . "none"}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
{{template "blog/highlight.html"}}
|
||||
</body>
|
||||
</html>
|
||||
@@ -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}} <span class="label label-default">{{.Count}}</span>
|
||||
</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -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"}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div id="posts">
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
{{.post.Title}}
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .post.Tags}}
|
||||
{{blogTags $ .post.Tags}}
|
||||
{{else}}
|
||||
{{msg . "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg . "updatedTime"}} {{$.post.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg . "createdTime"}} {{$.post.CreatedTime | datetime}}
|
||||
</div>
|
||||
|
||||
<!-- 仅为移动端 -->
|
||||
<div class="mobile-created-time">
|
||||
{{ if $.blogInfo.UserLogo}}
|
||||
<img src="{{$.blogInfo.UserLogo}}" id="userLogo">
|
||||
{{else}}
|
||||
<img src="{{$.siteUrl}}/images/blog/default_avatar.png" id="userLogo">
|
||||
{{end}}
|
||||
{{$.blogInfo.Username}}
|
||||
|
||||
{{if .post.Tags}}
|
||||
|
||||
<i class="fa fa-bookmark-o" style="color: #666"></i>
|
||||
{{blogTags $ $.post.Tags}}
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
<div class="desc" id="content">
|
||||
{{if $.post.IsMarkdown }}
|
||||
<div id="markdownContent" style="display: none">
|
||||
<!-- 用textarea装html, 防止得到的值失真 -->
|
||||
<textarea>{{$.post.Content | raw}}</textarea>
|
||||
</div>
|
||||
<div style="padding: 20px; text-align: center">
|
||||
<img src="{{$.themeBaseUrl}}/images/loading-32.gif" />
|
||||
</div>
|
||||
{{else}}
|
||||
{{$.post.Content | raw}}
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
<div class="pre-next-post">
|
||||
<p>
|
||||
上一篇: {{if $.prePost}}<a href="{{$.viewUrl}}/{{$.prePost.NoteId}}">{{$.prePost.Title}}</a>{{else}}无{{end}}
|
||||
</p>
|
||||
<p>
|
||||
下一篇: {{if $.nextPost}}<a href="{{$.viewUrl}}/{{$.nextPost.NoteId}}">{{$.nextPost.Title}}</a>{{else}}无{{end}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- share & comment -->
|
||||
{{template "comment.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "footer.html" .}}
|
||||
|
||||
{{template "highlight.html"}}
|
||||
<div id="blogNav">
|
||||
<div id="blogNavNav">
|
||||
<i class="fa fa-align-justify" title="文档导航"></i>
|
||||
<span>{{msg . "blogNav"}}</span>
|
||||
</div>
|
||||
<div id="blogNavContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 一些在comment.js 需要使用的变量 -->
|
||||
<script>
|
||||
var visitUserInfo = eval("(" + {{.visitUserInfoJson}} + ")");
|
||||
var urlPrefix = "{{$.leanoteUrl}}";
|
||||
var noteId = "{{$.post.NoteId}}";
|
||||
var preLikeNum = +"{{.blog.likeNum}}";
|
||||
var commentNum = +"{{.blog.commentNum}}";
|
||||
</script>
|
||||
|
||||
<!-- 一些公用的js -->
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/common.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/jsrender.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/jquery-cookie-min.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/bootstrap-dialog.min.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/jquery.qrcode.min.js"></script>
|
||||
|
||||
<!-- share && comment -->
|
||||
<script src="{{$.themeBaseUrl}}/view.js"></script>
|
||||
|
||||
<!--
|
||||
markdown
|
||||
调用markdown来解析得到html
|
||||
-->
|
||||
|
||||
{{if $.post.IsMarkdown }}
|
||||
<script src="/public/mdeditor/editor/pagedown/Markdown.Converter.js"></script>
|
||||
<script src="/public/mdeditor/editor/pagedown/Markdown.Sanitizer.js"></script>
|
||||
<script src="/public/mdeditor/editor/pagedown/Markdown.Editor.js"></script>
|
||||
<script src="/public/mdeditor/editor/pagedown/local/Markdown.local.zh.js"></script>
|
||||
<script src="/public/mdeditor/editor/Markdown.Extra.js"></script>
|
||||
|
||||
<!--mathjax-->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ["\\(","\\)"]], processEscapes: true }, messageStyle: "none"});
|
||||
</script>
|
||||
<script src="/public/mdeditor/editor/mathJax.js"></script>
|
||||
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
|
||||
<script>
|
||||
var content = $.trim($("#markdownContent textarea").val());
|
||||
var converter = Markdown.getSanitizingConverter();
|
||||
Markdown.Extra.init(converter, {extensions: ["tables", "fenced_code_gfm", "def_list"]});
|
||||
var html = converter.makeHtml(content);
|
||||
$("#content").html(html);
|
||||
$("pre").addClass("prettyprint linenums");
|
||||
prettyPrint();
|
||||
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"wmd-preview"]);
|
||||
|
||||
initNav();
|
||||
weixin();
|
||||
</script>
|
||||
|
||||
<!-- 不是markdown -->
|
||||
{{else}}
|
||||
<script>
|
||||
$(function() {
|
||||
initNav();
|
||||
weixin();
|
||||
});
|
||||
</script>
|
||||
{{end}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,509 @@
|
||||
function scrollTo(self, tagName, text) {
|
||||
var iframe = $("#content");
|
||||
var target = iframe.find(tagName + ":contains(" + text + ")");
|
||||
|
||||
// 找到是第几个
|
||||
// 在nav是第几个
|
||||
var navs = $('#blogNavContent [data-a="' + tagName + '-' + encodeURI(text) + '"]');
|
||||
var len = navs.size();
|
||||
for(var i = 0; i < len; ++i) {
|
||||
if(navs[i] == self) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (target.size() >= i+1) {
|
||||
target = target.eq(i);
|
||||
// 之前插入, 防止多行定位不准
|
||||
var top = target.offset().top;
|
||||
if(LEA.isMobile) {
|
||||
top -= 50;
|
||||
}
|
||||
var nowTop = $(document).scrollTop();
|
||||
// 用$("body").scrllTop(10)没反应 firefox下
|
||||
$('html,body').animate({scrollTop: top}, 200);
|
||||
return;
|
||||
}
|
||||
}
|
||||
function genNav() {
|
||||
var $con = $("#content");
|
||||
var html = $con.html();
|
||||
// 构造一棵树
|
||||
// {"h1-title":{h2-title:{}}}
|
||||
var tree = [];//[{title: "xx", children:[{}]}, {title:"xx2"}];
|
||||
var hs = $con.find("h1,h2,h3,h4,h5,h6").toArray();
|
||||
var titles = '<ul>';
|
||||
for(var i = 0; i < hs.length; ++i) {
|
||||
var text = $(hs[i]).text();
|
||||
var tagName = hs[i].tagName.toLowerCase();
|
||||
// scrollTo在page.js中定义
|
||||
titles += '<li class="nav-' + tagName + '"><a data-a="' + tagName + '-' + encodeURI(text)+'" onclick="scrollTo(this, \'' + tagName + '\', \'' + text + '\')">' + text + '</a></li>';
|
||||
}
|
||||
titles += "</ul>";
|
||||
$("#blogNavContent").html(titles);
|
||||
if(!hs.length) {
|
||||
$("#blogNavContent").html(getMsg("none"));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function initNav() {
|
||||
var hasNav = genNav();
|
||||
if(!hasNav) {
|
||||
return;
|
||||
}
|
||||
|
||||
var $title = $(".title");
|
||||
var titlePos = $title.offset();
|
||||
var top = titlePos.top + 10;// - $title.height();
|
||||
// 手机下不要与标题在同一高度
|
||||
if(LEA.isMobile){
|
||||
top += 30;
|
||||
}
|
||||
if(top < 0) {
|
||||
top = 10;
|
||||
}
|
||||
|
||||
var left = $title.width() + titlePos.left - 100;
|
||||
$("#blogNav").css("top", top).css("left", left);
|
||||
$("#blogNav").show();
|
||||
|
||||
$("#blogNavNav").click(function() {
|
||||
var $o = $("#blogNavContent");
|
||||
if($o.is(":hidden")) {
|
||||
$o.show();
|
||||
} else {
|
||||
$o.hide();
|
||||
}
|
||||
});
|
||||
|
||||
var $d = $(document);
|
||||
function reNav() {
|
||||
var vtop = $d.scrollTop();
|
||||
if(vtop <= top) {
|
||||
$("#blogNav").css("top", top-vtop);
|
||||
} else {
|
||||
// 差距很磊了
|
||||
if(LEA.isMobile) {
|
||||
$("#blogNav").css("top", 50);
|
||||
} else {
|
||||
$("#blogNav").css("top", 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
reNav();
|
||||
$(window).scroll(reNav);
|
||||
}
|
||||
|
||||
var C = {
|
||||
info: null,
|
||||
noteId: noteId,
|
||||
preLikeNum: preLikeNum,
|
||||
commentNum: commentNum,
|
||||
likeBtnO: $("#likeBtn"),
|
||||
likeNumO: $("#likeNum"),
|
||||
tLikersO: $("#tLikers"),
|
||||
likersO: $("#likers"),
|
||||
tCommentsO: $("#tComments"),
|
||||
commentsO: $("#comments"),
|
||||
|
||||
commentBtnO: $("#commentBtn"),
|
||||
|
||||
commentsLoadingO: $(".comments-loading"),
|
||||
commentsMoreO: $(".comments-more"),
|
||||
|
||||
commentBoxO: $(".comment-box"),
|
||||
init: function() {
|
||||
var self = this;
|
||||
if(UserBlogInfo.CanComment && UserBlogInfo.CommentType != "disqus") {
|
||||
self.initLikeAndComments();
|
||||
} else {
|
||||
self.initLike();
|
||||
}
|
||||
self.initEvent();
|
||||
self.incReadNum();
|
||||
},
|
||||
incReadNum: function() {
|
||||
var self = this;
|
||||
if(!$.cookie(self.noteId)) {
|
||||
$.cookie(self.noteId, 1);
|
||||
ajaxGet(staticUrl + "/blog/incReadNum", {noteId: self.noteId});
|
||||
}
|
||||
},
|
||||
initLike: function() {
|
||||
var self = this;
|
||||
ajaxGet(staticUrl + "/blog/getLike", {noteId: self.noteId}, function(ret) {
|
||||
self.info = ret;
|
||||
self.toggleLikeBtnActive();
|
||||
self.renderLikers();
|
||||
});
|
||||
},
|
||||
initLikeAndComments: function() {
|
||||
var self = this;
|
||||
ajaxGet(staticUrl + "/blog/getLikeAndComments", {noteId: self.noteId}, function(ret) {
|
||||
self.info = ret;
|
||||
self.toggleLikeBtnActive();
|
||||
self.renderLikers();
|
||||
// 是否需要renderComments?
|
||||
self.info.commentUserInfo = self.info.commentUserInfo || {};
|
||||
// 为了防止第一条评论找不到用户信息情况
|
||||
if(visitUserInfo.UserId) {
|
||||
self.info.commentUserInfo[visitUserInfo.UserId] = visitUserInfo;
|
||||
}
|
||||
self.renderComments();
|
||||
|
||||
self.commentBoxO.removeClass("hide");
|
||||
self.commentsLoadingO.addClass("hide");
|
||||
if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) {
|
||||
self.commentsMoreO.removeClass("hide");
|
||||
self.initMoreComments();
|
||||
}
|
||||
});
|
||||
},
|
||||
initMoreComments: function() {
|
||||
var self = this;
|
||||
self.commentsMoreO.find("a").click(function(){
|
||||
if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) {
|
||||
self.commentsMoreO.addClass("hide");
|
||||
self.commentsLoadingO.removeClass("hide");
|
||||
ajaxGet(staticUrl + "/blog/listComments", {noteId: self.noteId, page: self.info.pageInfo.CurPage+1}, function(ret) {
|
||||
var pageInfo = ret.pageInfo;
|
||||
var comments = ret.comments;
|
||||
var commentUserInfo = ret.commentUserInfo;
|
||||
|
||||
$.extend(self.info.commentUserInfo, commentUserInfo);
|
||||
|
||||
// 渲染之
|
||||
for(var i in comments) {
|
||||
var comment = comments[i];
|
||||
comment = self.parseComment(comment);
|
||||
}
|
||||
var html = self.tCommentsO.render({comments: comments, visitUserInfo: visitUserInfo});
|
||||
self.commentsO.append(html);
|
||||
|
||||
self.info.pageInfo = pageInfo;
|
||||
|
||||
if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) {
|
||||
self.commentsMoreO.removeClass("hide");
|
||||
} else {
|
||||
self.commentsMoreO.addClass("hide");
|
||||
}
|
||||
|
||||
self.commentsLoadingO.addClass("hide");
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
addCommentRender: function(comment){
|
||||
var self = this;
|
||||
comment = self.parseComment(comment);
|
||||
var html = self.tCommentsO.render({blogUrl: blogUrl, comments: [comment], visitUserInfo: visitUserInfo});
|
||||
self.commentsO.prepend(html);
|
||||
var li = self.commentsO.find("li").eq(0);
|
||||
li.hide();
|
||||
li.show(500);
|
||||
li.addClass("item-highlight");
|
||||
setTimeout(function() {
|
||||
li.removeClass("item-highlight");
|
||||
}, 2000);
|
||||
},
|
||||
parseComment: function(comment) {
|
||||
var self = this;
|
||||
var authorUserId = UserInfo.UserId;
|
||||
commentUserInfo = self.info.commentUserInfo;
|
||||
comment.UserInfo = commentUserInfo[comment.UserId];
|
||||
// 是作者自己
|
||||
if(visitUserInfo.UserId == UserInfo.UserId) {
|
||||
comment.IsMyNote = true;
|
||||
}
|
||||
if(comment.UserId == authorUserId) {
|
||||
comment.IsAuthorComment = true;
|
||||
}
|
||||
if(comment.UserId == visitUserInfo.UserId) {
|
||||
comment.IsMyComment = true;
|
||||
}
|
||||
// 不是回复自己
|
||||
if(comment.ToUserId && comment.ToUserId != comment.UserId) {
|
||||
comment.ToUserInfo = commentUserInfo[comment.ToUserId];
|
||||
if(comment.ToUserInfo.UserId == UserInfo.UserId) {
|
||||
comment.ToUserIsAuthor = true;
|
||||
}
|
||||
}
|
||||
comment.PublishDate = getDateDiff(Date.parse(goNowToDatetime(comment.CreatedTime)));
|
||||
return comment;
|
||||
},
|
||||
// 渲染评论
|
||||
renderComments: function() {
|
||||
var self = this;
|
||||
var comments = self.info.comments || [];
|
||||
if(comments.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 整理数据
|
||||
// 回复谁, 是否是作者?
|
||||
// 回复日期, 几天前, 刚刚
|
||||
for(var i in comments) {
|
||||
var comment = comments[i];
|
||||
comment = self.parseComment(comment);
|
||||
}
|
||||
var html = self.tCommentsO.render({blogUrl: blogUrl, comments: comments, visitUserInfo: visitUserInfo});
|
||||
self.commentsO.html(html);
|
||||
},
|
||||
|
||||
// 重新渲染likers
|
||||
reRenderLikers: function(addMe) {
|
||||
var self = this;
|
||||
var likedUsers = self.info.likedUsers || [];
|
||||
for(var i = 0; i < likedUsers.length; ++i) {
|
||||
var user = likedUsers[i];
|
||||
if(user.UserId == visitUserInfo.UserId) {
|
||||
likedUsers.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(addMe) {
|
||||
likedUsers = [visitUserInfo].concat(likedUsers);
|
||||
self.info.likedUsers = likedUsers;
|
||||
}
|
||||
self.renderLikers();
|
||||
},
|
||||
renderLikers: function() {
|
||||
var self = this;
|
||||
var users = self.info.likedUsers || [];
|
||||
var html = self.tLikersO.render({blogUrl: blogUrl, users: users});
|
||||
self.likersO.html(html);
|
||||
},
|
||||
toggleLikeBtnActive: function() {
|
||||
var self = this;
|
||||
if(self.info.isILikeIt) {
|
||||
self.likeBtnO.addClass("active");
|
||||
} else {
|
||||
self.likeBtnO.removeClass("active");
|
||||
}
|
||||
},
|
||||
commentNumO: $("#commentNum"),
|
||||
bindCommentNum: function(fix) {
|
||||
var self = this;
|
||||
self.commentNum += fix;
|
||||
self.commentNumO.text(self.commentNum);
|
||||
},
|
||||
initEvent: function() {
|
||||
var self = this;
|
||||
|
||||
// like or not
|
||||
self.likeBtnO.click(function() {
|
||||
if(!visitUserInfo.UserId) {
|
||||
needLogin();
|
||||
return;
|
||||
}
|
||||
ajaxPost(staticUrl + "/blog/likeBlog", {noteId: self.noteId}, function(ret) {
|
||||
if(ret.Ok) {
|
||||
// like
|
||||
if(ret.Item) {
|
||||
var num = self.preLikeNum+1;
|
||||
} else {
|
||||
var num = self.preLikeNum-1;
|
||||
}
|
||||
self.preLikeNum = num >= 0 ? num : 0;
|
||||
self.likeNumO.text(self.preLikeNum);
|
||||
self.info.isILikeIt = ret.Item;
|
||||
self.toggleLikeBtnActive();
|
||||
|
||||
// 重新render likers
|
||||
// 我是否在列表中
|
||||
self.reRenderLikers(ret.Item);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 显示回复回复
|
||||
$("#comments").on("click", ".comment-reply", function() {
|
||||
var form = $(this).closest("li").find("form");
|
||||
if(form.is(":hidden")) {
|
||||
form.show();
|
||||
form.find("textarea").focus();
|
||||
} else {
|
||||
form.hide();
|
||||
}
|
||||
});
|
||||
$("#comments").on("click", ".reply-cancel", function() {
|
||||
$(this).closest("form").hide();
|
||||
});
|
||||
|
||||
// 回复
|
||||
$(".comment-box").on("click", ".reply-comment-btn", function(e) {
|
||||
e.preventDefault();
|
||||
var commentId = $(this).data("comment-id");
|
||||
var $form = $(this).closest("form");
|
||||
var $content = $form.find("textarea");
|
||||
var content = $.trim($content.val());
|
||||
if(!content) {
|
||||
$content.focus();
|
||||
return;
|
||||
}
|
||||
var t = $(this);
|
||||
t.button("loading");
|
||||
var data = {noteId: self.noteId, toCommentId: commentId, content: content};
|
||||
ajaxPost(staticUrl + "/blog/comment", data, function(ret) {
|
||||
t.button("reset");
|
||||
$content.val("");
|
||||
self.bindCommentNum(1);
|
||||
if(commentId) {
|
||||
$form.hide();
|
||||
}
|
||||
|
||||
if(commentId) {
|
||||
scrollToTarget("#comments", -200);
|
||||
}
|
||||
|
||||
// 添加一个
|
||||
self.addCommentRender(ret.Item);
|
||||
});
|
||||
});
|
||||
|
||||
// 删除
|
||||
$(".comment-box").on("click", ".comment-trash", function(e) {
|
||||
var commentId = $(this).parent().data("comment-id");
|
||||
var t = this;
|
||||
BootstrapDialog.confirm(getMsg("confirmDeleteComment"), function(yes) {
|
||||
if(yes) {
|
||||
ajaxPost(staticUrl + "/blog/deleteComment", {noteId: self.noteId, commentId: commentId}, function(ret) {
|
||||
if(ret.Ok) {
|
||||
var li = $(t).closest("li");
|
||||
li.hide(500); // remove();
|
||||
setTimeout(function() {
|
||||
li.remove();
|
||||
}, 300);
|
||||
|
||||
self.bindCommentNum(-1);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 点zan
|
||||
$(".comment-box").on("click", ".comment-like", function(e) {
|
||||
var commentId = $(this).parent().data("comment-id");
|
||||
var t = this;
|
||||
|
||||
ajaxPost(staticUrl + "/blog/likeComment", {commentId: commentId}, function(re) {
|
||||
if(re.Ok) {
|
||||
var ret = re.Item;
|
||||
if(ret.Num <= 0) {
|
||||
$(t).parent().find(".like-num").addClass("hide");
|
||||
} else {
|
||||
$(t).parent().find(".like-num").removeClass("hide");
|
||||
$(t).parent().find(".like-num-i").text(ret.Num)
|
||||
}
|
||||
if(ret.IsILikeIt) {
|
||||
$(t).find(".like-text").text(getMsg("unlike"));
|
||||
} else {
|
||||
$(t).find(".like-text").text(getMsg('like'));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 举报
|
||||
function report(commentId, noteId, title) {
|
||||
var form = $("#reportMsg").html();
|
||||
var body;
|
||||
var input;
|
||||
var isOver = false;
|
||||
var modal = BootstrapDialog.show({
|
||||
title: title,
|
||||
message: form,
|
||||
nl2br: false,
|
||||
buttons: [{
|
||||
label: getMsg("cancel"),
|
||||
action: function(dialog) {
|
||||
dialog.close();
|
||||
}
|
||||
}, {
|
||||
label: getMsg("confirm"),
|
||||
cssClass: 'btn-primary',
|
||||
action: function(dialog) {
|
||||
if(isOver) {
|
||||
dialog.close();
|
||||
}
|
||||
var val = body.find("input[type='radio']:checked").val();
|
||||
if(!val) {
|
||||
var val = body.find(".input-container input").val();
|
||||
}
|
||||
if(!val) {
|
||||
body.find(".footnote").html(getMsg("chooseReason"));
|
||||
return;
|
||||
}
|
||||
ajaxPost(staticUrl + "/blog/report", {commentId: commentId, noteId: noteId, reason: val}, function(re) {
|
||||
isOver = true;
|
||||
if(reIsOk(re)) {
|
||||
body.html(getMsg("reportSuccess"));
|
||||
} else {
|
||||
body.html(getMsg("error"));
|
||||
}
|
||||
setTimeout(function() {
|
||||
dialog.close();
|
||||
}, 3000);
|
||||
});
|
||||
}
|
||||
}]
|
||||
});
|
||||
body = modal.getModalBody();
|
||||
input = body.find(".input-container");
|
||||
body.find("input[type='radio']").click(function(){
|
||||
if(!$(this).val()) {
|
||||
input.show();
|
||||
input.find("input").focus();
|
||||
} else {
|
||||
input.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
$(".comment-box").on("click", ".comment-report", function() {
|
||||
if(needLogin()) {
|
||||
return;
|
||||
}
|
||||
var commentId = $(this).parent().data("comment-id");
|
||||
report(commentId, self.noteId, getMsg("reportComment?"));
|
||||
});
|
||||
$("#reportBtn").click(function() {
|
||||
if(needLogin()) {
|
||||
return;
|
||||
}
|
||||
report("", self.noteId, getMsg("reportBlog?"));
|
||||
});
|
||||
|
||||
self.initShare();
|
||||
},
|
||||
weixinQRCodeO: $("#weixinQRCode"),
|
||||
initShare: function() {
|
||||
var self = this;
|
||||
$(".btn-weixin").click(function() {
|
||||
if(!self.weixinQRCodeO.html()) {
|
||||
self.weixinQRCodeO.qrcode(viewUrl + "/" + self.noteId);
|
||||
}
|
||||
BootstrapDialog.show({
|
||||
title: getMsg('scanQRCode'),
|
||||
message: self.weixinQRCodeO
|
||||
});
|
||||
});
|
||||
|
||||
$(".btn-share").click(function() {
|
||||
var $this = $(this);
|
||||
var map = {"btn-weibo": shareSinaWeibo, "tencent-weibo": shareTencentWeibo, "qq": shareQQ, "renren": shareRenRen};
|
||||
for(var i in map) {
|
||||
if($this.hasClass(i)) {
|
||||
map[i](self.noteId, document.title);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
C.init();
|
||||
});
|
||||
@@ -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>
|
||||
{{.PublicTime|date}} <a href="{{$.viewUrl}}/{{.NoteId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,41 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>分类 - {{$.curCateTitle}}</h2>
|
||||
</div>
|
||||
<div id="posts">
|
||||
{{range $.posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}.</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,204 @@
|
||||
<!-- 赞 -->
|
||||
<div class="entry-controls clearfix">
|
||||
<div class="vote-section-wrapper clearfix">
|
||||
<button class="btn btn-default btn-zan" id="likeBtn"><i class="fa fa-thumbs-o-up"></i> <span id="likeNum">{{.blog.LikeNum}}</span> {{msg . "like"}}</button>
|
||||
<span class="control-item read-counts"><i class="fa fa-eye"></i> {{if .blog.ReadNum}}{{.blog.ReadNum}}{{else}}1{{end}} {{msg . "viewers"}}</span>
|
||||
</div>
|
||||
<div class="right-section">
|
||||
<div id="weixinQRCode"></div>
|
||||
<!-- google+
|
||||
<g:plusone size=”medium”></g:plusone>
|
||||
-->
|
||||
<button class="btn btn-share btn-default btn-weibo"><i class="fa fa-weibo"></i> {{msg . "sinaWeibo"}}</button>
|
||||
<button class="btn btn-share btn-default btn-weixin"><i class="fa fa-wechat"></i> {{msg . "weixin"}}</button>
|
||||
<div class="dropdown" style="display: inline-block; cursor: pointer; padding: 5px 10px;">
|
||||
<!-- open -->
|
||||
<div class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown">
|
||||
<i class="fa fa-share-square-o"></i>
|
||||
{{msg . "moreShare"}}
|
||||
</div>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="#" class="btn-share tencent-weibo"><i class="fa fa-tencent-weibo"></i> {{msg . "tencentWeibo"}}</a></li>
|
||||
<li><a href="#" class="btn-share qq"><i class="fa fa-qq"></i> {{msg . "qqZone"}}</a></li>
|
||||
<li><a href="#" class="btn-share renren"><i class="fa fa-renren"></i> {{msg . "renren"}}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- 举报 -->
|
||||
{{if eq .locale "zh"}}
|
||||
<div style="display: inline-block">
|
||||
<a id="reportBtn"><i class="fa fa-flag-o"></i> {{msg . "report"}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="voters clearfix" id="likers">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/x-jsrender" id="tLikers">
|
||||
[[for users]]
|
||||
<a id="liker_[[:UserId]]" href="[[:~root.blogUrl]]/[[:Username]]" target="_blank" class="voter">
|
||||
[[if Logo]]
|
||||
<img alt="avatar" class="avatar-small" src="[[:Logo]]">
|
||||
[[else]]
|
||||
<img alt="avatar" class="avatar-small" src="/images/blog/default_avatar.png">
|
||||
[[/if]]
|
||||
</a>
|
||||
[[/for]]
|
||||
</script>
|
||||
{{if and .userBlog.CanComment (not (eq .userBlog.CommentType "disqus"))}}
|
||||
|
||||
<script type="text/x-jsrender" id="tComments">
|
||||
[[for comments]]
|
||||
<li class="comment-item">
|
||||
<!-- 头像 -->
|
||||
<a ui-hovercard="" target="_blank" class="avatar-link" title="[[:UserInfo.Username]]" href="[[:~root.blogUrl]]/[[:UserInfo.Username]]">
|
||||
<img class="avatar" src="[[:UserInfo.Logo]]">
|
||||
</a>
|
||||
<!-- 评论 -->
|
||||
<div class="comment-body">
|
||||
<div class="comment-hd">
|
||||
<a href="[[:~root.blogUrl]]/[[:UserInfo.Username]]" target="_blank" >[[:UserInfo.Username]]</a>
|
||||
[[if IsAuthorComment]]
|
||||
<span>({{msg . "author"}})</span>
|
||||
[[/if]]
|
||||
|
||||
<!-- 回复其它人 -->
|
||||
[[if ToUserInfo]]
|
||||
<span class="in-reply-to">
|
||||
{{rawMsg . "reply"}}
|
||||
<a href="[[:~root.blogUrl]]/[[:ToUserInfo.Username]]">[[:ToUserInfo.Username]]</a>
|
||||
</span>
|
||||
[[if ToUserIsAuthor]]
|
||||
<span>({{msg . "author"}})</span>
|
||||
[[/if]]
|
||||
[[/if]]
|
||||
</div>
|
||||
<div class="comment-content ng-binding" ng-bind-html="comment.content">
|
||||
[[html:Content]]
|
||||
</div>
|
||||
<div class="comment-ft clearfix" data-comment-id="[[:CommentId]]" >
|
||||
<span title="" ui-time="" class="date">[[:PublishDate]] </span>
|
||||
<span class="like-num [[if !LikeNum]]hide[[/if]]" title="[[:LikeNum]] {{rawMsg . "like"}}"><span class="like-num-i">[[:LikeNum]]</span> {{rawMsg . "like"}}</span></span>
|
||||
|
||||
[[if ~root.visitUserInfo.UserId]]
|
||||
[[if IsMyNote && !IsMyComment]]
|
||||
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> {{rawMsg . "delete"}}</a>
|
||||
[[/if]]
|
||||
[[if !IsMyComment]]
|
||||
<a href="javascript:;" class="comment-reply op-link ">
|
||||
<i class="fa fa-reply"></i>
|
||||
{{rawMsg . "reply"}}
|
||||
</a>
|
||||
<a href="javascript:;" class="comment-like op-link"><i class="fa fa-thumbs-o-up"></i> <span class="like-text">[[if IsILikeIt]]{{rawMsg . "unlike"}}[[else]]{{rawMsg . "like"}}[[/if]]</span></a>
|
||||
{{if eq .locale "zh"}}
|
||||
<a href="javascript:;" class="comment-report op-link "><i class="fa fa-flag-o"></i> {{rawMsg . "report"}}</a>
|
||||
{{end}}
|
||||
[[else]]
|
||||
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> {{rawMsg . "delete"}}</a>
|
||||
[[/if]]
|
||||
[[/if]]
|
||||
</div>
|
||||
|
||||
<!-- 回复该评论 -->
|
||||
[[if ~root.visitUserInfo.UserId]]
|
||||
<form class="comment-form comment-box-ft">
|
||||
<div class="clearfix">
|
||||
<div class="avatar-wrap">
|
||||
<img class="avatar" src="[[:~root.visitUserInfo.Logo]]">
|
||||
</div>
|
||||
<div class="editor-wrap">
|
||||
<textarea class="editable" id="commentContent" name="commentContent" placeholder="{{rawMsg . "reply"}}"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="command clearfix" style="display: block;">
|
||||
<button class="reply-comment-btn save btn btn-primary" data-comment-id="[[:CommentId]]">{{rawMsg . "comment"}}</button>
|
||||
<a class="cancel reply-cancel btn-link">{{rawMsg . "cancel"}}</a>
|
||||
</div>
|
||||
</form>
|
||||
[[/if]]
|
||||
</div>
|
||||
</li>
|
||||
[[/for]]
|
||||
</script>
|
||||
|
||||
<!-- 评论 -->
|
||||
<div class="comment-box hide">
|
||||
{{if .visitUserInfo.UserId}}
|
||||
<form class="comment-form comment-box-ft" id="commentForm">
|
||||
<div class="clearfix">
|
||||
<div class="avatar-wrap">
|
||||
<img class="avatar" src="{{.visitUserInfo.Logo}}">
|
||||
</div>
|
||||
<div class="editor-wrap">
|
||||
<textarea class="editable" id="commentContent" name="commentContent" placeholder="{{msg . "comment"}}" style="height: 100px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="command clearfix" style="display: block;">
|
||||
<button id="commentBtn" class="reply-comment-btn save btn btn-primary">{{msg . "comment"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
{{else}}
|
||||
<div class="needLogin">
|
||||
<a onclick="goLogin()">{{msg . "signIn"}}</a>, {{msg . "submitComment"}}.
|
||||
<br />
|
||||
没有帐号? <a onclick="goRegister()">{{msg . "signUp"}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="box-header">
|
||||
<span class="counter">
|
||||
<i class="icon icon-comment"></i><span id="commentNum">{{.blog.CommentNum}}</span> {{msg . "comments"}}
|
||||
</span>
|
||||
</div>
|
||||
<ul id="comments">
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="moreComments">
|
||||
<div class="hide comments-more">
|
||||
<a>More...</a>
|
||||
</div>
|
||||
<div class="comments-loading">
|
||||
<img src="/images/loading-32.gif" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{if eq .locale "zh"}}
|
||||
<div id="reportMsg" class="hide">
|
||||
<form class="report-form" name="reportForm">
|
||||
<ul class="options clearfix">
|
||||
<li><label><input required="" value="{{msg . "reportReason1"}}" name="reason" type="radio">{{msg . "reportReason1"}}</label></li>
|
||||
<li><label><input required="" value="{{msg . "reportReason2"}}" name="reason" type="radio">{{msg . "reportReason2"}}</label></li>
|
||||
<li><label><input required="" value="{{msg . "reportReason3"}}" name="reason" type="radio">{{msg . "reportReason3"}}</label></li>
|
||||
<li><label><input required="" value="{{msg . "reportReason4"}}" name="reason" type="radio">{{msg . "reportReason4"}}</label></li>
|
||||
<li><label><input required="" value="" name="reason" type="radio">{{msg . "other"}}</label></li>
|
||||
</ul>
|
||||
<p class="input-container" style="display: none">
|
||||
<input placeholder="{{msg . "reportReason"}}" type="text" name="detail" class="form-control reason-text basic-input" />
|
||||
</p>
|
||||
<p class="footnote"></p>
|
||||
</form>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{end}}
|
||||
|
||||
{{if and $.blogInfo.OpenComment (eq $.blogInfo.CommentType "disqus")}}
|
||||
|
||||
<div id="disqus_thread"></div>
|
||||
<!-- comment -->
|
||||
<script type="text/javascript">
|
||||
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
|
||||
var disqus_shortname = '{{.userBlog.DisqusId}}'; // required: replace example with your forum shortname
|
||||
var disqus_identifier = '{{.userBlog.UserId.Hex}}/{{.blog.NoteId.Hex}}/{{.blog.Title}}'; // 博客链接
|
||||
|
||||
/* * * DON'T EDIT BELOW THIS LINE * * */
|
||||
(function() {
|
||||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
||||
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||
})();
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
||||
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
|
||||
{{end}}
|
||||
@@ -0,0 +1,55 @@
|
||||
<div id="footerContainer">
|
||||
{{$userId := .userBlog.UserId.Hex}}
|
||||
<div class="container" id="footer">
|
||||
<div class="col-md-4">
|
||||
<h3>{{msg . "blogNavs"}}</h3>
|
||||
<ul>
|
||||
<li><a href="{{$.blogUrl}}/{{$.userInfo.Username}}">{{msg . "home"}}</a></li>
|
||||
{{range .notebooks}}
|
||||
<li>
|
||||
<a href="{{$.cateUrl}}/{{.NotebookId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
<li><a href="{{$.aboutMeUrl}}">{{msg . "aboutMe"}}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3>{{msg . "latestPosts"}}</h3>
|
||||
<ul>
|
||||
{{range .recentBlogs}}
|
||||
<li title="{{.Title}}"><a href="{{$.blogUrl}}/view/{{.NoteId.Hex}}/">{{.Title}}</a></li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3>{{msg . "quickLinks"}}</h3>
|
||||
<ul>
|
||||
<li><a href="{{$.noteUrl}}">{{msg . "myNote"}}</a></li>
|
||||
<li><a href="{{$.siteUrl}}/login">leanote {{msg . "login"}}</a></li>
|
||||
<li><a href="http://leanote.com" target="_blank">leanote {{msg . "home"}}</a></li>
|
||||
<li><a href="http://lea.leanote.com" target="_blank">lea++</a></li>
|
||||
<li><a href="http://bbs.leanote.com" target="_blank">leanote {{msg . "community"}}</a></li>
|
||||
<li><a href="https://github.com/leanote/leanote" target="_blank">leanote github</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="{{$.jQueryUrl}}"></script>
|
||||
<script src="{{$.bootstrapJsUrl}}"></script>
|
||||
<script src="{{$.siteUrl}}/js/bootstrap-hover-dropdown.js"></script>
|
||||
<script src="{{$.siteUrl}}/js/i18n/blog.{{.locale}}.js"></script>
|
||||
|
||||
<script>
|
||||
// 搜索
|
||||
function search(e) {
|
||||
var keywords = $("#searchInput").val();
|
||||
if(!keywords) {
|
||||
location.href = "{{$.searchUrl}}";
|
||||
} else {
|
||||
var tpl = '<form action="{{$.searchUrl}}" method="get">';
|
||||
tpl += '<input name="keywords" value="' + keywords + '" />';
|
||||
tpl += "</form";
|
||||
$(tpl).submit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,113 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="keywords" content="leanote,leanote.com">
|
||||
<meta name="description" content="leanote, {{msg $ "moto"}}">
|
||||
<meta name="author" content="leanote">
|
||||
|
||||
<title>我的博客</title>
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link href="{{$.bootstrapCssUrl}}" rel="stylesheet">
|
||||
<!-- 字体必须同一域 -->
|
||||
<link href="{{$.fontAwesomeUrl}}" rel="stylesheet">
|
||||
<link href="{{$.themeBaseUrl}}/style.css" rel="stylesheet">
|
||||
<link href="{{$.commentCssUrl}}" rel="stylesheet">
|
||||
<script>
|
||||
function log(o) {
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="headerAndNav" >
|
||||
<div id="headerContainer" class="container">
|
||||
<!-- 头部可放博客名, 导航 -->
|
||||
<div id="header">
|
||||
|
||||
{{$username := .userInfo.Username}}
|
||||
<h1>
|
||||
<a href="{{$.indexUrl}}" id="logo">
|
||||
{{if $.blogInfo.Logo}}
|
||||
<img src="{{$.blogInfo.Logo}}" title="{{$.blogInfo.Title}}"/>
|
||||
{{else}}
|
||||
{{$.blogInfo.Title | raw}}
|
||||
{{end}}
|
||||
</a>
|
||||
</h1>
|
||||
<div id="blogDesc">
|
||||
{{$.blogInfo.SubTitle | raw}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Static navbar -->
|
||||
<div class="navbar navbar-default">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="{{.indexUrl}}">
|
||||
{{if $.blogInfo.Logo}}
|
||||
|
||||
<img src="{{$.blogInfo.Logo}}" title="{{$.blogInfo.Title}}"/>
|
||||
{{else}}
|
||||
{{$.blogInfo.Title | raw}}
|
||||
{{end}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
|
||||
<li class="{{if $.curIsIndex}}active{{end}}"><a href="{{.indexUrl}}">主页</a></li>
|
||||
<!-- 分类页 -->
|
||||
{{range $.cates}}
|
||||
<li class="{{if eq .CateId $.curCateId}}active{{end}}">
|
||||
<a href="{{$.cateUrl}}/{{.CateId}}"
|
||||
>{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
<!-- 单页 -->
|
||||
{{range $.singles}}
|
||||
<li class="{{if eq $.curSingleId .SingleId}}active{{end}}">
|
||||
<a href="{{$.singleUrl}}/{{.SingleId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
|
||||
<!-- 归档 -->
|
||||
<li class="{{if $.curIsArchive}}active{{end}}">
|
||||
<a href="{{$.archiveUrl}}">归档</a>
|
||||
</li>
|
||||
<li class="{{if $.curIsTags}}active{{end}}">
|
||||
<a href="{{$.tagsUrl}}">标签</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<form class="navbar-form navbar-right" id="search" onsubmit="search(event);return false;">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="searchIcon" onclick="search(event);"><i class="fa fa-search"></i></span>
|
||||
<input type="text" placeholder="search" id="searchInput" class="form-control" value="{{.keywords}}">
|
||||
</div>
|
||||
</form>
|
||||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var UserInfo = {UserId: "{{$.blogInfo.UserId}}", Email: "{{.userInfo.Email}}", Username: "{{.userInfo.Username}}"};
|
||||
var UserBlogInfo={CanComment: {{.userBlog.CanComment}}, CommentType: "{{.userBlog.CommentType}}"};
|
||||
var indexUrl = "{{$.indexUrl}}";
|
||||
var viewUrl = "{{$.viewUrl}}";
|
||||
var blogUrl = "{{$.blogUrl}}";
|
||||
var staticUrl = "{{$.staticUrl}}"; // blog.leanote.com, life.leanote.com, aaa.com
|
||||
</script>
|
||||
@@ -0,0 +1,9 @@
|
||||
<!-- This file is Depreciated -->
|
||||
|
||||
<link href="/public/mdeditor/editor/google-code-prettify/prettify.css" type="text/css" rel="stylesheet">
|
||||
<script src="/public/mdeditor/editor/google-code-prettify/prettify.js"></script>
|
||||
|
||||
<script>
|
||||
$("pre").addClass("prettyprint linenums");
|
||||
prettyPrint();
|
||||
</script>
|
||||
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 83 KiB |
@@ -0,0 +1,39 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
|
||||
<div id="posts">
|
||||
{{range $.posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}.</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1 @@
|
||||
aaaaaaaaaaaaaaaaaaa
|
||||
@@ -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}}
|
||||
@@ -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="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}} |
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}</a>
|
||||
</div>
|
||||
|
||||
|
||||
{{else}}
|
||||
<div class="each-post">
|
||||
{{msg . "none"}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
{{template "blog/highlight.html"}}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,52 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div id="posts">
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
{{.single.Title}}
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-calendar"></i> {{msg . "updatedTime"}} {{$.single.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg . "createdTime"}} {{$.single.CreatedTime | datetime}}
|
||||
</div>
|
||||
|
||||
<!-- 仅为移动端 -->
|
||||
<div class="mobile-created-time">
|
||||
{{ if $.blogInfo.UserLogo}}
|
||||
<img src="{{$.blogInfo.UserLogo}}" id="userLogo">
|
||||
{{else}}
|
||||
<img src="{{$.siteUrl}}/images/blog/default_avatar.png" id="userLogo">
|
||||
{{end}}
|
||||
{{$.blogInfo.Username}}
|
||||
</div>
|
||||
|
||||
<div class="desc" id="content">
|
||||
{{$.single.Content | raw}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "footer.html" .}}
|
||||
|
||||
{{template "highlight.html"}}
|
||||
<div id="blogNav">
|
||||
<div id="blogNavNav">
|
||||
<i class="fa fa-align-justify" title="文档导航"></i>
|
||||
<span>{{msg . "blogNav"}}</span>
|
||||
</div>
|
||||
<div id="blogNavContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 一些公用的js -->
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/common.js"></script>
|
||||
<script>
|
||||
$(function() {
|
||||
initNav();
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,542 @@
|
||||
#posts img {
|
||||
max-width: 100%;
|
||||
}
|
||||
#content * {
|
||||
font-size: 16px;
|
||||
}
|
||||
#content h1 {
|
||||
font-size: 30px;
|
||||
}
|
||||
#content h2 {
|
||||
font-size: 24px;
|
||||
}
|
||||
#content h3 {
|
||||
font-size: 18px;
|
||||
}
|
||||
#content h4 {
|
||||
font-size: 14px;
|
||||
}
|
||||
@-webkit-keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-moz-keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-ms-keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@keyframes dropdown {
|
||||
0% {
|
||||
margin-top: -25px;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
margin-top: 2px;
|
||||
}
|
||||
100% {
|
||||
margin-top: 0;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-webkit-keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-moz-keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@-ms-keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
@keyframes pulldown {
|
||||
0% {
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
90% {
|
||||
top: 90%;
|
||||
}
|
||||
100% {
|
||||
top: 100%;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
a,
|
||||
.btn {
|
||||
-webkit-transition: all 0.2s ease;
|
||||
-moz-transition: all 0.2s ease;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
.btn:focus {
|
||||
outline: none;
|
||||
}
|
||||
ul.dropdown-menu {
|
||||
box-shadow: rgba(0, 0, 0, 0.172549) 0px 6px 12px 0px;
|
||||
}
|
||||
ul.dropdown-menu:before {
|
||||
content: "";
|
||||
width: 20px;
|
||||
height: 12px;
|
||||
position: absolute;
|
||||
top: -12px;
|
||||
right: 20px;
|
||||
background-image: url("../../images/triangle_2x.png");
|
||||
background-size: 20px 12px;
|
||||
}
|
||||
ul.dropdown-menu {
|
||||
display: block;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
}
|
||||
.open ul.dropdown-menu {
|
||||
-webkit-animation: pulldown .2s;
|
||||
animation: pulldown .2s;
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
.created-time .fa {
|
||||
color: #666;
|
||||
}
|
||||
#blogNav {
|
||||
display: none;
|
||||
background-color: #fff;
|
||||
opacity: 0.7;
|
||||
position: fixed;
|
||||
z-index: 10;
|
||||
padding: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
#blogNavContent {
|
||||
overflow-y: auto;
|
||||
max-height: 250px;
|
||||
display: none;
|
||||
-webkit-overflow-scrolling: touch !important;
|
||||
}
|
||||
#blogNavNav {
|
||||
cursor: pointer;
|
||||
}
|
||||
#blogNav a {
|
||||
color: #666;
|
||||
}
|
||||
#blogNav:hover {
|
||||
opacity: 0.9;
|
||||
}
|
||||
#blogNav a:hover {
|
||||
color: #0fb264;
|
||||
}
|
||||
#blogNav ul {
|
||||
padding-left: 20px;
|
||||
}
|
||||
#blogNav ul .nav-h2 {
|
||||
margin-left: 20px;
|
||||
}
|
||||
#blogNav ul .nav-h3 {
|
||||
margin-left: 30px;
|
||||
}
|
||||
#blogNav ul .nav-h4 {
|
||||
margin-left: 40px;
|
||||
}
|
||||
#blogNav ul .nav-h5 {
|
||||
margin-left: 50px;
|
||||
}
|
||||
.mobile-created-time {
|
||||
display: none;
|
||||
}
|
||||
#footer {
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.navbar-brand {
|
||||
display: none;
|
||||
}
|
||||
#themeList label {
|
||||
text-align: center;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
#themeList .preview {
|
||||
display: block;
|
||||
width: 400px;
|
||||
background: #fff;
|
||||
border: 1px solid #ccc;
|
||||
padding: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
src: local('Open Sans Light'), local('OpenSans-Light'), url('../../fonts/open-sans2/DXI1ORHCpsQm3Vp6mXoaTXhCUOGz7vYGh680lGh-uXM.woff') format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans'), local('OpenSans'), url('../../fonts/open-sans2/cJZKeOuBrn4kERxqtaUH3T8E0i7KZn-EPnyo3HZu7kw.woff') format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: local('Open Sans Bold'), local('OpenSans-Bold'), url('../../fonts/open-sans2/k3k702ZOKiLJc3WVjuplzHhCUOGz7vYGh680lGh-uXM.woff') format('woff');
|
||||
}
|
||||
@font-face {
|
||||
font-family: 'Open Sans';
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: local('Open Sans Italic'), local('OpenSans-Italic'), url('../../fonts/open-sans2/xjAJXh38I15wypJXxuGMBobN6UDyHWBl620a-IRfuBk.woff') format('woff');
|
||||
}
|
||||
/*"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue", Helvetica, "Microsoft Yahei", Verdana, Simsun, "Segoe UI", "Segoe UI Web Regular", "Segoe UI Symbol", "BBAlpha Sans", "S60 Sans", Arial, sans-serif;*/
|
||||
::selection {
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
::-moz-selection {
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
::-webkit-selection {
|
||||
background: #000000;
|
||||
color: #ffffff;
|
||||
}
|
||||
*,
|
||||
body {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300;
|
||||
font-size: 14px;
|
||||
}
|
||||
h1,
|
||||
h2,
|
||||
h3 {
|
||||
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
|
||||
font-weight: 300 !important;
|
||||
}
|
||||
a {
|
||||
cursor: pointer;
|
||||
}
|
||||
a:hover {
|
||||
text-decoration: underline !important;
|
||||
}
|
||||
#headerContainer {
|
||||
height: 230px;
|
||||
background-color: #fff;
|
||||
}
|
||||
#posts {
|
||||
width: 745px;
|
||||
margin: auto;
|
||||
}
|
||||
#postsContainer {
|
||||
background: #f5f5f5 url("../../images/noise.png");
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
/* header */
|
||||
#header {
|
||||
color: #000000;
|
||||
position: relative;
|
||||
padding: 0 0 20px 0;
|
||||
margin-top: 65px;
|
||||
}
|
||||
#header h1 {
|
||||
margin: 0;
|
||||
}
|
||||
#header h1 a {
|
||||
font-size: 48px;
|
||||
font-weight: bold;
|
||||
color: #000000;
|
||||
}
|
||||
#header h1 a img {
|
||||
height: 40px;
|
||||
}
|
||||
#header #blogDesc {
|
||||
font-size: 32px;
|
||||
font-style: italic;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.navbar {
|
||||
background-color: #f7f5e7;
|
||||
margin-bottom: 0;
|
||||
border-radius: 0;
|
||||
border: none;
|
||||
}
|
||||
.nav li a:hover {
|
||||
background-color: #000000 !important;
|
||||
color: #ffffff !important;
|
||||
}
|
||||
.nav li.active a {
|
||||
background-color: #f7f5e7 !important;
|
||||
color: #bc360a !important;
|
||||
}
|
||||
.navbar-collapse {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
.navbar-form {
|
||||
padding: 0;
|
||||
}
|
||||
/* posts */
|
||||
#posts {
|
||||
padding-top: 10px;
|
||||
}
|
||||
#posts .each-post {
|
||||
border-bottom: 1px solid #ebeff2;
|
||||
margin-bottom: 10px;
|
||||
padding: 30px;
|
||||
background-color: #fff;
|
||||
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 3px;
|
||||
}
|
||||
#posts .each-post .title {
|
||||
font-size: 48px;
|
||||
color: #000000;
|
||||
padding: 0 0 15px 0;
|
||||
}
|
||||
#posts .each-post .title a {
|
||||
font-size: 48px;
|
||||
color: #000000;
|
||||
padding: 0 0 15px 0;
|
||||
}
|
||||
#posts .each-post .title a:hover {
|
||||
color: #ea9629;
|
||||
}
|
||||
#posts .each-post .created-time {
|
||||
border-bottom: 1px solid #eee;
|
||||
padding-bottom: 3px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
#posts .each-post .more {
|
||||
background: #000000;
|
||||
padding: 9px 10px;
|
||||
border-radius: 2px;
|
||||
line-height: 1;
|
||||
font-size: 13px;
|
||||
display: inline-block;
|
||||
text-transform: uppercase;
|
||||
margin-top: 15px;
|
||||
margin-bottom: 15px;
|
||||
color: #fff;
|
||||
}
|
||||
#disqus_thread {
|
||||
border-top: 1px solid #eee;
|
||||
padding: 5px 0 0 0;
|
||||
}
|
||||
#search {
|
||||
width: 150px;
|
||||
}
|
||||
#footerContainer {
|
||||
background-color: #ffffff;
|
||||
color: #666666;
|
||||
}
|
||||
#footerContainer #footer a {
|
||||
color: #666666;
|
||||
}
|
||||
#footerContainer #footer ul {
|
||||
list-style: none;
|
||||
margin-bottom: 10px ;
|
||||
padding-left: 20px;
|
||||
}
|
||||
@media screen and (max-width: 600px) {
|
||||
html,
|
||||
body {
|
||||
overflow-x: hidden;
|
||||
background-color: #fbfcf7;
|
||||
}
|
||||
* {
|
||||
font-size: 16px;
|
||||
}
|
||||
#headerContainer,
|
||||
#footerContainer {
|
||||
background-color: #fbfcf7;
|
||||
margin: 10px 0;
|
||||
}
|
||||
#posts .each-post,
|
||||
#postsContainer {
|
||||
background-color: #fbfcf7 !important;
|
||||
}
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
#posts .each-post {
|
||||
padding: 10px;
|
||||
}
|
||||
#posts .each-post .title {
|
||||
font-size: 24px;
|
||||
border-left: 5px solid #65bd77;
|
||||
font-weight: bold;
|
||||
padding: 5px 0;
|
||||
padding-left: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.container {
|
||||
padding-right: 10px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
.created-time {
|
||||
display: none;
|
||||
}
|
||||
.mobile-created-time {
|
||||
display: block;
|
||||
}
|
||||
.mobile-created-time #userLogo {
|
||||
display: inline-block;
|
||||
max-height: 40px;
|
||||
width: 40px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
#content {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.right-section .dropdown,
|
||||
.right-section .btn {
|
||||
display: none !important;
|
||||
}
|
||||
#blogNav {
|
||||
left: initial !important;
|
||||
right: 10px !important;
|
||||
}
|
||||
#postsContainer .container,
|
||||
#footerContainer .container {
|
||||
max-width: 100%;
|
||||
}
|
||||
#postsContainer {
|
||||
margin: 0 !important;
|
||||
max-width: 100%;
|
||||
padding-top: 10px;
|
||||
background: #f5f5f5 url("../../images/noise.png");
|
||||
}
|
||||
#posts {
|
||||
max-width: 100% !important;
|
||||
}
|
||||
#footerContainer #footer a {
|
||||
padding: 3px;
|
||||
}
|
||||
#footerContainer #footer a:hover,
|
||||
#footerContainer #footer a:focus {
|
||||
color: #65bd77;
|
||||
}
|
||||
#headerAndNav {
|
||||
position: initial;
|
||||
text-align: left;
|
||||
width: 100%;
|
||||
border-bottom: 2px dashed #ebeff2;
|
||||
}
|
||||
#headerAndNav #headerContainer {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
padding-top: 30px;
|
||||
}
|
||||
#headerAndNav #header {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
#headerAndNav #header h1 {
|
||||
display: none;
|
||||
}
|
||||
#headerAndNav .navbar-collapse {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
#headerAndNav #blogDesc {
|
||||
border: none;
|
||||
margin-top: 20px;
|
||||
font-size: 24px;
|
||||
}
|
||||
#headerAndNav .navbar-brand {
|
||||
display: inline-block;
|
||||
line-height: 50px;
|
||||
padding: 0;
|
||||
padding-left: 10px;
|
||||
}
|
||||
#headerAndNav .navbar-brand img {
|
||||
height: 40px;
|
||||
}
|
||||
#headerAndNav .navbar .container {
|
||||
width: auto;
|
||||
padding: 0 15px;
|
||||
}
|
||||
#headerAndNav .navbar {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
background: #fbfcf7;
|
||||
z-index: 1000;
|
||||
border-bottom: 1px solid #DEDDDF;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), inset 0 1px 0 #ffffff;
|
||||
background-color: #FDFFF5;
|
||||
}
|
||||
#headerAndNav .navbar-nav {
|
||||
margin: 0 10px;
|
||||
}
|
||||
#headerAndNav .navbar-nav a {
|
||||
padding-left: 10px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
#headerAndNav #search {
|
||||
width: 100%;
|
||||
margin: 10px;
|
||||
}
|
||||
#headerAndNav .navbar-form {
|
||||
border: none;
|
||||
}
|
||||
#myTab,
|
||||
.tab-content {
|
||||
padding: 0 10px;
|
||||
}
|
||||
}
|
||||
@@ -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="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}} |
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}</a>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="each-post">
|
||||
{{msg . "none"}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
{{template "blog/highlight.html"}}
|
||||
</body>
|
||||
</html>
|
||||
@@ -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}} <span class="label label-default">{{.Count}}</span>
|
||||
</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -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"}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div id="posts">
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
{{.post.Title}}
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .post.Tags}}
|
||||
{{blogTags $ .post.Tags}}
|
||||
{{else}}
|
||||
{{msg . "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg . "updatedTime"}} {{$.post.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg . "createdTime"}} {{$.post.CreatedTime | datetime}}
|
||||
</div>
|
||||
|
||||
<!-- 仅为移动端 -->
|
||||
<div class="mobile-created-time">
|
||||
{{ if $.blogInfo.UserLogo}}
|
||||
<img src="{{$.blogInfo.UserLogo}}" id="userLogo">
|
||||
{{else}}
|
||||
<img src="{{$.siteUrl}}/images/blog/default_avatar.png" id="userLogo">
|
||||
{{end}}
|
||||
{{$.blogInfo.Username}}
|
||||
|
||||
{{if .post.Tags}}
|
||||
|
||||
<i class="fa fa-bookmark-o" style="color: #666"></i>
|
||||
{{blogTags $ $.post.Tags}}
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
<div class="desc" id="content">
|
||||
{{if $.post.IsMarkdown }}
|
||||
<div id="markdownContent" style="display: none">
|
||||
<!-- 用textarea装html, 防止得到的值失真 -->
|
||||
<textarea>{{$.post.Content | raw}}</textarea>
|
||||
</div>
|
||||
<div style="padding: 20px; text-align: center">
|
||||
<img src="{{$.themeBaseUrl}}/images/loading-32.gif" />
|
||||
</div>
|
||||
{{else}}
|
||||
{{$.post.Content | raw}}
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
<div class="pre-next-post">
|
||||
<p>
|
||||
上一篇: {{if $.prePost}}<a href="{{$.viewUrl}}/{{$.prePost.NoteId}}">{{$.prePost.Title}}</a>{{else}}无{{end}}
|
||||
</p>
|
||||
<p>
|
||||
下一篇: {{if $.nextPost}}<a href="{{$.viewUrl}}/{{$.nextPost.NoteId}}">{{$.nextPost.Title}}</a>{{else}}无{{end}}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- share & comment -->
|
||||
{{template "comment.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "footer.html" .}}
|
||||
|
||||
{{template "highlight.html"}}
|
||||
<div id="blogNav">
|
||||
<div id="blogNavNav">
|
||||
<i class="fa fa-align-justify" title="文档导航"></i>
|
||||
<span>{{msg . "blogNav"}}</span>
|
||||
</div>
|
||||
<div id="blogNavContent">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 一些在comment.js 需要使用的变量 -->
|
||||
<script>
|
||||
var visitUserInfo = eval("(" + {{.visitUserInfoJson}} + ")");
|
||||
var urlPrefix = "{{$.leanoteUrl}}";
|
||||
var noteId = "{{$.post.NoteId}}";
|
||||
var preLikeNum = +"{{.blog.likeNum}}";
|
||||
var commentNum = +"{{.blog.commentNum}}";
|
||||
</script>
|
||||
|
||||
<!-- 一些公用的js -->
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/common.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/jsrender.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/jquery-cookie-min.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/bootstrap-dialog.min.js"></script>
|
||||
<script src="{{$.leanoteUrl}}/public/blog/js/jquery.qrcode.min.js"></script>
|
||||
|
||||
<!-- share && comment -->
|
||||
<script src="{{$.themeBaseUrl}}/view.js"></script>
|
||||
|
||||
<!--
|
||||
markdown
|
||||
调用markdown来解析得到html
|
||||
-->
|
||||
|
||||
{{if $.post.IsMarkdown }}
|
||||
<script src="/public/mdeditor/editor/pagedown/Markdown.Converter.js"></script>
|
||||
<script src="/public/mdeditor/editor/pagedown/Markdown.Sanitizer.js"></script>
|
||||
<script src="/public/mdeditor/editor/pagedown/Markdown.Editor.js"></script>
|
||||
<script src="/public/mdeditor/editor/pagedown/local/Markdown.local.zh.js"></script>
|
||||
<script src="/public/mdeditor/editor/Markdown.Extra.js"></script>
|
||||
|
||||
<!--mathjax-->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ["\\(","\\)"]], processEscapes: true }, messageStyle: "none"});
|
||||
</script>
|
||||
<script src="/public/mdeditor/editor/mathJax.js"></script>
|
||||
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
|
||||
<script>
|
||||
var content = $.trim($("#markdownContent textarea").val());
|
||||
var converter = Markdown.getSanitizingConverter();
|
||||
Markdown.Extra.init(converter, {extensions: ["tables", "fenced_code_gfm", "def_list"]});
|
||||
var html = converter.makeHtml(content);
|
||||
$("#content").html(html);
|
||||
$("pre").addClass("prettyprint linenums");
|
||||
prettyPrint();
|
||||
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"wmd-preview"]);
|
||||
|
||||
initNav();
|
||||
weixin();
|
||||
</script>
|
||||
|
||||
<!-- 不是markdown -->
|
||||
{{else}}
|
||||
<script>
|
||||
$(function() {
|
||||
initNav();
|
||||
weixin();
|
||||
});
|
||||
</script>
|
||||
{{end}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,509 @@
|
||||
function scrollTo(self, tagName, text) {
|
||||
var iframe = $("#content");
|
||||
var target = iframe.find(tagName + ":contains(" + text + ")");
|
||||
|
||||
// 找到是第几个
|
||||
// 在nav是第几个
|
||||
var navs = $('#blogNavContent [data-a="' + tagName + '-' + encodeURI(text) + '"]');
|
||||
var len = navs.size();
|
||||
for(var i = 0; i < len; ++i) {
|
||||
if(navs[i] == self) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (target.size() >= i+1) {
|
||||
target = target.eq(i);
|
||||
// 之前插入, 防止多行定位不准
|
||||
var top = target.offset().top;
|
||||
if(LEA.isMobile) {
|
||||
top -= 50;
|
||||
}
|
||||
var nowTop = $(document).scrollTop();
|
||||
// 用$("body").scrllTop(10)没反应 firefox下
|
||||
$('html,body').animate({scrollTop: top}, 200);
|
||||
return;
|
||||
}
|
||||
}
|
||||
function genNav() {
|
||||
var $con = $("#content");
|
||||
var html = $con.html();
|
||||
// 构造一棵树
|
||||
// {"h1-title":{h2-title:{}}}
|
||||
var tree = [];//[{title: "xx", children:[{}]}, {title:"xx2"}];
|
||||
var hs = $con.find("h1,h2,h3,h4,h5,h6").toArray();
|
||||
var titles = '<ul>';
|
||||
for(var i = 0; i < hs.length; ++i) {
|
||||
var text = $(hs[i]).text();
|
||||
var tagName = hs[i].tagName.toLowerCase();
|
||||
// scrollTo在page.js中定义
|
||||
titles += '<li class="nav-' + tagName + '"><a data-a="' + tagName + '-' + encodeURI(text)+'" onclick="scrollTo(this, \'' + tagName + '\', \'' + text + '\')">' + text + '</a></li>';
|
||||
}
|
||||
titles += "</ul>";
|
||||
$("#blogNavContent").html(titles);
|
||||
if(!hs.length) {
|
||||
$("#blogNavContent").html(getMsg("none"));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function initNav() {
|
||||
var hasNav = genNav();
|
||||
if(!hasNav) {
|
||||
return;
|
||||
}
|
||||
|
||||
var $title = $(".title");
|
||||
var titlePos = $title.offset();
|
||||
var top = titlePos.top + 10;// - $title.height();
|
||||
// 手机下不要与标题在同一高度
|
||||
if(LEA.isMobile){
|
||||
top += 30;
|
||||
}
|
||||
if(top < 0) {
|
||||
top = 10;
|
||||
}
|
||||
|
||||
var left = $title.width() + titlePos.left - 100;
|
||||
$("#blogNav").css("top", top).css("left", left);
|
||||
$("#blogNav").show();
|
||||
|
||||
$("#blogNavNav").click(function() {
|
||||
var $o = $("#blogNavContent");
|
||||
if($o.is(":hidden")) {
|
||||
$o.show();
|
||||
} else {
|
||||
$o.hide();
|
||||
}
|
||||
});
|
||||
|
||||
var $d = $(document);
|
||||
function reNav() {
|
||||
var vtop = $d.scrollTop();
|
||||
if(vtop <= top) {
|
||||
$("#blogNav").css("top", top-vtop);
|
||||
} else {
|
||||
// 差距很磊了
|
||||
if(LEA.isMobile) {
|
||||
$("#blogNav").css("top", 50);
|
||||
} else {
|
||||
$("#blogNav").css("top", 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
reNav();
|
||||
$(window).scroll(reNav);
|
||||
}
|
||||
|
||||
var C = {
|
||||
info: null,
|
||||
noteId: noteId,
|
||||
preLikeNum: preLikeNum,
|
||||
commentNum: commentNum,
|
||||
likeBtnO: $("#likeBtn"),
|
||||
likeNumO: $("#likeNum"),
|
||||
tLikersO: $("#tLikers"),
|
||||
likersO: $("#likers"),
|
||||
tCommentsO: $("#tComments"),
|
||||
commentsO: $("#comments"),
|
||||
|
||||
commentBtnO: $("#commentBtn"),
|
||||
|
||||
commentsLoadingO: $(".comments-loading"),
|
||||
commentsMoreO: $(".comments-more"),
|
||||
|
||||
commentBoxO: $(".comment-box"),
|
||||
init: function() {
|
||||
var self = this;
|
||||
if(UserBlogInfo.CanComment && UserBlogInfo.CommentType != "disqus") {
|
||||
self.initLikeAndComments();
|
||||
} else {
|
||||
self.initLike();
|
||||
}
|
||||
self.initEvent();
|
||||
self.incReadNum();
|
||||
},
|
||||
incReadNum: function() {
|
||||
var self = this;
|
||||
if(!$.cookie(self.noteId)) {
|
||||
$.cookie(self.noteId, 1);
|
||||
ajaxGet(staticUrl + "/blog/incReadNum", {noteId: self.noteId});
|
||||
}
|
||||
},
|
||||
initLike: function() {
|
||||
var self = this;
|
||||
ajaxGet(staticUrl + "/blog/getLike", {noteId: self.noteId}, function(ret) {
|
||||
self.info = ret;
|
||||
self.toggleLikeBtnActive();
|
||||
self.renderLikers();
|
||||
});
|
||||
},
|
||||
initLikeAndComments: function() {
|
||||
var self = this;
|
||||
ajaxGet(staticUrl + "/blog/getLikeAndComments", {noteId: self.noteId}, function(ret) {
|
||||
self.info = ret;
|
||||
self.toggleLikeBtnActive();
|
||||
self.renderLikers();
|
||||
// 是否需要renderComments?
|
||||
self.info.commentUserInfo = self.info.commentUserInfo || {};
|
||||
// 为了防止第一条评论找不到用户信息情况
|
||||
if(visitUserInfo.UserId) {
|
||||
self.info.commentUserInfo[visitUserInfo.UserId] = visitUserInfo;
|
||||
}
|
||||
self.renderComments();
|
||||
|
||||
self.commentBoxO.removeClass("hide");
|
||||
self.commentsLoadingO.addClass("hide");
|
||||
if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) {
|
||||
self.commentsMoreO.removeClass("hide");
|
||||
self.initMoreComments();
|
||||
}
|
||||
});
|
||||
},
|
||||
initMoreComments: function() {
|
||||
var self = this;
|
||||
self.commentsMoreO.find("a").click(function(){
|
||||
if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) {
|
||||
self.commentsMoreO.addClass("hide");
|
||||
self.commentsLoadingO.removeClass("hide");
|
||||
ajaxGet(staticUrl + "/blog/listComments", {noteId: self.noteId, page: self.info.pageInfo.CurPage+1}, function(ret) {
|
||||
var pageInfo = ret.pageInfo;
|
||||
var comments = ret.comments;
|
||||
var commentUserInfo = ret.commentUserInfo;
|
||||
|
||||
$.extend(self.info.commentUserInfo, commentUserInfo);
|
||||
|
||||
// 渲染之
|
||||
for(var i in comments) {
|
||||
var comment = comments[i];
|
||||
comment = self.parseComment(comment);
|
||||
}
|
||||
var html = self.tCommentsO.render({comments: comments, visitUserInfo: visitUserInfo});
|
||||
self.commentsO.append(html);
|
||||
|
||||
self.info.pageInfo = pageInfo;
|
||||
|
||||
if(self.info.pageInfo.TotalPage > self.info.pageInfo.CurPage) {
|
||||
self.commentsMoreO.removeClass("hide");
|
||||
} else {
|
||||
self.commentsMoreO.addClass("hide");
|
||||
}
|
||||
|
||||
self.commentsLoadingO.addClass("hide");
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
addCommentRender: function(comment){
|
||||
var self = this;
|
||||
comment = self.parseComment(comment);
|
||||
var html = self.tCommentsO.render({blogUrl: blogUrl, comments: [comment], visitUserInfo: visitUserInfo});
|
||||
self.commentsO.prepend(html);
|
||||
var li = self.commentsO.find("li").eq(0);
|
||||
li.hide();
|
||||
li.show(500);
|
||||
li.addClass("item-highlight");
|
||||
setTimeout(function() {
|
||||
li.removeClass("item-highlight");
|
||||
}, 2000);
|
||||
},
|
||||
parseComment: function(comment) {
|
||||
var self = this;
|
||||
var authorUserId = UserInfo.UserId;
|
||||
commentUserInfo = self.info.commentUserInfo;
|
||||
comment.UserInfo = commentUserInfo[comment.UserId];
|
||||
// 是作者自己
|
||||
if(visitUserInfo.UserId == UserInfo.UserId) {
|
||||
comment.IsMyNote = true;
|
||||
}
|
||||
if(comment.UserId == authorUserId) {
|
||||
comment.IsAuthorComment = true;
|
||||
}
|
||||
if(comment.UserId == visitUserInfo.UserId) {
|
||||
comment.IsMyComment = true;
|
||||
}
|
||||
// 不是回复自己
|
||||
if(comment.ToUserId && comment.ToUserId != comment.UserId) {
|
||||
comment.ToUserInfo = commentUserInfo[comment.ToUserId];
|
||||
if(comment.ToUserInfo.UserId == UserInfo.UserId) {
|
||||
comment.ToUserIsAuthor = true;
|
||||
}
|
||||
}
|
||||
comment.PublishDate = getDateDiff(Date.parse(goNowToDatetime(comment.CreatedTime)));
|
||||
return comment;
|
||||
},
|
||||
// 渲染评论
|
||||
renderComments: function() {
|
||||
var self = this;
|
||||
var comments = self.info.comments || [];
|
||||
if(comments.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 整理数据
|
||||
// 回复谁, 是否是作者?
|
||||
// 回复日期, 几天前, 刚刚
|
||||
for(var i in comments) {
|
||||
var comment = comments[i];
|
||||
comment = self.parseComment(comment);
|
||||
}
|
||||
var html = self.tCommentsO.render({blogUrl: blogUrl, comments: comments, visitUserInfo: visitUserInfo});
|
||||
self.commentsO.html(html);
|
||||
},
|
||||
|
||||
// 重新渲染likers
|
||||
reRenderLikers: function(addMe) {
|
||||
var self = this;
|
||||
var likedUsers = self.info.likedUsers || [];
|
||||
for(var i = 0; i < likedUsers.length; ++i) {
|
||||
var user = likedUsers[i];
|
||||
if(user.UserId == visitUserInfo.UserId) {
|
||||
likedUsers.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(addMe) {
|
||||
likedUsers = [visitUserInfo].concat(likedUsers);
|
||||
self.info.likedUsers = likedUsers;
|
||||
}
|
||||
self.renderLikers();
|
||||
},
|
||||
renderLikers: function() {
|
||||
var self = this;
|
||||
var users = self.info.likedUsers || [];
|
||||
var html = self.tLikersO.render({blogUrl: blogUrl, users: users});
|
||||
self.likersO.html(html);
|
||||
},
|
||||
toggleLikeBtnActive: function() {
|
||||
var self = this;
|
||||
if(self.info.isILikeIt) {
|
||||
self.likeBtnO.addClass("active");
|
||||
} else {
|
||||
self.likeBtnO.removeClass("active");
|
||||
}
|
||||
},
|
||||
commentNumO: $("#commentNum"),
|
||||
bindCommentNum: function(fix) {
|
||||
var self = this;
|
||||
self.commentNum += fix;
|
||||
self.commentNumO.text(self.commentNum);
|
||||
},
|
||||
initEvent: function() {
|
||||
var self = this;
|
||||
|
||||
// like or not
|
||||
self.likeBtnO.click(function() {
|
||||
if(!visitUserInfo.UserId) {
|
||||
needLogin();
|
||||
return;
|
||||
}
|
||||
ajaxPost(staticUrl + "/blog/likeBlog", {noteId: self.noteId}, function(ret) {
|
||||
if(ret.Ok) {
|
||||
// like
|
||||
if(ret.Item) {
|
||||
var num = self.preLikeNum+1;
|
||||
} else {
|
||||
var num = self.preLikeNum-1;
|
||||
}
|
||||
self.preLikeNum = num >= 0 ? num : 0;
|
||||
self.likeNumO.text(self.preLikeNum);
|
||||
self.info.isILikeIt = ret.Item;
|
||||
self.toggleLikeBtnActive();
|
||||
|
||||
// 重新render likers
|
||||
// 我是否在列表中
|
||||
self.reRenderLikers(ret.Item);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 显示回复回复
|
||||
$("#comments").on("click", ".comment-reply", function() {
|
||||
var form = $(this).closest("li").find("form");
|
||||
if(form.is(":hidden")) {
|
||||
form.show();
|
||||
form.find("textarea").focus();
|
||||
} else {
|
||||
form.hide();
|
||||
}
|
||||
});
|
||||
$("#comments").on("click", ".reply-cancel", function() {
|
||||
$(this).closest("form").hide();
|
||||
});
|
||||
|
||||
// 回复
|
||||
$(".comment-box").on("click", ".reply-comment-btn", function(e) {
|
||||
e.preventDefault();
|
||||
var commentId = $(this).data("comment-id");
|
||||
var $form = $(this).closest("form");
|
||||
var $content = $form.find("textarea");
|
||||
var content = $.trim($content.val());
|
||||
if(!content) {
|
||||
$content.focus();
|
||||
return;
|
||||
}
|
||||
var t = $(this);
|
||||
t.button("loading");
|
||||
var data = {noteId: self.noteId, toCommentId: commentId, content: content};
|
||||
ajaxPost(staticUrl + "/blog/comment", data, function(ret) {
|
||||
t.button("reset");
|
||||
$content.val("");
|
||||
self.bindCommentNum(1);
|
||||
if(commentId) {
|
||||
$form.hide();
|
||||
}
|
||||
|
||||
if(commentId) {
|
||||
scrollToTarget("#comments", -200);
|
||||
}
|
||||
|
||||
// 添加一个
|
||||
self.addCommentRender(ret.Item);
|
||||
});
|
||||
});
|
||||
|
||||
// 删除
|
||||
$(".comment-box").on("click", ".comment-trash", function(e) {
|
||||
var commentId = $(this).parent().data("comment-id");
|
||||
var t = this;
|
||||
BootstrapDialog.confirm(getMsg("confirmDeleteComment"), function(yes) {
|
||||
if(yes) {
|
||||
ajaxPost(staticUrl + "/blog/deleteComment", {noteId: self.noteId, commentId: commentId}, function(ret) {
|
||||
if(ret.Ok) {
|
||||
var li = $(t).closest("li");
|
||||
li.hide(500); // remove();
|
||||
setTimeout(function() {
|
||||
li.remove();
|
||||
}, 300);
|
||||
|
||||
self.bindCommentNum(-1);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 点zan
|
||||
$(".comment-box").on("click", ".comment-like", function(e) {
|
||||
var commentId = $(this).parent().data("comment-id");
|
||||
var t = this;
|
||||
|
||||
ajaxPost(staticUrl + "/blog/likeComment", {commentId: commentId}, function(re) {
|
||||
if(re.Ok) {
|
||||
var ret = re.Item;
|
||||
if(ret.Num <= 0) {
|
||||
$(t).parent().find(".like-num").addClass("hide");
|
||||
} else {
|
||||
$(t).parent().find(".like-num").removeClass("hide");
|
||||
$(t).parent().find(".like-num-i").text(ret.Num)
|
||||
}
|
||||
if(ret.IsILikeIt) {
|
||||
$(t).find(".like-text").text(getMsg("unlike"));
|
||||
} else {
|
||||
$(t).find(".like-text").text(getMsg('like'));
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 举报
|
||||
function report(commentId, noteId, title) {
|
||||
var form = $("#reportMsg").html();
|
||||
var body;
|
||||
var input;
|
||||
var isOver = false;
|
||||
var modal = BootstrapDialog.show({
|
||||
title: title,
|
||||
message: form,
|
||||
nl2br: false,
|
||||
buttons: [{
|
||||
label: getMsg("cancel"),
|
||||
action: function(dialog) {
|
||||
dialog.close();
|
||||
}
|
||||
}, {
|
||||
label: getMsg("confirm"),
|
||||
cssClass: 'btn-primary',
|
||||
action: function(dialog) {
|
||||
if(isOver) {
|
||||
dialog.close();
|
||||
}
|
||||
var val = body.find("input[type='radio']:checked").val();
|
||||
if(!val) {
|
||||
var val = body.find(".input-container input").val();
|
||||
}
|
||||
if(!val) {
|
||||
body.find(".footnote").html(getMsg("chooseReason"));
|
||||
return;
|
||||
}
|
||||
ajaxPost(staticUrl + "/blog/report", {commentId: commentId, noteId: noteId, reason: val}, function(re) {
|
||||
isOver = true;
|
||||
if(reIsOk(re)) {
|
||||
body.html(getMsg("reportSuccess"));
|
||||
} else {
|
||||
body.html(getMsg("error"));
|
||||
}
|
||||
setTimeout(function() {
|
||||
dialog.close();
|
||||
}, 3000);
|
||||
});
|
||||
}
|
||||
}]
|
||||
});
|
||||
body = modal.getModalBody();
|
||||
input = body.find(".input-container");
|
||||
body.find("input[type='radio']").click(function(){
|
||||
if(!$(this).val()) {
|
||||
input.show();
|
||||
input.find("input").focus();
|
||||
} else {
|
||||
input.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
$(".comment-box").on("click", ".comment-report", function() {
|
||||
if(needLogin()) {
|
||||
return;
|
||||
}
|
||||
var commentId = $(this).parent().data("comment-id");
|
||||
report(commentId, self.noteId, getMsg("reportComment?"));
|
||||
});
|
||||
$("#reportBtn").click(function() {
|
||||
if(needLogin()) {
|
||||
return;
|
||||
}
|
||||
report("", self.noteId, getMsg("reportBlog?"));
|
||||
});
|
||||
|
||||
self.initShare();
|
||||
},
|
||||
weixinQRCodeO: $("#weixinQRCode"),
|
||||
initShare: function() {
|
||||
var self = this;
|
||||
$(".btn-weixin").click(function() {
|
||||
if(!self.weixinQRCodeO.html()) {
|
||||
self.weixinQRCodeO.qrcode(viewUrl + "/" + self.noteId);
|
||||
}
|
||||
BootstrapDialog.show({
|
||||
title: getMsg('scanQRCode'),
|
||||
message: self.weixinQRCodeO
|
||||
});
|
||||
});
|
||||
|
||||
$(".btn-share").click(function() {
|
||||
var $this = $(this);
|
||||
var map = {"btn-weibo": shareSinaWeibo, "tencent-weibo": shareTencentWeibo, "qq": shareQQ, "renren": shareRenRen};
|
||||
for(var i in map) {
|
||||
if($this.hasClass(i)) {
|
||||
map[i](self.noteId, document.title);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
C.init();
|
||||
});
|
||||
@@ -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>
|
||||
{{.PublicTime|date}} <a href="{{$.viewUrl}}/{{.NoteId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,41 @@
|
||||
{{template "header.html" .}}
|
||||
|
||||
<div id="postsContainer">
|
||||
<div class="container">
|
||||
<h2>分类 - {{$.curCateTitle}}</h2>
|
||||
</div>
|
||||
<div id="posts">
|
||||
{{range $.posts}}
|
||||
<div class="each-post">
|
||||
<div class="title">
|
||||
<a href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">
|
||||
{{.Title}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="created-time">
|
||||
<i class="fa fa-bookmark-o"></i>
|
||||
{{if .Tags}}
|
||||
{{blogTags $ .Tags}}
|
||||
{{else}}
|
||||
{{msg $ "noTag"}}
|
||||
{{end}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "updatedTime"}} {{.UpdatedTime | datetime}}
|
||||
|
|
||||
<i class="fa fa-calendar"></i> {{msg $ "createdTime"}} {{.CreatedTime | datetime}}
|
||||
</div>
|
||||
<div class="desc">
|
||||
{{.Abstract | raw}}
|
||||
</div>
|
||||
<a class="more" href="{{$.viewUrl}}/{{.NoteId}}" title="{{msg $ "fullBlog"}}">{{msg $ "more"}}.</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<!-- 分页 -->
|
||||
{{template "paging.html" $}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer.html" .}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,204 @@
|
||||
<!-- 赞 -->
|
||||
<div class="entry-controls clearfix">
|
||||
<div class="vote-section-wrapper clearfix">
|
||||
<button class="btn btn-default btn-zan" id="likeBtn"><i class="fa fa-thumbs-o-up"></i> <span id="likeNum">{{.blog.LikeNum}}</span> {{msg . "like"}}</button>
|
||||
<span class="control-item read-counts"><i class="fa fa-eye"></i> {{if .blog.ReadNum}}{{.blog.ReadNum}}{{else}}1{{end}} {{msg . "viewers"}}</span>
|
||||
</div>
|
||||
<div class="right-section">
|
||||
<div id="weixinQRCode"></div>
|
||||
<!-- google+
|
||||
<g:plusone size=”medium”></g:plusone>
|
||||
-->
|
||||
<button class="btn btn-share btn-default btn-weibo"><i class="fa fa-weibo"></i> {{msg . "sinaWeibo"}}</button>
|
||||
<button class="btn btn-share btn-default btn-weixin"><i class="fa fa-wechat"></i> {{msg . "weixin"}}</button>
|
||||
<div class="dropdown" style="display: inline-block; cursor: pointer; padding: 5px 10px;">
|
||||
<!-- open -->
|
||||
<div class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown">
|
||||
<i class="fa fa-share-square-o"></i>
|
||||
{{msg . "moreShare"}}
|
||||
</div>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="#" class="btn-share tencent-weibo"><i class="fa fa-tencent-weibo"></i> {{msg . "tencentWeibo"}}</a></li>
|
||||
<li><a href="#" class="btn-share qq"><i class="fa fa-qq"></i> {{msg . "qqZone"}}</a></li>
|
||||
<li><a href="#" class="btn-share renren"><i class="fa fa-renren"></i> {{msg . "renren"}}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<!-- 举报 -->
|
||||
{{if eq .locale "zh"}}
|
||||
<div style="display: inline-block">
|
||||
<a id="reportBtn"><i class="fa fa-flag-o"></i> {{msg . "report"}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="voters clearfix" id="likers">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/x-jsrender" id="tLikers">
|
||||
[[for users]]
|
||||
<a id="liker_[[:UserId]]" href="[[:~root.blogUrl]]/[[:Username]]" target="_blank" class="voter">
|
||||
[[if Logo]]
|
||||
<img alt="avatar" class="avatar-small" src="[[:Logo]]">
|
||||
[[else]]
|
||||
<img alt="avatar" class="avatar-small" src="/images/blog/default_avatar.png">
|
||||
[[/if]]
|
||||
</a>
|
||||
[[/for]]
|
||||
</script>
|
||||
{{if and .userBlog.CanComment (not (eq .userBlog.CommentType "disqus"))}}
|
||||
|
||||
<script type="text/x-jsrender" id="tComments">
|
||||
[[for comments]]
|
||||
<li class="comment-item">
|
||||
<!-- 头像 -->
|
||||
<a ui-hovercard="" target="_blank" class="avatar-link" title="[[:UserInfo.Username]]" href="[[:~root.blogUrl]]/[[:UserInfo.Username]]">
|
||||
<img class="avatar" src="[[:UserInfo.Logo]]">
|
||||
</a>
|
||||
<!-- 评论 -->
|
||||
<div class="comment-body">
|
||||
<div class="comment-hd">
|
||||
<a href="[[:~root.blogUrl]]/[[:UserInfo.Username]]" target="_blank" >[[:UserInfo.Username]]</a>
|
||||
[[if IsAuthorComment]]
|
||||
<span>({{msg . "author"}})</span>
|
||||
[[/if]]
|
||||
|
||||
<!-- 回复其它人 -->
|
||||
[[if ToUserInfo]]
|
||||
<span class="in-reply-to">
|
||||
{{rawMsg . "reply"}}
|
||||
<a href="[[:~root.blogUrl]]/[[:ToUserInfo.Username]]">[[:ToUserInfo.Username]]</a>
|
||||
</span>
|
||||
[[if ToUserIsAuthor]]
|
||||
<span>({{msg . "author"}})</span>
|
||||
[[/if]]
|
||||
[[/if]]
|
||||
</div>
|
||||
<div class="comment-content ng-binding" ng-bind-html="comment.content">
|
||||
[[html:Content]]
|
||||
</div>
|
||||
<div class="comment-ft clearfix" data-comment-id="[[:CommentId]]" >
|
||||
<span title="" ui-time="" class="date">[[:PublishDate]] </span>
|
||||
<span class="like-num [[if !LikeNum]]hide[[/if]]" title="[[:LikeNum]] {{rawMsg . "like"}}"><span class="like-num-i">[[:LikeNum]]</span> {{rawMsg . "like"}}</span></span>
|
||||
|
||||
[[if ~root.visitUserInfo.UserId]]
|
||||
[[if IsMyNote && !IsMyComment]]
|
||||
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> {{rawMsg . "delete"}}</a>
|
||||
[[/if]]
|
||||
[[if !IsMyComment]]
|
||||
<a href="javascript:;" class="comment-reply op-link ">
|
||||
<i class="fa fa-reply"></i>
|
||||
{{rawMsg . "reply"}}
|
||||
</a>
|
||||
<a href="javascript:;" class="comment-like op-link"><i class="fa fa-thumbs-o-up"></i> <span class="like-text">[[if IsILikeIt]]{{rawMsg . "unlike"}}[[else]]{{rawMsg . "like"}}[[/if]]</span></a>
|
||||
{{if eq .locale "zh"}}
|
||||
<a href="javascript:;" class="comment-report op-link "><i class="fa fa-flag-o"></i> {{rawMsg . "report"}}</a>
|
||||
{{end}}
|
||||
[[else]]
|
||||
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> {{rawMsg . "delete"}}</a>
|
||||
[[/if]]
|
||||
[[/if]]
|
||||
</div>
|
||||
|
||||
<!-- 回复该评论 -->
|
||||
[[if ~root.visitUserInfo.UserId]]
|
||||
<form class="comment-form comment-box-ft">
|
||||
<div class="clearfix">
|
||||
<div class="avatar-wrap">
|
||||
<img class="avatar" src="[[:~root.visitUserInfo.Logo]]">
|
||||
</div>
|
||||
<div class="editor-wrap">
|
||||
<textarea class="editable" id="commentContent" name="commentContent" placeholder="{{rawMsg . "reply"}}"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="command clearfix" style="display: block;">
|
||||
<button class="reply-comment-btn save btn btn-primary" data-comment-id="[[:CommentId]]">{{rawMsg . "comment"}}</button>
|
||||
<a class="cancel reply-cancel btn-link">{{rawMsg . "cancel"}}</a>
|
||||
</div>
|
||||
</form>
|
||||
[[/if]]
|
||||
</div>
|
||||
</li>
|
||||
[[/for]]
|
||||
</script>
|
||||
|
||||
<!-- 评论 -->
|
||||
<div class="comment-box hide">
|
||||
{{if .visitUserInfo.UserId}}
|
||||
<form class="comment-form comment-box-ft" id="commentForm">
|
||||
<div class="clearfix">
|
||||
<div class="avatar-wrap">
|
||||
<img class="avatar" src="{{.visitUserInfo.Logo}}">
|
||||
</div>
|
||||
<div class="editor-wrap">
|
||||
<textarea class="editable" id="commentContent" name="commentContent" placeholder="{{msg . "comment"}}" style="height: 100px;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="command clearfix" style="display: block;">
|
||||
<button id="commentBtn" class="reply-comment-btn save btn btn-primary">{{msg . "comment"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
{{else}}
|
||||
<div class="needLogin">
|
||||
<a onclick="goLogin()">{{msg . "signIn"}}</a>, {{msg . "submitComment"}}.
|
||||
<br />
|
||||
没有帐号? <a onclick="goRegister()">{{msg . "signUp"}}</a>
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="box-header">
|
||||
<span class="counter">
|
||||
<i class="icon icon-comment"></i><span id="commentNum">{{.blog.CommentNum}}</span> {{msg . "comments"}}
|
||||
</span>
|
||||
</div>
|
||||
<ul id="comments">
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="moreComments">
|
||||
<div class="hide comments-more">
|
||||
<a>More...</a>
|
||||
</div>
|
||||
<div class="comments-loading">
|
||||
<img src="/images/loading-32.gif" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{if eq .locale "zh"}}
|
||||
<div id="reportMsg" class="hide">
|
||||
<form class="report-form" name="reportForm">
|
||||
<ul class="options clearfix">
|
||||
<li><label><input required="" value="{{msg . "reportReason1"}}" name="reason" type="radio">{{msg . "reportReason1"}}</label></li>
|
||||
<li><label><input required="" value="{{msg . "reportReason2"}}" name="reason" type="radio">{{msg . "reportReason2"}}</label></li>
|
||||
<li><label><input required="" value="{{msg . "reportReason3"}}" name="reason" type="radio">{{msg . "reportReason3"}}</label></li>
|
||||
<li><label><input required="" value="{{msg . "reportReason4"}}" name="reason" type="radio">{{msg . "reportReason4"}}</label></li>
|
||||
<li><label><input required="" value="" name="reason" type="radio">{{msg . "other"}}</label></li>
|
||||
</ul>
|
||||
<p class="input-container" style="display: none">
|
||||
<input placeholder="{{msg . "reportReason"}}" type="text" name="detail" class="form-control reason-text basic-input" />
|
||||
</p>
|
||||
<p class="footnote"></p>
|
||||
</form>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
{{end}}
|
||||
|
||||
{{if and $.blogInfo.OpenComment (eq $.blogInfo.CommentType "disqus")}}
|
||||
|
||||
<div id="disqus_thread"></div>
|
||||
<!-- comment -->
|
||||
<script type="text/javascript">
|
||||
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
|
||||
var disqus_shortname = '{{.userBlog.DisqusId}}'; // required: replace example with your forum shortname
|
||||
var disqus_identifier = '{{.userBlog.UserId.Hex}}/{{.blog.NoteId.Hex}}/{{.blog.Title}}'; // 博客链接
|
||||
|
||||
/* * * DON'T EDIT BELOW THIS LINE * * */
|
||||
(function() {
|
||||
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
|
||||
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
|
||||
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
|
||||
})();
|
||||
</script>
|
||||
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
|
||||
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
|
||||
{{end}}
|
||||
@@ -0,0 +1,55 @@
|
||||
<div id="footerContainer">
|
||||
{{$userId := .userBlog.UserId.Hex}}
|
||||
<div class="container" id="footer">
|
||||
<div class="col-md-4">
|
||||
<h3>{{msg . "blogNavs"}}</h3>
|
||||
<ul>
|
||||
<li><a href="{{$.blogUrl}}/{{$.userInfo.Username}}">{{msg . "home"}}</a></li>
|
||||
{{range .notebooks}}
|
||||
<li>
|
||||
<a href="{{$.cateUrl}}/{{.NotebookId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
<li><a href="{{$.aboutMeUrl}}">{{msg . "aboutMe"}}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3>{{msg . "latestPosts"}}</h3>
|
||||
<ul>
|
||||
{{range .recentBlogs}}
|
||||
<li title="{{.Title}}"><a href="{{$.blogUrl}}/view/{{.NoteId.Hex}}/">{{.Title}}</a></li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<h3>{{msg . "quickLinks"}}</h3>
|
||||
<ul>
|
||||
<li><a href="{{$.noteUrl}}">{{msg . "myNote"}}</a></li>
|
||||
<li><a href="{{$.siteUrl}}/login">leanote {{msg . "login"}}</a></li>
|
||||
<li><a href="http://leanote.com" target="_blank">leanote {{msg . "home"}}</a></li>
|
||||
<li><a href="http://lea.leanote.com" target="_blank">lea++</a></li>
|
||||
<li><a href="http://bbs.leanote.com" target="_blank">leanote {{msg . "community"}}</a></li>
|
||||
<li><a href="https://github.com/leanote/leanote" target="_blank">leanote github</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="{{$.jQueryUrl}}"></script>
|
||||
<script src="{{$.bootstrapJsUrl}}"></script>
|
||||
<script src="{{$.siteUrl}}/js/bootstrap-hover-dropdown.js"></script>
|
||||
<script src="{{$.siteUrl}}/js/i18n/blog.{{.locale}}.js"></script>
|
||||
|
||||
<script>
|
||||
// 搜索
|
||||
function search(e) {
|
||||
var keywords = $("#searchInput").val();
|
||||
if(!keywords) {
|
||||
location.href = "{{$.searchUrl}}";
|
||||
} else {
|
||||
var tpl = '<form action="{{$.searchUrl}}" method="get">';
|
||||
tpl += '<input name="keywords" value="' + keywords + '" />';
|
||||
tpl += "</form";
|
||||
$(tpl).submit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,113 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="keywords" content="leanote,leanote.com">
|
||||
<meta name="description" content="leanote, {{msg $ "moto"}}">
|
||||
<meta name="author" content="leanote">
|
||||
|
||||
<title>{{.title}}</title>
|
||||
<!-- Bootstrap core CSS -->
|
||||
<link href="{{$.bootstrapCssUrl}}" rel="stylesheet">
|
||||
<!-- 字体必须同一域 -->
|
||||
<link href="{{$.fontAwesomeUrl}}" rel="stylesheet">
|
||||
<link href="{{$.themeBaseUrl}}/style.css" rel="stylesheet">
|
||||
<link href="{{$.commentCssUrl}}" rel="stylesheet">
|
||||
<script>
|
||||
function log(o) {
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="headerAndNav" >
|
||||
<div id="headerContainer" class="container">
|
||||
<!-- 头部可放博客名, 导航 -->
|
||||
<div id="header">
|
||||
|
||||
{{$username := .userInfo.Username}}
|
||||
<h1>
|
||||
<a href="{{$.indexUrl}}" id="logo">
|
||||
{{if $.blogInfo.Logo}}
|
||||
<img src="{{$.blogInfo.Logo}}" title="{{$.blogInfo.Title}}"/>
|
||||
{{else}}
|
||||
{{$.blogInfo.Title | raw}}
|
||||
{{end}}
|
||||
</a>
|
||||
</h1>
|
||||
<div id="blogDesc">
|
||||
{{$.blogInfo.SubTitle | raw}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Static navbar -->
|
||||
<div class="navbar navbar-default">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="{{.indexUrl}}">
|
||||
{{if $.blogInfo.Logo}}
|
||||
|
||||
<img src="{{$.blogInfo.Logo}}" title="{{$.blogInfo.Title}}"/>
|
||||
{{else}}
|
||||
{{$.blogInfo.Title | raw}}
|
||||
{{end}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
|
||||
<li class="{{if $.curIsIndex}}active{{end}}"><a href="{{.indexUrl}}">主页</a></li>
|
||||
<!-- 分类页 -->
|
||||
{{range $.cates}}
|
||||
<li class="{{if eq .CateId $.curCateId}}active{{end}}">
|
||||
<a href="{{$.cateUrl}}/{{.CateId}}"
|
||||
>{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
<!-- 单页 -->
|
||||
{{range $.singles}}
|
||||
<li class="{{if eq $.curSingleId .SingleId}}active{{end}}">
|
||||
<a href="{{$.singleUrl}}/{{.SingleId}}">{{.Title}}</a>
|
||||
</li>
|
||||
{{end}}
|
||||
|
||||
<!-- 归档 -->
|
||||
<li class="{{if $.curIsArchive}}active{{end}}">
|
||||
<a href="{{$.archiveUrl}}">归档</a>
|
||||
</li>
|
||||
<li class="{{if $.curIsTags}}active{{end}}">
|
||||
<a href="{{$.tagsUrl}}">标签</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<form class="navbar-form navbar-right" id="search" onsubmit="search(event);return false;">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon" id="searchIcon" onclick="search(event);"><i class="fa fa-search"></i></span>
|
||||
<input type="text" placeholder="search" id="searchInput" class="form-control" value="{{.keywords}}">
|
||||
</div>
|
||||
</form>
|
||||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var UserInfo = {UserId: "{{$.blogInfo.UserId}}", Email: "{{.userInfo.Email}}", Username: "{{.userInfo.Username}}"};
|
||||
var UserBlogInfo={CanComment: {{.userBlog.CanComment}}, CommentType: "{{.userBlog.CommentType}}"};
|
||||
var indexUrl = "{{$.indexUrl}}";
|
||||
var viewUrl = "{{$.viewUrl}}";
|
||||
var blogUrl = "{{$.blogUrl}}";
|
||||
var staticUrl = "{{$.staticUrl}}"; // blog.leanote.com, life.leanote.com, aaa.com
|
||||
</script>
|
||||
@@ -0,0 +1,9 @@
|
||||
<!-- This file is Depreciated -->
|
||||
|
||||
<link href="/public/mdeditor/editor/google-code-prettify/prettify.css" type="text/css" rel="stylesheet">
|
||||
<script src="/public/mdeditor/editor/google-code-prettify/prettify.js"></script>
|
||||
|
||||
<script>
|
||||
$("pre").addClass("prettyprint linenums");
|
||||
prettyPrint();
|
||||
</script>
|
||||
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 136 KiB |