Merge branch 'master' into dev-binnchx

This commit is contained in:
binnchx committed 2015-01-03 21:25:34 +08:00
commit a393bb8723
30 files changed
+1632 -210

No files matched your search

+3 -107
View File
@@ -1,4 +1,5 @@
[中文](https://github.com/leanote/leanote#1-介绍)
# Leanote
## 1. Introduction ## 1. Introduction
@@ -107,111 +108,6 @@ Please fork this repository and contribute back using [pull requests](https://gi
* QQ Group: 158716820 * QQ Group: 158716820
----------------------------------------------------------------------- -----------------------------------------------------------------------
[中文](README_zh.md)
## 1. 介绍
Leanote, 不只是笔记!
![leanote.png](leanote.png "")
**特性**
* 知识管理: 通过leanote来管理知识, leanote有易操作的界面, 包含两款编辑器tinymce和markdown. 在leanote, 你可以尽情享受写作.
* 分享: 你也可以通过分享知识给好友, 让好友拥有你的知识.
* 协作: 在分享的同时也可以与好友一起协作知识.
* 博客: leanote也可以作为你的博客, 将知识公开成博客, 让leanote把你的知识传播的更远!
## 2. 为什么我们要创建leanote?
说实话, 我们曾是evernote的忠实粉丝, 但是我们也发现evernote的不足:
* evernote的编辑器不能满足我们的需求, 不能贴代码(格式会乱掉, 作为程序员, 代码是我们的基本需求啊), 图片不能缩放.
* 我们是markdown的爱好者, 可是evernote竟然没有.
* 我们也想将知识公开, 所以我们有自己的博客, 如wordpress, 但为什么这两者不能合二为一呢?
* 还有...
## 3.安装leanote
leanote是一款私有云笔记, 你可以下载它安装在自己的服务器上, 当然也可以在 http://leanote.com 上注册.
这里详细整理了leanote二进版和leanote开发版的安装教程, 请移步至:
* [leanote二进制详细安装教程](https://github.com/leanote/leanote/wiki/leanote%E4%BA%8C%E8%BF%9B%E5%88%B6%E7%89%88%E8%AF%A6%E7%BB%86%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B)
* [leanote开发版详细安装教程](https://github.com/leanote/leanote/wiki/leanote%E5%BC%80%E5%8F%91%E7%89%88%E8%AF%A6%E7%BB%86%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B)
### 3.1. 下载leanote
Leanote V1.0-beta.2 已发布, 二进制文件(暂时没有windows版的):
* Linux: [leanote-linux-x86_64.v1.0-beta.2.bin.tar.gz](https://github.com/leanote/leanote/releases/download/1.0-beta/leanote-linux-x86_64.v1.0-beta.2.bin.tar.gz)
* MacOS X: [leanote-mac-x86_64.v1.0-beta.2.bin.tar.gz](https://github.com/leanote/leanote/releases/download/1.0-beta/leanote-mac-x86_64.v1.0-beta.2.bin.tar.gz)
或者直接检出[Leanote bin repository](https://github.com/leanote/leanote-bin) (推荐, 因为为最新版本)
### 3.2. 安装 MongodbDB
Leanote是由golang(使用[revel](https://revel.github.io/)框架 和 [MongoDB](https://www.mongodb.org)数据库), 你需要先安装Mongodb.
安装MongodbDB, 导入数据更多细节请查看: [wiki](https://github.com/leanote/leanote/wiki/Install-Mongodb)
### 3.3. 导入初始数据
MongodbDB初始数据在 `[PATH_TO_LEANOTE]/mongodb_backup/leanote_install_data`
```
$> mongorestore -h localhost -d leanote --directoryperdb PATH_TO_LEANOTE/mongodb_backup/leanote_install_data
```
初始数据包含两个用户:
```
user2 username: admin, password: abc123 (管理员, 重要!)
user3 username: demo@leanote.com, password: demo@leanote.com (为体验使用)
```
### 3.4. 配置
修改 `[PATH_TO_LEANOTE]/conf/app.conf`. 有以下选项:
``mongodb`` **必须配置!**
```Shell
db.host=localhost
db.port=27017
db.dbname=leanote
db.username=
db.password=
```
``app.secret`` **重要**
请随意修改一个, app的密钥, 不能使用默认的, 不然会有安全问题
更多配置请查看 `app/app.conf` 和 [revel 手册](https://revel.github.io/)
### 3.5. 运行leanote
```
$> cd PATH_TO_LEANOTE/bin
$> sudo sh run.sh
```
## 4. 如何对leanote进行二次开发
请查看 [How-to-develop-leanote](https://github.com/leanote/leanote/wiki/How-to-develop-leanote-%E5%A6%82%E4%BD%95%E5%BC%80%E5%8F%91leanote)
## 5. 贡献者
多谢 [贡献者](https://github.com/leanote/leanote/graphs/contributors) 的贡献, leanote因有你们而更完美!
## 6. 加入我们
欢迎提交[pull requests](https://github.com/leanote/leanote/pulls) 到leanote.
leanote还有很多问题, 如果你喜欢它, 欢迎加入我们一起完善leanote.
## 相关文档
* [leanote二进制版详细安装教程](https://github.com/leanote/leanote/wiki/leanote%E4%BA%8C%E8%BF%9B%E5%88%B6%E7%89%88%E8%AF%A6%E7%BB%86%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B)
* [leanote开发版详细安装教程](https://github.com/leanote/leanote/wiki/leanote%E5%BC%80%E5%8F%91%E7%89%88%E8%AF%A6%E7%BB%86%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B)
* [Leanote source leanote源码导读](https://github.com/leanote/leanote/wiki/Leanote-source-leanote源码导读)
* [leanote blog theme api(中文版)](https://github.com/leanote/leanote/wiki/leanote-blog-theme-api)
* [How to develop leanote 如何开发leanote](https://github.com/leanote/leanote/wiki/How-to-develop-leanote-如何开发leanote)
## 讨论
* [leanote 社区](http://bbs.leanote.com)
* QQ群: 158716820
* [leanote google group](https://groups.google.com/forum/#!forum/leanote)
+113
View File
@@ -0,0 +1,113 @@
# Leanote产品
## 1. 介绍
Leanote, 不只是笔记!
![leanote.png](leanote.png "")
**特性**
* 知识管理: 通过leanote来管理知识, leanote有易操作的界面, 包含两款编辑器tinymce和markdown. 在leanote, 你可以尽情享受写作.
* 分享: 你也可以通过分享知识给好友, 让好友拥有你的知识.
* 协作: 在分享的同时也可以与好友一起协作知识.
* 博客: leanote也可以作为你的博客, 将知识公开成博客, 让leanote把你的知识传播的更远!
## 2. 为什么我们要创建leanote?
说实话, 我们曾是evernote的忠实粉丝, 但是我们也发现evernote的不足:
* evernote的编辑器不能满足我们的需求, 不能贴代码(格式会乱掉, 作为程序员, 代码是我们的基本需求啊), 图片不能缩放.
* 我们是markdown的爱好者, 可是evernote竟然没有.
* 我们也想将知识公开, 所以我们有自己的博客, 如wordpress, 但为什么这两者不能合二为一呢?
* 还有...
## 3.安装leanote
leanote是一款私有云笔记, 你可以下载它安装在自己的服务器上, 当然也可以在 http://leanote.com 上注册.
这里详细整理了leanote二进版和leanote开发版的安装教程, 请移步至:
* [leanote二进制详细安装教程](https://github.com/leanote/leanote/wiki/leanote%E4%BA%8C%E8%BF%9B%E5%88%B6%E7%89%88%E8%AF%A6%E7%BB%86%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B)
* [leanote开发版详细安装教程](https://github.com/leanote/leanote/wiki/leanote%E5%BC%80%E5%8F%91%E7%89%88%E8%AF%A6%E7%BB%86%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B)
### 3.1. 下载leanote
Leanote V1.0-beta.2 已发布, 二进制文件(暂时没有windows版的):
* Linux: [leanote-linux-x86_64.v1.0-beta.2.bin.tar.gz](https://github.com/leanote/leanote/releases/download/1.0-beta/leanote-linux-x86_64.v1.0-beta.2.bin.tar.gz)
* MacOS X: [leanote-mac-x86_64.v1.0-beta.2.bin.tar.gz](https://github.com/leanote/leanote/releases/download/1.0-beta/leanote-mac-x86_64.v1.0-beta.2.bin.tar.gz)
或者直接检出[Leanote bin repository](https://github.com/leanote/leanote-bin) (推荐, 因为为最新版本)
### 3.2. 安装 MongodbDB
Leanote是由golang(使用[revel](https://revel.github.io/)框架 和 [MongoDB](https://www.mongodb.org)数据库), 你需要先安装Mongodb.
安装MongodbDB, 导入数据更多细节请查看: [wiki](https://github.com/leanote/leanote/wiki/Install-Mongodb)
### 3.3. 导入初始数据
MongodbDB初始数据在 `[PATH_TO_LEANOTE]/mongodb_backup/leanote_install_data`
```
$> mongorestore -h localhost -d leanote --directoryperdb PATH_TO_LEANOTE/mongodb_backup/leanote_install_data
```
初始数据包含两个用户:
```
user2 username: admin, password: abc123 (管理员, 重要!)
user3 username: demo@leanote.com, password: demo@leanote.com (为体验使用)
```
### 3.4. 配置
修改 `[PATH_TO_LEANOTE]/conf/app.conf`. 有以下选项:
``mongodb`` **必须配置!**
```Shell
db.host=localhost
db.port=27017
db.dbname=leanote
db.username=
db.password=
```
``app.secret`` **重要**
请随意修改一个, app的密钥, 不能使用默认的, 不然会有安全问题
更多配置请查看 `app/app.conf` 和 [revel 手册](https://revel.github.io/)
### 3.5. 运行leanote
```
$> cd PATH_TO_LEANOTE/bin
$> sudo sh run.sh
```
## 4. 如何对leanote进行二次开发
请查看 [How-to-develop-leanote](https://github.com/leanote/leanote/wiki/How-to-develop-leanote-%E5%A6%82%E4%BD%95%E5%BC%80%E5%8F%91leanote)
## 5. 贡献者
多谢 [贡献者](https://github.com/leanote/leanote/graphs/contributors) 的贡献, leanote因有你们而更完美!
## 6. 加入我们
欢迎提交[pull requests](https://github.com/leanote/leanote/pulls) 到leanote.
leanote还有很多问题, 如果你喜欢它, 欢迎加入我们一起完善leanote.
## 相关文档
* [leanote二进制版详细安装教程](https://github.com/leanote/leanote/wiki/leanote%E4%BA%8C%E8%BF%9B%E5%88%B6%E7%89%88%E8%AF%A6%E7%BB%86%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B)
* [leanote开发版详细安装教程](https://github.com/leanote/leanote/wiki/leanote%E5%BC%80%E5%8F%91%E7%89%88%E8%AF%A6%E7%BB%86%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B)
* [Leanote source leanote源码导读](https://github.com/leanote/leanote/wiki/Leanote-source-leanote源码导读)
* [leanote blog theme api(中文版)](https://github.com/leanote/leanote/wiki/leanote-blog-theme-api)
* [How to develop leanote 如何开发leanote](https://github.com/leanote/leanote/wiki/How-to-develop-leanote-如何开发leanote)
## 讨论
* [leanote 社区](http://bbs.leanote.com)
* QQ群: 158716820
* [leanote google group](https://groups.google.com/forum/#!forum/leanote)
----------------------------------------------------------------
[English](README.md)
+102 -101
View File
@@ -1,32 +1,32 @@
package app package app
import ( import (
"github.com/revel/revel" "encoding/json"
. "github.com/leanote/leanote/app/lea" "fmt"
"github.com/leanote/leanote/app/service"
"github.com/leanote/leanote/app/db"
"github.com/leanote/leanote/app/controllers" "github.com/leanote/leanote/app/controllers"
"github.com/leanote/leanote/app/controllers/admin" "github.com/leanote/leanote/app/controllers/admin"
"github.com/leanote/leanote/app/controllers/member" "github.com/leanote/leanote/app/controllers/member"
"github.com/leanote/leanote/app/db"
. "github.com/leanote/leanote/app/lea"
_ "github.com/leanote/leanote/app/lea/binder" _ "github.com/leanote/leanote/app/lea/binder"
"github.com/leanote/leanote/app/lea/session"
"github.com/leanote/leanote/app/lea/memcache" "github.com/leanote/leanote/app/lea/memcache"
"github.com/leanote/leanote/app/lea/route" "github.com/leanote/leanote/app/lea/route"
"reflect" "github.com/leanote/leanote/app/lea/session"
"fmt" "github.com/leanote/leanote/app/service"
"github.com/revel/revel"
"html/template" "html/template"
"math" "math"
"strings"
"strconv"
"time"
"encoding/json"
"net/url" "net/url"
"reflect"
"strconv"
"strings"
"time"
) )
func init() { func init() {
// Filters is the default set of global filters. // Filters is the default set of global filters.
revel.Filters = []revel.Filter{ revel.Filters = []revel.Filter{
revel.PanicFilter, // Recover from panics and display an error page instead. revel.PanicFilter, // Recover from panics and display an error page instead.
route.RouterFilter, route.RouterFilter,
// revel.RouterFilter, // Use the routing table to select the right Action // revel.RouterFilter, // Use the routing table to select the right Action
// AuthFilter, // Invoke the action. // AuthFilter, // Invoke the action.
@@ -36,31 +36,32 @@ func init() {
// 使用SessionFilter标准版从cookie中得到sessionID, 然后通过MssessionFilter从Memcache中得到 // 使用SessionFilter标准版从cookie中得到sessionID, 然后通过MssessionFilter从Memcache中得到
// session, 之后MSessionFilter将session只存sessionID然后返回给SessionFilter返回到web // session, 之后MSessionFilter将session只存sessionID然后返回给SessionFilter返回到web
session.SessionFilter, // leanote session session.SessionFilter, // leanote session
// session.MSessionFilter, // leanote memcache session // session.MSessionFilter, // leanote memcache session
revel.FlashFilter, // Restore and write the flash cookie. revel.FlashFilter, // Restore and write the flash cookie.
revel.ValidationFilter, // Restore kept validation errors and save new ones from cookie. revel.ValidationFilter, // Restore kept validation errors and save new ones from cookie.
revel.I18nFilter, // Resolve the requested language revel.I18nFilter, // Resolve the requested language
revel.InterceptorFilter, // Run interceptors around the action. revel.InterceptorFilter, // Run interceptors around the action.
revel.CompressFilter, // Compress the result. revel.CompressFilter, // Compress the result.
revel.ActionInvoker, // Invoke the action. revel.ActionInvoker, // Invoke the action.
} }
//自定义模版函数
revel.TemplateFuncs["raw"] = func(str string) template.HTML { revel.TemplateFuncs["raw"] = func(str string) template.HTML {
return template.HTML(str) return template.HTML(str)
} }
revel.TemplateFuncs["add"] = func(i int) string { revel.TemplateFuncs["add"] = func(i int) string {
i = i + 1; i = i + 1
return fmt.Sprintf("%v", i) return fmt.Sprintf("%v", i)
} }
revel.TemplateFuncs["sub"] = func(i int) int { revel.TemplateFuncs["sub"] = func(i int) int {
i = i - 1; i = i - 1
return i return i
} }
// 增加或减少 // 增加或减少
revel.TemplateFuncs["incr"] = func(n, i int) int { revel.TemplateFuncs["incr"] = func(n, i int) int {
n = n + i; n = n + i
return n return n
} }
revel.TemplateFuncs["join"] = func(arr []string) template.HTML { revel.TemplateFuncs["join"] = func(arr []string) template.HTML {
@@ -124,62 +125,62 @@ func init() {
str = tag str = tag
} }
tagStr += str tagStr += str
if i != lenTags - 1 { if i != lenTags-1 {
tagStr += "," tagStr += ","
} }
} }
return template.HTML(tagStr) return template.HTML(tagStr)
} }
/* /*
revel.TemplateFuncs["blogTags"] = func(tags []string) template.HTML { revel.TemplateFuncs["blogTags"] = func(tags []string) template.HTML {
if tags == nil || len(tags) == 0 { if tags == nil || len(tags) == 0 {
return "" return ""
}
// TODO 这里判断语言, 从语言包中拿
tagMap := map[string]string{"red": "红色", "yellow": "黄色", "blue": "蓝色", "green": "绿色"}
tagStr := ""
lenTags := len(tags)
for i, tag := range tags {
if text, ok := tagMap[tag]; ok {
tagStr += text
} else {
tagStr += tag
} }
if i != lenTags - 1 { // TODO 这里判断语言, 从语言包中拿
tagStr += "," tagMap := map[string]string{"red": "红色", "yellow": "黄色", "blue": "蓝色", "green": "绿色"}
tagStr := ""
lenTags := len(tags)
for i, tag := range tags {
if text, ok := tagMap[tag]; ok {
tagStr += text
} else {
tagStr += tag
}
if i != lenTags - 1 {
tagStr += ","
}
} }
return template.HTML(tagStr)
} }
return template.HTML(tagStr)
}
*/ */
revel.TemplateFuncs["li"] = func(a string) string { revel.TemplateFuncs["li"] = func(a string) string {
return "" return ""
} }
// str连接 // str连接
revel.TemplateFuncs["urlConcat"] = func(url string, v... interface{}) string { revel.TemplateFuncs["urlConcat"] = func(url string, v ...interface{}) string {
html := "" html := ""
for i := 0; i < len(v); i = i + 2 { for i := 0; i < len(v); i = i + 2 {
item := v[i] item := v[i]
if i+1 == len(v) { if i+1 == len(v) {
break; break
} }
value := v[i+1] value := v[i+1]
if item != nil && value != nil { if item != nil && value != nil {
keyStr, _ := item.(string) keyStr, _ := item.(string)
valueStr, err := value.(string) valueStr, err := value.(string)
if !err { if !err {
valueInt, _ := value.(int) valueInt, _ := value.(int)
valueStr = strconv.Itoa(valueInt) valueStr = strconv.Itoa(valueInt)
} }
if keyStr != "" && valueStr != "" { if keyStr != "" && valueStr != "" {
s := keyStr + "=" + valueStr s := keyStr + "=" + valueStr
if html != "" { if html != "" {
html += "&" + s html += "&" + s
} else { } else {
html += s html += s
} }
} }
} }
} }
if html != "" { if html != "" {
@@ -209,32 +210,32 @@ func init() {
// 必须要返回HTMLAttr, 返回html, golang 会执行安全检查返回ZgotmplZ // 必须要返回HTMLAttr, 返回html, golang 会执行安全检查返回ZgotmplZ
// sorterI 可能是nil, 所以用interfalce{}来接收 // sorterI 可能是nil, 所以用interfalce{}来接收
/* /*
data-url="/adminUser/index" data-url="/adminUser/index"
data-sorter="email" data-sorter="email"
class="th-sortable {{if eq .sorter "email-up"}}th-sort-up{{else}}{{if eq .sorter "email-down"}}th-sort-down{{end}}{{end}}" class="th-sortable {{if eq .sorter "email-up"}}th-sort-up{{else}}{{if eq .sorter "email-down"}}th-sort-down{{end}}{{end}}"
*/ */
revel.TemplateFuncs["sorterTh"] = func(url, sorterField string, sorterI interface{}) template.HTMLAttr { revel.TemplateFuncs["sorterTh"] = func(url, sorterField string, sorterI interface{}) template.HTMLAttr {
sorter := "" sorter := ""
if sorterI != nil { if sorterI != nil {
sorter, _ = sorterI.(string) sorter, _ = sorterI.(string)
} }
html := "data-url=\"" + url + "\" data-sorter=\"" + sorterField + "\""; html := "data-url=\"" + url + "\" data-sorter=\"" + sorterField + "\""
html += " class=\"th-sortable "; html += " class=\"th-sortable "
if sorter == sorterField + "-up" { if sorter == sorterField+"-up" {
html += "th-sort-up\""; html += "th-sort-up\""
} else if(sorter == sorterField + "-down") { } else if sorter == sorterField+"-down" {
html += "th-sort-down"; html += "th-sort-down"
} }
html += "\""; html += "\""
return template.HTMLAttr(html) return template.HTMLAttr(html)
} }
// pagination // pagination
revel.TemplateFuncs["page"] = func(urlBase string, page, pageSize, count int) template.HTML { revel.TemplateFuncs["page"] = func(urlBase string, page, pageSize, count int) template.HTML {
if count == 0 { if count == 0 {
return ""; return ""
} }
totalPage := int(math.Ceil(float64(count)/float64(pageSize))) totalPage := int(math.Ceil(float64(count) / float64(pageSize)))
preClass := "" preClass := ""
prePage := page - 1 prePage := page - 1
@@ -245,7 +246,7 @@ func init() {
nextPage := page + 1 nextPage := page + 1
var preUrl, nextUrl string var preUrl, nextUrl string
preUrl = urlBase + "?page=" + strconv.Itoa(prePage) preUrl = urlBase + "?page=" + strconv.Itoa(prePage)
nextUrl = urlBase + "?page=" + strconv.Itoa(nextPage) nextUrl = urlBase + "?page=" + strconv.Itoa(nextPage)
// 没有上一页了 // 没有上一页了
@@ -265,47 +266,47 @@ func init() {
// http://play.golang.org/p/snygrVpQva // http://play.golang.org/p/snygrVpQva
// http://grokbase.com/t/gg/golang-nuts/142a6dhfh3/go-nuts-text-template-using-comparison-operators-eq-gt-etc-on-non-existent-variable-causes-the-template-to-stop-outputting-but-with-no-error-correct-behaviour // http://grokbase.com/t/gg/golang-nuts/142a6dhfh3/go-nuts-text-template-using-comparison-operators-eq-gt-etc-on-non-existent-variable-causes-the-template-to-stop-outputting-but-with-no-error-correct-behaviour
/* /*
revel.TemplateFuncs["gt"] = func(a1, a2 interface{}) bool { revel.TemplateFuncs["gt"] = func(a1, a2 interface{}) bool {
switch a1.(type) { switch a1.(type) {
case string:
switch a2.(type) {
case string: case string:
return reflect.ValueOf(a1).String() > reflect.ValueOf(a2).String() switch a2.(type) {
} case string:
case int, int8, int16, int32, int64: return reflect.ValueOf(a1).String() > reflect.ValueOf(a2).String()
switch a2.(type) { }
case int, int8, int16, int32, int64: case int, int8, int16, int32, int64:
return reflect.ValueOf(a1).Int() > reflect.ValueOf(a2).Int() switch a2.(type) {
} case int, int8, int16, int32, int64:
case uint, uint8, uint16, uint32, uint64: return reflect.ValueOf(a1).Int() > reflect.ValueOf(a2).Int()
switch a2.(type) { }
case uint, uint8, uint16, uint32, uint64: case uint, uint8, uint16, uint32, uint64:
return reflect.ValueOf(a1).Uint() > reflect.ValueOf(a2).Uint() switch a2.(type) {
} case uint, uint8, uint16, uint32, uint64:
case float32, float64: return reflect.ValueOf(a1).Uint() > reflect.ValueOf(a2).Uint()
switch a2.(type) { }
case float32, float64: case float32, float64:
return reflect.ValueOf(a1).Float() > reflect.ValueOf(a2).Float() switch a2.(type) {
case float32, float64:
return reflect.ValueOf(a1).Float() > reflect.ValueOf(a2).Float()
}
} }
return false
} }
return false
}
*/ */
/* /*
{{range $i := N 1 10}} {{range $i := N 1 10}}
<div>{{$i}}</div> <div>{{$i}}</div>
{{end}} {{end}}
*/ */
revel.TemplateFuncs["N"] = func(start, end int) (stream chan int) { revel.TemplateFuncs["N"] = func(start, end int) (stream chan int) {
stream = make(chan int) stream = make(chan int)
go func() { go func() {
for i := start; i <= end; i++ { for i := start; i <= end; i++ {
stream <- i stream <- i
} }
close(stream) close(stream)
}() }()
return return
} }
// init Email // init Email
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 KiB

After

Width:  |  Height:  |  Size: 305 KiB

+19
View File
@@ -0,0 +1,19 @@
{{template "header.html" .}}
<div id="postsContainer">
<div id="posts">
<div class="each-post">
<div class="title">
404 NOT FOUND
</div>
<div class="desc">
Sorry, We can't find this page.
</div>
</div>
</div>
</div>
{{template "footer.html" $}}
</body>
</html>
+38
View File
@@ -0,0 +1,38 @@
{{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 .MonthAchives}}
<li>
<span class="archive-month">{{.Month}}</span>
<ul>
{{range .Posts}}
<li>
{{dateFormat .PublicTime "2006-01-02"}} <a href="{{$.postUrl}}/{{.UrlTitle}}">{{.Title}}</a>
</li>
{{end}}
</ul>
</li>
{{end}}
</ul>
</li>
{{end}}
</ul>
</div>
</div>
</div>
{{template "footer.html" .}}
</body>
</html>
+42
View File
@@ -0,0 +1,42 @@
{{template "header.html" .}}
<div id="postsContainer">
<div class="container">
<h2>分类 - {{$.curCateTitle}}</h2>
</div>
<div id="posts">
{{range $.posts}}
<div class="each-post">
<div class="title">
<a href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">
{{.Title}}
</a>
</div>
<div class="created-time">
<i class="fa fa-bookmark-o"></i>
{{if .Tags}}
{{blogTags $ .Tags}}
{{else}}
无
{{end}}
|
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}}
|
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
</div>
<div class="desc">
{{.Abstract | raw}}
</div>
<a class="more" href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">查看</a>
</div>
{{end}}
<!-- 分页 -->
{{template "paging.html" $}}
</div>
</div>
{{template "footer.html" $}}
{{template "highlight.html" $}}
</body>
</html>
+65
View File
@@ -0,0 +1,65 @@
<div id="footerContainer">
{{$userId := $.blogInfo.UserId}}
<div class="container" id="footer">
<div class="col-md-4">
<h3>导航</h3>
<ul>
<li><a href="{{$.indexUrl}}">主页</a></li>
{{range $.cates}}
<li>
<a href="{{$.cateUrl}}/{{.UrlTitle}}">{{.Title}}</a>
</li>
{{end}}
<!-- 单页 -->
{{range $.singles}}
<li class="{{if eq $.curSingleId .SingleId}}active{{end}}">
<a href="{{$.singleUrl}}/{{.UrlTitle}}">{{.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>
</div>
<div class="col-md-4">
<h3>最近发表</h3>
<ul>
{{range .recentPosts}}
<li title="{{.Title}}"><a href="{{$.postUrl}}/{{.UrlTitle}}">{{.Title}}</a></li>
{{end}}
</ul>
</div>
<div class="col-md-4">
<h3>友情链接 </h3>
<ul>
{{if $.themeInfo.FriendLinks}}
{{range $.themeInfo.FriendLinks}}
<li><a href="{{.Url}}" target="_blank">{{.Title}}</a></li>
{{end}}
{{end}}
</ul>
</div>
</div>
</div>
<script src="{{$.jQueryUrl}}"></script>
<script src="{{$.bootstrapJsUrl}}"></script>
<script src="{{$.siteUrl}}/js/bootstrap-hover-dropdown.js"></script>
<script>
// 搜索
function search(e) {
var keywords = $("#searchInput").val();
if(!keywords) {
location.href = "{{$.searchUrl}}";
} else {
var tpl = '<form action="{{$.searchUrl}}" method="get">';
tpl += '<input name="keywords" value="' + keywords + '" />';
tpl += "</form";
$(tpl).submit();
}
}
</script>
+122
View File
@@ -0,0 +1,122 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="keywords" content="leanote,leanote.com">
<meta name="description" content="leanote, not only a notebook">
<meta name="author" content="leanote">
<title>
{{if $.curIsIndex}}
{{$.blogInfo.Title}}
{{else if $.curIsCate}}
分类-{{$.curCateTitle}}
{{else if $.curIsSearch}}
搜索-{{$.keywords}}
{{else if $.curIsTags}}
我的标签
{{else if $.curIsTagPosts}}
标签-{{$.curTag}}
{{else if $.curIsPost}}
{{$.post.Title}}
{{else if $.curIsSingle}}
{{$.single.Title}}
{{else if $.curIsArchive}}
归档
{{end}}
</title>
<!-- Bootstrap core CSS -->
<link href="{{$.bootstrapCssUrl}}" rel="stylesheet">
<!-- 字体必须同一域 -->
<link href="{{$.fontAwesomeUrl}}" rel="stylesheet">
<link href="{{$.themeBaseUrl}}/style.css" rel="stylesheet">
<script>
function log(o) {
}
</script>
<style>
</style>
</head>
<body>
<div id="headerAndNav" >
<div id="headerContainer" class="container">
<!-- 头部可放博客名, 导航 -->
<div id="header">
{{$username := .userInfo.Username}}
<h1>
<a href="{{$.indexUrl}}" id="logo">
{{if $.blogInfo.Logo}}
<img src="{{$.blogInfo.Logo}}" title="{{$.blogInfo.Title}}"/>
{{else}}
{{$.blogInfo.Title | raw}}
{{end}}
</a>
</h1>
<div id="blogDesc">
{{$.blogInfo.SubTitle | raw}}
</div>
</div>
</div>
<!-- Static navbar -->
<div class="navbar navbar-default">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{{.indexUrl}}">
{{if $.blogInfo.Logo}}
<img src="{{$.blogInfo.Logo}}" title="{{$.blogInfo.Title}}"/>
{{else}}
{{$.blogInfo.Title | raw}}
{{end}}
</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="{{if $.curIsIndex}}active{{end}}"><a href="{{.indexUrl}}">主页</a></li>
<!-- 分类页 -->
{{range $.cates}}
<li class="{{if eq .CateId $.curCateId}}active{{end}}">
<a href="{{$.cateUrl}}/{{.UrlTitle}}"
>{{.Title}}</a>
</li>
{{end}}
<!-- 单页 -->
{{range $.singles}}
<li class="{{if eq $.curSingleId .SingleId}}active{{end}}">
<a href="{{$.singleUrl}}/{{.UrlTitle}}">{{.Title}}</a>
</li>
{{end}}
<!-- 归档 -->
<li class="{{if $.curIsArchive}}active{{end}}">
<a href="{{$.archiveUrl}}">归档</a>
</li>
<li class="{{if $.curIsTags}}active{{end}}">
<a href="{{$.tagsUrl}}">标签</a>
</li>
</ul>
<form class="navbar-form navbar-right" id="search" onsubmit="search(event);return false;">
<div class="input-group">
<span class="input-group-addon" id="searchIcon" onclick="search(event);"><i class="fa fa-search"></i></span>
<input type="text" placeholder="search" id="searchInput" class="form-control" value="{{.keywords}}">
</div>
</form>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
+6
View File
@@ -0,0 +1,6 @@
<link href="{{$.prettifyCssUrl}}" type="text/css" rel="stylesheet"/>
<script src="{{$.prettifyJsUrl}}"></script>
<script>
$("pre").addClass("prettyprint linenums");
prettyPrint();
</script>
Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 629 B

+39
View File
@@ -0,0 +1,39 @@
{{template "header.html" .}}
<div id="postsContainer">
<div id="posts">
{{range $.posts}}
<div class="each-post">
<div class="title">
<a href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">
{{.Title}}
</a>
</div>
<div class="created-time">
<i class="fa fa-bookmark-o"></i>
{{if .Tags}}
{{blogTags $ .Tags}}
{{else}}
无
{{end}}
|
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}}
|
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
</div>
<div class="desc">
{{.Abstract | raw}}
</div>
<a class="more" href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">查看</a>
</div>
{{end}}
<!-- 分页 -->
{{template "paging.html" $}}
</div>
</div>
{{template "footer.html" $}}
{{template "highlight.html" $}}
</body>
</html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

+1
View File
@@ -0,0 +1 @@
aaaaaaaaaaaaaaaaaaa
+27
View File
@@ -0,0 +1,27 @@
{{if gt $.paging.TotalPage 1}}
<!-- 上一页 -->
{{if gt $.paging.CurPage 1}}
{{set . "prePageClass" ""}}
{{set . "prePageUrl" (urlConcat $.pagingBaseUrl "page" (incr $.paging.CurPage -1)) }}
{{else}}
{{set . "prePageClass" "disabled"}}
{{set . "prePageUrl" "#"}}
{{end}}
<!-- 下一页 -->
{{if lt $.paging.CurPage $.paging.TotalPage }}
{{set . "nextPageClass" ""}}
{{set . "nextPageUrl" (urlConcat $.pagingBaseUrl "page" (incr $.paging.CurPage 1)) }}
{{else}}
{{set . "nextPageClass" "disabled"}}
{{set . "nextPageUrl" "#"}}
{{end}}
{{$.paging.CurPage}}/{{$.paging.TotalPage}}
<ul class="pager">
<li class="{{$.prePageClass}}"><a href="{{$.prePageUrl}}">上一页</a></li>
<li class="{{$.nextPageClass}}"><a href="{{$.nextPageUrl}}">下一页</a></li>
</ul>
{{end}}
+143
View File
@@ -0,0 +1,143 @@
{{template "header.html" .}}
<div id="postsContainer">
<div id="posts">
<div class="each-post">
<div class="title">
{{.post.Title}}
</div>
<div class="created-time">
<i class="fa fa-bookmark-o"></i>
{{if .post.Tags}}
{{blogTags $ .post.Tags}}
{{else}}
无
{{end}}
|
<i class="fa fa-calendar"></i> 更新 {{$.post.UpdatedTime | datetime}}
|
<i class="fa fa-calendar"></i> 创建 {{$.post.CreatedTime | datetime}}
</div>
<!-- 仅为移动端 -->
<div class="mobile-created-time">
{{ if $.blogInfo.UserLogo}}
<img src="{{$.blogInfo.UserLogo}}" id="userLogo">
{{else}}
<img src="{{$.siteUrl}}/images/blog/default_avatar.png" id="userLogo">
{{end}}
{{$.blogInfo.Username}}
{{if .post.Tags}}
&nbsp;
<i class="fa fa-bookmark-o" style="color: #666"></i>
{{blogTags $ $.post.Tags}}
{{end}}
</div>
<div class="desc {{if $.post.IsMarkdown }}markdown-content{{end}}" id="content">
{{if $.post.IsMarkdown }}
<div id="markdownContent" style="display: none">
<!-- 用textarea装html, 防止得到的值失真 -->
<textarea>{{$.post.Content | raw}}</textarea>
</div>
<div style="padding: 20px; text-align: center">
<img src="{{$.themeBaseUrl}}/images/loading-32.gif" />
</div>
{{else}}
{{$.post.Content | raw}}
{{end}}
</div>
<div class="pre-next-post">
<p>
上一篇: {{if $.prePost}}<a href="{{$.postUrl}}/{{$.prePost.UrlTitle}}">{{$.prePost.Title}}</a>{{else}}无{{end}}
</p>
<p>
下一篇: {{if $.nextPost}}<a href="{{$.postUrl}}/{{$.nextPost.UrlTitle}}">{{$.nextPost.Title}}</a>{{else}}无{{end}}
</p>
</div>
<!-- share & comment -->
{{template "share_comment.html" $}}
</div>
</div>
</div>
{{template "footer.html" $}}
{{template "highlight.html" $}}
<div id="blogNav">
<div id="blogNavNav">
<i class="fa fa-align-justify" title="文档导航"></i>
<span>文档导航</span>
</div>
<div id="blogNavContent">
</div>
</div>
<!-- 一些在share_comment.js 需要使用的变量 -->
<script>
var siteUrl = "{{$.siteUrl}}"; // common.js需要
// 以下 share_comment.js需要
var blogInfo={UserId: "{{$.blogInfo.UserId}}", OpenComment: {{$.blogInfo.OpenComment}}, CommentType: "{{$.blogInfo.CommentType}}"};
var noteId = "{{$.post.NoteId}}"; //
var preLikeNum = +"{{$.post.LikeNum}}";
var commentNum = +"{{$.post.CommentNum}}";
</script>
<!-- 共享与评论css -->
<link href="{{$.shareCommentCssUrl}}" rel="stylesheet">
<!-- 一些公用的js -->
<script src="{{$.blogCommonJsUrl}}"></script>
<script src="{{$.siteUrl}}/public/blog/js/jsrender.js"></script>
<script src="{{$.siteUrl}}/public/blog/js/jquery-cookie-min.js"></script>
<script src="{{$.siteUrl}}/public/blog/js/bootstrap-dialog.min.js"></script>
<script src="{{$.siteUrl}}/public/blog/js/jquery.qrcode.min.js"></script>
<!-- share && comment -->
<script src="{{$.shareCommentJsUrl}}"></script>
<!--
markdown
调用markdown来解析得到html
-->
{{if $.post.IsMarkdown }}
<script src="/public/mdeditor/editor/pagedown/Markdown.Converter.js"></script>
<script src="/public/mdeditor/editor/pagedown/Markdown.Sanitizer.js"></script>
<script src="/public/mdeditor/editor/pagedown/Markdown.Editor.js"></script>
<script src="/public/mdeditor/editor/pagedown/local/Markdown.local.zh.js"></script>
<script src="/public/mdeditor/editor/Markdown.Extra.js"></script>
<!--mathjax-->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ["\\(","\\)"]], processEscapes: true }, messageStyle: "none"});
</script>
<script src="/public/mdeditor/editor/mathJax.js"></script>
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script>
var content = $.trim($("#markdownContent textarea").val());
var converter = Markdown.getSanitizingConverter();
Markdown.Extra.init(converter, {extensions: ["tables", "fenced_code_gfm", "def_list"]});
var html = converter.makeHtml(content);
$("#content").html(html);
$("pre").addClass("prettyprint linenums");
prettyPrint();
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"wmd-preview"]);
initNav();
weixin();
</script>
<!-- 不是markdown -->
{{else}}
<script>
$(function() {
initNav();
weixin();
});
</script>
{{end}}
</body>
</html>
+49
View File
@@ -0,0 +1,49 @@
{{template "header.html" .}}
<div id="postsContainer">
<div class="container">
<h2>搜索 - {{.keywords}} </h2>
</div>
<div id="posts">
{{range .posts}}
<div class="each-post">
<div class="title">
<a href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">
{{.Title}}
</a>
</div>
<div class="created-time">
<i class="fa fa-bookmark-o"></i>
{{if .Tags}}
{{blogTags $ .Tags}}
{{else}}
无
{{end}}
|
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}} |
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
</div>
<div class="desc">
{{.Abstract | raw}}
</div>
<a class="more" href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">查看</a>
</div>
{{else}}
<div class="each-post">
无
</div>
{{end}}
<!-- 分页 -->
{{template "paging.html" $}}
</div>
</div>
{{template "footer.html" $}}
{{template "highlight.html" $}}
</body>
</html>
@@ -0,0 +1,172 @@
<!-- 赞 -->
<div class="entry-controls clearfix">
<div class="vote-section-wrapper clearfix">
<button class="btn btn-default btn-zan" id="likeBtn"><i class="fa fa-thumbs-o-up"></i> <span id="likeNum">{{$.post.LikeNum}}</span> 赞</button>
<span class="control-item read-counts"><i class="fa fa-eye"></i> {{if $.post.ReadNum}}{{$.post.ReadNum}}{{else}}1{{end}} 人读过</span>
</div>
<div class="right-section">
<div id="weixinQRCode"></div>
<button class="btn btn-share btn-default btn-weibo"><i class="fa fa-weibo"></i> 新浪微博</button>
<button class="btn btn-share btn-default btn-weixin"><i class="fa fa-wechat"></i> 微信</button>
<div class="dropdown" style="display: inline-block; cursor: pointer; padding: 5px 10px;">
<!-- open -->
<div class="dropdown-toggle" data-hover="dropdown" data-toggle="dropdown">
<i class="fa fa-share-square-o"></i>
更多分享
</div>
<ul class="dropdown-menu" role="menu">
<li><a href="#" class="btn-share tencent-weibo"><i class="fa fa-tencent-weibo"></i> 腾讯微博</a></li>
<li><a href="#" class="btn-share qq"><i class="fa fa-qq"></i> QQ空间</a></li>
<li><a href="#" class="btn-share renren"><i class="fa fa-renren"></i> 人人网</a></li>
</ul>
</div>
</div>
<div class="voters clearfix" id="likers">
</div>
</div>
<script type="text/x-jsrender" id="tLikers">
[[for users]]
<a id="liker_[[:UserId]]" title="[[:BlogTitle]]" href="[[:BlogUrl]]" target="_blank" class="voter">
[[if Logo]]
<img alt="avatar" class="avatar-small" src="[[:Logo]]">
[[else]]
<img alt="avatar" class="avatar-small" src="/images/blog/default_avatar.png">
[[/if]]
</a>
[[/for]]
</script>
{{if and $.blogInfo.OpenComment (not (eq $.blogInfo.CommentType "disqus"))}}
<script type="text/x-jsrender" id="tComments">
[[for comments]]
<li class="comment-item">
<!-- 头像 -->
<a ui-hovercard="" target="_blank" class="avatar-link" title="[[:UserInfo.Username]]" href="[[:UserInfo.BlogUrl]]">
<img class="avatar" src="[[:UserInfo.Logo]]">
</a>
<!-- 评论 -->
<div class="comment-body">
<div class="comment-hd">
<a href="[[:UserInfo.BlogUrl]]" target="_blank" >[[:UserInfo.Username]]</a>
[[if IsAuthorComment]]
<span>(作者)</span>
[[/if]]
<!-- 回复其它人 -->
[[if ToUserInfo]]
<span class="in-reply-to">
回复
<a href="[[:ToUserInfo.BlogUrl]]">[[:ToUserInfo.Username]]</a>
</span>
[[if ToUserIsAuthor]]
<span>(作者)</span>
[[/if]]
[[/if]]
</div>
<div class="comment-content ng-binding" ng-bind-html="comment.content">
[[html:Content]]
</div>
<div class="comment-ft clearfix" data-comment-id="[[:CommentId]]" >
<span title="" ui-time="" class="date">[[:PublishDate]] </span>
<span class="like-num [[if !LikeNum]]hide[[/if]]" title="[[:LikeNum]] 赞"><span class="like-num-i">[[:LikeNum]]</span> 赞</span></span>
[[if ~root.visitUserInfo.UserId]]
[[if IsMyNote && !IsMyComment]]
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> 删除</a>
[[/if]]
[[if !IsMyComment]]
<a href="javascript:;" class="comment-reply op-link ">
<i class="fa fa-reply"></i>
回复
</a>
<a href="javascript:;" class="comment-like op-link"><i class="fa fa-thumbs-o-up"></i> <span class="like-text">[[if IsILikeIt]]取消赞[[else]]赞[[/if]]</span></a>
[[else]]
<a href="javascript:;" class="comment-trash op-link "><i class="fa fa-trash"></i> 删除</a>
[[/if]]
[[/if]]
</div>
<!-- 回复该评论 -->
[[if ~root.visitUserInfo.UserId]]
<form class="comment-form comment-box-ft">
<div class="clearfix">
<div class="avatar-wrap">
<img class="avatar" src="[[:~root.visitUserInfo.Logo]]">
</div>
<div class="editor-wrap">
<textarea class="editable" id="commentContent" name="commentContent" placeholder="回复"></textarea>
</div>
</div>
<div class="command clearfix" style="display: block;">
<button class="reply-comment-btn save btn btn-primary" data-comment-id="[[:CommentId]]">提交评论</button>
<a class="cancel reply-cancel btn-link">取消</a>
</div>
</form>
[[/if]]
</div>
</li>
[[/for]]
</script>
<!-- 评论 -->
<div class="comment-box hide">
<form class="comment-form comment-box-ft hide" id="commentForm">
<div class="clearfix">
<div class="avatar-wrap">
<img class="avatar" id="visitUserLogo">
</div>
<div class="editor-wrap">
<textarea class="editable" id="commentContent" name="commentContent" placeholder="评论" style="height: 100px;"></textarea>
</div>
</div>
<div class="command clearfix" style="display: block;">
<button id="commentBtn" class="reply-comment-btn save btn btn-primary">提交评论</button>
</div>
</form>
<div class="needLogin hide" id="noLoginContainer">
<a onclick="goLogin()">立即登录</a>, 发表评论.
<br />
没有帐号? <a onclick="goRegister()">立即注册</a>
</div>
<div class="box-header">
<span class="counter">
<i class="icon icon-comment"></i><span id="commentNum">{{$.post.CommentNum}}</span> 条评论
</span>
</div>
<!-- 评论列表 -->
<ul id="comments">
</ul>
</div>
<!-- 更多评论 -->
<div id="moreComments">
<div class="hide comments-more">
<a>More...</a>
</div>
<div class="comments-loading">
<img src="/images/loading-32.gif" />
</div>
</div>
{{end}}
{{if and $.blogInfo.OpenComment (eq $.blogInfo.CommentType "disqus")}}
<div id="disqus_thread"></div>
<!-- comment -->
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = '{{.blogInfo.DisqusId}}'; // required: replace example with your forum shortname
var disqus_identifier = '{{.blogInfo.UserId}}/{{$.post.NoteId}}/{{$.post.Title}}'; // 博客链接
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
{{end}}
+53
View File
@@ -0,0 +1,53 @@
{{template "header.html" .}}
<div id="postsContainer">
<div id="posts">
<div class="each-post">
<div class="title">
{{.single.Title}}
</div>
<div class="created-time">
<i class="fa fa-calendar"></i> 更新 {{$.single.UpdatedTime | datetime}}
|
<i class="fa fa-calendar"></i> 创建 {{$.single.CreatedTime | datetime}}
</div>
<!-- 仅为移动端 -->
<div class="mobile-created-time">
{{ if $.blogInfo.UserLogo}}
<img src="{{$.blogInfo.UserLogo}}" id="userLogo">
{{else}}
<img src="{{$.siteUrl}}/images/blog/default_avatar.png" id="userLogo">
{{end}}
{{$.blogInfo.Username}}
</div>
<div class="desc" id="content">
{{$.single.Content | raw}}
</div>
</div>
</div>
</div>
{{template "footer.html" $}}
{{template "highlight.html" $}}
<div id="blogNav">
<div id="blogNavNav">
<i class="fa fa-align-justify" title="文档导航"></i>
<span>文档导航</span>
</div>
<div id="blogNavContent">
</div>
</div>
<!-- 一些公用的js -->
<script src="{{$.leanoteUrl}}/public/blog/js/common.js"></script>
<script>
$(function() {
initNav();
});
</script>
</body>
</html>
+530
View File
@@ -0,0 +1,530 @@
#posts img {
max-width: 100%;
}
#content * {
font-size: 16px;
}
#content h1 {
font-size: 30px;
}
#content h2 {
font-size: 24px;
}
#content h3 {
font-size: 18px;
}
#content h4 {
font-size: 14px;
}
@-webkit-keyframes dropdown {
0% {
margin-top: -25px;
opacity: 0;
}
90% {
margin-top: 2px;
}
100% {
margin-top: 0;
opacity: 1;
}
}
@-moz-keyframes dropdown {
0% {
margin-top: -25px;
opacity: 0;
}
90% {
margin-top: 2px;
}
100% {
margin-top: 0;
opacity: 1;
}
}
@-ms-keyframes dropdown {
0% {
margin-top: -25px;
opacity: 0;
}
90% {
margin-top: 2px;
}
100% {
margin-top: 0;
opacity: 1;
}
}
@keyframes dropdown {
0% {
margin-top: -25px;
opacity: 0;
}
90% {
margin-top: 2px;
}
100% {
margin-top: 0;
opacity: 1;
}
}
@-webkit-keyframes pulldown {
0% {
top: 0;
opacity: 0;
}
90% {
top: 90%;
}
100% {
top: 100%;
opacity: 1;
}
}
@-moz-keyframes pulldown {
0% {
top: 0;
opacity: 0;
}
90% {
top: 90%;
}
100% {
top: 100%;
opacity: 1;
}
}
@-ms-keyframes pulldown {
0% {
top: 0;
opacity: 0;
}
90% {
top: 90%;
}
100% {
top: 100%;
opacity: 1;
}
}
@keyframes pulldown {
0% {
top: 0;
opacity: 0;
}
90% {
top: 90%;
}
100% {
top: 100%;
opacity: 1;
}
}
a,
.btn {
-webkit-transition: all 0.2s ease;
-moz-transition: all 0.2s ease;
transition: all 0.2s ease;
}
.btn:focus {
outline: none;
}
ul.dropdown-menu {
box-shadow: rgba(0, 0, 0, 0.172549) 0px 6px 12px 0px;
}
ul.dropdown-menu:before {
content: "";
width: 20px;
height: 12px;
position: absolute;
top: -12px;
right: 20px;
background-image: url("images/triangle_2x.png");
background-size: 20px 12px;
}
ul.dropdown-menu {
display: block;
visibility: hidden;
opacity: 0;
}
.open ul.dropdown-menu {
-webkit-animation: pulldown .2s;
animation: pulldown .2s;
visibility: visible;
opacity: 1;
}
.created-time .fa {
color: #666;
}
#blogNav {
display: none;
background-color: #fff;
opacity: 0.7;
position: fixed;
z-index: 10;
padding: 3px;
border-radius: 3px;
}
#blogNavContent {
overflow-y: auto;
max-height: 250px;
display: none;
-webkit-overflow-scrolling: touch !important;
}
#blogNavNav {
cursor: pointer;
}
#blogNav a {
color: #666;
}
#blogNav:hover {
opacity: 0.9;
}
#blogNav a:hover {
color: #0fb264;
}
#blogNav ul {
padding-left: 20px;
}
#blogNav ul .nav-h2 {
margin-left: 20px;
}
#blogNav ul .nav-h3 {
margin-left: 30px;
}
#blogNav ul .nav-h4 {
margin-left: 40px;
}
#blogNav ul .nav-h5 {
margin-left: 50px;
}
.mobile-created-time {
display: none;
}
#footer {
padding-bottom: 10px;
}
.navbar-brand {
display: none;
}
#themeList label {
text-align: center;
margin-bottom: 5px;
}
#themeList .preview {
display: block;
width: 400px;
background: #fff;
border: 1px solid #ccc;
padding: 5px;
border-radius: 5px;
}
/*"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue", Helvetica, "Microsoft Yahei", Verdana, Simsun, "Segoe UI", "Segoe UI Web Regular", "Segoe UI Symbol", "BBAlpha Sans", "S60 Sans", Arial, sans-serif;*/
::selection {
background: #000000;
color: #ffffff;
}
::-moz-selection {
background: #000000;
color: #ffffff;
}
::-webkit-selection {
background: #000000;
color: #ffffff;
}
*,
body {
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
font-weight: 300;
font-size: 14px;
}
h1,
h2,
h3 {
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
font-weight: 300 !important;
}
a {
cursor: pointer;
}
a:hover {
text-decoration: none !important;
}
#headerContainer {
height: 100px;
background-color: #fff;
}
#posts {
width: 845px;
margin: auto;
}
#postsContainer {
background: #f5f5f5 url("images/noise.png");
padding-bottom: 5px;
}
/* header */
#header {
color: #000000;
position: relative;
padding: 0 0 20px 0;
margin-top: 15px;
}
#header h1 {
margin: 0;
font-size: 32px;
}
#header h1 a {
color: #000000;
font-size: 32px;
}
#header h1 a img {
height: 40px;
}
#header #blogDesc {
margin-top: 10px;
}
.navbar {
margin-bottom: 0;
border-radius: 0;
border: none;
}
.navbar-collapse {
padding-left: 0;
padding-right: 0;
}
.navbar-form {
padding: 0;
}
/* posts */
#posts {
padding-top: 10px;
}
#posts .each-post {
border-bottom: 1px solid #ebeff2;
margin-bottom: 10px;
padding: 30px;
background-color: #fff;
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
border-radius: 3px;
}
#posts .each-post .title {
font-size: 32px;
color: #0fb264;
padding: 0 0 15px 0;
}
#posts .each-post .title a {
font-size: 32px;
color: #0fb264;
padding: 0 0 15px 0;
}
#posts .each-post .created-time {
border-bottom: 1px solid #eee;
padding-bottom: 3px;
margin-bottom: 5px;
}
#posts .each-post .more {
background: #0fb264;
padding: 9px 10px;
border-radius: 2px;
line-height: 1;
font-size: 13px;
display: inline-block;
text-transform: uppercase;
margin-top: 15px;
margin-bottom: 15px;
color: #fff;
}
#disqus_thread {
border-top: 1px solid #eee;
padding: 5px 0 0 0;
}
#search {
width: 200px;
}
#footerContainer {
background-color: #ffffff;
color: #666666;
}
#footerContainer #footer a {
color: #666666;
}
#footerContainer #footer ul {
list-style: none;
margin: 0;
padding-left: 20px;
}
@media screen and (max-width: 600px) {
html,
body {
overflow-x: hidden;
background-color: #fbfcf7;
}
* {
font-size: 16px;
}
#headerContainer,
#footerContainer {
background-color: #fbfcf7;
margin: 10px 0;
}
#posts .each-post,
#postsContainer {
background-color: #fbfcf7 !important;
}
img {
max-width: 100%;
}
#posts .each-post {
padding: 10px;
}
#posts .each-post .title {
font-size: 24px;
border-left: 5px solid #65bd77;
font-weight: bold;
padding: 5px 0;
padding-left: 10px;
margin-bottom: 10px;
}
.container {
padding-right: 10px;
padding-left: 10px;
}
.created-time {
display: none;
}
.mobile-created-time {
display: block;
}
.mobile-created-time #userLogo {
display: inline-block;
max-height: 40px;
width: 40px;
border-radius: 50%;
}
#content {
margin-top: 10px;
}
.right-section .dropdown,
.right-section .btn {
display: none !important;
}
#blogNav {
left: initial !important;
right: 10px !important;
}
#postsContainer .container,
#footerContainer .container {
max-width: 100%;
}
#postsContainer {
margin: 0 !important;
max-width: 100%;
padding-top: 10px;
background: #f5f5f5 url("../../images/noise.png");
}
#posts {
max-width: 100% !important;
}
#footerContainer #footer a {
padding: 3px;
}
#footerContainer #footer a:hover,
#footerContainer #footer a:focus {
color: #65bd77;
}
#headerAndNav {
position: initial;
text-align: left;
width: 100%;
border-bottom: 2px dashed #ebeff2;
}
#headerAndNav #headerContainer {
width: 100%;
height: auto;
padding-top: 30px;
}
#headerAndNav #header {
margin: 0;
padding: 0;
}
#headerAndNav #header h1 {
display: none;
}
#headerAndNav .navbar-collapse {
overflow-x: hidden;
}
#headerAndNav #blogDesc {
border: none;
margin-top: 20px;
font-size: 24px;
}
#headerAndNav .navbar-brand {
display: inline-block;
line-height: 50px;
padding: 0;
padding-left: 10px;
}
#headerAndNav .navbar-brand img {
height: 40px;
}
#headerAndNav .navbar .container {
width: auto;
padding: 0 15px;
}
#headerAndNav .navbar {
position: fixed;
top: 0;
right: 0;
left: 0;
background: #fbfcf7;
z-index: 1000;
border-bottom: 1px solid #DEDDDF;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), inset 0 1px 0 #ffffff;
background-color: #FDFFF5;
}
#headerAndNav .navbar-nav {
margin: 0 10px;
}
#headerAndNav .navbar-nav a {
padding-left: 10px;
border-radius: 5px;
}
#headerAndNav #search {
width: 100%;
margin: 10px;
}
#headerAndNav .navbar-form {
border: none;
}
#myTab,
.tab-content {
padding: 0 10px;
}
}
table {
margin-bottom: 16px;
}
table th, table td {
padding: 6px 13px;
border: 1px solid #ddd;
}
table th {
font-weight: bold;
}
table tr {
background-color: #fff;
border-top: 1px solid #ccc;
}
table tr:nth-child(2n) {
background-color: #f8f8f8;
}
.mce-item-table, .mce-item-table td, .mce-item-table th, .mce-item-table caption {
border: 1px solid #ddd;
border-collapse: collapse;
padding: 6px 13px;
}
+47
View File
@@ -0,0 +1,47 @@
{{template "header.html" .}}
<div id="postsContainer">
<div class="container">
<h2>标签 - {{.curTag}} </h2>
</div>
<div id="posts">
{{range .posts}}
<div class="each-post">
<div class="title">
<a href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">
{{.Title}}
</a>
</div>
<div class="created-time">
<i class="fa fa-bookmark-o"></i>
{{if .Tags}}
{{blogTags $ .Tags}}
{{else}}
无
{{end}}
|
<i class="fa fa-calendar"></i> 更新 {{.UpdatedTime | datetime}} |
<i class="fa fa-calendar"></i> 创建 {{.CreatedTime | datetime}}
</div>
<div class="desc">
{{.Abstract | raw}}
</div>
<a class="more" href="{{$.postUrl}}/{{.UrlTitle}}" title="全文">查看</a>
</div>
{{else}}
<div class="each-post">
无
</div>
{{end}}
<!-- 分页 -->
{{template "paging.html" $}}
</div>
</div>
{{template "footer.html" $}}
{{template "highlight.html" $}}
</body>
</html>
+26
View File
@@ -0,0 +1,26 @@
{{template "header.html" .}}
<div id="postsContainer">
<div class="container">
<h2>标签</h2>
</div>
<div id="posts">
<div class="each-post">
<ul>
{{range $.tags}}
<li>
<a href="{{$.tagPostsUrl}}/{{.Tag}}">
{{.Tag}} {{.Count}}
</a>
</li>
{{end}}
</ul>
</div>
</div>
</div>
{{template "footer.html" .}}
</body>
</html>
+31
View File
@@ -0,0 +1,31 @@
/*
以下是本主题的配置, 采用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": "我的笔记", "Url": "http://leanote.com/note"},
{"Title": "leanote home", "Url": "http://leanote.com"},
{"Title": "leanote 社区", "Url": "http://bbs.leanote.com"},
{"Title": "lea++", "Url": "http://lea.leanote.com"},
{"Title": "leanote github", "Url": "https://github.com/leanote/leanote"}
]
}
+3
View File
@@ -767,6 +767,9 @@ Notebook.deleteNotebook = function(target) {
// 改变nav // 改变nav
Notebook.changeNav(); Notebook.changeNav();
//显示默认笔记本keep #5
$("#notebookList #548125adf4e872105c000007_span").trigger("click");
} else { } else {
alert(ret.Msg); alert(ret.Msg);
} }
+1 -1
View File
@@ -1 +1 @@
var LEA={};var Notebook={cache:{}};var Note={cache:{}};var Tag={};var Notebook={};var Share={};var Mobile={};var Converter;var MarkdownEditor;var ScrollLink;function trimLeft(str,substr){if(!substr||substr==" "){return $.trim(str)}while(str.indexOf(substr)==0){str=str.substring(substr.length)}return str}function json(str){return eval("("+str+")")}function t(){var args=arguments;if(args.length<=1){return args[0]}var text=args[0];if(!text){return text}var pattern="LEAAEL";text=text.replace(/\?/g,pattern);for(var i=1;i<=args.length;++i){text=text.replace(pattern,args[i])}return text}var tt=t;function arrayEqual(a,b){a=a||[];b=b||[];return a.join(",")==b.join(",")}function isArray(obj){return Object.prototype.toString.call(obj)==="[object Array]"}function isEmpty(obj){if(!obj){return true}if(isArray(obj)){if(obj.length==0){return true}}return false}function getFormJsonData(formId){var data=formArrDataToJson($("#"+formId).serializeArray());return data}function formArrDataToJson(arrData){var datas={};var arrObj={};for(var i in arrData){var attr=arrData[i].name;var value=arrData[i].value;if(attr.substring(attr.length-2,attr.length)=="[]"){attr=attr.substring(0,attr.length-2);if(arrObj[attr]==undefined){arrObj[attr]=[value]}else{arrObj[attr].push(value)}continue}datas[attr]=value}return $.extend(datas,arrObj)}function formSerializeDataToJson(formSerializeData){var arr=formSerializeData.split("&");var datas={};var arrObj={};for(var i=0;i<arr.length;++i){var each=arr[i].split("=");var attr=decodeURI(each[0]);var value=decodeURI(each[1]);if(attr.substring(attr.length-2,attr.length)=="[]"){attr=attr.substring(0,attr.length-2);if(arrObj[attr]==undefined){arrObj[attr]=[value]}else{arrObj[attr].push(value)}continue}datas[attr]=value}return $.extend(datas,arrObj)}function _ajaxCallback(ret,successFunc,failureFunc){if(ret===true||ret=="true"||typeof ret=="object"){if(ret&&typeof ret=="object"){if(ret.Msg=="NOTLOGIN"){alert("你还没有登录, 请先登录!");return}}if(typeof successFunc=="function"){successFunc(ret)}}else{if(typeof failureFunc=="function"){failureFunc(ret)}else{alert("error!")}}}function _ajax(type,url,param,successFunc,failureFunc,async){log("-------------------ajax:");log(url);log(param);if(typeof async=="undefined"){async=true}else{async=false}return $.ajax({type:type,url:url,data:param,async:async,success:function(ret){_ajaxCallback(ret,successFunc,failureFunc)},error:function(ret){_ajaxCallback(ret,successFunc,failureFunc)}})}function ajaxGet(url,param,successFunc,failureFunc,async){return _ajax("GET",url,param,successFunc,failureFunc,async)}function ajaxPost(url,param,successFunc,failureFunc,async){_ajax("POST",url,param,successFunc,failureFunc,async)}function ajaxPostJson(url,param,successFunc,failureFunc,async){log("-------------------ajaxPostJson:");log(url);log(param);if(typeof async=="undefined"){async=true}else{async=false}$.ajax({url:url,type:"POST",contentType:"application/json; charset=utf-8",datatype:"json",async:async,data:JSON.stringify(param),success:function(ret,stats){_ajaxCallback(ret,successFunc,failureFunc)},error:function(ret){_ajaxCallback(ret,successFunc,failureFunc)}})}function findParents(target,selector){if($(target).is(selector)){return $(target)}var parents=$(target).parents();for(var i=0;i<parents.length;++i){log(parents.eq(i));if(parents.eq(i).is(selector)){return parents.seq(i)}}return null}function editorIframeTabindex(index){var $i=$("#editorContent_ifr");if($i.size()==0){setTimeout(function(){editorIframeTabindex(index)},100)}else{$i.attr("tabindex",index)}}LEA.isM=false;LEA.isMarkdownEditor=function(){return LEA.isM};function switchEditor(isMarkdown){LEA.isM=isMarkdown;if(!isMarkdown){$("#editor").show();$("#mdEditor").css("z-index",1);editorIframeTabindex(2);$("#wmd-input").attr("tabindex",3);$("#leanoteNav").show()}else{$("#mdEditor").css("z-index",3).show();editorIframeTabindex(3);$("#wmd-input").attr("tabindex",2);$("#leanoteNav").hide()}}var previewToken="<div style='display: none'>FORTOKEN</div>";function setEditorContent(content,isMarkdown,preview){if(!content){content=""}if(!isMarkdown){$("#editorContent").html(content);if(typeof tinymce!="undefined"&&tinymce.activeEditor){var editor=tinymce.activeEditor;editor.setContent(content);editor.undoManager.clear()}else{setTimeout(function(){setEditorContent(content,false)},100)}}else{$("#wmd-input").val(content);$("#wmd-preview").html("");if(!content||preview){$("#wmd-preview").html(preview).css("height","auto");if(ScrollLink){ScrollLink.onPreviewFinished()}}else{if(MarkdownEditor){$("#wmd-preview").html(previewToken+"<div style='text-align:center; padding: 10px 0;'><img src='http://leanote.com/images/loading-24.gif' /> 正在转换...</div>");MarkdownEditor.refreshPreview()}else{setTimeout(function(){setEditorContent(content,true,preview)},200)}}}}function previewIsEmpty(preview){if(!preview||preview.substr(0,previewToken.length)==previewToken){return true}return false}function getEditorContent(isMarkdown){if(!isMLine truncated function trimLeft(a,b){if(!b||" "==b)return $.trim(a);for(;0==a.indexOf(b);)a=a.substring(b.length);return a}function json(str){return eval("("+str+")")}function t(){var a=arguments;if(a.length<=1)return a[0];var b=a[0];if(!b)return b;var c="LEAAEL";b=b.replace(/\?/g,c);for(var d=1;d<=a.length;++d)b=b.replace(c,a[d]);return b}function arrayEqual(a,b){return a=a||[],b=b||[],a.join(",")==b.join(",")}function isArray(a){return"[object Array]"===Object.prototype.toString.call(a)}function isEmpty(a){return a?isArray(a)&&0==a.length?!0:!1:!0}function getFormJsonData(a){var b=formArrDataToJson($("#"+a).serializeArray());return b}function formArrDataToJson(a){var b={},c={};for(var d in a){var e=a[d].name,f=a[d].value;"[]"!=e.substring(e.length-2,e.length)?b[e]=f:(e=e.substring(0,e.length-2),void 0==c[e]?c[e]=[f]:c[e].push(f))}return $.extend(b,c)}function formSerializeDataToJson(a){for(var b=a.split("&"),c={},d={},e=0;e<b.length;++e){var f=b[e].split("="),g=decodeURI(f[0]),h=decodeURI(f[1]);"[]"!=g.substring(g.length-2,g.length)?c[g]=h:(g=g.substring(0,g.length-2),void 0==d[g]?d[g]=[h]:d[g].push(h))}return $.extend(c,d)}function _ajaxCallback(a,b,c){if(a===!0||"true"==a||"object"==typeof a){if(a&&"object"==typeof a&&"NOTLOGIN"==a.Msg)return alert("\u4f60\u8fd8\u6ca1\u6709\u767b\u5f55, \u8bf7\u5148\u767b\u5f55!"),void 0;"function"==typeof b&&b(a)}else"function"==typeof c?c(a):alert("error!")}function _ajax(a,b,c,d,e,f){return log("-------------------ajax:"),log(b),log(c),f="undefined"==typeof f?!0:!1,$.ajax({type:a,url:b,data:c,async:f,success:function(a){_ajaxCallback(a,d,e)},error:function(a){_ajaxCallback(a,d,e)}})}function ajaxGet(a,b,c,d,e){return _ajax("GET",a,b,c,d,e)}function ajaxPost(a,b,c,d,e){_ajax("POST",a,b,c,d,e)}function ajaxPostJson(a,b,c,d,e){log("-------------------ajaxPostJson:"),log(a),log(b),e="undefined"==typeof e?!0:!1,$.ajax({url:a,type:"POST",contentType:"application/json; charset=utf-8",datatype:"json",async:e,data:JSON.stringify(b),success:function(a){_ajaxCallback(a,c,d)},error:function(a){_ajaxCallback(a,c,d)}})}function findParents(a,b){if($(a).is(b))return $(a);for(var c=$(a).parents(),d=0;d<c.length;++d)if(log(c.eq(d)),c.eq(d).is(b))return c.seq(d);return null}function editorIframeTabindex(a){var b=$("#editorContent_ifr");0==b.size()?setTimeout(function(){editorIframeTabindex(a)},100):b.attr("tabindex",a)}function switchEditor(a){LEA.isM=a,a?($("#mdEditor").css("z-index",3).show(),editorIframeTabindex(3),$("#wmd-input").attr("tabindex",2),$("#leanoteNav").hide()):($("#editor").show(),$("#mdEditor").css("z-index",1),editorIframeTabindex(2),$("#wmd-input").attr("tabindex",3),$("#leanoteNav").show())}function setEditorContent(a,b,c){if(a||(a=""),b)$("#wmd-input").val(a),$("#wmd-preview").html(""),!a||c?($("#wmd-preview").html(c).css("height","auto"),ScrollLink&&ScrollLink.onPreviewFinished()):MarkdownEditor?($("#wmd-preview").html(previewToken+"<div style='text-align:center; padding: 10px 0;'><img src='http://leanote.com/images/loading-24.gif' /> \u6b63\u5728\u8f6c\u6362...</div>"),MarkdownEditor.refreshPreview()):setTimeout(function(){setEditorContent(a,!0,c)},200);else if($("#editorContent").html(a),"undefined"!=typeof tinymce&&tinymce.activeEditor){var d=tinymce.activeEditor;d.setContent(a),d.undoManager.clear()}else setTimeout(function(){setEditorContent(a,!1)},100)}function previewIsEmpty(a){return a&&a.substr(0,previewToken.length)!=previewToken?!1:!0}function getEditorContent(a){if(a)return[$("#wmd-input").val(),$("#wmd-preview").html()];var b=tinymce.activeEditor;if(b){var c=$(b.getBody());if(c.find("pinit").remove(),c.find(".thunderpin").remove(),c.find(".pin").parent().remove(),c=$(c).html())for(;;){var d=c.lastIndexOf("</script>");if(-1==d)return c;var e=c.length;if(e-9!=d)return c;var f=c.lastIndexOf("<script ");if(-1==f&&(f=c.lastIndexOf("<script>")),-1==f)return c;c=c.substring(0,f)}return c}}function disableEditor(){var a=tinymce.activeEditor;a&&(a.hide(),LEA.editorStatus=!1,$("#mceTollbarMark").show().css("z-index",1e3))}function enableEditor(){if(!LEA.editorStatus){$("#mceTollbarMark").css("z-index",-1).hide();var a=tinymce.activeEditor;a&&a.show()}}function showDialog(a,b){$("#leanoteDialog #modalTitle").html(b.title),$("#leanoteDialog .modal-body").html($("#"+a+" .modal-body").html()),$("#leanoteDialog .modal-footer").html($("#"+a+" .modal-footer").html()),delete b.title,b.show=!0,$("#leanoteDialog").modal(b)}function hideDialog(a){a||(a=0),setTimeout(function(){$("#leanoteDialog").modal("hide")},a)}function closeDialog(){$(".modal").modal("hide")}function showDialog2(a,b){b=b||{},b.show=!0,$(a).modal(b)}function hideDialog2(a,b){b||(b=0),setTimeout(function(){$(a).modal("hide")},b)}function showDialogRemote(a,b){b=b||{},a+="?";for(var c in b)a+=c+"="+b[c]+"&";$("#leanoteDialogRemote").modal({remote:a})}function hideDialogRemote(a){a?setTimeout(function(){$("#leanoteDialogRemote").modal("hide")},a):$("#leanoteDialogRemote").modal("hide")}function notifyInfo(a){$.pnotiLine truncated
-1
View File
@@ -721,7 +721,6 @@ function hideLoading() {
// 注销, 先清空cookie // 注销, 先清空cookie
function logout() { function logout() {
$.removeCookie("LEANOTE_SESSION");
location.href = UrlPrefix + "/logout?id=1"; location.href = UrlPrefix + "/logout?id=1";
} }