Compare commits

...

94 Commits
0.1 ... 0.4

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
life
2d107b754d writting mode resize editor 2014-05-15 22:55:16 +08:00
life
872f4e68cf writting mode resize editor 2014-05-15 22:41:29 +08:00
life
8f86baa616 writting mode resize editor 2014-05-15 22:36:32 +08:00
life
1fa03e901d angularjs mobile v1.0 2014-05-14 22:46:57 +08:00
life
04d41dff4a angularjs mobile v1.0 2014-05-14 22:41:39 +08:00
life
4d1f3b957e angularjs mobile v1.0 2014-05-14 22:35:56 +08:00
life
0929c715c0 angularjs mobile v1.0 2014-05-14 22:30:28 +08:00
life
cac06e673a Merge branch 'develop' 2014-05-14 22:25:34 +08:00
life
ab5e5c7b76 angularjs mobile v0.1 2014-05-14 22:23:35 +08:00
life
88ad35e9be test 2014-05-13 21:22:45 +08:00
life
cd61592f74 Merge branch 'master' into develop 2014-05-13 21:19:29 +08:00
life
bf6590eef9 lock page 2014-05-13 21:18:33 +08:00
life
0a75902865 i18n 2014-05-13 17:44:31 +08:00
life
58d1e0ec00 i18n 2014-05-13 17:42:55 +08:00
life
5244c89987 writing mode fix 2014-05-13 17:17:13 +08:00
life
6ed0e30d2b writing mode fix 2014-05-13 17:13:02 +08:00
life
2f79331ccf writing mode leanote nav 2014-05-13 17:04:14 +08:00
life
76ecc00ad0 fix bug 2014-05-13 16:54:41 +08:00
life
418c70bad2 editor tabIndex 2014-05-13 16:47:06 +08:00
life
077e702ba1 writing mode v1.0 2014-05-13 15:29:23 +08:00
life
6ee8fc999d writing mode v1.0 2014-05-13 15:23:27 +08:00
life
4f7d2b5645 default theme 2014-05-13 15:18:21 +08:00
life
7a89eca49d writing mode v1.0 2014-05-13 15:16:49 +08:00
life
d392c0eb36 merge 2014-05-13 15:15:12 +08:00
life
e3f4b50c53 writing mode v1.0 2014-05-13 15:12:38 +08:00
life
03f2ebe3f7 writting mode v0.1 2014-05-13 14:34:30 +08:00
life
48c2474668 for brunch test 2014-05-12 14:10:13 +08:00
life
cbe62557f8 for develop writting mod 2014-05-12 14:03:19 +08:00
life
0b9dd488c2 update readme.md 2014-05-11 22:46:32 +08:00
life
3db06ed738 update readme.md 2014-05-11 22:46:00 +08:00
life
76b279c1e5 update readme.md 2014-05-11 22:44:14 +08:00
life
6eb4702cd2 mobile 2014-05-10 17:35:20 +08:00
life
f0b4012118 fix markdown editor 2014-05-10 16:50:03 +08:00
life
0e45f2c17f editor i18n 2014-05-10 16:28:09 +08:00
life
3baa31d44c note i18n 2014-05-10 16:12:38 +08:00
life
365ad3853c blog i18n 2014-05-10 16:01:50 +08:00
life
98cf275e37 update readme.md 2014-05-10 14:27:50 +08:00
leanote
498f2dc3a8 Update README.md 2014-05-09 21:20:48 +08:00
leanote
98b048235c Update README.md 2014-05-09 21:18:56 +08:00
leanote
273028ea96 Update README.md 2014-05-09 20:56:11 +08:00
leanote
a93048b016 Merge pull request #3 from jaseg/master
README: Small grammar, style & markdown fixes
2014-05-09 20:39:34 +08:00
jaseg
b63e79954a README: Grammar & markdown fixes 2014-05-09 14:27:03 +02:00
life
b8b103ace1 update readme.md 2014-05-09 18:14:01 +08:00
life
b2436ee711 update readme.md 2014-05-09 18:08:11 +08:00
life
91f4698c09 update readme.md 2014-05-09 18:06:58 +08:00
life
2605b86e00 update readme.md 2014-05-09 18:03:58 +08:00
life
cd7915f92b deleve bin files 2014-05-09 18:01:23 +08:00
life
6f413bfa1f remove 2014-05-09 17:58:46 +08:00
life
298f7bc1d6 release v0.1 2014-05-09 17:56:14 +08:00
252 changed files with 30965 additions and 777 deletions

4
.gitignore vendored
View File

@@ -2,9 +2,12 @@
pkg
bin2
bin/i18n
bin/leanote-linux
bin/leanote-mac
bin/release
bin/tmp
bin/test
bin/src
conf/app.conf
conf/routes
public/upload
@@ -12,3 +15,4 @@ app/routes/routes.go
app/tmp/main.go
.DS_Store
.settings
public/config.codekit

196
README.md
View File

@@ -1,46 +1,57 @@
## Introduction
[中文](https://github.com/leanote/leanote#1-介绍)
Leanote, a cloud note. You can create your own cloud note by leanote.
## 1. Introduction
## Features
* Knowledge: manage your knowledge in leanote. leanote contains tinymce editor and markdown editor, just enjoy yourself in writting.
* Share: share your knowledge to your friends in leanote. Well, you are not alone, you can invite your friends to join your cloud note and share your knowledge each other.
* Cooperation: collaborate with friends to improve your knowledge.
* Blog: public your knowledge and leanote be your blog.
Leanote, your own cloud note.
## Why we create leanote
To be honest, our inspiration comes from evernote, and we use evenote to manage our knowledge everyday. But we find that:
* Evernote's editor can't meet our needs, it hasn't document navigation, can't put our codes(as a programmer, put codes is the basic needs), can't resize images...)
* We like markdown, but evernote don't support it.
* We want to public our knowledge, so we have our blog(such as wordpress) and evernote, but why can't be the one!
**Some Features**
* Knowledge: Manage your knowledge in leanote. leanote contains the tinymce editor and a markdown editor, just enjoy yourself writing.
* Share: Share your knowledge with your friends in leanote. You can invite your friends to join your notepad in the cloud so you can share knowledge.
* Cooperation: Collaborate with friends to improve your skills.
* Blog: Publish your knowledge and make leanote your blog.
## 2. Why we created leanote
To be honest, our inspiration comes from Evernote. We use Evernote to manage our knowledge everyday. But we find that:
* Evernote's editor can't meet our needs, it does not have document navigation, it does not render code properly (as a programmer, syntax highlighted code rendering is a basic need), it cannot resize images and so forth
* We like markdown, but Evernote does not support it.
* We want to share our knowledge, so all of us have our blogs (e.g. on Wordpress) and our Evernote accounts, but why can not those two be one!
* ......
## How to use it
Leanote build with golang(revel) and mongodb. so you must install mongodb at first.
## 3. How to install leanote
### Install mongodb
For more tips please go https://github.com/leanote/leanote/wiki/mongodb-in-leanote
### 3.1. Download leanote
Go http://www.mongodb.org to download and install it.
Leanote V0.3 has been released. Binaries:
### Export initial mongodb data
* 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)
The mongodb data is in path_to_leante/mongodb_backup/leanote_install_data
### 3.2. Install MongoDB
Leanote is written in go using [revel](https://revel.github.io/) and [MongoDB](https://www.mongodb.org). Thus, you need to first install MongoDB.
For more tips please have a look at [our wiki](https://github.com/leanote/leanote/wiki/Install-Mongodb)
### 3.3. Import initial MongoDB data
The mongodb data is in `[PATH_TO_LEANOTE]/mongodb_backup/leanote_install_data`
```
$> mongorestore -h localhost -d leanote --directoryperdb path_to_leante/mongodb_backup/leanote_install_data
$> mongorestore -h localhost -d leanote --directoryperdb PATH_TO_LEANOTE/mongodb_backup/leanote_install_data
```
The initial data 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)
```
### Configuration
### 3.4. Configuration
Copy path_to_leante/conf/app-default.conf to path_to_leante/conf/app.conf, the options contains:
Modify `[PATH_TO_LEANOTE]/conf/app.conf`. Available configuration options are:
``mongodb`` **required**
@@ -58,55 +69,144 @@ Default is 80
``site.url``
Default is http://localhost, you must config it when your domain isn't it, it is used when upload images.
Default is `http://localhost`, you must edit this when hosting leanote anywhere else. This is used when uploading images.
``email``
for find password
For password recovery mails
``adminUsername``
Default is admin. The index site is the adminUsername's blog
Default is `admin`. The landing page is the admin user's blog.
For more infomation please see app/app.conf and revel manuals http://revel.github.io
For more infomation please see `app/app.conf` and the [revel manuals](https://revel.github.io/)
### Run leanote
### 3.5. Run leanote
```
$> cd path_to_leanote/bin
$> cd PATH_TO_LEANOTE/bin
$> sudo sh run.sh
```
## How to develop leanote
## 4. How to develop leanote
For more tips please go 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(http://revel.github.io), so if you want to develop leanote as you want, you must be familar with revel.
### 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 GOPATH
## 6. Contributing
### Install revel
```
go get github.com/revel/revel
go get github.com/revel/cmd/revel
```
Please fork this repository and contribute back using [pull requests](https://github.com/leanote/leanote/pulls).
### Get leanote
## 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`
```
go get github.com/leanote/leanote/app
$> mongorestore -h localhost -d leanote --directoryperdb PATH_TO_LEANOTE/mongodb_backup/leanote_install_data
```
### Build/Run leanote via revel
cp conf/routes-default to conf/routes
Now you can modify leanote source and build/run with revel
初始数据包含三个用户:
```
revel run github.com/leanote/leanote
user1 username: leanote, password: abc123
user2 username: admin, password: abc123
user3 username: demo@leanote.com, password: demo@leanote.com (为体验使用)
```
Welcome to join with us and contribute your code to leanote! Thanks.
### 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)

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))
}

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"

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")
}

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)
if(ext != ".gif" && ext != ".jpg" && ext != ".png" && ext != ".bmp" && ext != ".jpeg") {
resultMsg = "不是图片"
return re
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)
}

View File

@@ -22,6 +22,7 @@ func (c Mobile) Index() revel.Result {
return c.RenderTemplate("mobile/login.html")
}
/*
// 已登录了, 那么得到所有信息
notebooks := notebookService.GetNotebooks(userId)
shareNotebooks, sharedUserInfos := shareService.GetShareNotebooks(userId)
@@ -32,8 +33,9 @@ func (c Mobile) Index() revel.Result {
c.RenderArgs["shareNotebooks"] = c.Json(shareNotebooks)
c.RenderArgs["sharedUserInfos"] = c.Json(sharedUserInfos)
c.RenderArgs["tagsJson"] = c.Json(tagService.GetTags(c.GetUserId()))
*/
return c.RenderTemplate("mobile/index.html");
return c.RenderTemplate("mobile/angular.html");
}
func (c Mobile) Logout() revel.Result {

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"
@@ -85,6 +85,11 @@ func (c Note) ListTrashNotes() revel.Result {
return c.RenderJson(notes)
}
// 得到note和内容
func (c Note) GetNoteAndContent(noteId string) revel.Result {
return c.RenderJson(noteService.GetNoteAndContent(noteId, c.GetUserId()))
}
// 得到内容
func (c Note) GetNoteContent(noteId string) revel.Result {
noteContent := noteService.GetNoteContent(noteId, c.GetUserId())

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"
)
@@ -13,17 +13,12 @@ type Notebook struct {
BaseController
}
// 得到笔记本
// 该用户下的
func (c Notebook) GetNotebooks() {
}
func (c Notebook) Index(notebook info.Notebook, i int, name string) revel.Result {
return c.RenderJson(notebook)
}
// 得到用户的所有笔记本
func (c Notebook) getNotebooks() revel.Result {
func (c Notebook) GetNotebooks() revel.Result {
re := notebookService.GetNotebooks(c.GetUserId())
return c.RenderJson(re)
}

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"

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"

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"

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() {

View File

@@ -10,8 +10,8 @@ import (
// convert revel msg to js msg
var msgBasePath = "/Users/life/Documents/Go/package/src/leanote/messages/"
var targetBasePath = "/Users/life/Documents/Go/package/src/leanote/public/js/i18n/"
var msgBasePath = "/Users/life/Documents/Go/package/src/github.com/leanote/leanote/messages/"
var targetBasePath = "/Users/life/Documents/Go/package/src/github.com/leanote/leanote/public/js/i18n/"
func parse(filename string) {
file, err := os.Open(msgBasePath + filename)
reader := bufio.NewReader(file)

15
app/info/AlbumInfo.go Normal file
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`
}

View File

@@ -1,7 +1,7 @@
package info
import (
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
)
// 只为blog, 不为note

19
app/info/FileInfo.go Normal file
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`
}

View File

@@ -1,7 +1,7 @@
package info
import (
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
"time"
)

View File

@@ -1,7 +1,7 @@
package info
import (
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
"time"
)

View File

@@ -1,7 +1,7 @@
package info
import (
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
"time"
)

View File

@@ -1,7 +1,7 @@
package info
import (
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
)
// 建议

View File

@@ -1,7 +1,7 @@
package info
import (
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
)
// 这里主要是为了统计每个tag的note数目

View File

@@ -1,7 +1,7 @@
package info
import (
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
"time"
)

View File

@@ -1,7 +1,7 @@
package info
import (
"labix.org/v2/mgo/bson"
"gopkg.in/mgo.v2/bson"
"time"
)

View File

@@ -8,5 +8,6 @@ import (
type Page struct {
CurPage int // 当前页码
TotalPage int // 总页
Count int // 总记录数
List interface{}
}

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

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 {
@@ -42,4 +52,14 @@ func ClearDir(dir string) bool {
return false
}
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
}

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"
)

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)
}

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"

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
app/service/FileService.go Normal file
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)
}

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"
)

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"
)
@@ -31,6 +31,13 @@ func (this *NoteService) GetNoteContent(noteContentId, userId string) (noteConte
return
}
// 得到笔记和内容
func (this *NoteService) GetNoteAndContent(noteId, userId string) (noteAndContent info.NoteAndContent) {
note := this.GetNote(noteId, userId)
noteContent := this.GetNoteContent(noteId, userId)
return info.NoteAndContent{note, noteContent}
}
// 列出note, 排序规则, 还有分页
// CreatedTime, UpdatedTime, title 来排序
func (this *NoteService) ListNotes(userId, notebookId string,

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"

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"

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"
)

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"
)

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"
)

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"

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"
)

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
@@ -291,4 +291,4 @@ func (this *UserService)UpdateColumnWidth(userId string, notebookWidth, noteList
// 左侧是否隐藏
func (this *UserService)UpdateLeftIsMin(userId string, leftIsMin bool) bool {
return db.UpdateByQMap(db.Users, bson.M{"_id": bson.ObjectIdHex(userId)}, bson.M{"LeftIsMin": leftIsMin})
}
}

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()

View File

@@ -4,7 +4,7 @@
<div id="posts">
<div class="each-post">
<div class="title">
关于我
{{msg . "aboutMe"}}
</div>
<div class="created-time">
</div>

View File

@@ -2,19 +2,19 @@
{{$userId := .userBlog.UserId.Hex}}
<div class="container" id="footer">
<div class="col-md-4">
<h3>导航</h3>
<h3>{{msg . "blogNavs"}}</h3>
<ul>
<li><a href="/blog/{{$userId}}">首页</a></li>
<li><a href="/blog/{{$userId}}">{{msg . "home"}}</a></li>
{{range .notebooks}}
<li>
<a href="/blog/{{$userId}}/{{.NotebookId.Hex}}">{{.Title}}</a>
</li>
{{end}}
<li><a href="/blog/aboutMe/{{$userId}}">关于我</a></li>
<li><a href="/blog/aboutMe/{{$userId}}">{{msg . "aboutMe"}}</a></li>
</ul>
</div>
<div class="col-md-4">
<h3>最近发表</h3>
<h3>{{msg . "latestPosts"}}</h3>
<ul>
{{range .recentBlogs}}
<li title="{{.Title}}"><a href="/blog/view/{{.NoteId.Hex}}/">{{.Title}}</a></li>
@@ -22,10 +22,10 @@
</ul>
</div>
<div class="col-md-4">
<h3>快速链接</h3>
<h3>{{msg . "quickLinks"}}</h3>
<ul>
<li><a href="/note">我的笔记</a></li>
<li><a href="/login">登录</a></li>
<li><a href="/note">{{msg . "myNote"}}</a></li>
<li><a href="/login">{{msg . "login"}}</a></li>
<li><a href="http://leanote.com" target="_blank">leanote</a></li>
<li><a href="https://github.com/leanote/leanote" target="_blank">leanote github</a></li>
</ul>

View File

@@ -58,17 +58,17 @@ function log(o) {
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
{{$navNotebookId := .notebookId}}
<li class="{{if .index}}active{{end}}"><a href="/blog/{{$username}}">首页</a></li>
<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>
{{end}}
<li class="{{if .aboutMe}}active{{end}}"><a href="/blog/aboutMe/{{$username}}">关于我</a></li>
<li class="{{if .aboutMe}}active{{end}}"><a href="/blog/aboutMe/{{$username}}">{{msg . "aboutMe"}}</a></li>
{{if .isMe}}
<li class="{{if .set}}active{{end}}"><a href="/blog/set" >博客设置</a></li>
<li class="{{if .set}}active{{end}}"><a href="/blog/set">{{msg . "blogSet"}}</a></li>
<li><a href="/note" >{{msg . "myNote"}}</a></li>
{{end}}
</ul>

View File

@@ -1,3 +1,5 @@
<!-- This file is Depreciated -->
<link href="/public/mdeditor/editor/google-code-prettify/prettify.css" type="text/css" rel="stylesheet">
<script src="/public/mdeditor/editor/google-code-prettify/prettify.js"></script>

View File

@@ -3,14 +3,15 @@
<div id="postsContainer">
<div class="container">
{{if .notebookId}}
<h2>分类 {{.notebook.Title}}</h2>
<h2>{{msg . "blogClass"}}: {{.notebook.Title}}</h2>
{{end}}
</div>
<div id="posts">
{{$G := .}}
{{range .blogs}}
<div class="each-post">
<div class="title">
<a href="/blog/view/{{.NoteId.Hex}}" title="全文">
<a href="/blog/view/{{.NoteId.Hex}}" title="{{msg $G "fullBlog"}}">
{{.Title}}
</a>
</div>
@@ -19,16 +20,16 @@
{{if .Tags}}
{{blogTags .Tags}}
{{else}}
{{msg $G "noTag"}}
{{end}}
|
<i class="fa fa-calendar" style="color: #666"></i> 更新 {{.UpdatedTime | datetime}} |
<i class="fa fa-calendar" style="color: #666"></i> 创建 {{.CreatedTime | datetime}}
<i class="fa fa-calendar" style="color: #666"></i> {{msg $G "updatedTime"}} {{.UpdatedTime | datetime}} |
<i class="fa fa-calendar" style="color: #666"></i> {{msg $G "createdTime"}} {{.CreatedTime | datetime}}
</div>
<div class="desc">
{{.Content | raw}}
</div>
<a class="more" href="/blog/view/{{.NoteId.Hex}}" title="更多">More...</a>
<a class="more" href="/blog/view/{{.NoteId.Hex}}" title="{{msg $G "fullBlog"}}">More...</a>
</div>
{{end}}
<!-- 分页 -->

View File

@@ -1,8 +1,7 @@
{{template "Blog/header.html" .}}
<!-- -->
<link rel="stylesheet" href="/tinymce/skins/custom/skin.min.css"
type="text/css">
<link rel="stylesheet" href="/tinymce/skins/custom/skin.min.css" type="text/css">
<style>
.tab-pane {
padding-top: 10px;
@@ -11,9 +10,9 @@
<div id="postsContainer">
<div id="posts">
<ul id="myTab" class="nav nav-tabs">
<li class="active"><a href="#baseInfo" data-toggle="tab">基本设置</a></li>
<li class=""><a href="#commentInfo" data-toggle="tab">评论设置</a></li>
<li class=""><a href="#styleInfo" data-toggle="tab">主题设置</a></li>
<li class="active"><a href="#baseInfo" data-toggle="tab">{{msg . "baseInfoSet"}}</a></li>
<li class=""><a href="#commentInfo" data-toggle="tab">{{msg . "commentSet"}}</a></li>
<li class=""><a href="#styleInfo" data-toggle="tab">{{msg . "themeSet"}}</a></li>
</ul>
<!-- Tab panes -->
@@ -21,7 +20,7 @@
<div class="tab-pane" id="styleInfo">
<form class="form-horizontal" role="form">
<div class="form-group">
<label for="Style" class="col-sm-2 control-label">主题</label>
<label for="Style" class="col-sm-2 control-label">{{msg . "theme"}}</label>
<div class="col-sm-10">
<label><input type="radio" name="Style"
value="blog_default"
@@ -32,19 +31,19 @@
checked="checked"
{{end}}
{{end}}>
默认 </label>
{{msg . "default"}} </label>
<label><input type="radio" name="Style"
value="blog_daqi"
{{if eq .userBlog.Style "blog_daqi"}}checked="checked"{{end}}>
大气</label>
{{msg . "elegant"}}</label>
<label><input type="radio" name="Style"
value="blog_left_fixed"
{{if eq .userBlog.Style "blog_left_fixed"}}checked="checked"{{end}}>
左侧导航固定</label>
{{msg . "navFixed"}}</label>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button class="btn btn-success">保存</button>
<button class="btn btn-success">{{msg . "save"}}</button>
<span class="msg"></span>
</div>
</div>
@@ -54,26 +53,25 @@
<div class="tab-pane" id="commentInfo">
<form class="form-horizontal" role="form">
<div class="form-group">
<label for="subTitle" class="col-sm-2 control-label">开启评论</label>
<label for="subTitle" class="col-sm-2 control-label">{{msg . "openComment"}}</label>
<div class="col-sm-10">
<input type="checkbox" id="CanComment" name="CanComment"
{{if .userBlog.CanComment}}checked="checked"{{end}} >
<br />
leanote采用 <a href="http://disqus.com" target="_blank">Disqus</a>
作为评论系统
{{msg . "commentSys"}}
<div id="disqusSet">
<label for="DisqusId">Disqus Id</label> <input type="text"
class="form-control" style="display: inline; width: 50%"
id="DisqusId" name="DisqusId"
value="{{if .userBlog.DisqusId}}{{.userBlog.DisqusId}}{{else}}leanote{{end}}">
<br /> (请填写您申请的Disqus唯一url前缀, 建议您申请Disqus帐号, 这样可以自己管理评论.
或使用leanote的默认Disqus Id. <a target="_blank"
href="/blog/view/52db8463e01c530ef8000001">需要帮助?</a>)
<br />
{{msg . "disqusHelp"}}
<a target="_blank" href="http://leanote.com/blog/view/52db8463e01c530ef8000001">{{msg . "needHelp"}}</a>)
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button class="btn btn-success">保存</button>
<button class="btn btn-success">{{msg . "save"}}</button>
<span class="msg"></span>
</div>
</div>
@@ -90,16 +88,16 @@
</div>
</div>
<div class="form-group">
<label for="title" class="col-sm-2 control-label">博客名称</label>
<label for="title" class="col-sm-2 control-label">{{msg . "blogName"}}</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="Title" name="Title"
placeholder="比如: leanote的博客"
value="{{if .userBlog.Title}}{{.userBlog.Title}}{{else}}{{.userInfo.Email}} 的博客{{end}}">
placeholder="eg: leanote's blog"
value="{{if .userBlog.Title}}{{.userBlog.Title}}{{else}}{{.userInfo.Email}} 's blog{{end}}">
</div>
</div>
<div class="form-group">
<label for="logo" class="col-sm-2 control-label">博客Logo</label>
<label for="logo" class="col-sm-2 control-label">{{msg . "blogLogo"}}</label>
<div class="col-sm-10">
<input type="hidden" name="Logo" id="Logo"
value="{{.userBlog.Logo}}" />
@@ -107,14 +105,15 @@
enctype="multipart/form-data" target="logoTarget"
onsubmit="inProgress()">
<input type="file" class="form-control" id="logo2" name="file"
onChange='$("#formLogo").submit();' /> 上传logo将显示logo(替代博客标题)
onChange='$("#formLogo").submit();' />
{{msg . "blogLogoTips"}}
<div id="logoImg"
{{if .userBlog.Logo }}
{{else}}
style="display: none"{{end}}
>
<img src="{{.userBlog.Logo}}" style="height: 40px" /> <a
href="#" id="deleteLogo">删除</a>
href="#" id="deleteLogo">{{msg . "delete"}}</a>
</div>
</form>
<iframe id="logoTarget" name="logoTarget" src="#"
@@ -123,11 +122,11 @@
</div>
<div class="form-group">
<label for="subTitle" class="col-sm-2 control-label">博客描述</label>
<label for="subTitle" class="col-sm-2 control-label">{{msg . "blogDesc"}}</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="SubTitle"
name="SubTitle" value="{{.userBlog.SubTitle}}"
placeholder="比如: leanote, 不只是笔记">
placeholder="eg: leanote, your own cloud note">
</div>
</div>
@@ -139,7 +138,7 @@
</div>
<div class="form-group">
<label for="aboutMe" class="col-sm-2 control-label">关于我</label>
<label for="aboutMe" class="col-sm-2 control-label">{{msg . "aboutMe"}}</label>
<div class="col-sm-10">
<textarea id="AboutMe" name="AboutMe">{{.userBlog.AboutMe}}</textarea>
</div>
@@ -147,7 +146,7 @@
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button class="btn btn-success">保存</button>
<button class="btn btn-success">{{msg . "save"}}</button>
<span class="msg"></span>
</div>
</div>
@@ -167,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,
@@ -218,7 +215,7 @@ $(function() {
}
post("/blog/setUserBlogBase", data, function(ret) {
showMsg2($("#baseInfo .msg"), "保存成功", 2000);
showMsg2($("#baseInfo .msg"), "{{msg . "saveSuccess"}}", 2000);
$("#blogDesc").html(data.SubTitle);
$("#logo").html(data.Title);
if(data.Logo) {
@@ -234,7 +231,7 @@ $(function() {
DisqusId : $("#DisqusId").val(),
}
post("/blog/setUserBlogComment", data, function(ret) {
showMsg2($("#commentInfo .msg"), "保存成功", 2000);
showMsg2($("#commentInfo .msg"), "{{msg . "saveSuccess"}}", 2000);
}, this);
});
// 主题
@@ -244,7 +241,7 @@ $(function() {
Style : $("input[name='Style']:checked").val()
}
post("/blog/setUserBlogStyle", data, function(ret) {
showMsg2($("#styleInfo .msg"), "保存成功", 2000);
showMsg2($("#styleInfo .msg"), "{{msg . "saveSuccess"}}", 2000);
}, this);
});
$("input[name='Style']").click(function() {

View File

@@ -12,11 +12,11 @@
{{if .blog.Tags}}
{{blogTags .blog.Tags}}
{{else}}
{{msg . "noTag"}}
{{end}}
|
<i class="fa fa-calendar" style="color: #666"></i> 更新 {{.blog.UpdatedTime | datetime}} |
<i class="fa fa-calendar" style="color: #666"></i> 创建 {{.blog.CreatedTime | datetime}}
<i class="fa fa-calendar" style="color: #666"></i> {{msg . "updatedTime"}} {{.blog.UpdatedTime | datetime}} |
<i class="fa fa-calendar" style="color: #666"></i> {{msg . "createdTime"}} {{.blog.CreatedTime | datetime}}
</div>
<div class="desc" id="content">
@@ -93,7 +93,7 @@
<div id="blogNav">
<div id="blogNavNav">
<i class="fa fa-align-justify" title="文档导航"></i>
<span>{{msg . "nav"}}</span>
<span>{{msg . "blogNav"}}</span>
</div>
<div id="blogNavContent" style="max-width: 200px">
</div>

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>

View File

@@ -4,18 +4,19 @@
</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 from 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;
OR
OR
&nbsp;
&nbsp;
<a class="btn btn-default" href="/register">{{msg . "register"}}</a>
@@ -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>

View File

@@ -0,0 +1,49 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link href="/public/mobile2/topcoat/css/topcoat-mobile-light.min.css" rel="stylesheet">
<link href="/public/mobile2/css/styles.css" rel="stylesheet">
<link href="/public/css/font-awesome-4.0.3/css/font-awesome.css" rel="stylesheet">
</head>
<body ng-controller="MainCtrl">
<div id="sidebar" class="page-sidebar">
<h1>leanote</h1>
<ul id="nav">
<li ng-click="go('/notes/all')"><a>[[msg.all]]</a></li>
<li ng-click="go('/notebooks')"><a>[[msg.notebook]]</a></li>
<li><a href="#">[[msg.tag]]</a></li>
</ul>
<footer>
<a href="/mobile/logout">[[msg.logout]]</a>
</footer>
</div>
<div id="content" class="page-content">
<div ng-view ng-class="slide" >
</div>
</div>
<script src="/js/jquery-1.9.0.min.js"></script>
<script src="/js/i18n/msg.{{.locale}}.js"></script>
<script src="/js/common.js"></script>
<script src="/public/js/angular/angular.min.js"></script>
<script src="/public/js/angular/angular-touch.min.js"></script>
<script src="/public/js/angular/angular-resource.min.js"></script>
<script src="/public/js/angular/angular-animate.min.js"></script>
<script src="/public/js/angular/angular-route.min.js"></script>
<script src="/public/mobile2/js/app.js"></script>
<script src="/public/mobile2/js/controllers.js"></script>
<script src="/public/mobile2/js/services.js"></script>
<script src="/public/mobile2/js/snap.js"></script>
<script>
angular.element(document).ready(function() {
angular.bootstrap(document, ['myApp']);
});
</script>
</body>
</html>

View File

@@ -61,7 +61,7 @@ function log(o) {
</div>
</div>
<div id="content" class="page-content" style="position: absolute;background-color: #fff;width: 100%;">
<div id="content" class="page-content" style="position: absolute; background-color: #fff;width: 100%;">
<!-- notebooks -->
<div id="notebooks">
<!-- 头部 -->

View File

@@ -4,14 +4,10 @@
<meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title>leanote login</title>
<title>leanote sign in</title>
<link href="/public/css/font-awesome-4.0.3/css/font-awesome.css" rel="stylesheet">
<link href="/public/mobile/styles/style.css" rel="stylesheet" type="text/css">
<link href="/public/mobile/styles/colors/default.css" rel="stylesheet" type="text/css" id="pagestyle">
<link href="/public/mobile/styles/framework.css" rel="stylesheet" type="text/css">
<link href="/public/css/font-awesome-4.0.3/css/font-awesome.css" rel="mobile/csssheet">
<link href="/public/css/bootstrap.css" rel="stylesheet" />
<link href="/public/mobile/styles/life.css" rel="stylesheet" type="text/css">
<style>
.alert {
@@ -31,33 +27,24 @@
</head>
<body>
<div id="preloader">
<div id="status">
<p class="center-text">
loading...
</p>
</div>
</div>
<div style="text-align: center">
<img src="/public/mobile/images/blog01.jpg" style="width: 100%"/>
<form id="loginForm" style="width: 90%; margin: auto;">
<div class="form-group">
<h2 style="margin-top:10px">leanote 登录</h2>
<h2 style="margin-top:10px">leanote {{msg . "login"}}</h2>
</div>
<div class="alert alert-danger" id="loginMsg" style="display: none"></div>
<div class="form-group">
<input class="form-control" id="email" name="email" placeholder="用户名或Email" value="">
<input class="form-control" id="email" name="email" placeholder="{{msg . "usernameOrEmail"}}" value="">
</div>
<div class="form-group">
<input type="password" class="form-control" id="pwd" name="pwd" placeholder="密码">
<input type="password" class="form-control" id="pwd" name="pwd" placeholder="{{msg . "password"}}">
</div>
<button id="loginBtn" class="btn btn-success" style="width: 100%">登录</button>
<button id="loginBtn" class="btn btn-success" style="width: 100%">{{msg . "login"}}</button>
</form>
</div>
<script type="text/javascript" src="/public/mobile/scripts/jquery.js"></script>
<script type="text/javascript" src="/public/js/jquery-1.9.0.min.js"></script>
<script>
$(function() {
$("#status").fadeOut(); // will first fade out the loading animation

View File

@@ -11,10 +11,22 @@
<link href="css/bootstrap.css" rel="stylesheet" />
<!-- 先加载, 没有样式, 宽度不定 -->
<link rel="stylesheet" href="tinymce/skins/custom/skin.min.css" type="text/css" />
<!-- leanote css -->
<link rel="stylesheet" href="css/theme/{{if .userInfo.Theme}}{{.userInfo.Theme}}{{else}}default{{end}}.css" type="text/css" id="themeLink" />
<script>
var hash = location.hash;
if(hash == "#writing") {
var files = '<link rel="stylesheet" href="css/theme/writting-overwrite.css" type="text/css" id="themeLink" />';
} else {
var files ='<link rel="stylesheet" href="css/theme/{{if .userInfo.Theme}}{{.userInfo.Theme}}{{else}}default{{end}}.css" type="text/css" id="themeLink" />';
}
document.write(files);
</script>
<link href="css/font-awesome-4.0.3/css/font-awesome.css" rel="stylesheet" />
<!-- For Develop writting mod -->
<script>
function log(o) {
console.log(o);
@@ -29,27 +41,27 @@ function log(o) {
<!-- <div id="headerContainer"> -->
<div id="header">
<!-- <div id="headerLeft" class="pull-left">
</div>
<!--
<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">
<div class="pull-left" id="searchWrap">
<form class="navbar-form form-inline col-lg-2 hidden-xs" id="searchNote">
<input class="form-control" placeholder="Search" type="text" id="searchNoteInput">
</form>
</div>
<!-- 全局按钮 -->
<div class="pull-left" style="line-height: 40px; margin-top: 10px;">
<div class="pull-left" style="" id="newNoteWrap">
<!-- 新建笔记 -->
<div id="newMyNote">
@@ -57,11 +69,12 @@ function log(o) {
<i class="fa fa-file-o"></i>
{{msg . "newNote"}}
</a>
|
<span class="new-split">|</span>
<a id="newNoteMarkdownBtn" title="{{msg . "newMarkdown"}}">
Markdown
</a>
- <span id="curNotebookForNewNote" notebookId=""></span>
<span class="for-split"> - </span>
<span id="curNotebookForNewNote" notebookId=""></span>
<div class="dropdown" style="display: inline-block">
<a class="ios7-a dropdown-toggle"
id="dropdownMenu2" data-toggle="dropdown">
@@ -78,11 +91,12 @@ function log(o) {
<i class="fa fa-file-o"></i>
{{msg . "newNote"}}
</a>
|
<span class="new-split">|</span>
<a id="newShareNoteMarkdownBtn" title="{{msg . "newMarkdown"}}">
Markdown
</a>
- <span id="curNotebookForNewSharedNote" notebookId="" userId=""></span>
<span class="for-split"> - </span>
<span id="curNotebookForNewSharedNote" notebookId="" userId=""></span>
<div class="dropdown" style="display: inline-block">
<a class="ios7-a dropdown-toggle"
id="dropdownMenu2" data-toggle="dropdown">
@@ -94,17 +108,10 @@ function log(o) {
</div>
</div>
<div class="pull-left" style="line-height: 40px; margin-top: 10px; margin-left: 10px;" id="leanoteMsg">
<div class="pull-left" id="leanoteMsg">
<span id="msg" style="display: inline-block;"></span>
<img id="loading" style="visibility: hidden" src="/images/loading-a-20.gif" />
{{if .openRegister}}
{{if eq .userInfo.Email "demo@leanote.com"}}
<span>
{{msg . "demoRegister"}}
</span>
{{end}}
{{end}}
<span id="loading">
</span>
</div>
<!--
@@ -159,6 +166,20 @@ function log(o) {
</a>
</div>
<div class="pull-right" style="line-height: 60px; margin-right:10px" id="toggleEditorMode">
<a href="#writing">{{msg . "writingMode"}}</a>
</div>
{{if eq .userInfo.Email "demo@leanote.com"}}
{{if .openRegister}}
<div class="pull-right" style="line-height: 60px; margin-right:10px" id="demoRegister">
<span>
{{msg . "demoRegister"}}
</span>
</div>
{{end}}
{{end}}
<!--
<ul id="setting" class="pull-right">
<li class="dropdown messages">
@@ -236,7 +257,7 @@ function log(o) {
<div class="folderHeader">
<i class="fa fa-user fa-left"></i>
<span>
共享
{{msg . "share"}}
</span>
</div>
@@ -429,8 +450,9 @@ 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"
@@ -443,7 +465,7 @@ function log(o) {
</div>
<div id="noteTitleDiv">
<input name="noteTitle" id="noteTitle" value="" placeholder="{{msg . "unTitled"}}">
<input name="noteTitle" id="noteTitle" value="" placeholder="{{msg . "unTitled"}}" tabindex="1" />
</div>
</div>
@@ -457,6 +479,7 @@ function log(o) {
id="moreBtn"> <i class="fa fa-angle-down"></i>
</a>
</div>
<div class="editorBg"></div>
<div id="leanoteNav">
<h1>
<i class="fa fa-align-justify" title="文档导航"></i>
@@ -465,20 +488,32 @@ 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">
<div id="editorContent" name="editorContent" tabindex="2" />
{{.noteContent}}
</div>
</div>
<div id="mdEditor">
<div id="wmd-button-bar" id="mdBar"></div>
<div class="editorBg"></div>
<!-- 为了scroll -->
<div class="clearfix" id="mdEditorPreview">
<div id="left-column" class="pull-left">
<div id="wmd-panel-editor" class="wmd-panel-editor">
<textarea class="wmd-input theme" id="wmd-input" spellcheck="false"></textarea>
<textarea class="wmd-input theme" id="wmd-input" spellcheck="false" tabindex="3"></textarea>
</div>
</div>
<div id="right-column" class="pull-right">
@@ -489,8 +524,8 @@ function log(o) {
</div>
<textarea id="md-section-helper"></textarea>
</div>
<!-- for test -->
<!-- mdEditor -->
<!-- Hidden Popup Modal -->
<div class="modal fade bs-modal-sm" id="editorDialog" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
@@ -707,7 +742,7 @@ function log(o) {
</div>
</div>
<!-- 长微博 -->
<!-- 激活邮件 -->
<div id="reSendActiveEmailDialog">
<div class="modal-body">
<div style="max-height: 300px; padding: 5px 0; text-align: center; overflow: scroll;" class="weibo">
@@ -811,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>
@@ -898,13 +933,14 @@ var sharedUserInfos = json({{.sharedUserInfos}});
var notes = json({{.notes}});
var noteContentJson = json({{.noteContentJson}});
var tagsJson = json({{.tagsJson}});
LEA.locale = "{{.locale}}";
</script>
<!-- 渲染view -->
<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>
@@ -926,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>
@@ -942,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>
@@ -951,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>

View File

@@ -11,10 +11,22 @@
<link href="css/bootstrap.css" rel="stylesheet" />
<!-- 先加载, 没有样式, 宽度不定 -->
<link rel="stylesheet" href="tinymce/skins/custom/skin.min.css" type="text/css" />
<!-- leanote css -->
<link rel="stylesheet" href="css/theme/{{if .userInfo.Theme}}{{.userInfo.Theme}}{{else}}default{{end}}.css" type="text/css" id="themeLink" />
<script>
var hash = location.hash;
if(hash == "#writing") {
var files = '<link rel="stylesheet" href="css/theme/writting-overwrite.css" type="text/css" id="themeLink" />';
} else {
var files ='<link rel="stylesheet" href="css/theme/{{if .userInfo.Theme}}{{.userInfo.Theme}}{{else}}default{{end}}.css" type="text/css" id="themeLink" />';
}
document.write(files);
</script>
<link href="css/font-awesome-4.0.3/css/font-awesome.css" rel="stylesheet" />
<!-- For Develop writting mod -->
<script>
function log(o) {
@@ -29,27 +41,27 @@ function log(o) {
<!-- <div id="headerContainer"> -->
<div id="header">
<!-- <div id="headerLeft" class="pull-left">
</div>
<!--
<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">
<div class="pull-left" id="searchWrap">
<form class="navbar-form form-inline col-lg-2 hidden-xs" id="searchNote">
<input class="form-control" placeholder="Search" type="text" id="searchNoteInput">
</form>
</div>
<!-- 全局按钮 -->
<div class="pull-left" style="line-height: 40px; margin-top: 10px;">
<div class="pull-left" style="" id="newNoteWrap">
<!-- 新建笔记 -->
<div id="newMyNote">
@@ -57,11 +69,12 @@ function log(o) {
<i class="fa fa-file-o"></i>
{{msg . "newNote"}}
</a>
|
<span class="new-split">|</span>
<a id="newNoteMarkdownBtn" title="{{msg . "newMarkdown"}}">
Markdown
</a>
- <span id="curNotebookForNewNote" notebookId=""></span>
<span class="for-split"> - </span>
<span id="curNotebookForNewNote" notebookId=""></span>
<div class="dropdown" style="display: inline-block">
<a class="ios7-a dropdown-toggle"
id="dropdownMenu2" data-toggle="dropdown">
@@ -78,11 +91,12 @@ function log(o) {
<i class="fa fa-file-o"></i>
{{msg . "newNote"}}
</a>
|
<span class="new-split">|</span>
<a id="newShareNoteMarkdownBtn" title="{{msg . "newMarkdown"}}">
Markdown
</a>
- <span id="curNotebookForNewSharedNote" notebookId="" userId=""></span>
<span class="for-split"> - </span>
<span id="curNotebookForNewSharedNote" notebookId="" userId=""></span>
<div class="dropdown" style="display: inline-block">
<a class="ios7-a dropdown-toggle"
id="dropdownMenu2" data-toggle="dropdown">
@@ -94,17 +108,10 @@ function log(o) {
</div>
</div>
<div class="pull-left" style="line-height: 40px; margin-top: 10px; margin-left: 10px;" id="leanoteMsg">
<div class="pull-left" id="leanoteMsg">
<span id="msg" style="display: inline-block;"></span>
<img id="loading" style="visibility: hidden" src="/images/loading-a-20.gif" />
{{if .openRegister}}
{{if eq .userInfo.Email "demo@leanote.com"}}
<span>
{{msg . "demoRegister"}}
</span>
{{end}}
{{end}}
<span id="loading">
</span>
</div>
<!--
@@ -159,6 +166,20 @@ function log(o) {
</a>
</div>
<div class="pull-right" style="line-height: 60px; margin-right:10px" id="toggleEditorMode">
<a href="#writing">{{msg . "writingMode"}}</a>
</div>
{{if eq .userInfo.Email "demo@leanote.com"}}
{{if .openRegister}}
<div class="pull-right" style="line-height: 60px; margin-right:10px" id="demoRegister">
<span>
{{msg . "demoRegister"}}
</span>
</div>
{{end}}
{{end}}
<!--
<ul id="setting" class="pull-right">
<li class="dropdown messages">
@@ -236,7 +257,7 @@ function log(o) {
<div class="folderHeader">
<i class="fa fa-user fa-left"></i>
<span>
共享
{{msg . "share"}}
</span>
</div>
@@ -429,8 +450,9 @@ 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"
@@ -443,7 +465,7 @@ function log(o) {
</div>
<div id="noteTitleDiv">
<input name="noteTitle" id="noteTitle" value="" placeholder="{{msg . "unTitled"}}">
<input name="noteTitle" id="noteTitle" value="" placeholder="{{msg . "unTitled"}}" tabindex="1" />
</div>
</div>
@@ -457,6 +479,7 @@ function log(o) {
id="moreBtn"> <i class="fa fa-angle-down"></i>
</a>
</div>
<div class="editorBg"></div>
<div id="leanoteNav">
<h1>
<i class="fa fa-align-justify" title="文档导航"></i>
@@ -465,20 +488,32 @@ 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">
<div id="editorContent" name="editorContent" tabindex="2" />
{{.noteContent}}
</div>
</div>
<div id="mdEditor">
<div id="wmd-button-bar" id="mdBar"></div>
<div class="editorBg"></div>
<!-- 为了scroll -->
<div class="clearfix" id="mdEditorPreview">
<div id="left-column" class="pull-left">
<div id="wmd-panel-editor" class="wmd-panel-editor">
<textarea class="wmd-input theme" id="wmd-input" spellcheck="false"></textarea>
<textarea class="wmd-input theme" id="wmd-input" spellcheck="false" tabindex="3"></textarea>
</div>
</div>
<div id="right-column" class="pull-right">
@@ -489,8 +524,8 @@ function log(o) {
</div>
<textarea id="md-section-helper"></textarea>
</div>
<!-- for test -->
<!-- mdEditor -->
<!-- Hidden Popup Modal -->
<div class="modal fade bs-modal-sm" id="editorDialog" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
@@ -707,7 +742,7 @@ function log(o) {
</div>
</div>
<!-- 长微博 -->
<!-- 激活邮件 -->
<div id="reSendActiveEmailDialog">
<div class="modal-body">
<div style="max-height: 300px; padding: 5px 0; text-align: center; overflow: scroll;" class="weibo">
@@ -811,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>
@@ -898,13 +933,14 @@ var sharedUserInfos = json({{.sharedUserInfos}});
var notes = json({{.notes}});
var noteContentJson = json({{.noteContentJson}});
var tagsJson = json({{.tagsJson}});
LEA.locale = "{{.locale}}";
</script>
<!-- 渲染view -->
<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>
@@ -926,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>
@@ -942,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>
@@ -951,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>

Binary file not shown.

Binary file not shown.

67
bin/release.sh Normal file
View File

@@ -0,0 +1,67 @@
#!/bin/sh
# release leanote
SP=$(cd "$(dirname "$0")"; pwd)
cd $SP
cd ../
# tmp path to store leanote release files
tmp="/Users/life/Desktop/leanote_release"
rm -rf $tmp/leanote
mkdir -p $tmp/leanote/app
mkdir -p $tmp/leanote/conf
mkdir -p $tmp/leanote/bin
# bin
cp -r ./bin/src $tmp/leanote/bin/
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
# others
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
ln -s ../../../../ ./src/github.com/leanote/leanote
# archieve
# << 'BLOCK
# linux
cd $SP
cd ../
cp ./bin/leanote-linux $tmp/leanote/bin/
cd $tmp
tar -cvf $tmp/leanote-linux.tar.gz leanote
# mac
rm $tmp/leanote/bin/leanote-linux
cd $SP
cd ../
cp ./bin/leanote-mac $tmp/leanote/bin/
cd $tmp
tar -cvf $tmp/leanote-mac.tar.gz leanote
# BLOCK'

View File

@@ -1 +0,0 @@
../../../../

41
messages/blog.en Normal file
View File

@@ -0,0 +1,41 @@
# blog
blog=Blog
aboutMe=About me
blogSet=Set blog
blogNavs=Navs
quickLinks=Quick links
latestPosts=Latest posts
noBlog=No blog
noTag=No tag
blogClass=Classification
updatedTime=Updated at
createdTime=Created at
fullBlog=Full blog
blogNav=Blog nav
#
# set blog
#
baseInfoSet=Base info
commentSet=Comment
themeSet=Theme
theme=Theme
blogName=Title
blogLogo=Logo
blogDesc=Description
# theme
elegant=Elegant
navFixed=Nav fixed at left side
openComment=Open comment?
commentSys=leanote use <a href="http://disqus.com" target="_blank">Disqus</a> as comment system
disqusHelp=Please input your Disqus Id or use "leanote"
needHelp=Need help?
blogLogoTips=Upload image to replace blog title
saveSuccess=Save success
a=a

41
messages/blog.zh Normal file
View File

@@ -0,0 +1,41 @@
# blog
blog=博客
aboutMe=关于我
blogSet=博客设置
blogNavs=导航
quickLinks=快速链接
latestPosts=最近发表
noBlog=无博客
noTag=无
blogClass=分类
updatedTime=更新
createdTime=创建
fullBlog=全文
blogNav=导航
#
# set blog
#
baseInfoSet=基本设置
commentSet=评论设置
themeSet=主题设置
theme=主题
blogName=博客标题
blogLogo=博客Logo
blogDesc=博客描述
# theme
elegant=大气
navFixed=导航左侧固定
openComment=开启评论?
commentSys=leanote 使用 <a href="http://disqus.com" target="_blank">Disqus</a> 作为评论系统
disqusHelp=请填写您申请的Disqus唯一url前缀. 建议您申请Disqus帐号, 这样可以自己管理评论. 或使用leanote的默认Disqus Id.
needHelp=需要帮助?
blogLogoTips=上传logo将显示logo(替代博客标题)
saveSuccess=保存成功
a=a

View File

@@ -1,5 +1,9 @@
# leanote
moto=Not just a note!
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?
or=or
@@ -26,7 +30,7 @@ emailOrOthers=Email or other contact way
hi=Hi
welcomeUseLeanote=Welcome!
myNote=Enter to my note
myNote=My note
curUser=Email
# form
@@ -65,26 +69,31 @@ notGoodPassword=Tt's not a good password, the length is at least 6
myBlog=Blog
history=Histories
save=Save
editorTips=Editor Tips
editorTipsInfo=<h4>1. Short Cuts</h4>ctrl+shift+c Toggle code <br /> ctrl+shift+i Insert/edit image <h4>2. shift+enter Get out of current block</h4> eg. <img src="/images/outofcode.png" style="width: 90px"/> in this situation you can use shift+enter to get out of current code block.
newNote=New Note
newMarkdown=New Markdown Note
editorTips=Tips
editorTipsInfo=<h4>1. Short cuts</h4>ctrl+shift+c Toggle code <br /> ctrl+shift+i Insert/edit image <h4>2. shift+enter Get out of current block</h4> eg. <img src="/images/outofcode.png" style="width: 90px"/> in this situation you can use shift+enter to get out of current code block.
newNote=New note
newMarkdown=New markdown note
clickAddTag=Click to add Tag
notebook=Notebook
myNotebook=My Notebook
addNotebook=Add Notebook
myNotebook=My notebook
addNotebook=Add notebook
all=Newest
trash=Trash
delete=Delete
unTitled=UnTitled
defaultShare=Default sharing
leftHidden=Hidden slide bar
leftShow=Show slide bar
nav=Note Nav
nav=Note nav
writingMode=Writing Mode
normalMode=Normal Mode
saving=Saving
saveSuccess=Save success
update=Update
create=Create
demoRegister=您现在使用的是体验帐号, <a href="/register">立即注册?</a>
demoRegister=<a href="/register">Sign up</a>
close=Close
cancel=Cancel
@@ -92,7 +101,7 @@ send=Send
# 标签
tag=Tag
myTag=My Tag
myTag=My tag
red=red
yellow=yellow
blue=blue
@@ -103,18 +112,25 @@ accountSetting=Account
themeSetting=Theme
logout=Logout
basicInfo=Basic
updateEmail=Update Email
usernameSetting=Update Username
oldPassword=Old Password
newPassword=New Password
updateEmail=Update email
usernameSetting=Update username
oldPassword=Old password
newPassword=New password
default=Default
simple=Simple
# tinymce
uploadImage=Upload Image
uploadImage=Upload image
# blog
aboutMe=About me
blogSet=Set blog
# index
discussion=Discussion
download=Download
howToInstallLeanote=How to install leanote
# error
notFound=This page cann't found.
a=a

View File

@@ -1,5 +1,8 @@
# leanote
moto=不一样的笔记!
moto=你的私人云笔记!
moto2=知识管理, 博客, 分享, 协作... 尽在leanote
moto3=简约而不简单
fork github=Github 源码
# 首页
forgetPassword = 忘记密码?
@@ -27,7 +30,7 @@ emailOrOthers=Email或其它联系方式
hi=Hi
welcomeUseLeanote=欢迎使用leanote
myNote=进入我的笔记
myNote=我的笔记
curUser=当前登录帐户
# form
@@ -77,16 +80,21 @@ myNotebook=我的笔记本
addNotebook=添加笔记本
all=最新
trash=废纸篓
delete=删除
unTitled=无标题
defaultShare=默认共享
leftHidden=隐藏左侧
leftShow=展开左侧
nav=文档导航
writingMode=写作模式
normalMode=普通模式
saving=正在保存
saveSuccess=保存成功
update=更新
create=创建
demoRegister=您现在使用的是体验帐号, <a href="/register">立即注册?</a>
demoRegister=<a href="/register">立即注册</a>
close=关闭
cancel=取消
@@ -116,8 +124,18 @@ simple=简约
# tinymce
uploadImage=上传图片
# blog
aboutMe=关于我
blogSet=博客设置
# error
notFound=该页面不存在
# index
discussion=参与讨论
download=下载
howToInstallLeanote=leanote安装步骤
# 必须要加这个, 奇怪
[CN]

Binary file not shown.

View File

@@ -0,0 +1 @@
{ "indexes" : [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "leanote_public_3.files", "name" : "_id_" } ] }

View File

@@ -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" } ] }

View File

@@ -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_" } ] }

View File

@@ -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_" } ] }

View File

@@ -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" } ] }

View File

@@ -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" } ] }

View File

@@ -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_" } ] }

View File

@@ -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" } ] }

View File

@@ -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" } ] }

View File

@@ -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" } ] }

View File

@@ -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_" } ] }

View File

@@ -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_" } ] }

View File

@@ -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_" } ] }

View File

@@ -7099,4 +7099,8 @@ td.visible-print {
/* life */
.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
public/css/css/basic.css Normal file
View File

@@ -0,0 +1,3 @@
.aaa {
font-size: 12px;
}

View File

@@ -1,2 +0,0 @@
html{margin-top:3px;padding:3px;border:1px solid #ebeff2;border-radius:5px;-webkit-border-radius:5px;border-width:1px;box-shadow:none}
*{font-family:'Open Sans','Helvetica Neue',Arial,'Hiragino Sans GB','Microsoft YaHei','WenQuanYi Micro Hei',sans-serif}

View File

@@ -0,0 +1,12 @@
html {
border: none;
}
body {
background-color: #fbfcf7;
}
* {
font-size: 16px;
}
pre {
font-size: 14px;
}

View File

@@ -0,0 +1,15 @@
@bgColor: #fbfcf7;
html {
border: none;
}
body {
background-color: @bgColor;
}
* {
font-size: 16px;
}
pre {
font-size:14px;
}

View File

@@ -0,0 +1,17 @@
html {
margin-top: 3px;
padding: 3px;
border: 1px solid #ebeff2;
border-radius: 5px;
-webkit-border-radius: 5px;
border-width: 1px;
box-shadow: none;
}
* {
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;
}

View File

@@ -21,4 +21,9 @@ 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;
}

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 one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More