Compare commits

..
45 Commits
Author SHA1 Message Date
life 3ffb10b923 mongodb initial data 2014-09-04 16:15:57 +08:00
life ba9b35c46e logo changed 2014-09-04 14:45:12 +08:00
life acc67754c3 logo changed 2014-09-04 14:23:01 +08:00
life 1ed9f0c96d favicon changed 2014-09-04 14:15:38 +08:00
life 2db2a55e81 favicon changed 2014-09-04 13:50:12 +08:00
life 634b17c6f7 leanote logo font 2014-09-04 13:27:36 +08:00
life 468ad4dec7 leanote logo font 2014-09-04 12:53:04 +08:00
life 7cbd38e8bf mgo package changed to 'gopkg.in/mgo.v2/bson' 2014-09-02 15:45:44 +08:00
life 1d8be4c012 golang template 2014-08-28 11:53:04 +08:00
life 7b6a5c0929 leaui image bug fix 2014-07-15 20:59:43 +08:00
life fe10dbbd77 leaui image fix bugs 2014-07-15 20:55:28 +08:00
life 7db9d95108 leaui image 2014-07-14 22:59:00 +08:00
life 91eb893814 m 2014-07-14 22:58:09 +08:00
life fcc86de37c leaui image 2014-07-08 22:09:48 +08:00
life 61a0b9caa0 leaui image 2014-07-08 22:05:33 +08:00
life 95fe0c5289 leaui image 2014-07-08 21:45:43 +08:00
life bb0350fdac update leaui_image 2014-06-28 23:12:34 +08:00
life 1494b25129 add leaui_image plugin for replace leanote_image. on a train to ChangSha 2014-06-28 23:07:34 +08:00
life 06eb27faab loading css 2014-06-28 12:24:29 +08:00
life 121eab5d38 thumb css 2014-06-28 12:18:15 +08:00
life 37da418bdd thumb css 2014-06-28 12:17:09 +08:00
life eea6ad07f8 thumb css 2014-06-28 12:15:54 +08:00
life b0402f29dd markdown 2014-06-24 21:41:02 +08:00
life 8e05e433de blog 2014-06-24 21:14:17 +08:00
life a0acd31fcf tinyce table 2014-06-17 19:46:34 +08:00
life a5b525affd update readme 2014-06-15 13:31:08 +08:00
life 414639dc3d fix notebook 2014-06-14 17:44:04 +08:00
life cf4accc110 slim scroll 2014-06-14 17:29:29 +08:00
life 8d4a757ee9 update readme 2014-06-12 15:12:08 +08:00
life 68bacdc3bf update readme 2014-06-12 15:11:12 +08:00
life 3df6fa2bb7 update readme 2014-06-12 11:35:14 +08:00
life e8c0001721 update readme 2014-06-12 11:34:27 +08:00
life 4210d56a0d update readme 2014-06-12 11:31:37 +08:00
life 63b65920db paste image on chrome 2014-06-08 18:03:23 +08:00
life c55f364153 paste image on chrome 2014-06-08 17:57:19 +08:00
life 8af64c7b74 toggle writing mode bookmark 2014-06-05 19:04:39 +08:00
life 7bb05bd9e7 index 2014-05-27 13:55:18 +08:00
life abf3297639 release 0.3 2014-05-27 13:33:05 +08:00
life ad00f36fd9 release 0.3 2014-05-27 13:32:30 +08:00
life c549957cdc release 0.3 2014-05-27 13:30:07 +08:00
life 7f9356c5a7 release 0.3 2014-05-27 13:29:19 +08:00
life 910b079c55 resize editor 2014-05-27 12:59:14 +08:00
life b1b36cec23 update email 2014-05-27 11:37:03 +08:00
life 8eab8c7310 fix updateEmail 2014-05-27 11:21:35 +08:00
life ddd0c13d34 editor fix 2014-05-21 10:08:47 +08:00
145 changed files with 14927 additions and 2491 deletions

No files matched your search

+1
View File
@@ -15,3 +15,4 @@ app/routes/routes.go
app/tmp/main.go
.DS_Store
.settings
public/config.codekit
+120 -34
View File
@@ -1,3 +1,5 @@
[中文](https://github.com/leanote/leanote#1-介绍)
## 1. Introduction
Leanote, your own cloud note.
@@ -20,10 +22,10 @@ To be honest, our inspiration comes from Evernote. We use Evernote to manage our
### 3.1. Download leanote
Leanote v0.1 has been released. Binaries:
Leanote V0.3 has been released. Binaries:
* Linux: [leanote-linux-v0.1.bin.tar.gz](https://github.com/leanote/leanote/releases/download/0.1/leanote-linux-v0.1.bin.tar.gz)
* MacOS X: [leanote-mac-v0.1.bin.tar.gz](https://github.com/leanote/leanote/releases/download/0.1/leanote-mac-v0.1.bin.tar.gz)
* Linux: [leanote-linux-v0.3.bin.tar.gz](https://github.com/leanote/leanote/releases/download/0.3/leanote-linux-v0.3.bin.tar.gz)
* MacOS X: [leanote-mac-v0.3.bin.tar.gz](https://github.com/leanote/leanote/releases/download/0.3/leanote-mac-v0.3.bin.tar.gz)
### 3.2. Install MongoDB
@@ -39,11 +41,12 @@ The mongodb data is in `[PATH_TO_LEANOTE]/mongodb_backup/leanote_install_data`
$> mongorestore -h localhost -d leanote --directoryperdb PATH_TO_LEANOTE/mongodb_backup/leanote_install_data
```
The initial database contains two users:
The initial database contains three users:
```
user1 username: leanote, password: abc123
user2 username: admin, password: abc123
user3 username: demo@leanote.com, password: demo@leanote.com (this user is for demo)
```
### 3.4. Configuration
@@ -87,40 +90,123 @@ $> sudo sh run.sh
## 4. How to develop leanote
For more tips please see [our wiki](https://github.com/leanote/leanote/wiki/How-to-develop-leanote)
Please see [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)
Leanote is a app based on [revel](https://revel.github.io/), so if you want to work on leanote, you should be familar with revel.
### 4.1 Install golang
## 5. Contributors
Thank you to all the [contributors](https://github.com/leanote/leanote/graphs/contributors) on
this project. Your help is much appreciated.
Install golang and set the `GOPATH` environment variable
## 6. Contributing
### 4.2 Install revel
```
$> go get github.com/revel/revel
$> go get github.com/revel/cmd/revel
```
### 4.3 Get leanote
```
$> go get github.com/leanote/leanote/app
```
### 4.4 Build/Run leanote via revel
```
$> cp conf/app.conf-default conf/app.conf
$> cp conf/routes-default conf/routes
```
Now you can modify the leanote source and build/run using `revel`
```
$> revel run github.com/leanote/leanote
```
You are welcome to join us and contribute code to leanote! Thanks.
Please fork this repository and contribute back using [pull requests](https://github.com/leanote/leanote/pulls).
## Discussion
[leanote google group](https://groups.google.com/forum/#!forum/leanote)
-----------------------------------------------------------------------
## 1. 介绍
Leanote, 你的私人云笔记!
**特性**
* 知识管理: 通过leanote来管理知识, leanote有易操作的界面, 包含两款编辑器tinymce和markdown. 在leanote, 你可以尽情享受写作.
* 分享: 你也可以通过分享知识给好友, 让好友拥有你的知识.
* 协作: 在分享的同时也可以与好友一起协作知识.
* 博客: leanote也可以作为你的博客, 将知识公开成博客, 让leanote把你的知识传播的更远!
## 2. 为什么我们要创建leanote?
说实话, 我们曾是evernote的忠实粉丝, 但是我们也发现evernote的不足:
* leanote的编辑器不能满足我们的需求, 不能贴代码(格式会乱掉, 作为程序员, 代码是我们的基本需求啊), 图片不能缩放.
* 我们是markdown的爱好者, 可是evernote竟然没有.
* 我们也想将知识公开, 所以我们有自己的博客, 如wordpress, 但为什么这两者不能合二为一呢?
* 还有...
## 3.安装leanote
leanote是一款私有云笔记, 你可以下载它安装在自己的服务器上, 当然也可以在 http://leanote.com 上注册.
### 3.1. 下载leanote
Leanote V0.3 已发布, 二进制文件(暂时没有windows版的):
* Linux: [leanote-linux-v0.3.bin.tar.gz](https://github.com/leanote/leanote/releases/download/0.3/leanote-linux-v0.3.bin.tar.gz)
* MacOS X: [leanote-mac-v0.3.bin.tar.gz](https://github.com/leanote/leanote/releases/download/0.3/leanote-mac-v0.3.bin.tar.gz)
### 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
```
初始数据包含三个用户:
```
user1 username: leanote, password: abc123
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=
```
``http.port``
默认为 80
``site.url``
默认是 `http://localhost`, 这会在上传图片后的图片路径中用户, 还有发邮件, 找回密码验证邮箱时用到.
``email``
找回密码和验证邮箱时使用
``adminUsername``
默认是 `admin`. 首页即为该用户的博客
更多配置请查看 `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 google group](https://groups.google.com/forum/#!forum/leanote)
+46
View File
@@ -0,0 +1,46 @@
package controllers
import (
"github.com/revel/revel"
// "encoding/json"
"github.com/leanote/leanote/app/info"
"gopkg.in/mgo.v2/bson"
// . "github.com/leanote/leanote/app/lea"
// "io/ioutil"
)
type Album struct {
BaseController
}
// all albums by userId
func (c Album) GetAlbums() revel.Result {
re := albumService.GetAlbums(c.GetUserId())
return c.RenderJson(re)
}
func (c Album) DeleteAlbum(albumId string) revel.Result {
re, msg := albumService.DeleteAlbum(c.GetUserId(), albumId)
return c.RenderJson(info.Re{Ok: re, Msg: msg})
}
// add album
func (c Album) AddAlbum(name string) revel.Result {
album := info.Album{
AlbumId: bson.NewObjectId(),
Name: name,
Seq: -1,
UserId: c.GetObjectUserId()}
re := albumService.AddAlbum(album)
if(re) {
return c.RenderJson(album)
} else {
return c.RenderJson(false)
}
}
// update alnum name
func (c Album) UpdateAlbum(albumId, name string) revel.Result {
return c.RenderJson(albumService.UpdateAlbum(albumId, c.GetUserId(), name))
}
+1 -1
View File
@@ -2,7 +2,7 @@ package controllers
import (
"github.com/revel/revel"
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
"encoding/json"
"github.com/leanote/leanote/app/info"
// "io/ioutil"
+3 -1
View File
@@ -3,7 +3,7 @@ package controllers
import (
"github.com/revel/revel"
// "encoding/json"
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
// . "leanote/app/lea"
"github.com/leanote/leanote/app/info"
// "github.com/leanote/leanote/app/types"
@@ -173,6 +173,8 @@ func (c Blog) Set() revel.Result {
c.getRecentBlogs(userId)
c.SetLocale();
return c.RenderTemplate("blog/set.html")
}
+103 -8
View File
@@ -7,6 +7,7 @@ import (
"github.com/leanote/leanote/app/info"
"io/ioutil"
"os"
"strconv"
)
// 首页
@@ -20,7 +21,7 @@ func (c File) UploadImage(renderHtml string) revel.Result {
renderHtml = "file/image.html"
}
re := c.uploadImage();
re := c.uploadImage("", "");
c.RenderArgs["fileUrlPath"] = siteUrl + re.Id
c.RenderArgs["resultCode"] = re.Code
@@ -34,24 +35,34 @@ func (c File) UploadBlogLogo() revel.Result {
return c.UploadImage("file/blog_logo.html");
}
// 拖拉上传
func (c File) UploadImageJson(renderHtml string) revel.Result {
re := c.uploadImage();
// 拖拉上传, pasteImage
func (c File) UploadImageJson(renderHtml, from string) revel.Result {
re := c.uploadImage(from, "");
re.Id = siteUrl + re.Id
// re.Id = re.Id
return c.RenderJson(re)
}
// leaui image plugin
func (c File) UploadImageLeaui(albumId string) revel.Result {
re := c.uploadImage("", albumId);
re.Id = siteUrl + re.Id
// re.Id = re.Id
return c.RenderJson(re)
}
// 上传图片, 公用方法
func (c File) uploadImage() (re info.Re) {
func (c File) uploadImage(from, albumId string) (re info.Re) {
var fileUrlPath = ""
var resultCode = 0 // 1表示正常
var resultMsg = "内部错误" // 错误信息
var Ok = false
defer func() {
re.Id = fileUrlPath
re.Code = resultCode
re.Msg = resultMsg
re.Ok = Ok
}()
file, handel, err := c.Request.FormFile("file")
@@ -69,11 +80,18 @@ func (c File) uploadImage() (re info.Re) {
}
// 生成新的文件名
filename := handel.Filename
_, ext := SplitFilename(filename)
var ext string;
if from == "pasteImage" {
ext = ".png"; // TODO 可能不是png类型
} else {
_, ext = SplitFilename(filename)
if(ext != ".gif" && ext != ".jpg" && ext != ".png" && ext != ".bmp" && ext != ".jpeg") {
resultMsg = "不是图片"
return re
}
}
filename = NewGuid() + ext
data, err := ioutil.ReadAll(file)
if err != nil {
@@ -96,10 +114,87 @@ func (c File) uploadImage() (re info.Re) {
}
// 改变成gif图片
_, toPathGif := TransToGif(toPath, 0, true)
fileUrlPath += "/" + GetFilename(toPathGif)
filename = GetFilename(toPathGif)
filesize := GetFilesize(toPathGif)
fileUrlPath += "/" + filename
resultCode = 1
resultMsg = "上传成功!"
// File
fileInfo := info.File{Name: filename,
Title: handel.Filename,
Path: fileUrlPath,
Size: filesize}
Ok = fileService.AddImage(fileInfo, albumId, c.GetUserId())
re.Item = fileInfo
return re
}
// get all images by userId with page
func (c File) GetImages(albumId, key string, page int) revel.Result {
re := fileService.ListImagesWithPage(c.GetUserId(), albumId, key, page, 12)
return c.RenderJson(re)
}
func (c File) UpdateImageTitle(fileId, title string) revel.Result {
re := info.NewRe()
re.Ok = fileService.UpdateImageTitle(c.GetUserId(), fileId, title)
return c.RenderJson(re)
}
func (c File) DeleteImage(fileId string) revel.Result {
re := info.NewRe()
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)
}
+1 -1
View File
@@ -3,7 +3,7 @@ package controllers
import (
"github.com/revel/revel"
// "encoding/json"
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
. "github.com/leanote/leanote/app/lea"
"github.com/leanote/leanote/app/lea/html2image"
"github.com/leanote/leanote/app/info"
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"github.com/revel/revel"
// "encoding/json"
"github.com/leanote/leanote/app/info"
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
// . "github.com/leanote/leanote/app/lea"
// "io/ioutil"
)
+1 -1
View File
@@ -3,7 +3,7 @@ package controllers
import (
"github.com/revel/revel"
// "encoding/json"
// "labix.org/v2/mgo/bson"
// "gopkg.in/mgo.v2/bson"
// . "github.com/leanote/leanote/app/lea"
"github.com/leanote/leanote/app/info"
// "github.com/leanote/leanote/app/types"
+1 -1
View File
@@ -3,7 +3,7 @@ package controllers
import (
"github.com/revel/revel"
// "encoding/json"
// "labix.org/v2/mgo/bson"
// "gopkg.in/mgo.v2/bson"
. "github.com/leanote/leanote/app/lea"
"github.com/leanote/leanote/app/info"
// "github.com/leanote/leanote/app/types"
+3
View File
@@ -23,6 +23,9 @@ var pwdService *service.PwdService
var tokenService *service.TokenService
var suggestionService *service.SuggestionService
var albumService *service.AlbumService
var fileService *service.FileService
var pageSize = 1000
var defaultSortField = "UpdatedTime"
var leanoteUserId = "52d26b4e99c37b609a000001"
+11 -3
View File
@@ -2,8 +2,8 @@ package db
import (
"fmt"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"github.com/revel/revel"
)
@@ -33,6 +33,10 @@ var Tokens *mgo.Collection
var Suggestions *mgo.Collection
// Album & file(image)
var Albums *mgo.Collection
var Files *mgo.Collection
// 初始化时连接数据库
func Init() {
var url string
@@ -94,8 +98,12 @@ func Init() {
// find password
Tokens = Session.DB(dbname).C("tokens")
//
// Suggestion
Suggestions = Session.DB(dbname).C("suggestions")
// Album & file
Albums = Session.DB(dbname).C("albums")
Files = Session.DB(dbname).C("files")
}
func init() {
+15
View File
@@ -0,0 +1,15 @@
package info
import (
"gopkg.in/mgo.v2/bson"
"time"
)
type Album struct {
AlbumId bson.ObjectId `bson:"_id,omitempty"` //
UserId bson.ObjectId `bson:"UserId"`
Name string `Name` // album name
Type int `Type` // type, the default is image: 0
Seq int `Seq`
CreatedTime time.Time `CreatedTime`
}
+1 -1
View File
@@ -1,7 +1,7 @@
package info
import (
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
)
// 只为blog, 不为note
+19
View File
@@ -0,0 +1,19 @@
package info
import (
"gopkg.in/mgo.v2/bson"
"time"
)
type File struct {
FileId bson.ObjectId `bson:"_id,omitempty"` //
UserId bson.ObjectId `bson:"UserId"`
AlbumId bson.ObjectId `bson:"AlbumId"`
Name string `Name` // file name
Title string `Title` // file name or user defined for search
Size int64 `Size` // file size (byte)
Type string `Type` // file type, such as image/jpg
Path string `Path` // the file path, based on /upload
IsDefaultAlbum bool `IsDefaultAlbum`
CreatedTime time.Time `CreatedTime`
}
+1 -1
View File
@@ -1,7 +1,7 @@
package info
import (
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
"time"
)
+1 -1
View File
@@ -1,7 +1,7 @@
package info
import (
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
"time"
)
+1 -1
View File
@@ -1,7 +1,7 @@
package info
import (
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
"time"
)
+1 -1
View File
@@ -1,7 +1,7 @@
package info
import (
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
)
// 建议
+1 -1
View File
@@ -1,7 +1,7 @@
package info
import (
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
)
// 这里主要是为了统计每个tag的note数目
+1 -1
View File
@@ -1,7 +1,7 @@
package info
import (
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
"time"
)
+1 -1
View File
@@ -1,7 +1,7 @@
package info
import (
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
"time"
)
+1
View File
@@ -8,5 +8,6 @@ import (
type Page struct {
CurPage int // 当前页码
TotalPage int // 总页
Count int // 总记录数
List interface{}
}
+4 -3
View File
@@ -28,8 +28,8 @@ var bodyTpl = `
<div style="float:left; height: 40px;">
<a href="http://leanote.com" style="font-size: 24px">leanote</a>
</div>
<div style="float:left; height:40px; line-height:16px;">
&nbsp;&nbsp;| &nbsp;<span style="font-size:24px">$title</span>
<div style="float:left; height:40px; line-height:40px;">
&nbsp;&nbsp;| &nbsp;<span style="font-size:14px">$title</span>
</div>
<div style="clear:both"></div>
</div>
@@ -50,7 +50,7 @@ var bodyTpl = `
font-size: 12px;
}
</style>
<a href="http://leanote.com">leanote</a>, your own cloud note
<a href="http://leanote.com">leanote</a>, your own cloud note!
</div>
</div>
</body>
@@ -78,6 +78,7 @@ func SendEmail(to, subject, title, body string) bool {
err := smtp.SendMail(host+":"+port, auth, username, send_to, msg)
if err != nil {
Log(err)
return false
}
return true
+20
View File
@@ -30,6 +30,16 @@ func GetFilename(path string) string {
return filepath.Base(path)
}
// file size
// length in bytes
func GetFilesize(path string) int64 {
fileinfo, err := os.Stat(path)
if err == nil {
return fileinfo.Size()
}
return 0;
}
// 清空dir下所有的文件和文件夹
// RemoveAll会清空本文件夹, 所以还要创建之
func ClearDir(dir string) bool {
@@ -43,3 +53,13 @@ func ClearDir(dir string) bool {
}
return true
}
// list dir's all file, return filenames
func ListDir(dir string) []string {
f, err := os.Open(dir)
if err != nil {
return nil
}
names, _ := f.Readdirnames(0)
return names
}
+1 -1
View File
@@ -8,7 +8,7 @@ import (
"encoding/base64"
"encoding/hex"
"io"
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
"time"
math_rand "math/rand"
)
+44
View File
@@ -0,0 +1,44 @@
package service
import (
"github.com/leanote/leanote/app/info"
// . "github.com/leanote/leanote/app/lea"
"github.com/leanote/leanote/app/db"
"gopkg.in/mgo.v2/bson"
"time"
)
const IMAGE_TYPE = 0
type AlbumService struct {
}
// add album
func (this *AlbumService) AddAlbum(album info.Album) bool {
album.CreatedTime = time.Now()
album.Type = IMAGE_TYPE
return db.Insert(db.Albums, album)
}
// get albums
func (this *AlbumService) GetAlbums(userId string) []info.Album {
albums := []info.Album{}
db.ListByQ(db.Albums, bson.M{"UserId": bson.ObjectIdHex(userId)}, &albums)
return albums
}
// delete album
// presupposition: has no images under this ablum
func (this *AlbumService) DeleteAlbum(userId, albumId string) (bool, string) {
if db.Count(db.Files, bson.M{"AlbumId": bson.ObjectIdHex(albumId),
"UserId": bson.ObjectIdHex(userId),
}) == 0 {
return db.DeleteByIdAndUserId(db.Albums, albumId, userId), ""
}
return false, "has images"
}
// update album name
func (this *AlbumService) UpdateAlbum(albumId, userId, name string) bool {
return db.UpdateByIdAndUserIdField(db.Albums, albumId, userId, "Name", name)
}
+1 -1
View File
@@ -1,7 +1,7 @@
package service
import (
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
// "github.com/leanote/leanote/app/db"
"github.com/leanote/leanote/app/info"
"github.com/revel/revel"
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"github.com/leanote/leanote/app/info"
"github.com/leanote/leanote/app/db"
// . "github.com/leanote/leanote/app/lea"
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
// "time"
// "sort"
)
+106
View File
@@ -0,0 +1,106 @@
package service
import (
// . "github.com/leanote/leanote/app/lea"
"github.com/revel/revel"
"github.com/leanote/leanote/app/info"
"github.com/leanote/leanote/app/db"
"gopkg.in/mgo.v2/bson"
"time"
"os"
)
const DEFAULT_ALBUM_ID = "52d3e8ac99c37b7f0d000001"
type FileService struct {
}
// add Image
func (this *FileService) AddImage(image info.File, albumId, userId string) bool {
image.CreatedTime = time.Now()
if albumId != "" {
image.AlbumId = bson.ObjectIdHex(albumId)
} else {
image.AlbumId = bson.ObjectIdHex(DEFAULT_ALBUM_ID)
image.IsDefaultAlbum = true
}
image.UserId = bson.ObjectIdHex(userId)
return db.Insert(db.Files, image)
}
// list images
// if albumId == "" get default album images
func (this *FileService) ListImagesWithPage(userId, albumId, key string, pageNumber, pageSize int) info.Page {
skipNum, sortFieldR := parsePageAndSort(pageNumber, pageSize, "CreatedTime", false)
files := []info.File{}
q := bson.M{"UserId": bson.ObjectIdHex(userId)}
if albumId != "" {
q["AlbumId"] = bson.ObjectIdHex(albumId);
} else {
q["IsDefaultAlbum"] = true
}
if key != "" {
q["Title"] = bson.M{"$regex": bson.RegEx{".*?" + key + ".*", "i"}}
}
// LogJ(q)
count := db.Count(db.Files, q);
db.Files.
Find(q).
Sort(sortFieldR).
Skip(skipNum).
Limit(pageSize).
All(&files)
return info.Page{Count: count, List: files}
}
func (this *FileService) UpdateImageTitle(userId, fileId, title string) bool {
return db.UpdateByIdAndUserIdField(db.Files, fileId, userId, "Title", title)
}
// get all images names
// for upgrade
func (this *FileService) GetAllImageNamesMap(userId string) (m map[string]bool) {
q := bson.M{"UserId": bson.ObjectIdHex(userId)}
files := []info.File{}
db.ListByQWithFields(db.Files, q, []string{"Name"}, &files)
m = make(map[string]bool)
if len(files) == 0 {
return
}
for _, file := range files {
m[file.Name] = true
}
return
}
// delete image
func (this *FileService) DeleteImage(userId, fileId string) (bool, string) {
file := info.File{}
db.GetByIdAndUserId(db.Files, fileId, userId, &file)
if(file.FileId != "") {
if db.DeleteByIdAndUserId(db.Files, fileId, userId) {
// delete image
err := os.Remove(revel.BasePath + "/public/" + file.Path)
if err == nil {
return true, ""
}
return false, "delete file error!"
}
return false, "db error"
}
return false, "no such item"
}
// update image title
func (this *FileService) UpdateImage(userId, fileId, title string) bool {
return db.UpdateByIdAndUserIdField(db.Files, fileId, userId, "Title", title)
}
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"github.com/leanote/leanote/app/info"
"github.com/leanote/leanote/app/db"
// . "github.com/leanote/leanote/app/lea"
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
// "time"
)
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"github.com/leanote/leanote/app/info"
"github.com/leanote/leanote/app/db"
. "github.com/leanote/leanote/app/lea"
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
"time"
)
+1 -1
View File
@@ -2,7 +2,7 @@ package service
import (
// "fmt"
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
"github.com/leanote/leanote/app/db"
"github.com/leanote/leanote/app/info"
// . "github.com/leanote/leanote/app/lea"
+1 -1
View File
@@ -1,7 +1,7 @@
package service
import (
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
"github.com/leanote/leanote/app/db"
"github.com/leanote/leanote/app/info"
. "github.com/leanote/leanote/app/lea"
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"github.com/leanote/leanote/app/info"
"github.com/leanote/leanote/app/db"
// . "github.com/leanote/leanote/app/lea"
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
"time"
"sort"
)
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"github.com/leanote/leanote/app/info"
"github.com/leanote/leanote/app/db"
// . "github.com/leanote/leanote/app/lea"
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
// "time"
// "sort"
)
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"github.com/leanote/leanote/app/info"
"github.com/leanote/leanote/app/db"
. "github.com/leanote/leanote/app/lea"
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
// "time"
)
+1 -1
View File
@@ -1,7 +1,7 @@
package service
import (
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
"github.com/leanote/leanote/app/db"
"github.com/leanote/leanote/app/info"
. "github.com/leanote/leanote/app/lea"
+1 -1
View File
@@ -1,7 +1,7 @@
package service
import (
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
"github.com/leanote/leanote/app/db"
"github.com/leanote/leanote/app/info"
)
+3 -3
View File
@@ -4,7 +4,7 @@ import (
"github.com/leanote/leanote/app/info"
"github.com/leanote/leanote/app/db"
. "github.com/leanote/leanote/app/lea"
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
"time"
"strings"
"fmt"
@@ -208,11 +208,11 @@ func (this *UserService) UpdateEmailSendActiveEmail(userId, email string) (ok bo
}
// 发送邮件
url := "http://115.28.133.226/user/updateEmail?token=" + token
url := "http://leanote.com/user/updateEmail?token=" + token
body := "邮箱验证后您的登录邮箱为: <b>" + email + "</b><br />";
body += fmt.Sprintf("请点击链接验证邮箱: <a href='%v'>%v</a>. %v小时后过期.", url, url, tokenService.GetOverHours(info.TokenUpdateEmail));
if !SendEmail(email, "leanote-验证邮箱", "验证邮箱", body) {
msg = "发送失败"
msg = "发送失败, 该邮箱存在?"
return
}
ok = true
+10 -3
View File
@@ -11,8 +11,8 @@ import (
"github.com/leanote/leanote/app/lea/html2image"
"time"
"fmt"
"labix.org/v2/mgo/bson"
// "labix.org/v2/mgo"
"gopkg.in/mgo.v2/bson"
// "gopkg.in/mgo.v2"
// "encoding/json"
// "strings"
)
@@ -181,8 +181,15 @@ make<br>make --- install</pre>
`, "/Users/life/Desktop/a.png")
fmt.Printf("time cost %v\n", time.Now().Sub(start))
}
func testLea() {
names := ListDir("/Users/life/Documents/Go/package/src/leanote")
fmt.Println(names);
}
func main() {
revel.BasePath = "/Users/life/Documents/Go/package/src/leanote"
testLea();
// a, b := SplitFilename("http://ab/c/a.gif#??")
// println(a)
// println(b)
@@ -199,7 +206,7 @@ func main() {
//_, err := mgo.Dial("mongodb://leanote:nKFAkxKnWkEQy8Vv2LlM@115.28.133.226:27017/leanote")
// testNotebookService();
testNoteService();
// testNoteService();
// testShareService()
// testAuthService()
+1 -1
View File
@@ -61,7 +61,7 @@ function log(o) {
<li class="{{if .index}}active{{end}}"><a href="/blog/{{$username}}">{{msg . "home"}}</a></li>
{{range .notebooks}}
{{$notebookId := .NotebookId.Hex}}
<li class="{{if eq $navNotebookId $notebookId}}active{{else}}{{end}}">
<li class="{{if $navNotebookId}}{{if eq $navNotebookId $notebookId}}active{{else}}{{end}}{{end}}">
<a href="/blog/{{$username}}/{{$notebookId}}"
>{{.Title}}</a>
</li>
+7 -9
View File
@@ -166,19 +166,17 @@
$(function() {
tinymce.init({
selector : "#AboutMe",
content_css : [ "/css/bootstrap.css", "/css/editor.css" ],
content_css : [ "/css/bootstrap.css", "/css/editor/editor.css" ],
skin : "custom",
language : "zh_CN",
language : "{{.locale}}",
height : 300,
width : "100%",
skin : "custom",
plugins : [
"advlist autolink link image lists charmap hr ",
"searchreplace visualblocks visualchars code tabfocus",
"table contextmenu directionality textcolor paste fullpage textcolor" ],
toolbar1 : "formatselect fontselect fontsizeselect | forecolor backcolor | bold italic underline strikethrough | image | bullist numlist | alignleft aligncenter alignright alignjustify",
toolbar2 : "outdent indent blockquote | link unlink | table | hr removeformat | subscript superscript | visualchars visualblocks | searchreplace | code",
"advlist autolink link leanote_image lists charmap hr ",
"searchreplace visualblocks visualchars leanote_code tabfocus",
"table contextmenu directionality textcolor paste fullpage textcolor"],
toolbar1 : "formatselect |fontselect fontsizeselect| forecolor backcolor | bold italic underline strikethrough | bullist numlist |",
menubar : false,
toolbar_items_size : 'small',
statusbar : false,
+3 -1
View File
@@ -27,7 +27,7 @@ function log(o) {
<div class="pull-left">
<h1>
<a href="/index">
<img src="/images/logo.png" id="" style="height: 40px" title="leanote, Your own cloud note!"/>
<img src="/images/logo/leanote_black.png" id="" style="height: 50px" title="leanote, Your own cloud note!"/>
</a>
</h1>
</div>
@@ -48,7 +48,9 @@ function log(o) {
<ul id="blogNav" class="pull-right">
<li><a href="/index#" target="body" class="smooth-scroll">{{msg . "home"}}</a></li>
<li><a href="/index#aboutLeanote" target="#aboutLeanote" class="smooth-scroll">{{msg . "aboutLeanote"}}</a> </li>
<li><a href="/index#download" target="#download" class="smooth-scroll">{{msg . "download"}}</a> </li>
<li><a id="leanoteBlog" href="http://leanote.com/blog/leanote" target="_blank" class="">{{msg . "leanoteBlog"}}</a></li>
<li><a href="https://groups.google.com/forum/?fromgroups#!forum/leanote" target="_blank" class="">{{msg . "discussion"}}</a></li>
</ul>
</div>
+17 -4
View File
@@ -4,14 +4,15 @@
</style>
<section>
<div class="header">
<h2>leanote, your own cloud note!</h2>
<p>Knowledge, Sharing, Cooperation, Blog... all just in leanote</p>
<h2>leanote, {{msg . "moto"}}</h2>
<p>{{msg . "moto3"}}</p>
<p>{{msg . "moto2"}}</p>
<div>
<a class="btn btn-primary" href="https://github.com/leanote/leanote">Fork leanote on Github</a>
<a class="btn btn-primary" href="https://github.com/leanote/leanote">{{msg . "fork github"}}</a>
&nbsp;
&nbsp;
<a class="btn btn-default" href="/demo">Try it</a>
<a class="btn btn-default" href="/demo">{{msg . "try"}}</a>
{{if .openRegister}}
&nbsp;
&nbsp;
@@ -61,6 +62,18 @@
</div>
</div>
<div class="container" id="download">
<h2 style="margin: 20px 0;text-align: center;">{{msg . "download"}}</h2>
<div class="row">
<div style="width:300px; margin:auto; padding: 10px;">
Linux: <a href="https://github.com/leanote/leanote/releases/download/0.3/leanote-linux-v0.3.bin.tar.gz">leanote-linux-v0.3.bin.tar.gz</a> <br />
MacOS X: <a href="https://github.com/leanote/leanote/releases/download/0.3/leanote-mac-v0.3.bin.tar.gz">leanote-mac-v0.3.bin.tar.gz</a> <br />
<br />
<a href="https://github.com/leanote/leanote#3-how-to-install-leanote">{{msg . "howToInstallLeanote"}}</a>
</div>
</div>
</div>
{{template "home/footer.html"}}
<script src="/js/jquery-1.9.0.min.js"></script>
+44 -10
View File
@@ -41,17 +41,17 @@ function log(o) {
<!-- <div id="headerContainer"> -->
<div id="header">
<!-- <div id="headerLeft" class="pull-left">
<!--
<div id="headerLeft" class="pull-left">
</div>
-->
<div id="logo" class="pull-left">
<span>lea</span>note
<!-- <img style="height: 45px;" src="/images/logo.png" title="leanote, 不一样的笔记" alt="leanote">
-->
<!--<span>lea</span>note -->
<!--<img style="height: 45px;" src="/images/logo/leanote_white.png" title="leanote, 不一样的笔记" alt="leanote">-->
</div>
<div id="switcher" class="pull-left">
<i class="fa fa-align-justify" id="leftSwitcher" title="{{msg . "leftHidden"}}"></i>
<span id="leftSwitcher2" title="{{msg . "leftShow"}}">lea</span>
<span id="leftSwitcher2" title="{{msg . "leftShow"}}"></span>
</div>
<!-- search -->
<div class="pull-left" id="searchWrap">
@@ -450,9 +450,10 @@ function log(o) {
<li role="presentation"><span class="label label-green">{{msg . "green"}}</span></li>
</ul>
</div>
</div>
<ul class="pull-right" id="editorTool">
<li><a class="ios7-a " id="saveBtn" title="ctrl+s"
data-toggle="dropdown">{{msg . "save"}}</a></li>
@@ -487,6 +488,17 @@ function log(o) {
<div id="leanoteNavContent">
</div>
</div>
<!-- leaui image -->
<form id="upload" method="post" action="/file/uploadImageLeaui" enctype="multipart/form-data" style="margin-top: 5px;">
<div id="drop">
Drop images to here
<input type="file" name="file" multiple style="display: none"/>
</div>
<ul id="uploadMsg">
</ul>
</form>
<!-- 由此可以算高度 -->
<div id="editorContent" name="editorContent" tabindex="2" />
{{.noteContent}}
@@ -512,7 +524,7 @@ function log(o) {
</div>
<textarea id="md-section-helper"></textarea>
</div>
<!-- for test -->
<!-- mdEditor -->
<!-- Hidden Popup Modal -->
@@ -834,7 +846,7 @@ function log(o) {
<tr>
<td>
<button id="pwdBtn" class="btn btn-success" style="width: 100%">{{msg . "submit"}}</button>
<button id="pwdBtn" class="btn btn-success">{{msg . "submit"}}</button>
</td>
</tr>
</table>
@@ -928,7 +940,7 @@ LEA.locale = "{{.locale}}";
<script src="/js/jQuery-slimScroll-1.3.0/jquery.slimscroll.js"></script>
<script src="js/app/page.js"></script>
<script src="tinymce/tinymce.min.js"></script>
<script src="tinymce/tinymce.js"></script>
<script src="js/jquery-cookie-min.js"></script>
<script src="js/bootstrap-min.js"></script>
<script src="js/app/note.js"></script>
@@ -950,8 +962,12 @@ Note.setNoteCache(noteContentJson);
Note.renderNoteContent(noteContentJson)
Tag.renderTagNav(tagsJson);
// init notebook后才调用
initSlimScroll();
</script>
<!-- mdEditor -->
<link href="/public/mdeditor/editor/editor.css" rel="stylesheet">
<script src="/public/mdeditor/editor/pagedown/Markdown.Converter-min.js"></script>
@@ -966,7 +982,7 @@ Tag.renderTagNav(tagsJson);
MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ["\\(","\\)"]], processEscapes: true }, messageStyle: "none"});
</script>
<script src="/public/mdeditor/editor/mathJax-min.js"></script>
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script src="/public/mdeditor/editor/jquery.waitforimages-min.js"></script>
<script src="/public/mdeditor/editor/google-code-prettify/prettify.js"></script>
<script src="/public/mdeditor/editor/editor.js"></script>
@@ -975,5 +991,23 @@ Tag.renderTagNav(tagsJson);
<!-- context-menu -->
<link rel="stylesheet" href="/js/contextmenu/css/contextmenu.css" type="text/css" />
<script src="/js/contextmenu/jquery.contextmenu.js"></script>
<!-- version 2.0 -->
<script src="/js/require.js"></script>
<script>
require.config({
baseUrl: '/public',
paths: {
// 'jquery': 'js/jquery-1.9.0.min',
'leaui_image': 'tinymce/plugins/leaui_image/public/js/for_editor',
'jquery.ui.widget': 'tinymce/plugins/leaui_image/public/js/jquery.ui.widget',
'fileupload': '/tinymce/plugins/leaui_image/public/js/jquery.fileupload'
},
shim: {
}
});
require(['leaui_image'], function(leaui_image) {
});
</script>
</body>
</html>
+44 -10
View File
@@ -41,17 +41,17 @@ function log(o) {
<!-- <div id="headerContainer"> -->
<div id="header">
<!-- <div id="headerLeft" class="pull-left">
<!--
<div id="headerLeft" class="pull-left">
</div>
-->
<div id="logo" class="pull-left">
<span>lea</span>note
<!-- <img style="height: 45px;" src="/images/logo.png" title="leanote, 不一样的笔记" alt="leanote">
-->
<!--<span>lea</span>note -->
<!--<img style="height: 45px;" src="/images/logo/leanote_white.png" title="leanote, 不一样的笔记" alt="leanote">-->
</div>
<div id="switcher" class="pull-left">
<i class="fa fa-align-justify" id="leftSwitcher" title="{{msg . "leftHidden"}}"></i>
<span id="leftSwitcher2" title="{{msg . "leftShow"}}">lea</span>
<span id="leftSwitcher2" title="{{msg . "leftShow"}}"></span>
</div>
<!-- search -->
<div class="pull-left" id="searchWrap">
@@ -450,9 +450,10 @@ function log(o) {
<li role="presentation"><span class="label label-green">{{msg . "green"}}</span></li>
</ul>
</div>
</div>
<ul class="pull-right" id="editorTool">
<li><a class="ios7-a " id="saveBtn" title="ctrl+s"
data-toggle="dropdown">{{msg . "save"}}</a></li>
@@ -487,6 +488,17 @@ function log(o) {
<div id="leanoteNavContent">
</div>
</div>
<!-- leaui image -->
<form id="upload" method="post" action="/file/uploadImageLeaui" enctype="multipart/form-data" style="margin-top: 5px;">
<div id="drop">
Drop images to here
<input type="file" name="file" multiple style="display: none"/>
</div>
<ul id="uploadMsg">
</ul>
</form>
<!-- 由此可以算高度 -->
<div id="editorContent" name="editorContent" tabindex="2" />
{{.noteContent}}
@@ -512,7 +524,7 @@ function log(o) {
</div>
<textarea id="md-section-helper"></textarea>
</div>
<!-- for test -->
<!-- mdEditor -->
<!-- Hidden Popup Modal -->
@@ -834,7 +846,7 @@ function log(o) {
<tr>
<td>
<button id="pwdBtn" class="btn btn-success" style="width: 100%">{{msg . "submit"}}</button>
<button id="pwdBtn" class="btn btn-success">{{msg . "submit"}}</button>
</td>
</tr>
</table>
@@ -928,7 +940,7 @@ LEA.locale = "{{.locale}}";
<script src="/js/jQuery-slimScroll-1.3.0/jquery.slimscroll.js"></script>
<script src="js/app/page-min.js"></script>
<script src="tinymce/tinymce.min.js"></script>
<script src="tinymce/tinymce.js"></script>
<script src="js/jquery-cookie-min.js"></script>
<script src="js/bootstrap-min.js"></script>
<script src="js/app/note-min.js"></script>
@@ -950,8 +962,12 @@ Note.setNoteCache(noteContentJson);
Note.renderNoteContent(noteContentJson)
Tag.renderTagNav(tagsJson);
// init notebook后才调用
initSlimScroll();
</script>
<!-- mdEditor -->
<link href="/public/mdeditor/editor/editor.css" rel="stylesheet">
<script src="/public/mdeditor/editor/pagedown/Markdown.Converter-min.js"></script>
@@ -966,7 +982,7 @@ Tag.renderTagNav(tagsJson);
MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ["\\(","\\)"]], processEscapes: true }, messageStyle: "none"});
</script>
<script src="/public/mdeditor/editor/mathJax-min.js"></script>
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script src="/public/mdeditor/editor/jquery.waitforimages-min.js"></script>
<script src="/public/mdeditor/editor/google-code-prettify/prettify.js"></script>
<script src="/public/mdeditor/editor/editor-min.js"></script>
@@ -975,5 +991,23 @@ Tag.renderTagNav(tagsJson);
<!-- context-menu -->
<link rel="stylesheet" href="/js/contextmenu/css/contextmenu.css" type="text/css" />
<script src="/js/contextmenu/jquery.contextmenu-min.js"></script>
<!-- version 2.0 -->
<script src="/js/require.js"></script>
<script>
require.config({
baseUrl: '/public',
paths: {
// 'jquery': 'js/jquery-1.9.0.min',
'leaui_image': 'tinymce/plugins/leaui_image/public/js/for_editor',
'jquery.ui.widget': 'tinymce/plugins/leaui_image/public/js/jquery.ui.widget',
'fileupload': '/tinymce/plugins/leaui_image/public/js/jquery.fileupload'
},
shim: {
}
});
require(['leaui_image'], function(leaui_image) {
});
</script>
</body>
</html>
BIN
View File
Binary file not shown.
+12
View File
@@ -21,6 +21,13 @@ cp ./bin/run.sh $tmp/leanote/bin/
# views
cp -r ./app/views $tmp/leanote/app
# 可不要
cp -r ./app/service $tmp/leanote/app/service
cp -r ./app/controllers $tmp/leanote/app/controllers
cp -r ./app/db $tmp/leanote/app/db
cp -r ./app/info $tmp/leanote/app/info
cp -r ./app/lea $tmp/leanote/app/lea
# conf
cp ./conf/app.conf-default $tmp/leanote/conf/app.conf
cp ./conf/routes-default $tmp/leanote/conf/routes
@@ -30,6 +37,11 @@ cp -r ./messages ./public ./mongodb_backup $tmp/leanote/
# delete some files
rm -r $tmp/leanote/public/tinymce/classes
rm -r $tmp/leanote/public/upload
mkdir $tmp/leanote/public/upload
rm -r $tmp/leanote/public/.codekit-cache
rm $tmp/leanote/public/.DS_Store
rm $tmp/leanote/public/config.codekit
# make link
cd $tmp/leanote/bin
+9
View File
@@ -1,5 +1,8 @@
# leanote
moto=your own cloud note!
moto2=Knowledge, Sharing, Cooperation, Blog... all in leanote
moto3=Brief But Not Simple
fork github=Fork leanote on Github
# 首页
forgetPassword = Forget password?
@@ -76,6 +79,7 @@ myNotebook=My notebook
addNotebook=Add notebook
all=Newest
trash=Trash
delete=Delete
unTitled=UnTitled
defaultShare=Default sharing
leftHidden=Hidden slide bar
@@ -123,5 +127,10 @@ uploadImage=Upload image
aboutMe=About me
blogSet=Set blog
# index
discussion=Discussion
download=Download
howToInstallLeanote=How to install leanote
# error
notFound=This page cann't found.
+9 -1
View File
@@ -1,5 +1,8 @@
# leanote
moto=不一样的笔记!
moto=你的私人云笔记!
moto2=知识管理, 博客, 分享, 协作... 尽在leanote
moto3=简约而不简单
fork github=Github 源码
# 首页
forgetPassword = 忘记密码?
@@ -77,6 +80,7 @@ myNotebook=我的笔记本
addNotebook=添加笔记本
all=最新
trash=废纸篓
delete=删除
unTitled=无标题
defaultShare=默认共享
leftHidden=隐藏左侧
@@ -127,6 +131,10 @@ blogSet=博客设置
# error
notFound=该页面不存在
# index
discussion=参与讨论
download=下载
howToInstallLeanote=leanote安装步骤
# 必须要加这个, 奇怪
Binary file not shown.
@@ -0,0 +1 @@
{ "indexes" : [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "leanote_public_3.files", "name" : "_id_" } ] }
@@ -1 +1 @@
{ "indexes" : [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "leanote_public.has_share_notes", "name" : "_id_" }, { "v" : 1, "key" : { "UserId" : 1, "ToUserId" : 1 }, "unique" : true, "ns" : "leanote_public.has_share_notes", "name" : "UserId_1_ToUserId_1" } ] }
{ "indexes" : [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "leanote_public_3.has_share_notes", "name" : "_id_" }, { "v" : 1, "key" : { "UserId" : 1, "ToUserId" : 1 }, "unique" : true, "ns" : "leanote_public_3.has_share_notes", "name" : "UserId_1_ToUserId_1" } ] }
@@ -1 +1 @@
{ "indexes" : [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "leanote_public.note_content_histories", "name" : "_id_" } ] }
{ "indexes" : [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "leanote_public_3.note_content_histories", "name" : "_id_" } ] }
@@ -1 +1 @@
{ "indexes" : [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "leanote_public.note_contents", "name" : "_id_" } ] }
{ "indexes" : [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "leanote_public_3.note_contents", "name" : "_id_" } ] }
Binary file not shown.
@@ -1 +1 @@
{ "indexes" : [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "leanote_public.notebooks", "name" : "_id_" }, { "v" : 1, "key" : { "UserId" : 1 }, "ns" : "leanote_public.notebooks", "name" : "UserId_1" } ] }
{ "indexes" : [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "leanote_public_3.notebooks", "name" : "_id_" }, { "v" : 1, "key" : { "UserId" : 1 }, "ns" : "leanote_public_3.notebooks", "name" : "UserId_1" } ] }
Binary file not shown.
@@ -1 +1 @@
{ "indexes" : [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "leanote_public.notes", "name" : "_id_" }, { "v" : 1, "key" : { "UserId" : 1 }, "ns" : "leanote_public.notes", "name" : "UserId_1" } ] }
{ "indexes" : [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "leanote_public_3.notes", "name" : "_id_" }, { "v" : 1, "key" : { "UserId" : 1 }, "ns" : "leanote_public_3.notes", "name" : "UserId_1" } ] }
@@ -1 +1 @@
{ "indexes" : [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "leanote_public.share_notebooks", "name" : "_id_" } ] }
{ "indexes" : [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "leanote_public_3.share_notebooks", "name" : "_id_" } ] }
Binary file not shown.
@@ -1 +1 @@
{ "indexes" : [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "leanote_public.share_notes", "name" : "_id_" }, { "v" : 1, "key" : { "UserId" : 1, "ToUserId" : 1, "NoteId" : 1 }, "unique" : true, "ns" : "leanote_public.share_notes", "name" : "UserId_1_ToUserId_1_NoteId_1" } ] }
{ "indexes" : [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "leanote_public_3.share_notes", "name" : "_id_" }, { "v" : 1, "key" : { "UserId" : 1, "ToUserId" : 1, "NoteId" : 1 }, "unique" : true, "ns" : "leanote_public_3.share_notes", "name" : "UserId_1_ToUserId_1_NoteId_1" } ] }
@@ -1 +1 @@
{ "indexes" : [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "leanote_public.system.users", "name" : "_id_" }, { "v" : 1, "key" : { "user" : 1, "userSource" : 1 }, "unique" : true, "ns" : "leanote_public.system.users", "name" : "user_1_userSource_1" } ] }
{ "indexes" : [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "leanote_public_3.system.users", "name" : "_id_" }, { "v" : 1, "key" : { "user" : 1, "userSource" : 1 }, "unique" : true, "ns" : "leanote_public_3.system.users", "name" : "user_1_userSource_1" } ] }
@@ -1 +1 @@
{ "indexes" : [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "leanote_public.tags", "name" : "_id_" }, { "v" : 1, "key" : { "UserId" : 1 }, "ns" : "leanote_public.tags", "name" : "UserId_1" } ] }
{ "indexes" : [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "leanote_public_3.tags", "name" : "_id_" }, { "v" : 1, "key" : { "UserId" : 1 }, "ns" : "leanote_public_3.tags", "name" : "UserId_1" } ] }
Binary file not shown.
@@ -1 +1 @@
{ "indexes" : [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "leanote_public.tokens", "name" : "_id_" } ] }
{ "indexes" : [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "leanote_public_3.tokens", "name" : "_id_" } ] }
Binary file not shown.
@@ -1 +1 @@
{ "indexes" : [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "leanote_public.user_blogs", "name" : "_id_" } ] }
{ "indexes" : [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "leanote_public_3.user_blogs", "name" : "_id_" } ] }
Binary file not shown.
@@ -1 +1 @@
{ "indexes" : [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "leanote_public.users", "name" : "_id_" } ] }
{ "indexes" : [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "leanote_public_3.users", "name" : "_id_" } ] }
+4
View File
@@ -7100,3 +7100,7 @@ td.visible-print {
.btn {
border-radius: 0;
}
.mce-item-table, .mce-item-table td, .mce-item-table th, .mce-item-table caption {
border: 1px solid #9B9898;
border-collapse: collapse;
}
+3
View File
@@ -0,0 +1,3 @@
.aaa {
font-size: 12px;
}
+5
View File
@@ -10,3 +10,8 @@ html {
* {
font-family: 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
}
.mce-item-table, .mce-item-table td, .mce-item-table th, .mce-item-table caption {
border: 1px solid #9B9898;
border-collapse: collapse;
}
+5
View File
@@ -22,3 +22,8 @@ html {
* {
font-family: @fontFamily;
}
.mce-item-table, .mce-item-table td, .mce-item-table th, .mce-item-table caption {
border: 1px solid #9B9898;
border-collapse: collapse;
}
+61
View File
@@ -0,0 +1,61 @@
// font
@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');
}
/* leanote */
@font-face {
font-family: 'leanoteregular';
src: url('../../fonts/leanote/leanote-regular-webfont.eot');
src: url('../../fonts/leanote/leanote-regular-webfont.eot?#iefix') format('embedded-opentype'),
url('../../fonts/leanote/leanote-regular-webfont.woff') format('woff'),
url('../../fonts/leanote/leanote-regular-webfont.ttf') format('truetype'),
url('../../fonts/leanote/leanote-regular-webfont.svg#leanoteregular') format('svg');
font-weight: normal;
font-style: normal;
}
/*"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;*/
#logo {
font-family: "leanoteregular";
font-size: 36px;
}
#logo:before {
content: "a";
}
#switcher span {
font-family: "leanoteregular";
border-radius: 5px;
display: inline-block;
cursor: pointer;
font-size: 18px;
height: 34px;
line-height: 34px;
margin-top: 8px;
padding: 0 5px;
}
#switcher span:before {
content: "b";
}
File diff suppressed because it is too large. Load diff
+40 -34
View File
@@ -1,3 +1,4 @@
@import "basic.less";
@bgColor: #fff;
@headerBgColor: #25313e;
@@ -14,34 +15,6 @@
@noteListWidth: 250px;
@noteActiveBg: #65bd77;
// font
@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;*/
@selectionBg: @aBlackColor;
@selectionColor: #fff;
::selection { background:@selectionBg; color:@selectionColor; }
@@ -101,7 +74,6 @@ a.raw:hover {
#logo, #logo span {
line-height: 50px;//@headerHeight;
font-size: 28px;
}
#logo {
width: 140px;
@@ -113,7 +85,7 @@ a.raw:hover {
border-color: rgba(255, 255, 255, 0.1);
//color: #ccc;
}
#logo span , #switcher span {
#logo span{
background-color: #000;
//color: #eee;
border-radius: 10px;
@@ -137,7 +109,7 @@ a.raw:hover {
}
span {
border-radius: 5px;
padding: 8px 4px;
background-color: #000;
cursor: pointer;
font-size: 16px;
&:hover {
@@ -640,18 +612,20 @@ a.raw:hover {
}
#noteItemList .item-thumb {
padding-left: 10px;
width: 100px;
height: 100px;
overflow: hidden;
position: absolute;
z-index: 1;
right: 0px;
height: 100px;
background-color: #fff;
margin-right: 5px;
line-height: 100px;
text-align: center;
}
.item-thumb img {
width: 100px;
max-width: 100px;
}
#noteItemList .item-desc {
position: absolute;
@@ -1202,10 +1176,42 @@ background-position:-1px -670px
width: 20px;
height: 20px;
content: url(../../images/loading-a-20.gif);
margin-top:10px;
vertical-align: middle;
visibility: hidden;
}
#toggleEditorMode {
margin: 0 10px !important;
}
// leaui image drop drag
#upload {
position: absolute;
z-index: 0;
bottom: 0;
right: 0;
left: 0px;
padding: 0;
background-color: #fff;
text-align: center;
display: none;
}
#upload #drop {
width: 100%;
height: 100%;
padding-top: 100px;
}
#drop.in {
border: 1px solid #000000;
}
#drop.hover {
border: 2px solid #000000;
}
#uploadMsg {
position: absolute;
top: 3px;
right: 3px;
bottom: 10px;
overflow: scroll;
list-style: none;
}
File diff suppressed because it is too large. Load diff
+42 -36
View File
@@ -1,3 +1,4 @@
@import "basic.less";
@bgColor: #fff;
@headerBgColor: #fff;
@@ -13,34 +14,6 @@
@noteListWidth: 250px;
@noteActiveBg: #65bd77;
// font
@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;*/
@selectionBg: @aBlackColor;
@selectionColor: #fff;
::selection { background:@selectionBg; color:@selectionColor; }
@@ -94,7 +67,6 @@ a.raw:hover {
#logo, #logo span {
line-height: 50px;// @headerHeight;
font-size: 28px;
}
#logo {
width: 140px;
@@ -106,7 +78,7 @@ a.raw:hover {
border-color: rgba(255, 255, 255, 0.1);
//color: #ccc;
}
#logo span, #switcher span {
#logo span {
background-color: #000;
color: #fff;
border-radius: 10px;
@@ -129,8 +101,9 @@ a.raw:hover {
}
}
span {
background-color: #000;
color: #fff;
border-radius: 5px;
padding: 6px 4px;
cursor: pointer;
font-size: 14px;
&:hover {
@@ -450,8 +423,6 @@ a.raw:hover {
*/
}
#myNotebooks .folderBody {
max-height: 600px;
overflow: auto;
}
#addNotebookPlus {
padding-right: 10px;
@@ -607,18 +578,20 @@ border: 1px solid @borderColor;
// font-weight: 800;
}
}#noteItemList .item-thumb {
padding-left: 10px;
width: 100px;
height: 100px;
overflow: hidden;
position: absolute;
z-index: 1;
right: 0px;
height: 100px;
background-color: #fff;
margin-right: 5px;
line-height: 100px;
text-align: center;
}
.item-thumb img {
width: 100px;
max-width: 100px;
}
#noteItemList .item-desc {
position: absolute;
@@ -1163,10 +1136,43 @@ background-position:-1px -670px
width: 20px;
height: 20px;
content: url(../../images/loading-a-20-black.gif);
margin-top:10px;
vertical-align: middle;
visibility: hidden;
}
#toggleEditorMode {
margin: 0 10px !important;
}
// leaui image drop drag
#upload {
position: absolute;
z-index: 0;
bottom: 0;
right: 0;
left: 0px;
padding: 0;
background-color: #fff;
text-align: center;
display: none;
}
#upload #drop {
width: 100%;
height: 100%;
padding-top: 100px;
}
#drop.in {
border: 1px solid #000000;
}
#drop.hover {
border: 2px solid #000000;
}
#uploadMsg {
position: absolute;
top: 3px;
right: 3px;
bottom: 10px;
overflow: scroll;
list-style: none;
}
+30 -8
View File
@@ -72,13 +72,10 @@ a.raw:hover {
color: #ffffff;
border-bottom: 1px solid #ebeff2;
/* for app */
webkit-user-select: none;
/* 还不知 */
-webkit-app-region: drag;
/* -webkit-app-region: no-drag; */
}
#header a {
color: #ccc;
@@ -290,7 +287,6 @@ a.raw:hover {
}
.item-title {
/*font-weight: 400;*/
font-size: 16px;
height: 22px;
line-height: 20px;
@@ -345,9 +341,7 @@ a.raw:hover {
border: none;
overflow: hidden !important;
/*不知道哪里设置了auto*/
/*border-radius: 5px;*/
}
/* 最顶层 */
#editor .mce-tinymce {
@@ -449,7 +443,6 @@ a.raw:hover {
cursor: pointer;
font-style: normal;
/*border-left: 1px solid #ccc;*/
display: inline-block;
padding-left: 3px;
opacity: 0;
@@ -911,7 +904,6 @@ body {
}
}
*/
}
#noteList #notesAndSort {
display: none;
@@ -963,3 +955,33 @@ body {
#toggleEditorMode {
margin: 0 10px !important;
}
#upload {
position: absolute;
z-index: 0;
bottom: 0;
right: 0;
left: 0px;
padding: 0;
background-color: #fff;
text-align: center;
display: none;
}
#upload #drop {
width: 100%;
height: 100%;
padding-top: 100px;
}
#drop.in {
border: 1px solid #000000;
}
#drop.hover {
border: 2px solid #000000;
}
#uploadMsg {
position: absolute;
top: 3px;
right: 3px;
bottom: 10px;
overflow: scroll;
list-style: none;
}
+31
View File
@@ -1060,3 +1060,34 @@ body {
#toggleEditorMode {
margin: 0 10px !important;
}
// leaui image drop drag
#upload {
position: absolute;
z-index: 0;
bottom: 0;
right: 0;
left: 0px;
padding: 0;
background-color: #fff;
text-align: center;
display: none;
}
#upload #drop {
width: 100%;
height: 100%;
padding-top: 100px;
}
#drop.in {
border: 1px solid #000000;
}
#drop.hover {
border: 2px solid #000000;
}
#uploadMsg {
position: absolute;
top: 3px;
right: 3px;
bottom: 10px;
overflow: scroll;
list-style: none;
}
+30 -7
View File
@@ -72,13 +72,10 @@ a.raw:hover {
color: #ffffff;
border-bottom: 1px solid #ebeff2;
/* for app */
webkit-user-select: none;
/* 还不知 */
-webkit-app-region: drag;
/* -webkit-app-region: no-drag; */
}
#header a {
color: #ccc;
@@ -290,7 +287,6 @@ a.raw:hover {
}
.item-title {
/*font-weight: 400;*/
font-size: 16px;
height: 22px;
line-height: 20px;
@@ -345,9 +341,7 @@ a.raw:hover {
border: none;
overflow: hidden !important;
/*不知道哪里设置了auto*/
/*border-radius: 5px;*/
}
/* 最顶层 */
#editor .mce-tinymce {
@@ -449,7 +443,6 @@ a.raw:hover {
cursor: pointer;
font-style: normal;
/*border-left: 1px solid #ccc;*/
display: inline-block;
padding-left: 3px;
opacity: 0;
@@ -741,3 +734,33 @@ background-position:-1px -670px
background-color: #65bd77;
color: #fff;
}
#upload {
position: absolute;
z-index: 0;
bottom: 0;
right: 0;
left: 0px;
padding: 0;
background-color: #fff;
text-align: center;
display: none;
}
#upload #drop {
width: 100%;
height: 100%;
padding-top: 100px;
}
#drop.in {
border: 1px solid #000000;
}
#drop.hover {
border: 2px solid #000000;
}
#uploadMsg {
position: absolute;
top: 3px;
right: 3px;
bottom: 10px;
overflow: scroll;
list-style: none;
}
Binary file not shown.
@@ -0,0 +1,33 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata></metadata>
<defs>
<font id="leanoteregular" horiz-adv-x="512" >
<font-face units-per-em="2048" ascent="2048" descent="0" />
<missing-glyph horiz-adv-x="500" />
<glyph horiz-adv-x="0" />
<glyph unicode="&#xd;" />
<glyph horiz-adv-x="0" />
<glyph horiz-adv-x="0" />
<glyph unicode=" " />
<glyph unicode="&#x22;" horiz-adv-x="2048" />
<glyph unicode="a" horiz-adv-x="6750" d="M7 729q11 76 43 139.5t85 104.5t125 41q47 63 77 145q23 63 23 149q0 26 -2 54q-43 6 -95 15t-95 25q-44 17 -68 46q-16 18 -15 44q0 15 5 32q8 25 27.5 33t47.5 9t59.5 -1t62.5 4q27 4 50 15t46 22.5t44.5 19.5t45.5 4q39 -25 55.5 -71t26.5 -99q28 -6 52 -6q15 0 28 2 q35 6 67.5 15.5t65.5 14.5l20 2q25 0 54 -9q18 43 39.5 61.5t54.5 25.5t77 11t105 18q27 6 57.5 18.5t60.5 19.5q16 4 30 4q12 0 24 -3q24 -6 33 -39q7 -21 7 -39q0 -22 -12 -36q-20 -26 -56.5 -43t-77.5 -29t-66 -33q-33 -25 -61.5 -75t-51 -113.5t-37 -136t-16.5 -140.5 v-20q0 -56 9 -106q11 -60 40 -97q51 -12 106.5 -40t104 -67.5t83 -92t46.5 -113.5q8 -39 8 -78q-1 -10 -1 -20q-2 -48 -16.5 -90t-39 -72.5t-57.5 -42.5q-38 -15 -71 -15q-18 0 -34 4q-46 12 -79 45t-56.5 79t-38.5 91q1 -12 1 -23q-1 -66 -31 -128q-36 -72 -94 -115 t-130 -48h-12q-65 0 -127 46q-37 29 -52 74t-26.5 93t-28 94t-53.5 79q-12 1 -23 1q-28 0 -50 -4q-32 -5 -60 -9t-55 -5t-53 9q-66 23 -104 78t-50 125q-6 37 -6 76q0 35 5 71zM313 844q43 -10 56.5 16.5t-2.5 54.5q-33 0 -43.5 -20t-10.5 -51zM492 1245q-4 -15 -4 -27 q0 -16 7 -26q13 -18 36.5 -24.5t51 -1.5t44.5 18q-3 29 -3 54q0 38 7 70q12 52 22 107q-10 6 -27.5 9t-35 1t-30.5 -8t-15 -18q35 0 52 -16.5t19 -41t-7 -51t-26.5 -44t-42 -20.5t-48.5 19zM563 424q20 -35 32.5 -78t30.5 -80q19 -38 49 -62q28 -23 77 -22h8q18 18 25.5 44 t7.5 53.5t-9.5 54t-23.5 45.5q-47 14 -101.5 18t-95.5 27zM672 1245q-2 -6 -2 -11q0 -6 3 -12q5 -8 11 -13t13.5 -10t9.5 -15q28 -8 52 -8q28 0 49 12q38 22 54 62q11 30 11 62q1 12 -1 24q-6 46 -28 78q-20 32 -56 37q-4 1 -8 1q-33 0 -73 -37q29 4 45 -7t26 -28 q5 -18 5 -36q0 -16 -5 -34q-10 -36 -35 -55q-10 -14 -22 -12t-25 7q-12 6 -19 8q-5 2 -5 -7v-6zM885 459q51 -16 79.5 -66.5t53 -106t53.5 -99.5t82 -50q9 -1 17 -1q22 0 40 8q26 10 46 28t32 42t19 48q7 33 7 65q0 45 -14 85q-22 70 -66 125t-103.5 91t-118.5 46 q-4 -25 -12.5 -43t-6.5 -47q41 -10 79 -29.5t66 -49.5q30 -30 46 -66q15 -32 14 -70v-9q-25 37 -62 80q-38 44 -81 68q-35 20 -70 19q-9 0 -18 -1q-45 -6 -82 -67zM1502 836v140.5v139.5q1 139 9 273h162v-1119q-14 -6 -37.5 -8t-48 -2t-47 2t-37.5 8q1 93 1 187v95z M1783 560q-2 34 -1 68q0 36 1 72q3 72 10 135.5t20.5 111.5t29.5 67q23 23 71 39t110 25q62 8 128 10q11 0 22 1q56 -1 106 -7q62 -8 111.5 -23t76.5 -37q42 -36 58 -98q11 -43 11 -89q1 -19 -1 -37q-6 -64 -35 -119.5t-76 -76.5q-49 -23 -99 -25q-13 -1 -26 -1q-37 0 -75 4 q-51 6 -107 10q-16 1 -32 1q-40 0 -83 -7v170q29 3 60 3q15 0 31 -1q48 -2 95 -3h23q34 0 66 2q42 3 75 17q6 18 9 50t-9 48q-29 20 -76 26q-36 5 -76 5h-25q-54 -2 -107.5 -6t-92.5 -6q-12 -41 -16 -96.5t-4 -113.5t4 -116.5t8 -103.5q46 -23 106 -27q48 -3 101 -3h27 q68 1 136 5q27 2 53 2q40 0 77 -4v-170q-56 6 -114 6q-40 0 -82 -3q-100 -7 -189.5 -7t-160.5 19.5t-105 82.5q-14 25 -22.5 78.5t-11.5 121.5zM2630 492q-1 10 -1 20q-1 56 19 110q22 64 72 97q37 25 86 32q43 6 91 6h15q56 -1 120 -4q27 -1 56 -1q38 0 78 2v-170 q-25 -2 -51 -2q-20 0 -42 1q-50 3 -97 4h-16q-38 0 -73 -4q-42 -5 -69 -26q-10 -14 -10 -49t10 -49q27 -18 74 -24.5t99 -6.5t103.5 5t90.5 7q18 37 24 96.5t6 124t-7 125t-15 103.5q-80 10 -173 10q-33 0 -67 -1q-73 -3 -142 -3q-56 0 -110 2q2 20 1 46t-2 50.5t0 46 t10 37.5q48 -4 97 -4q25 0 49 1q74 3 144 5q20 1 41 1q49 0 95 -4q64 -5 114.5 -24.5t85.5 -57.5t45 -105q15 -97 17 -201v-24q0 -90 -16 -170q-18 -90 -61.5 -155t-117.5 -77q-43 -6 -105 -10q-42 -3 -85 -3q-21 0 -43 1q-64 2 -123.5 9t-91.5 22q-59 25 -90 84t-35 127z M3506 262v787q0 23 19 28q61 -9 126 -9q37 0 75 3q106 8 203 10h18q86 1 157 -17q78 -20 119 -87q37 -61 39 -147v-34q0 -70 -6 -146q-8 -96 -15 -196q-2 -31 -2 -60q0 -68 11 -132h-170v608q-29 25 -76 32q-41 6 -88 6h-14q-54 -1 -111 -4q-19 -1 -37 -1q-36 0 -70 4 q-8 -75 -9 -155q0 -40 -0.5 -81t0.5 -82q1 -83 2 -165v-54q0 -54 -1 -108h-170zM4363 639q-2 36 -1.5 70.5t1.5 66.5q3 66 12.5 120t25.5 81q25 43 67.5 61.5t110.5 28.5q61 8 134 12q36 2 71.5 2t69.5 -2q68 -4 123 -19.5t86 -45.5q16 -16 29.5 -62.5t22.5 -108t12 -131.5 q2 -53 2 -104v-34q-1 -66 -8 -120.5t-21 -84.5q-10 -16 -35 -41l-29 -29q-29 -18 -78 -31q-50 -12 -110 -17q-43 -4 -88 -4q-18 0 -36 1q-64 2 -123 11t-105 25.5t-68 41.5q-18 18 -31.5 66t-22 111.5t-11.5 135.5zM4540 664.5q0 -60.5 6.5 -118t16.5 -95.5q33 -10 85 -16.5 t107.5 -6.5t104.5 6t78 25q4 45 8 102t4 116.5t-4 115t-16 96.5q-37 4 -87.5 8t-102.5 4t-99 -5t-78 -17q-12 -39 -17.5 -96.5t-5.5 -118zM5224 907v160q10 10 31 9t41 1v312h160v-304q17 -12 42 -12q10 0 20 2q24 4 46 4q14 0 27 -2v-180h-135v-635h-160v627q-4 8 -14 9 t-21.5 1h-23t-13.5 8zM5674 560q-2 34 -2 68q0 36 2 72q3 72 10 135.5t20.5 111.5t29.5 67q23 23 71 39t109 25q62 8 128 10q11 0 23 1q55 -1 105 -7q62 -8 112 -23t77 -37q43 -36 59 -98q11 -43 11 -89q-1 -19 -3 -37q-6 -64 -34.5 -119.5t-75.5 -76.5q-49 -23 -98 -25 q-13 -1 -26 -1q-38 0 -76 4q-52 6 -108 10q-16 1 -32 1q-40 0 -82 -7v170q29 3 60 3q15 0 31 -1q47 -2 95 -3h24q35 0 66 2q42 3 74 17q6 18 9.5 50t-9.5 48q-29 20 -76 26q-36 5 -76 5h-25q-54 -2 -107.5 -6t-91.5 -6q-12 -41 -16.5 -96.5t-4.5 -113.5t4 -116.5t8 -103.5 q45 -23 105 -27q48 -3 102 -3h26q68 1 137 5q28 2 54 2q39 0 76 -4v-170q-56 6 -114 6q-41 0 -83 -3q-100 -7 -189 -7t-159.5 19.5t-105.5 82.5q-14 25 -22.5 78.5t-11.5 121.5z" />
<glyph unicode="b" horiz-adv-x="1771" d="M8 912q14 94 54 172.5t107 130t155 53.5q59 80 97 182q28 76 28 180q0 35 -3 74q-53 8 -117.5 18.5t-118.5 32t-85 57.5q-19 22 -19 52q0 19 7 41q8 31 33.5 41t59.5 11h23q25 0 51 -1h19q30 0 59 4q35 6 64 20.5t56.5 28.5t55 23.5t58.5 5.5q47 -31 68.5 -88.5 t31.5 -122.5q35 -8 66 -8q18 0 34 3q46 7 86 18q40 12 82 18q13 2 25 1q31 0 66 -10q23 53 50 76t67 32t95.5 14t133.5 24q33 6 71.5 22.5t75.5 25.5q20 5 37 5q15 0 29 -4q30 -8 45 -49q9 -27 9 -48q0 -28 -14 -47q-26 -34 -72 -54.5t-98.5 -36t-82.5 -40.5 q-41 -31 -77 -93t-63.5 -142t-46 -170t-20.5 -176v-23q0 -73 11 -136q13 -73 50 -120q66 -16 134.5 -50t128 -84t103.5 -114.5t60 -142.5q9 -46 9 -91q0 -15 -1 -31q-4 -60 -22 -112.5t-49 -91t-72 -55.5q-47 -18 -87 -18q-23 -1 -43 5q-56 16 -99 57.5t-72 99t-45 114.5 q1 -12 1 -23q0 -87 -40 -166q-45 -89 -117 -144q-72 -54 -162 -61q-9 -1 -18 -1q-80 0 -155 59q-45 37 -64.5 92.5t-35 116t-36 117.5t-65.5 98q-12 1 -24 1q-35 0 -66 -5q-41 -6 -76 -11q-34 -5 -68 -6h-6q-31 0 -63 11q-82 29 -128 99q-47 69 -63 157q-9 47 -8 96 q-1 43 6 87zM391 1055q14 -3 26 -3q31 0 43 24q8 16 8 32q0 18 -9 37q-41 0 -54.5 -25.5t-13.5 -64.5zM614 1559q-5 -17 -5 -32q1 -21 11 -36q18 -25 46 -32t62 -2t54 22q-3 31 -3 58q1 53 11 97q16 66 27 135q-14 8 -35.5 11.5t-42 1.5t-37 -11.5t-20.5 -23.5h7 q37 1 57 -19q22 -22 25 -52q1 -6 0 -13q0 -25 -9 -51q-12 -33 -34.5 -54.5t-52.5 -24.5h-6q-27 0 -55 26zM705 528q25 -43 40 -96t37 -99t60 -77q35 -29 100 -29h8q23 23 32 55q8 28 8 59v7q-1 35 -11 68t-29 57q-29 8 -61.5 13.5t-65 10.5t-63.5 12t-55 19zM838 1559 q-2 -7 -2 -13q0 -10 4 -16q6 -10 14 -17.5t16.5 -14.5t12.5 -19q36 -10 65 -10q36 -1 62 15q46 28 66 78q14 36 15 77q-1 15 -3 31q-8 58 -34 98t-70 48q-5 1 -11 0q-40 0 -90 -47q37 4 57.5 -8t32.5 -35q6 -21 6 -42q1 -24 -7 -48q-14 -45 -44 -67q-10 -16 -26.5 -13t-31 9 t-24.5 9q-8 2 -8 -10v-5zM1108 573q41 -14 70.5 -47.5t52 -76.5t42 -90.5t42 -87.5t53.5 -67.5t74 -31.5q9 -1 18 0q28 0 52 8q32 12 56.5 36t41 53.5t22.5 58.5q9 42 9 82q1 53 -15 104q-26 88 -82.5 156.5t-131.5 113.5t-148 58q-4 -29 -14.5 -52.5t-8.5 -58.5 q51 -12 99.5 -37.5t84 -62.5t55.5 -83q19 -42 19 -88v-9q-31 45 -79 99t-101 85q-43 25 -88 25q-11 0 -21 -2q-56 -8 -102 -85z" />
<glyph unicode="&#xa0;" />
<glyph unicode="&#x2000;" horiz-adv-x="1024" />
<glyph unicode="&#x2001;" horiz-adv-x="2048" />
<glyph unicode="&#x2002;" horiz-adv-x="1024" />
<glyph unicode="&#x2003;" horiz-adv-x="2048" />
<glyph unicode="&#x2004;" horiz-adv-x="682" />
<glyph unicode="&#x2005;" />
<glyph unicode="&#x2006;" horiz-adv-x="341" />
<glyph unicode="&#x2007;" horiz-adv-x="341" />
<glyph unicode="&#x2008;" horiz-adv-x="256" />
<glyph unicode="&#x2009;" horiz-adv-x="409" />
<glyph unicode="&#x200a;" horiz-adv-x="113" />
<glyph unicode="&#x202f;" horiz-adv-x="409" />
<glyph unicode="&#x205f;" />
<glyph unicode="&#x25fc;" horiz-adv-x="1024" d="M0 0z" />
</font>
</defs></svg>

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

+1
View File
@@ -0,0 +1 @@
leanote logo is designed by jaguarWang(https://github.com/jaguarWang)
Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

+1 -1
View File
@@ -1,2 +1,2 @@
(function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory)}else{factory(jQuery)}})(function($){var pluses=/\+/g;function encode(s){return config.raw?s:encodeURIComponent(s)}function decode(s){return config.raw?s:decodeURIComponent(s)}function stringifyCookieValue(value){return encode(config.json?JSON.stringify(value):String(value))}function parseCookieValue(s){if(s.indexOf('"')===0){s=s.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\")}try{s=decodeURIComponent(s.replace(pluses," "));return config.json?JSON.parse(s):s}catch(e){}}function read(s,converter){var value=config.raw?s:parseCookieValue(s);return $.isFunction(converter)?converter(value):value}var config=$.cookie=function(key,value,options){if(value!==undefined&&!$.isFunction(value)){options=$.extend({},config.defaults,options);if(typeof options.expires==="number"){var days=options.expires,t=options.expires=new Date;t.setTime(+t+days*864e5)}return document.cookie=[encode(key),"=",stringifyCookieValue(value),options.expires?"; expires="+options.expires.toUTCString():"",options.path?"; path="+options.path:"",options.domain?"; domain="+options.domain:"",options.secure?"; secure":""].join("")}var result=key?undefined:{};var cookies=document.cookie?document.cookie.split("; "):[];for(var i=0,l=cookies.length;i<l;i++){var parts=cookies[i].split("=");var name=decode(parts.shift());var cookie=parts.join("=");if(key&&key===name){result=read(cookie,value);break}if(!key&&(cookie=read(cookie))!==undefined){result[name]=cookie}}return result};config.defaults={};$.removeCookie=function(key,options){if($.cookie(key)===undefined){return false}$.cookie(key,"",$.extend({},options,{expires:-1}));return!$.cookie(key)}});if(typeof jQuery==="undefined"){throw new Error("Bootstrap requires jQuery")}+function($){"use strict";function transitionEnd(){var el=document.createElement("bootstrap");var transEndEventNames={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var name in transEndEventNames){if(el.style[name]!==undefined){return{end:transEndEventNames[name]}}}}$.fn.emulateTransitionEnd=function(duration){var called=false,$el=this;$(this).one($.support.transition.end,function(){called=true});var callback=function(){if(!called)$($el).trigger($.support.transition.end)};setTimeout(callback,duration);return this};$(function(){$.support.transition=transitionEnd()})}(jQuery);+function($){"use strict";var dismiss='[data-dismiss="alert"]';var Alert=function(el){$(el).on("click",dismiss,this.close)};Alert.prototype.close=function(e){var $this=$(this);var selector=$this.attr("data-target");if(!selector){selector=$this.attr("href");selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,"")}var $parent=$(selector);if(e)e.preventDefault();if(!$parent.length){$parent=$this.hasClass("alert")?$this:$this.parent()}$parent.trigger(e=$.Event("close.bs.alert"));if(e.isDefaultPrevented())return;$parent.removeClass("in");function removeElement(){$parent.trigger("closed.bs.alert").remove()}$.support.transition&&$parent.hasClass("fade")?$parent.one($.support.transition.end,removeElement).emulateTransitionEnd(150):removeElement()};var old=$.fn.alert;$.fn.alert=function(option){return this.each(function(){var $this=$(this);var data=$this.data("bs.alert");if(!data)$this.data("bs.alert",data=new Alert(this));if(typeof option=="string")data[option].call($this)})};$.fn.alert.Constructor=Alert;$.fn.alert.noConflict=function(){$.fn.alert=old;return this};$(document).on("click.bs.alert.data-api",dismiss,Alert.prototype.close)}(jQuery);+function($){"use strict";var Button=function(element,options){this.$element=$(element);this.options=$.extend({},Button.DEFAULTS,options)};Button.DEFAULTS={loadingText:"loading..."};Button.prototype.setState=function(state){var d="disabled";var $el=this.$element;var val=$el.is("input")?"val":"html";var data=$el.data();state=state+"Text";if(!data.resetText)$el.data("resetText",$el[val]());$el[val](data[state]||this.options[state]);setTimeout(function(){state=="loadingText"?$el.addClass(d).attr(d,d):$el.removeClass(d).removeAttr(d)},0)};Button.prototype.toggle=function(){var $parent=this.$element.closest('[data-toggle="buttons"]');if($parent.length){var $input=this.$element.find("input").prop("checked",!this.$element.hasClass("active")).trigger("change");if($input.prop("type")==="radio")$parent.find(".active").removeClass("active")}this.$element.toggleClass("active")};var old=$.fn.button;$.fn.button=function(option){return this.each(function(){var $this=$(this);var data=$this.data("bs.button");var options=typeof option=="object"&&option;if(!data)$this.data("bs.button",data=new Button(this,options));if(option=="toggle")data.toggle();else if(option)data.setState(option)})};$.fn.button.Constructor=Button;$.fn.button.noConflict=function(){$.fn.button=old;return this};$(document).on("click.bs.button.data-api","[data-toggle^=button]",function(e){var $btn=$(Line truncated
})};$.fn.tab.Constructor=Tab;$.fn.tab.noConflict=function(){$.fn.tab=old;return this};$(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(e){e.preventDefault();$(this).tab("show")})}(jQuery);+function($){"use strict";var Affix=function(element,options){this.options=$.extend({},Affix.DEFAULTS,options);this.$window=$(window).on("scroll.bs.affix.data-api",$.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",$.proxy(this.checkPositionWithEventLoop,this));this.$element=$(element);this.affixed=this.unpin=null;this.checkPosition()};Affix.RESET="affix affix-top affix-bottom";Affix.DEFAULTS={offset:0};Affix.prototype.checkPositionWithEventLoop=function(){setTimeout($.proxy(this.checkPosition,this),1)};Affix.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var scrollHeight=$(document).height();var scrollTop=this.$window.scrollTop();var position=this.$element.offset();var offset=this.options.offset;var offsetTop=offset.top;var offsetBottom=offset.bottom;if(typeof offset!="object")offsetBottom=offsetTop=offset;if(typeof offsetTop=="function")offsetTop=offset.top();if(typeof offsetBottom=="function")offsetBottom=offset.bottom();var affix=this.unpin!=null&&scrollTop+this.unpin<=position.top?false:offsetBottom!=null&&position.top+this.$element.height()>=scrollHeight-offsetBottom?"bottom":offsetTop!=null&&scrollTop<=offsetTop?"top":false;if(this.affixed===affix)return;if(this.unpin)this.$element.css("top","");this.affixed=affix;this.unpin=affix=="bottom"?position.top-scrollTop:null;this.$element.removeClass(Affix.RESET).addClass("affix"+(affix?"-"+affix:""));if(affix=="bottom"){this.$element.offset({top:document.body.offsetHeight-offsetBottom-this.$element.height()})}};var old=$.fn.affix;$.fn.affix=function(option){return this.each(function(){var $this=$(this);var data=$this.data("bs.affix");var options=typeof option=="object"&&option;if(!data)$this.data("bs.affix",data=new Affix(this,options));if(typeof option=="string")data[option]()})};$.fn.affix.Constructor=Affix;$.fn.affix.noConflict=function(){$.fn.affix=old;return this};$(window).on("load",function(){$('[data-spy="affix"]').each(function(){var $spy=$(this);var data=$spy.data();data.offset=data.offset||{};if(data.offsetBottom)data.offset.bottom=data.offsetBottom;if(data.offsetTop)data.offset.top=data.offsetTop;$spy.affix(data)})})}(jQuery);var LEA={};var Notebook={cache:{}};var Note={cache:{}};var Tag={};var Notebook={};var Share={};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}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}$.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){_ajax("GET",url,param,successFunc,failureFunc,async)}function ajaxPost(url,param,successFunc,failLine truncated
})};$.fn.tab.Constructor=Tab;$.fn.tab.noConflict=function(){$.fn.tab=old;return this};$(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(e){e.preventDefault();$(this).tab("show")})}(jQuery);+function($){"use strict";var Affix=function(element,options){this.options=$.extend({},Affix.DEFAULTS,options);this.$window=$(window).on("scroll.bs.affix.data-api",$.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",$.proxy(this.checkPositionWithEventLoop,this));this.$element=$(element);this.affixed=this.unpin=null;this.checkPosition()};Affix.RESET="affix affix-top affix-bottom";Affix.DEFAULTS={offset:0};Affix.prototype.checkPositionWithEventLoop=function(){setTimeout($.proxy(this.checkPosition,this),1)};Affix.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var scrollHeight=$(document).height();var scrollTop=this.$window.scrollTop();var position=this.$element.offset();var offset=this.options.offset;var offsetTop=offset.top;var offsetBottom=offset.bottom;if(typeof offset!="object")offsetBottom=offsetTop=offset;if(typeof offsetTop=="function")offsetTop=offset.top();if(typeof offsetBottom=="function")offsetBottom=offset.bottom();var affix=this.unpin!=null&&scrollTop+this.unpin<=position.top?false:offsetBottom!=null&&position.top+this.$element.height()>=scrollHeight-offsetBottom?"bottom":offsetTop!=null&&scrollTop<=offsetTop?"top":false;if(this.affixed===affix)return;if(this.unpin)this.$element.css("top","");this.affixed=affix;this.unpin=affix=="bottom"?position.top-scrollTop:null;this.$element.removeClass(Affix.RESET).addClass("affix"+(affix?"-"+affix:""));if(affix=="bottom"){this.$element.offset({top:document.body.offsetHeight-offsetBottom-this.$element.height()})}};var old=$.fn.affix;$.fn.affix=function(option){return this.each(function(){var $this=$(this);var data=$this.data("bs.affix");var options=typeof option=="object"&&option;if(!data)$this.data("bs.affix",data=new Affix(this,options));if(typeof option=="string")data[option]()})};$.fn.affix.Constructor=Affix;$.fn.affix.noConflict=function(){$.fn.affix=old;return this};$(window).on("load",function(){$('[data-spy="affix"]').each(function(){var $spy=$(this);var data=$spy.data();data.offset=data.offset||{};if(data.offsetBottom)data.offset.bottom=data.offsetBottom;if(data.offsetTop)data.offset.top=data.offsetTop;$spy.affix(data)})})}(jQuery);var LEA={};var Notebook={cache:{}};var Note={cache:{}};var Tag={};var Notebook={};var Share={};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}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}$.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){_ajax("GET",url,param,successFunc,failureFunc,async)}function ajaxPost(url,param,successFunc,failLine truncated
Loaded 100 of 145 files, more files were not shown because too many files have changed in this diff. Show more