Merge branch 'feature-v1.4'
This commit is contained in:
commit
bfa85e2d34
120 files changed
+8363
-3185
No files matched your search
+27
-11
@@ -21,7 +21,7 @@ gulp.task('concatDepJs', function() {
|
||||
var jss = [
|
||||
'js/jquery-1.9.0.min.js',
|
||||
'js/jquery.ztree.all-3.5-min.js',
|
||||
'tinymce/tinymce.full.min.js', // 使用打成的包, 加载速度快
|
||||
// 'tinymce/tinymce.full.min.js', // 使用打成的包, 加载速度快
|
||||
// 'libs/ace/ace.js',
|
||||
'js/jQuery-slimScroll-1.3.0/jquery.slimscroll-min.js',
|
||||
'js/contextmenu/jquery.contextmenu-min.js',
|
||||
@@ -136,6 +136,7 @@ gulp.task('devToProHtml', function() {
|
||||
.pipe(replace(/<!-- pro_app_js -->/, '<script src="/js/app.min.js"></script>')) // 替换
|
||||
// .pipe(replace(/<!-- pro_markdown_js -->/, '<script src="/js/markdown.min.js"></script>')) // 替换
|
||||
.pipe(replace(/<!-- pro_markdown_js -->/, '<script src="/js/markdown-v2.min.js"></script>')) // 替换
|
||||
.pipe(replace('/tinymce/tinymce.js', '/tinymce/tinymce.full.min.js')) // 替换
|
||||
.pipe(replace(/<!-- pro_tinymce_init_js -->/, "var tinyMCEPreInit = {base: '/public/tinymce', suffix: '.min'};")) // 替换
|
||||
.pipe(replace(/plugins\/main.js/, "plugins/main.min.js")) // 替换
|
||||
// 连续两个空行换成一个空行
|
||||
@@ -152,7 +153,6 @@ gulp.task('devToProHtml', function() {
|
||||
.pipe(gulp.dest(noteProBase));
|
||||
});
|
||||
|
||||
// Get used keys
|
||||
// 只获取需要js i18n的key
|
||||
var path = require('path');
|
||||
gulp.task('i18n', function() {
|
||||
@@ -230,9 +230,18 @@ gulp.task('i18n', function() {
|
||||
}
|
||||
|
||||
// msg.zh, msg.js
|
||||
function genI18nJsFile(fromFilename, keys) {
|
||||
var msgs = getAllMsgs(leanoteBase + '/messages/' + fromFilename);
|
||||
var toFilename = fromFilename + '.js';
|
||||
function genI18nJsFile(fromFilename, otherNames, keys) {
|
||||
var msgs = {};
|
||||
otherNames.unshift(fromFilename);
|
||||
// console.log(fromFilename);
|
||||
// console.log(otherNames);
|
||||
otherNames.forEach(function (name) {
|
||||
var tmpMsgs = getAllMsgs(leanoteBase + '/messages/' + name);
|
||||
for (var i in tmpMsgs) {
|
||||
msgs[i] = tmpMsgs[i];
|
||||
}
|
||||
});
|
||||
|
||||
var toMsgs = {};
|
||||
for (var i in msgs) {
|
||||
// 只要需要的
|
||||
@@ -250,16 +259,23 @@ gulp.task('i18n', function() {
|
||||
'}' +
|
||||
'return key;' +
|
||||
'}';
|
||||
|
||||
// 写入到文件中
|
||||
var toFilename = fromFilename + '.js';
|
||||
fs.writeFile(base + '/js/i18n/' + toFilename, str);
|
||||
}
|
||||
|
||||
genI18nJsFile('msg.zh', keys);
|
||||
genI18nJsFile('msg.en', keys);
|
||||
genI18nJsFile('msg.fr', keys);
|
||||
genI18nJsFile('blog.zh', keys);
|
||||
genI18nJsFile('blog.en', keys);
|
||||
genI18nJsFile('blog.fr', keys);
|
||||
// 必须要的
|
||||
// keys.push();
|
||||
|
||||
genI18nJsFile('blog.zh', [], keys);
|
||||
genI18nJsFile('blog.en', [], keys);
|
||||
genI18nJsFile('blog.fr', [], keys);
|
||||
|
||||
genI18nJsFile('msg.fr', ['member.fr'], keys);
|
||||
genI18nJsFile('msg.zh', ['member.zh'], keys);
|
||||
genI18nJsFile('msg.en', ['member.en'], keys);
|
||||
|
||||
});
|
||||
|
||||
// 合并album需要的js
|
||||
|
||||
@@ -67,7 +67,9 @@ func (c Attach) uploadAttach(noteId string) (re info.Re) {
|
||||
}
|
||||
|
||||
// 生成上传路径
|
||||
filePath := "files/" + c.GetUserId() + "/attachs"
|
||||
// filePath := "files/" + c.GetUserId() + "/attachs"
|
||||
newGuid := NewGuid()
|
||||
filePath := "files/" + GetRandomFilePath(c.GetUserId(), newGuid) + "/attachs"
|
||||
dir := revel.BasePath + "/" + filePath
|
||||
err = os.MkdirAll(dir, 0755)
|
||||
if err != nil {
|
||||
@@ -76,7 +78,7 @@ func (c Attach) uploadAttach(noteId string) (re info.Re) {
|
||||
// 生成新的文件名
|
||||
filename := handel.Filename
|
||||
_, ext := SplitFilename(filename) // .doc
|
||||
filename = NewGuid() + ext
|
||||
filename = newGuid + ext
|
||||
toPath := dir + "/" + filename
|
||||
err = ioutil.WriteFile(toPath, data, 0777)
|
||||
if err != nil {
|
||||
@@ -165,10 +167,16 @@ func (c Attach) DownloadAll(noteId string) revel.Result {
|
||||
filename = "all.tar.gz"
|
||||
}
|
||||
|
||||
dir := revel.BasePath + "/files/attach_all"
|
||||
|
||||
if !MkdirAll(dir) {
|
||||
return c.RenderText("error")
|
||||
}
|
||||
|
||||
// file write
|
||||
fw, err := os.Create(revel.BasePath + "/files/" + filename)
|
||||
fw, err := os.Create(dir + "/" + filename)
|
||||
if err != nil {
|
||||
return c.RenderText("")
|
||||
return c.RenderText("error")
|
||||
}
|
||||
// defer fw.Close() // 不需要关闭, 还要读取给用户下载
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"github.com/leanote/leanote/app/info"
|
||||
. "github.com/leanote/leanote/app/lea"
|
||||
"github.com/revel/revel"
|
||||
"strings"
|
||||
// "strconv"
|
||||
)
|
||||
|
||||
@@ -127,6 +128,8 @@ func (c Auth) DoRegister(email, pwd, iu string) revel.Result {
|
||||
return c.RenderRe(re)
|
||||
}
|
||||
|
||||
email = strings.ToLower(email)
|
||||
|
||||
// 注册
|
||||
re.Ok, re.Msg = authService.Register(email, pwd, iu)
|
||||
|
||||
@@ -141,6 +144,7 @@ func (c Auth) DoRegister(email, pwd, iu string) revel.Result {
|
||||
//--------
|
||||
// 找回密码
|
||||
func (c Auth) FindPassword() revel.Result {
|
||||
c.SetLocale()
|
||||
c.RenderArgs["title"] = c.Message("findPassword")
|
||||
c.RenderArgs["subTitle"] = c.Message("findPassword")
|
||||
return c.RenderTemplate("home/find_password.html")
|
||||
@@ -154,6 +158,7 @@ func (c Auth) DoFindPassword(email string) revel.Result {
|
||||
|
||||
// 点击链接后, 先验证之
|
||||
func (c Auth) FindPassword2(token string) revel.Result {
|
||||
c.SetLocale()
|
||||
c.RenderArgs["title"] = c.Message("findPassword")
|
||||
c.RenderArgs["subTitle"] = c.Message("findPassword")
|
||||
if token == "" {
|
||||
|
||||
@@ -109,7 +109,8 @@ func (c File) uploadImage(from, albumId string) (re info.Re) {
|
||||
if from == "logo" || from == "blogLogo" {
|
||||
fileUrlPath = "public/upload/" + Digest3(userId) + "/" + userId + "/images/logo"
|
||||
} else {
|
||||
fileUrlPath = "files/" + Digest3(userId) + "/" + userId + "/" + Digest2(newGuid) + "/images"
|
||||
// fileUrlPath = "files/" + Digest3(userId) + "/" + userId + "/" + Digest2(newGuid) + "/images"
|
||||
fileUrlPath = "files/" + GetRandomFilePath(userId, newGuid) + "/images"
|
||||
}
|
||||
|
||||
dir := revel.BasePath + "/" + fileUrlPath
|
||||
@@ -242,7 +243,8 @@ func (c File) CopyHttpImage(src string) revel.Result {
|
||||
// 生成上传路径
|
||||
newGuid := NewGuid()
|
||||
userId := c.GetUserId()
|
||||
fileUrlPath := "files/" + Digest3(userId) + "/" + userId + "/" + Digest2(newGuid) + "/images"
|
||||
// fileUrlPath := "files/" + Digest3(userId) + "/" + userId + "/" + Digest2(newGuid) + "/images"
|
||||
fileUrlPath := "files/" + GetRandomFilePath(userId, newGuid) + "/images"
|
||||
dir := revel.BasePath + "/" + fileUrlPath
|
||||
err := os.MkdirAll(dir, 0755)
|
||||
if err != nil {
|
||||
|
||||
@@ -3,7 +3,6 @@ package controllers
|
||||
import (
|
||||
"github.com/revel/revel"
|
||||
// "encoding/json"
|
||||
"fmt"
|
||||
"github.com/leanote/leanote/app/info"
|
||||
. "github.com/leanote/leanote/app/lea"
|
||||
"gopkg.in/mgo.v2/bson"
|
||||
@@ -14,6 +13,7 @@ import (
|
||||
"time"
|
||||
// "github.com/leanote/leanote/app/types"
|
||||
// "io/ioutil"
|
||||
"fmt"
|
||||
// "bytes"
|
||||
// "os"
|
||||
)
|
||||
@@ -248,7 +248,8 @@ func (c Note) UpdateNoteOrContent(noteOrContent NoteOrContent) revel.Result {
|
||||
// noteService.UpdateNoteContent(noteOrContent.UserId, c.GetUserId(),
|
||||
// noteOrContent.NoteId, noteOrContent.Content, noteOrContent.Abstract)
|
||||
contentOk, contentMsg, afterContentUsn = noteService.UpdateNoteContent(c.GetUserId(),
|
||||
noteOrContent.NoteId, noteOrContent.Content, noteOrContent.Abstract, needUpdateNote, -1)
|
||||
noteOrContent.NoteId, noteOrContent.Content, noteOrContent.Abstract,
|
||||
needUpdateNote, -1, time.Now())
|
||||
}
|
||||
|
||||
Log(afterContentUsn)
|
||||
@@ -334,11 +335,11 @@ func (c Note) ToPdf(noteId, appKey string) revel.Result {
|
||||
// 虽然传了cookie但是这里还是不能得到userId, 所以还是通过appKey来验证之
|
||||
appKeyTrue, _ := revel.Config.String("app.secret")
|
||||
if appKeyTrue != appKey {
|
||||
return c.RenderText("error")
|
||||
return c.RenderText("auth error")
|
||||
}
|
||||
note := noteService.GetNoteById(noteId)
|
||||
if note.NoteId == "" {
|
||||
return c.RenderText("error")
|
||||
return c.RenderText("no note")
|
||||
}
|
||||
|
||||
noteUserId := note.UserId.Hex()
|
||||
@@ -427,13 +428,13 @@ func (c Note) ExportPdf(noteId string) revel.Result {
|
||||
// 是否是有权限协作的
|
||||
if !note.IsBlog && !shareService.HasReadPerm(noteUserId, userId, noteId) {
|
||||
re.Msg = "No Perm"
|
||||
return c.RenderText("error")
|
||||
return c.RenderText("No Perm")
|
||||
}
|
||||
}
|
||||
|
||||
// path 判断是否需要重新生成之
|
||||
guid := NewGuid()
|
||||
fileUrlPath := "files/" + Digest3(noteUserId) + "/" + noteUserId + "/" + Digest2(guid) + "/images/pdf"
|
||||
fileUrlPath := "files/export_pdf"
|
||||
dir := revel.BasePath + "/" + fileUrlPath
|
||||
if !MkdirAll(dir) {
|
||||
return c.RenderText("error, no dir")
|
||||
@@ -462,9 +463,9 @@ func (c Note) ExportPdf(noteId string) revel.Result {
|
||||
// wkhtmltopdf参数大全
|
||||
var cc string
|
||||
if note.IsMarkdown {
|
||||
cc = binPath + " --window-status done \"" + url + "\" \"" + path + "\"" // \"" + cookieDomain + "\" \"" + cookieName + "\" \"" + cookieValue + "\""
|
||||
cc = binPath + " --lowquality --window-status done \"" + url + "\" \"" + path + "\"" // \"" + cookieDomain + "\" \"" + cookieName + "\" \"" + cookieValue + "\""
|
||||
} else {
|
||||
cc = binPath + " \"" + url + "\" \"" + path + "\"" // \"" + cookieDomain + "\" \"" + cookieName + "\" \"" + cookieValue + "\""
|
||||
cc = binPath + " --lowquality \"" + url + "\" \"" + path + "\"" // \"" + cookieDomain + "\" \"" + cookieName + "\" \"" + cookieValue + "\""
|
||||
}
|
||||
|
||||
cmd := exec.Command("/bin/sh", "-c", cc)
|
||||
|
||||
@@ -23,7 +23,7 @@ type Preview struct {
|
||||
// 得到要预览的主题绝对路径
|
||||
func (c Preview) getPreviewThemeAbsolutePath(themeId string) bool {
|
||||
if themeId != "" {
|
||||
c.Session["themeId"] = themeId // 存到session中, 下次的url就不能带了
|
||||
c.Session["themeId"] = themeId // 存到session中, 下次的url就不能带了, 待优化, 有时会取不到
|
||||
} else {
|
||||
themeId = c.Session["themeId"] // 直接从session中获取
|
||||
}
|
||||
|
||||
@@ -93,21 +93,6 @@ func (c User) ReSendActiveEmail() revel.Result {
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
// 修改Email发送激活邮箱
|
||||
func (c User) updateEmailSendActiveEmail(email, pwd string) revel.Result {
|
||||
re := info.NewRe()
|
||||
if c.GetUserId() == configService.GetGlobalStringConfig("demoUserId") {
|
||||
re.Msg = "cannotUpdateDemo"
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
if re.Ok, re.Msg = Vd("email", email); !re.Ok {
|
||||
return c.RenderRe(re)
|
||||
}
|
||||
|
||||
re.Ok, re.Msg = emailService.UpdateEmailSendActiveEmail(c.GetUserInfo(), email)
|
||||
return c.RenderRe(re)
|
||||
}
|
||||
|
||||
// 通过点击链接
|
||||
// 修改邮箱
|
||||
func (c User) UpdateEmail(token string) revel.Result {
|
||||
@@ -147,27 +132,6 @@ func (c User) ActiveEmail(token string) revel.Result {
|
||||
return c.RenderTemplate("user/active_email.html")
|
||||
}
|
||||
|
||||
//------------
|
||||
// 第三方账号添加leanote账号
|
||||
func (c User) AddAccount(email, pwd string) revel.Result {
|
||||
re := info.NewRe()
|
||||
|
||||
if re.Ok, re.Msg = Vd("email", email); !re.Ok {
|
||||
return c.RenderRe(re)
|
||||
}
|
||||
if re.Ok, re.Msg = Vd("password", pwd); !re.Ok {
|
||||
return c.RenderRe(re)
|
||||
}
|
||||
|
||||
re.Ok, re.Msg = userService.ThirdAddUser(c.GetUserId(), email, pwd)
|
||||
|
||||
if re.Ok {
|
||||
c.UpdateSession("Email", email)
|
||||
}
|
||||
|
||||
return c.RenderRe(re)
|
||||
}
|
||||
|
||||
//-----------------
|
||||
// 用户偏爱
|
||||
func (c User) UpdateColumnWidth(notebookWidth, noteListWidth, mdEditorWidth int) revel.Result {
|
||||
|
||||
@@ -75,7 +75,8 @@ func (c ApiBaseContrller) uploadAttach(name string, noteId string) (ok bool, msg
|
||||
|
||||
// 生成上传路径
|
||||
newGuid := NewGuid()
|
||||
filePath := "files/" + Digest3(userId) + "/" + userId + "/" + Digest2(newGuid) + "/attachs"
|
||||
// filePath := "files/" + Digest3(userId) + "/" + userId + "/" + Digest2(newGuid) + "/attachs"
|
||||
filePath := "files/" + GetRandomFilePath(userId, newGuid) + "/attachs"
|
||||
|
||||
dir := revel.BasePath + "/" + filePath
|
||||
err = os.MkdirAll(dir, 0755)
|
||||
@@ -130,7 +131,8 @@ func (c ApiBaseContrller) upload(name string, noteId string, isAttach bool) (ok
|
||||
newGuid := NewGuid()
|
||||
// 生成上传路径
|
||||
userId := c.getUserId()
|
||||
fileUrlPath := "files/" + Digest3(userId) + "/" + userId + "/" + Digest2(newGuid) + "/images"
|
||||
// fileUrlPath := "files/" + Digest3(userId) + "/" + userId + "/" + Digest2(newGuid) + "/images"
|
||||
fileUrlPath := "files/" + GetRandomFilePath(userId, newGuid) + "/images"
|
||||
|
||||
dir := revel.BasePath + "/" + fileUrlPath
|
||||
err = os.MkdirAll(dir, 0755)
|
||||
|
||||
@@ -8,7 +8,6 @@ import (
|
||||
"gopkg.in/mgo.v2/bson"
|
||||
"os"
|
||||
"os/exec"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
// "github.com/leanote/leanote/app/types"
|
||||
@@ -85,7 +84,6 @@ func (c ApiNote) GetTrashNotes() revel.Result {
|
||||
"Title": "asdfadsf--=",
|
||||
"Desc": "",
|
||||
"Tags": [
|
||||
""
|
||||
],
|
||||
"Abstract": "",
|
||||
"Content": "",
|
||||
@@ -95,7 +93,7 @@ func (c ApiNote) GetTrashNotes() revel.Result {
|
||||
"Usn": 8,
|
||||
"Files": [
|
||||
{
|
||||
"FileId": "551975d599c37b970f000002",
|
||||
"FileId": "551975d599c37b970f000000",
|
||||
"LocalFileId": "",
|
||||
"Type": "",
|
||||
"Title": "",
|
||||
@@ -103,18 +101,18 @@ func (c ApiNote) GetTrashNotes() revel.Result {
|
||||
"IsAttach": false
|
||||
},
|
||||
{
|
||||
"FileId": "551975de99c37b970f000003",
|
||||
"FileId": "551975de99c37b970f000001",
|
||||
"LocalFileId": "",
|
||||
"Type": "doc",
|
||||
"Title": "李铁-简历-ali-print-en.doc",
|
||||
"Title": "李铁-print-en.doc",
|
||||
"HasBody": false,
|
||||
"IsAttach": true
|
||||
},
|
||||
{
|
||||
"FileId": "551975de99c37b970f000004",
|
||||
"FileId": "551975de99c37b970f000002",
|
||||
"LocalFileId": "",
|
||||
"Type": "doc",
|
||||
"Title": "李铁-简历-ali-print.doc",
|
||||
"Title": "李铁-print.doc",
|
||||
"HasBody": false,
|
||||
"IsAttach": true
|
||||
}
|
||||
@@ -148,68 +146,10 @@ func (c ApiNote) GetNoteAndContent(noteId string) revel.Result {
|
||||
|
||||
apiNotes := noteService.ToApiNotes([]info.Note{noteAndContent.Note})
|
||||
apiNote := apiNotes[0]
|
||||
apiNote.Content = noteAndContent.Content
|
||||
apiNote.Content = noteService.FixContent(noteAndContent.Content, noteAndContent.IsMarkdown)
|
||||
return c.RenderJson(apiNote)
|
||||
}
|
||||
|
||||
// 处理笔记内容数据 http://leanote.com/file/outputImage -> https://leanote.com/api/file/getImage
|
||||
// 图片, 附件都替换
|
||||
func (c ApiNote) fixContent(content string) string {
|
||||
// TODO, 这个url需要从config中取
|
||||
// baseUrl := "http://leanote.com"
|
||||
baseUrl := configService.GetSiteUrl()
|
||||
// baseUrl := "http://localhost:9000"
|
||||
|
||||
patterns := []map[string]string{
|
||||
map[string]string{"src": "src", "middle": "/file/outputImage", "param": "fileId", "to": "getImage?fileId="},
|
||||
map[string]string{"src": "href", "middle": "/attach/download", "param": "attachId", "to": "getAttach?fileId="},
|
||||
map[string]string{"src": "href", "middle": "/attach/downloadAll", "param": "noteId", "to": "getAllAttachs?noteId="},
|
||||
}
|
||||
|
||||
for _, eachPattern := range patterns {
|
||||
|
||||
// src="http://leanote.com/file/outputImage?fileId=5503537b38f4111dcb0000d1"
|
||||
// href="http://leanote.com/attach/download?attachId=5504243a38f4111dcb00017d"
|
||||
// href="http://leanote.com/attach/downloadAll?noteId=55041b6a38f4111dcb000159"
|
||||
|
||||
regImage, _ := regexp.Compile(eachPattern["src"] + `=('|")` + baseUrl + eachPattern["middle"] + `\?` + eachPattern["param"] + `=([a-z0-9A-Z]{24})("|')`)
|
||||
findsImage := regImage.FindAllStringSubmatch(content, -1) // 查找所有的
|
||||
|
||||
// [[src='http://leanote.com/file/outputImage?fileId=54672e8d38f411286b000069" ' 54672e8d38f411286b000069 "] [src="http://leanote.com/file/outputImage?fileId=54672e8d38f411286b000069" " 54672e8d38f411286b000069 "] [src="http://leanote.com/file/outputImage?fileId=54672e8d38f411286b000069" " 54672e8d38f411286b000069 "] [src="http://leanote.com/file/outputImage?fileId=54672e8d38f411286b000069" " 54672e8d38f411286b000069 "]]
|
||||
for _, eachFind := range findsImage {
|
||||
// [src='http://leanote.com/file/outputImage?fileId=54672e8d38f411286b000069" ' 54672e8d38f411286b000069 "]
|
||||
if len(eachFind) == 4 {
|
||||
content = strings.Replace(content,
|
||||
eachFind[0],
|
||||
eachPattern["src"]+"=\""+baseUrl+"/api/file/"+eachPattern["to"]+eachFind[2]+"\"",
|
||||
1)
|
||||
}
|
||||
}
|
||||
|
||||
// markdown处理
|
||||
// 
|
||||
// [selection 2.html](http://leanote.com/attach/download?attachId=5504262638f4111dcb00017f)
|
||||
// [all.tar.gz](http://leanote.com/attach/downloadAll?noteId=5503b57d59f81b4eb4000000)
|
||||
|
||||
pre := "!" // 默认图片
|
||||
if eachPattern["src"] == "href" { // 是attach
|
||||
pre = ""
|
||||
}
|
||||
|
||||
regImageMarkdown, _ := regexp.Compile(pre + `\[(.*?)\]\(` + baseUrl + eachPattern["middle"] + `\?` + eachPattern["param"] + `=([a-z0-9A-Z]{24})\)`)
|
||||
findsImageMarkdown := regImageMarkdown.FindAllStringSubmatch(content, -1) // 查找所有的
|
||||
// [[ 5503537b38f4111dcb0000d1] [ 5503537b38f4111dcb0000d1]]
|
||||
for _, eachFind := range findsImageMarkdown {
|
||||
// [ 你好啊, 我很好, 为什么? 5503537b38f4111dcb0000d1]
|
||||
if len(eachFind) == 3 {
|
||||
content = strings.Replace(content, eachFind[0], pre+"["+eachFind[1]+"]("+baseUrl+"/api/file/"+eachPattern["to"]+eachFind[2]+")", 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return content
|
||||
}
|
||||
|
||||
// content里的image, attach链接是
|
||||
// https://leanote.com/api/file/getImage?fileId=xx
|
||||
// https://leanote.com/api/file/getAttach?fileId=xx
|
||||
@@ -229,12 +169,13 @@ func (c ApiNote) fixPostNotecontent(noteOrContent *info.ApiNote) {
|
||||
}
|
||||
|
||||
// 得到内容
|
||||
// [OK]
|
||||
func (c ApiNote) GetNoteContent(noteId string) revel.Result {
|
||||
userId := c.getUserId()
|
||||
note := noteService.GetNote(noteId, userId)
|
||||
// re := info.NewRe()
|
||||
noteContent := noteService.GetNoteContent(noteId, c.getUserId())
|
||||
noteContent := noteService.GetNoteContent(noteId, userId)
|
||||
if noteContent.Content != "" {
|
||||
noteContent.Content = c.fixContent(noteContent.Content)
|
||||
noteContent.Content = noteService.FixContent(noteContent.Content, note.IsMarkdown)
|
||||
}
|
||||
|
||||
apiNoteContent := info.ApiNoteContent{
|
||||
@@ -243,7 +184,6 @@ func (c ApiNote) GetNoteContent(noteId string) revel.Result {
|
||||
Content: noteContent.Content,
|
||||
}
|
||||
|
||||
// re.Item = noteContent
|
||||
return c.RenderJson(apiNoteContent)
|
||||
}
|
||||
|
||||
@@ -261,6 +201,7 @@ func (c ApiNote) AddNote(noteOrContent info.ApiNote) revel.Result {
|
||||
*/
|
||||
// Log(noteOrContent.Title)
|
||||
// LogJ(noteOrContent)
|
||||
|
||||
/*
|
||||
LogJ(c.Params)
|
||||
for name, _ := range c.Params.Files {
|
||||
@@ -330,12 +271,17 @@ func (c ApiNote) AddNote(noteOrContent info.ApiNote) revel.Result {
|
||||
IsBlog: noteOrContent.IsBlog,
|
||||
IsMarkdown: noteOrContent.IsMarkdown,
|
||||
AttachNum: attachNum,
|
||||
CreatedTime: noteOrContent.CreatedTime,
|
||||
UpdatedTime: noteOrContent.UpdatedTime,
|
||||
}
|
||||
noteContent := info.NoteContent{NoteId: note.NoteId,
|
||||
UserId: userId,
|
||||
IsBlog: note.IsBlog,
|
||||
Content: noteOrContent.Content,
|
||||
Abstract: noteOrContent.Abstract}
|
||||
Abstract: noteOrContent.Abstract,
|
||||
CreatedTime: noteOrContent.CreatedTime,
|
||||
UpdatedTime: noteOrContent.UpdatedTime,
|
||||
}
|
||||
|
||||
// 通过内容得到Desc, abstract
|
||||
if noteOrContent.Abstract == "" {
|
||||
@@ -447,6 +393,7 @@ func (c ApiNote) UpdateNote(noteOrContent info.ApiNote) revel.Result {
|
||||
|
||||
// Log("after upload")
|
||||
// LogJ(noteOrContent.Files)
|
||||
|
||||
}
|
||||
|
||||
// 移到外面来, 删除最后一个file时也要处理, 不然总删不掉
|
||||
@@ -509,6 +456,8 @@ func (c ApiNote) UpdateNote(noteOrContent info.ApiNote) revel.Result {
|
||||
}
|
||||
}
|
||||
|
||||
noteUpdate["UpdatedTime"] = noteOrContent.UpdatedTime
|
||||
|
||||
afterNoteUsn := 0
|
||||
noteOk := false
|
||||
noteMsg := ""
|
||||
@@ -532,10 +481,16 @@ func (c ApiNote) UpdateNote(noteOrContent info.ApiNote) revel.Result {
|
||||
if noteOrContent.Abstract == "" {
|
||||
noteOrContent.Abstract = SubStringHTML(noteOrContent.Content, 200, "")
|
||||
}
|
||||
|
||||
// Log("--------> afte fixed")
|
||||
// Log(noteOrContent.Content)
|
||||
contentOk, contentMsg, afterContentUsn = noteService.UpdateNoteContent(c.getUserId(),
|
||||
noteOrContent.NoteId, noteOrContent.Content, noteOrContent.Abstract, needUpdateNote, noteOrContent.Usn)
|
||||
noteOrContent.NoteId,
|
||||
noteOrContent.Content,
|
||||
noteOrContent.Abstract,
|
||||
needUpdateNote,
|
||||
noteOrContent.Usn,
|
||||
noteOrContent.UpdatedTime)
|
||||
}
|
||||
|
||||
if needUpdateNote {
|
||||
@@ -585,7 +540,6 @@ func (c ApiNote) GetHistories(noteId string) revel.Result {
|
||||
|
||||
// 0.2 新增
|
||||
// 导出成PDF
|
||||
// test localhost:9000/api/note/exportPdf?noteId=554f07bf05fcd15fa9000000&token=562211dc99c37ba6a7000001
|
||||
func (c ApiNote) ExportPdf(noteId string) revel.Result {
|
||||
re := info.NewApiRe()
|
||||
userId := c.getUserId()
|
||||
@@ -612,7 +566,7 @@ func (c ApiNote) ExportPdf(noteId string) revel.Result {
|
||||
|
||||
// path 判断是否需要重新生成之
|
||||
guid := NewGuid()
|
||||
fileUrlPath := "files/" + Digest3(noteUserId) + "/" + noteUserId + "/" + Digest2(guid) + "/images/pdf"
|
||||
fileUrlPath := "files/export_pdf"
|
||||
dir := revel.BasePath + "/" + fileUrlPath
|
||||
if !MkdirAll(dir) {
|
||||
re.Msg = "noDir"
|
||||
@@ -636,9 +590,9 @@ func (c ApiNote) ExportPdf(noteId string) revel.Result {
|
||||
url := configService.GetSiteUrl() + "/note/toPdf?noteId=" + noteId + "&appKey=" + appKey
|
||||
var cc string
|
||||
if note.IsMarkdown {
|
||||
cc = binPath + " --window-status done \"" + url + "\" \"" + path + "\"" // \"" + cookieDomain + "\" \"" + cookieName + "\" \"" + cookieValue + "\""
|
||||
cc = binPath + " --lowquality --window-status done \"" + url + "\" \"" + path + "\"" // \"" + cookieDomain + "\" \"" + cookieName + "\" \"" + cookieValue + "\""
|
||||
} else {
|
||||
cc = binPath + " \"" + url + "\" \"" + path + "\"" // \"" + cookieDomain + "\" \"" + cookieName + "\" \"" + cookieValue + "\""
|
||||
cc = binPath + " --lowquality \"" + url + "\" \"" + path + "\"" // \"" + cookieDomain + "\" \"" + cookieName + "\" \"" + cookieValue + "\""
|
||||
}
|
||||
|
||||
cmd := exec.Command("/bin/sh", "-c", cc)
|
||||
|
||||
@@ -74,7 +74,7 @@ func (c MemberBlog) Index(sorter, keywords string) revel.Result {
|
||||
userInfo := userService.GetUserInfo(userId)
|
||||
c.RenderArgs["userInfo"] = userInfo
|
||||
|
||||
c.RenderArgs["title"] = "Posts"
|
||||
c.RenderArgs["title"] = c.Message("Posts")
|
||||
pageNumber := c.GetPage()
|
||||
sorterField, isAsc := c.getSorter("CreatedTime", false, []string{"title", "urlTitle", "updatedTime", "publicTime", "createdTime"})
|
||||
pageInfo, blogs := blogService.ListAllBlogs(c.GetUserId(), "", keywords, false, pageNumber, userPageSize, sorterField, isAsc)
|
||||
@@ -85,6 +85,8 @@ func (c MemberBlog) Index(sorter, keywords string) revel.Result {
|
||||
userAndBlog := userService.GetUserAndBlog(c.GetUserId())
|
||||
c.RenderArgs["userAndBlog"] = userAndBlog
|
||||
|
||||
c.common()
|
||||
|
||||
return c.RenderTemplate("member/blog/list.html")
|
||||
}
|
||||
|
||||
@@ -97,7 +99,8 @@ func (c MemberBlog) UpdateBlogUrlTitle(noteId, urlTitle string) revel.Result {
|
||||
|
||||
// 修改笔记的urlTitle
|
||||
func (c MemberBlog) UpdateBlogAbstract(noteId string) revel.Result {
|
||||
c.RenderArgs["title"] = "Update Post Abstract"
|
||||
c.common()
|
||||
c.RenderArgs["title"] = c.Message("Update Post Abstract")
|
||||
note := noteService.GetNoteAndContent(noteId, c.GetUserId())
|
||||
if !note.Note.IsBlog {
|
||||
return c.E404()
|
||||
@@ -107,7 +110,6 @@ func (c MemberBlog) UpdateBlogAbstract(noteId string) revel.Result {
|
||||
return c.RenderTemplate("member/blog/update_abstract.html")
|
||||
}
|
||||
func (c MemberBlog) DoUpdateBlogAbstract(noteId, imgSrc, desc, abstract string) revel.Result {
|
||||
|
||||
re := info.NewRe()
|
||||
re.Ok = blogService.UpateBlogAbstract(c.GetUserId(), noteId, imgSrc, desc, abstract)
|
||||
return c.RenderJson(re)
|
||||
@@ -116,24 +118,24 @@ func (c MemberBlog) DoUpdateBlogAbstract(noteId, imgSrc, desc, abstract string)
|
||||
// 基本信息设置
|
||||
func (c MemberBlog) Base() revel.Result {
|
||||
c.common()
|
||||
c.RenderArgs["title"] = "Blog Base Info"
|
||||
c.RenderArgs["title"] = c.Message("Blog Base Info")
|
||||
return c.RenderTemplate("member/blog/base.html")
|
||||
}
|
||||
func (c MemberBlog) Comment() revel.Result {
|
||||
c.common()
|
||||
c.RenderArgs["title"] = "Comment"
|
||||
c.RenderArgs["title"] = c.Message("Comment")
|
||||
return c.RenderTemplate("member/blog/comment.html")
|
||||
}
|
||||
|
||||
func (c MemberBlog) Paging() revel.Result {
|
||||
c.common()
|
||||
c.RenderArgs["title"] = "Paging"
|
||||
c.RenderArgs["title"] = c.Message("Paging")
|
||||
return c.RenderTemplate("member/blog/paging.html")
|
||||
}
|
||||
|
||||
func (c MemberBlog) Cate() revel.Result {
|
||||
userBlog := c.common()
|
||||
c.RenderArgs["title"] = "Cate"
|
||||
c.RenderArgs["title"] = c.Message("Category")
|
||||
|
||||
notebooks := blogService.ListBlogNotebooks(c.GetUserId())
|
||||
notebooksMap := map[string]info.Notebook{}
|
||||
@@ -190,10 +192,10 @@ func (c MemberBlog) DoAddOrUpdateSingle(singleId, title, content string) revel.R
|
||||
}
|
||||
func (c MemberBlog) AddOrUpdateSingle(singleId string) revel.Result {
|
||||
c.common()
|
||||
c.RenderArgs["title"] = "Add Single"
|
||||
c.RenderArgs["title"] = c.Message("Add Single")
|
||||
c.RenderArgs["singleId"] = singleId
|
||||
if singleId != "" {
|
||||
c.RenderArgs["title"] = "Update Single"
|
||||
c.RenderArgs["title"] = c.Message("Update Single")
|
||||
c.RenderArgs["single"] = blogService.GetSingle(singleId)
|
||||
}
|
||||
return c.RenderTemplate("member/blog/add_single.html")
|
||||
@@ -219,7 +221,7 @@ func (c MemberBlog) UpdateSingleUrlTitle(singleId, urlTitle string) revel.Result
|
||||
|
||||
func (c MemberBlog) Single() revel.Result {
|
||||
c.common()
|
||||
c.RenderArgs["title"] = "Cate"
|
||||
c.RenderArgs["title"] = c.Message("Single")
|
||||
c.RenderArgs["singles"] = blogService.GetSingles(c.GetUserId())
|
||||
|
||||
return c.RenderTemplate("member/blog/single.html")
|
||||
@@ -234,7 +236,7 @@ func (c MemberBlog) Theme() revel.Result {
|
||||
|
||||
c.RenderArgs["optionThemes"] = themeService.GetDefaultThemes()
|
||||
|
||||
c.RenderArgs["title"] = "Theme"
|
||||
c.RenderArgs["title"] = c.Message("Theme")
|
||||
return c.RenderTemplate("member/blog/theme.html")
|
||||
}
|
||||
|
||||
@@ -251,7 +253,7 @@ func (c MemberBlog) UpdateTheme(themeId string, isNew int) revel.Result {
|
||||
}
|
||||
|
||||
c.common()
|
||||
c.RenderArgs["title"] = "Upate Theme"
|
||||
c.RenderArgs["title"] = c.Message("Update Theme")
|
||||
c.RenderArgs["isNew"] = isNew
|
||||
|
||||
// 先复制之
|
||||
@@ -443,8 +445,8 @@ func (c MemberBlog) ImportTheme() revel.Result {
|
||||
if err != nil {
|
||||
re.Msg = fmt.Sprintf("%v", err)
|
||||
return c.RenderJson(re)
|
||||
|
||||
}
|
||||
|
||||
defer file.Close()
|
||||
// 生成上传路径
|
||||
userId := c.GetUserId()
|
||||
|
||||
@@ -14,7 +14,7 @@ type MemberGroup struct {
|
||||
func (c MemberGroup) Index() revel.Result {
|
||||
c.SetUserInfo()
|
||||
c.SetLocale()
|
||||
c.RenderArgs["title"] = "My Group"
|
||||
c.RenderArgs["title"] = c.Message("My Group")
|
||||
c.RenderArgs["groups"] = groupService.GetGroupsAndUsers(c.GetUserId())
|
||||
return c.RenderTemplate("member/group/index.html")
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ type MemberIndex struct {
|
||||
// admin 主页
|
||||
func (c MemberIndex) Index() revel.Result {
|
||||
c.SetUserInfo()
|
||||
c.RenderArgs["title"] = "Leanote Member Center"
|
||||
c.RenderArgs["title"] = c.Message("Leanote Member Center")
|
||||
|
||||
c.RenderArgs["countNote"] = noteService.CountNote(c.GetUserId())
|
||||
c.RenderArgs["countBlog"] = noteService.CountBlog(c.GetUserId())
|
||||
|
||||
@@ -13,34 +13,28 @@ type MemberUser struct {
|
||||
func (c MemberUser) Username() revel.Result {
|
||||
c.SetUserInfo()
|
||||
c.SetLocale()
|
||||
c.RenderArgs["title"] = "Username"
|
||||
c.RenderArgs["title"] = c.Message("Username")
|
||||
return c.RenderTemplate("member/user/username.html")
|
||||
}
|
||||
|
||||
func (c MemberUser) Email() revel.Result {
|
||||
c.SetUserInfo()
|
||||
c.SetLocale()
|
||||
c.RenderArgs["title"] = "Email"
|
||||
c.RenderArgs["title"] = c.Message("Email")
|
||||
return c.RenderTemplate("member/user/email.html")
|
||||
}
|
||||
|
||||
func (c MemberUser) Password() revel.Result {
|
||||
c.SetUserInfo()
|
||||
c.SetLocale()
|
||||
c.RenderArgs["title"] = "Password"
|
||||
c.RenderArgs["title"] = c.Message("Password")
|
||||
return c.RenderTemplate("member/user/password.html")
|
||||
}
|
||||
|
||||
func (c MemberUser) Avatar() revel.Result {
|
||||
c.SetUserInfo()
|
||||
c.SetLocale()
|
||||
c.RenderArgs["title"] = "Avatar"
|
||||
c.RenderArgs["title"] = c.Message("Avatar")
|
||||
c.RenderArgs["globalConfigs"] = configService.GetGlobalConfigForUser()
|
||||
return c.RenderTemplate("member/user/avatar.html")
|
||||
}
|
||||
func (c MemberUser) AddAccount() revel.Result {
|
||||
c.SetUserInfo()
|
||||
c.SetLocale()
|
||||
c.RenderArgs["title"] = "Add Account"
|
||||
return c.RenderTemplate("member/user/add_account.html")
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
包括基本信息设置
|
||||
博客设置
|
||||
@@ -394,3 +394,40 @@ func FixFilename(filename string) string {
|
||||
}
|
||||
return filename
|
||||
}
|
||||
|
||||
// 是否是合法的时间
|
||||
// 不是, 0001-01-01T00:00:00Z, 且比今天小
|
||||
func IsValidTime(t time.Time) bool {
|
||||
if t.Year() > 20 {
|
||||
now := time.Now()
|
||||
Log("------")
|
||||
Log(t)
|
||||
Log(now)
|
||||
if t.Before(now) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// url传过来的时间没有时区信息, 转到本地时间
|
||||
func ToLocalTime(t time.Time) time.Time {
|
||||
return time.Date(t.Year(), t.Month(), t.Day(), t.Hour(), t.Minute(), t.Second(), 0, time.Local)
|
||||
}
|
||||
|
||||
// 修复传过来的时间, 如果比今天大, 则设为现在
|
||||
func FixUrlTime(t time.Time) time.Time {
|
||||
localTime := ToLocalTime(t)
|
||||
if IsValidTime(localTime) {
|
||||
return localTime
|
||||
}
|
||||
return time.Now()
|
||||
}
|
||||
|
||||
// 得到用户的随机文件路径 3位/userId/2位
|
||||
func GetRandomFilePath(userId, uuid string) string {
|
||||
if uuid == "" {
|
||||
uuid = NewGuid()
|
||||
}
|
||||
return Digest3(userId) + "/" + userId + "/" + Digest2(uuid)
|
||||
}
|
||||
@@ -919,7 +919,7 @@ func (this *BlogService) UpateCateUrlTitle(userId string, cateId, urlTitle strin
|
||||
"UrlTitle": "",
|
||||
})
|
||||
*/
|
||||
url = GetUrTitle(userId, urlTitle, "notebook")
|
||||
url = GetUrTitle(userId, urlTitle, "notebook", cateId)
|
||||
ok = db.UpdateByIdAndUserIdMap(db.Notebooks, cateId, userId, bson.M{
|
||||
"UrlTitle": url,
|
||||
})
|
||||
@@ -935,7 +935,7 @@ func (this *BlogService) UpateBlogUrlTitle(userId string, noteId, urlTitle strin
|
||||
ok = db.UpdateByIdAndUserIdMap(db.Notes, noteId, userId, bson.M{
|
||||
"UrlTitle": "",
|
||||
})
|
||||
url = GetUrTitle(userId, urlTitle, "note")
|
||||
url = GetUrTitle(userId, urlTitle, "note", noteId)
|
||||
ok = db.UpdateByIdAndUserIdMap(db.Notes, noteId, userId, bson.M{
|
||||
"UrlTitle": url,
|
||||
})
|
||||
@@ -1036,7 +1036,7 @@ func (this *BlogService) UpdateSingleUrlTitle(userId, singleId, urlTitle string)
|
||||
"UrlTitle": "",
|
||||
})
|
||||
*/
|
||||
url = GetUrTitle(userId, urlTitle, "single")
|
||||
url = GetUrTitle(userId, urlTitle, "single", singleId)
|
||||
ok = db.UpdateByIdAndUserIdMap(db.BlogSingles, singleId, userId, bson.M{
|
||||
"UrlTitle": url,
|
||||
})
|
||||
@@ -1070,7 +1070,7 @@ func (this *BlogService) AddOrUpdateSingle(userId, singleId, title, content stri
|
||||
UserId: bson.ObjectIdHex(userId),
|
||||
Title: title,
|
||||
Content: content,
|
||||
UrlTitle: GetUrTitle(userId, title, "single"),
|
||||
UrlTitle: GetUrTitle(userId, title, "single", singleId),
|
||||
CreatedTime: time.Now(),
|
||||
}
|
||||
page.UpdatedTime = page.CreatedTime
|
||||
|
||||
@@ -577,6 +577,14 @@ func (this *ConfigService) GetUploadSize(key string) float64 {
|
||||
f, _ := strconv.ParseFloat(this.GetGlobalStringConfig(key), 64)
|
||||
return f
|
||||
}
|
||||
func (this *ConfigService) GetInt64(key string) int64 {
|
||||
f, _ := strconv.ParseInt(this.GetGlobalStringConfig(key), 10, 64)
|
||||
return f
|
||||
}
|
||||
func (this *ConfigService) GetInt32(key string) int32 {
|
||||
f, _ := strconv.ParseInt(this.GetGlobalStringConfig(key), 10, 32)
|
||||
return int32(f)
|
||||
}
|
||||
func (this *ConfigService) GetUploadSizeLimit() map[string]float64 {
|
||||
return map[string]float64{
|
||||
"uploadImageSize": this.GetUploadSize("uploadImageSize"),
|
||||
|
||||
@@ -242,6 +242,7 @@ func (this *FileService) GetFile(userId, fileId string) string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// 复制共享的笔记时, 复制其中的图片到我本地
|
||||
// 复制图片
|
||||
func (this *FileService) CopyImage(userId, fileId, toUserId string) (bool, string) {
|
||||
// 是否已经复制过了
|
||||
@@ -252,7 +253,6 @@ func (this *FileService) CopyImage(userId, fileId, toUserId string) (bool, strin
|
||||
}
|
||||
|
||||
// 复制之
|
||||
|
||||
file := info.File{}
|
||||
db.GetByIdAndUserId(db.Files, fileId, userId, &file)
|
||||
|
||||
@@ -261,18 +261,20 @@ func (this *FileService) CopyImage(userId, fileId, toUserId string) (bool, strin
|
||||
}
|
||||
|
||||
_, ext := SplitFilename(file.Name)
|
||||
newFilename := NewGuid() + ext
|
||||
guid := NewGuid()
|
||||
newFilename := guid + ext
|
||||
|
||||
dir := "files/" + toUserId + "/images"
|
||||
// TODO 统一目录格式
|
||||
// dir := "files/" + toUserId + "/images"
|
||||
dir := "files/" + GetRandomFilePath(toUserId, guid) + "/images"
|
||||
filePath := dir + "/" + newFilename
|
||||
err := os.MkdirAll(dir, 0755)
|
||||
err := os.MkdirAll(revel.BasePath+dir, 0755)
|
||||
if err != nil {
|
||||
return false, ""
|
||||
}
|
||||
|
||||
_, err = CopyFile(revel.BasePath+"/"+file.Path, revel.BasePath+"/"+filePath)
|
||||
if err != nil {
|
||||
Log(err)
|
||||
return false, ""
|
||||
}
|
||||
|
||||
|
||||
@@ -185,16 +185,16 @@ func (this *GroupService) AddUser(ownUserId, groupId, userId string) (ok bool, m
|
||||
// groupId是否是ownUserId的?
|
||||
/*
|
||||
if !this.IsExistsGroupUser(ownUserId, groupId) {
|
||||
return false, "forbidden"
|
||||
return false, "forbiddenNotMyGroup"
|
||||
}
|
||||
*/
|
||||
if !this.isMyGroup(ownUserId, groupId) {
|
||||
return false, "forbidden"
|
||||
return false, "forbiddenNotMyGroup"
|
||||
}
|
||||
|
||||
// 是否已存在
|
||||
if db.Has(db.GroupUsers, bson.M{"GroupId": bson.ObjectIdHex(groupId), "UserId": bson.ObjectIdHex(userId)}) {
|
||||
return false, "hasUsers"
|
||||
return false, "userExistsInGroup"
|
||||
}
|
||||
|
||||
return db.Insert(db.GroupUsers, info.GroupUser{
|
||||
@@ -210,11 +210,11 @@ func (this *GroupService) DeleteUser(ownUserId, groupId, userId string) (ok bool
|
||||
// groupId是否是ownUserId的?
|
||||
/*
|
||||
if !this.IsExistsGroupUser(ownUserId, groupId) {
|
||||
return false, "forbidden"
|
||||
return false, "forbiddenNotMyGroup"
|
||||
}
|
||||
*/
|
||||
if !this.isMyGroup(ownUserId, groupId) {
|
||||
return false, "forbidden"
|
||||
return false, "forbiddenNotMyGroup"
|
||||
}
|
||||
|
||||
// 删除该用户分享到本组的笔记本, 笔记
|
||||
|
||||
+223
-11
@@ -5,6 +5,8 @@ import (
|
||||
"github.com/leanote/leanote/app/info"
|
||||
. "github.com/leanote/leanote/app/lea"
|
||||
"gopkg.in/mgo.v2/bson"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -245,11 +247,14 @@ func (this *NoteService) AddNote(note info.Note, fromApi bool) info.Note {
|
||||
noteId := bson.NewObjectId()
|
||||
note.NoteId = noteId
|
||||
}
|
||||
note.CreatedTime = time.Now()
|
||||
note.UpdatedTime = note.CreatedTime
|
||||
|
||||
// 关于创建时间, 可能是客户端发来, 此时判断时间是否有
|
||||
note.CreatedTime = FixUrlTime(note.CreatedTime)
|
||||
note.UpdatedTime = FixUrlTime(note.UpdatedTime)
|
||||
|
||||
note.IsTrash = false
|
||||
note.UpdatedUserId = note.UserId
|
||||
note.UrlTitle = GetUrTitle(note.UserId.Hex(), note.Title, "note")
|
||||
note.UrlTitle = GetUrTitle(note.UserId.Hex(), note.Title, "note", note.NoteId.Hex())
|
||||
note.Usn = userService.IncrUsn(note.UserId.Hex())
|
||||
|
||||
notebookId := note.NotebookId.Hex()
|
||||
@@ -287,8 +292,10 @@ func (this *NoteService) AddSharedNote(note info.Note, myUserId bson.ObjectId) i
|
||||
// 添加笔记本内容
|
||||
// [ok]
|
||||
func (this *NoteService) AddNoteContent(noteContent info.NoteContent) info.NoteContent {
|
||||
noteContent.CreatedTime = time.Now()
|
||||
noteContent.UpdatedTime = noteContent.CreatedTime
|
||||
|
||||
noteContent.CreatedTime = FixUrlTime(noteContent.CreatedTime)
|
||||
noteContent.UpdatedTime = FixUrlTime(noteContent.UpdatedTime)
|
||||
|
||||
noteContent.UpdatedUserId = noteContent.UserId
|
||||
db.Insert(db.NoteContents, noteContent)
|
||||
|
||||
@@ -419,7 +426,15 @@ func (this *NoteService) UpdateNote(updatedUserId, noteId string, needUpdate bso
|
||||
}
|
||||
|
||||
needUpdate["UpdatedUserId"] = bson.ObjectIdHex(updatedUserId)
|
||||
|
||||
// 可以将时间传过来
|
||||
updatedTime, ok := needUpdate["UpdatedTime"].(time.Time)
|
||||
if ok {
|
||||
needUpdate["UpdatedTime"] = FixUrlTime(updatedTime)
|
||||
} else {
|
||||
needUpdate["UpdatedTime"] = time.Now()
|
||||
}
|
||||
|
||||
afterUsn := userService.IncrUsn(userId)
|
||||
needUpdate["Usn"] = afterUsn
|
||||
|
||||
@@ -443,7 +458,7 @@ func (this *NoteService) UpdateNote(updatedUserId, noteId string, needUpdate bso
|
||||
}
|
||||
}
|
||||
|
||||
ok := db.UpdateByIdAndUserIdMap(db.Notes, noteId, userId, needUpdate)
|
||||
ok = db.UpdateByIdAndUserIdMap(db.Notes, noteId, userId, needUpdate)
|
||||
if !ok {
|
||||
return ok, "", 0
|
||||
}
|
||||
@@ -460,14 +475,19 @@ func (this *NoteService) UpdateNote(updatedUserId, noteId string, needUpdate bso
|
||||
notebookId := notebookIdI.(bson.ObjectId)
|
||||
if notebookId != "" {
|
||||
notebookService.ReCountNotebookNumberNotes(note.NotebookId.Hex())
|
||||
hasRecount = true
|
||||
notebookService.ReCountNotebookNumberNotes(notebookId.Hex())
|
||||
hasRecount = true
|
||||
}
|
||||
}
|
||||
|
||||
// 不要多次更新, isTrash = false, = true都要重新统计
|
||||
if isTrashI, ok := needUpdate["IsTrash"]; ok {
|
||||
// 如果是垃圾, 则删除之共享
|
||||
isTrash := isTrashI.(bool)
|
||||
if isTrash {
|
||||
shareService.DeleteShareNoteAll(noteId, userId)
|
||||
}
|
||||
if !hasRecount {
|
||||
if _, ok := needUpdate["IsTrash"]; ok {
|
||||
notebookService.ReCountNotebookNumberNotes(note.NotebookId.Hex())
|
||||
}
|
||||
}
|
||||
@@ -507,7 +527,9 @@ func (this *NoteService) UpdateNoteTitle(userId, updatedUserId, noteId, title st
|
||||
// [ok] TODO perm未测
|
||||
// hasBeforeUpdateNote 之前是否更新过note其它信息, 如果有更新, usn不用更新
|
||||
// TODO abstract这里生成
|
||||
func (this *NoteService) UpdateNoteContent(updatedUserId, noteId, content, abstract string, hasBeforeUpdateNote bool, usn int) (bool, string, int) {
|
||||
func (this *NoteService) UpdateNoteContent(updatedUserId, noteId, content, abstract string,
|
||||
hasBeforeUpdateNote bool,
|
||||
usn int, updatedTime time.Time) (bool, string, int) {
|
||||
// 是否已自定义
|
||||
note := this.GetNoteById(noteId)
|
||||
if note.NoteId == "" {
|
||||
@@ -522,11 +544,13 @@ func (this *NoteService) UpdateNoteContent(updatedUserId, noteId, content, abstr
|
||||
}
|
||||
}
|
||||
|
||||
updatedTime = FixUrlTime(updatedTime)
|
||||
|
||||
// abstract重置
|
||||
data := bson.M{"UpdatedUserId": bson.ObjectIdHex(updatedUserId),
|
||||
"Content": content,
|
||||
"Abstract": abstract,
|
||||
"UpdatedTime": time.Now()}
|
||||
"UpdatedTime": updatedTime}
|
||||
|
||||
if note.IsBlog && note.HasSelfDefined {
|
||||
delete(data, "Abstract")
|
||||
@@ -788,7 +812,11 @@ func (this *NoteService) searchNoteFromContent(notes []info.Note, userId, key st
|
||||
noteIds[i] = note.NoteId
|
||||
}
|
||||
noteContents := []info.NoteContent{}
|
||||
query := bson.M{"_id": bson.M{"$nin": noteIds}, "UserId": bson.ObjectIdHex(userId), "Content": bson.M{"$regex": bson.RegEx{".*?" + key + ".*", "i"}}}
|
||||
query := bson.M{
|
||||
"_id": bson.M{"$nin": noteIds},
|
||||
"UserId": bson.ObjectIdHex(userId),
|
||||
"Content": bson.M{"$regex": bson.RegEx{".*?" + key + ".*", "i"}},
|
||||
}
|
||||
if isBlog {
|
||||
query["IsBlog"] = true
|
||||
}
|
||||
@@ -895,3 +923,187 @@ func (this *NoteService) UpdateNoteToDeleteTag(userId string, targetTag string)
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
// api
|
||||
|
||||
// 得到笔记的内容, 此时将笔记内的链接转成标准的Leanote Url
|
||||
// 将笔记的图片, 附件链接转换成 site.url/file/getImage?fileId=xxx, site.url/file/getAttach?fileId=xxxx
|
||||
func (this *NoteService) FixContentBad(content string, isMarkdown bool) string {
|
||||
baseUrl := configService.GetSiteUrl()
|
||||
|
||||
baseUrlPattern := baseUrl
|
||||
|
||||
// 避免https的url
|
||||
if baseUrl[0:8] == "https://" {
|
||||
baseUrlPattern = strings.Replace(baseUrl, "https://", "https*://", 1)
|
||||
} else {
|
||||
baseUrlPattern = strings.Replace(baseUrl, "http://", "https*://", 1)
|
||||
}
|
||||
|
||||
patterns := []map[string]string{
|
||||
map[string]string{"src": "src", "middle": "/file/outputImage", "param": "fileId", "to": "getImage?fileId="},
|
||||
map[string]string{"src": "href", "middle": "/attach/download", "param": "attachId", "to": "getAttach?fileId="},
|
||||
// 该链接已失效, 不再支持
|
||||
map[string]string{"src": "href", "middle": "/attach/downloadAll", "param": "noteId", "to": "getAllAttachs?noteId="},
|
||||
}
|
||||
|
||||
for _, eachPattern := range patterns {
|
||||
|
||||
if !isMarkdown {
|
||||
|
||||
// 富文本处理
|
||||
|
||||
// <img src="http://leanote.com/file/outputImage?fileId=5503537b38f4111dcb0000d1">
|
||||
// <a href="http://leanote.com/attach/download?attachId=5504243a38f4111dcb00017d"></a>
|
||||
|
||||
var reg *regexp.Regexp
|
||||
if eachPattern["src"] == "src" {
|
||||
reg, _ = regexp.Compile("<img(?:[^>]+?)(" + eachPattern["src"] + `=['"]*` + baseUrlPattern + eachPattern["middle"] + `\?` + eachPattern["param"] + `=([a-z0-9A-Z]{24})["']*)[^>]*>`)
|
||||
} else {
|
||||
reg, _ = regexp.Compile("<a(?:[^>]+?)(" + eachPattern["src"] + `=['"]*` + baseUrlPattern + eachPattern["middle"] + `\?` + eachPattern["param"] + `=([a-z0-9A-Z]{24})["']*)[^>]*>`)
|
||||
}
|
||||
|
||||
finds := reg.FindAllStringSubmatch(content, -1) // 查找所有的
|
||||
|
||||
for _, eachFind := range finds {
|
||||
if len(eachFind) == 3 {
|
||||
// 这一行会非常慢!, content是全部的内容, 多次replace导致
|
||||
content = strings.Replace(content,
|
||||
eachFind[1],
|
||||
eachPattern["src"]+"=\""+baseUrl+"/api/file/"+eachPattern["to"]+eachFind[2]+"\"",
|
||||
1)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
// markdown处理
|
||||
// 
|
||||
// [selection 2.html](http://leanote.com/attach/download?attachId=5504262638f4111dcb00017f)
|
||||
// [all.tar.gz](http://leanote.com/attach/downloadAll?noteId=5503b57d59f81b4eb4000000)
|
||||
|
||||
pre := "!" // 默认图片
|
||||
if eachPattern["src"] == "href" { // 是attach
|
||||
pre = ""
|
||||
}
|
||||
|
||||
regImageMarkdown, _ := regexp.Compile(pre + `\[([^]]*?)\]\(` + baseUrlPattern + eachPattern["middle"] + `\?` + eachPattern["param"] + `=([a-z0-9A-Z]{24})\)`)
|
||||
findsImageMarkdown := regImageMarkdown.FindAllStringSubmatch(content, -1) // 查找所有的
|
||||
// [[ 5503537b38f4111dcb0000d1] [ 5503537b38f4111dcb0000d1]]
|
||||
for _, eachFind := range findsImageMarkdown {
|
||||
// [ 你好啊, 我很好, 为什么? 5503537b38f4111dcb0000d1]
|
||||
if len(eachFind) == 3 {
|
||||
content = strings.Replace(content, eachFind[0], pre+"["+eachFind[1]+"]("+baseUrl+"/api/file/"+eachPattern["to"]+eachFind[2]+")", 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return content
|
||||
}
|
||||
|
||||
// 性能更好, 5倍的差距
|
||||
func (this *NoteService) FixContent(content string, isMarkdown bool) string {
|
||||
baseUrl := configService.GetSiteUrl()
|
||||
|
||||
baseUrlPattern := baseUrl
|
||||
|
||||
// 避免https的url
|
||||
if baseUrl[0:8] == "https://" {
|
||||
baseUrlPattern = strings.Replace(baseUrl, "https://", "https*://", 1)
|
||||
} else {
|
||||
baseUrlPattern = strings.Replace(baseUrl, "http://", "https*://", 1)
|
||||
}
|
||||
|
||||
patterns := []map[string]string{
|
||||
map[string]string{"src": "src", "middle": "/file/outputImage", "param": "fileId", "to": "getImage?fileId="},
|
||||
map[string]string{"src": "href", "middle": "/attach/download", "param": "attachId", "to": "getAttach?fileId="},
|
||||
// 该链接已失效, 不再支持
|
||||
map[string]string{"src": "href", "middle": "/attach/downloadAll", "param": "noteId", "to": "getAllAttachs?noteId="},
|
||||
}
|
||||
|
||||
for _, eachPattern := range patterns {
|
||||
|
||||
if !isMarkdown {
|
||||
|
||||
// 富文本处理
|
||||
|
||||
// <img src="http://leanote.com/file/outputImage?fileId=5503537b38f4111dcb0000d1">
|
||||
// <a href="http://leanote.com/attach/download?attachId=5504243a38f4111dcb00017d"></a>
|
||||
|
||||
var reg *regexp.Regexp
|
||||
var reg2 *regexp.Regexp
|
||||
if eachPattern["src"] == "src" {
|
||||
reg, _ = regexp.Compile("<img(?:[^>]+?)(?:" + eachPattern["src"] + `=['"]*` + baseUrlPattern + eachPattern["middle"] + `\?` + eachPattern["param"] + `=(?:[a-z0-9A-Z]{24})["']*)[^>]*>`)
|
||||
reg2, _ = regexp.Compile("<img(?:[^>]+?)(" + eachPattern["src"] + `=['"]*` + baseUrlPattern + eachPattern["middle"] + `\?` + eachPattern["param"] + `=([a-z0-9A-Z]{24})["']*)[^>]*>`)
|
||||
} else {
|
||||
reg, _ = regexp.Compile("<a(?:[^>]+?)(?:" + eachPattern["src"] + `=['"]*` + baseUrlPattern + eachPattern["middle"] + `\?` + eachPattern["param"] + `=(?:[a-z0-9A-Z]{24})["']*)[^>]*>`)
|
||||
reg2, _ = regexp.Compile("<a(?:[^>]+?)(" + eachPattern["src"] + `=['"]*` + baseUrlPattern + eachPattern["middle"] + `\?` + eachPattern["param"] + `=([a-z0-9A-Z]{24})["']*)[^>]*>`)
|
||||
}
|
||||
|
||||
content = reg.ReplaceAllStringFunc(content, func(str string) string {
|
||||
// str=这样的
|
||||
// <img src="http://localhost:9000/file/outputImage?fileId=563d706e99c37b48e0000001" alt="" data-mce-src="http://localhost:9000/file/outputImage?fileId=563d706e99c37b48e0000002">
|
||||
|
||||
eachFind := reg2.FindStringSubmatch(str)
|
||||
str = strings.Replace(str,
|
||||
eachFind[1],
|
||||
eachPattern["src"]+"=\""+baseUrl+"/api/file/"+eachPattern["to"]+eachFind[2]+"\"",
|
||||
1)
|
||||
|
||||
// fmt.Println(str)
|
||||
return str
|
||||
})
|
||||
/*
|
||||
finds := reg.FindAllStringSubmatch(content, -1) // 查找所有的
|
||||
|
||||
for _, eachFind := range finds {
|
||||
if len(eachFind) == 3 {
|
||||
// 这一行会非常慢!, content是全部的内容, 多次replace导致
|
||||
content = strings.Replace(content,
|
||||
eachFind[1],
|
||||
eachPattern["src"]+"=\""+baseUrl+"/api/file/"+eachPattern["to"]+eachFind[2]+"\"",
|
||||
1)
|
||||
}
|
||||
}
|
||||
*/
|
||||
} else {
|
||||
|
||||
// markdown处理
|
||||
// 
|
||||
// [selection 2.html](http://leanote.com/attach/download?attachId=5504262638f4111dcb00017f)
|
||||
// [all.tar.gz](http://leanote.com/attach/downloadAll?noteId=5503b57d59f81b4eb4000000)
|
||||
|
||||
pre := "!" // 默认图片
|
||||
if eachPattern["src"] == "href" { // 是attach
|
||||
pre = ""
|
||||
}
|
||||
|
||||
regImageMarkdown, _ := regexp.Compile(pre + `\[(?:[^]]*?)\]\(` + baseUrlPattern + eachPattern["middle"] + `\?` + eachPattern["param"] + `=(?:[a-z0-9A-Z]{24})\)`)
|
||||
regImageMarkdown2, _ := regexp.Compile(pre + `\[([^]]*?)\]\(` + baseUrlPattern + eachPattern["middle"] + `\?` + eachPattern["param"] + `=([a-z0-9A-Z]{24})\)`)
|
||||
|
||||
content = regImageMarkdown.ReplaceAllStringFunc(content, func(str string) string {
|
||||
// str=这样的
|
||||
// <img src="http://localhost:9000/file/outputImage?fileId=563d706e99c37b48e0000001" alt="" data-mce-src="http://localhost:9000/file/outputImage?fileId=563d706e99c37b48e0000002">
|
||||
|
||||
eachFind := regImageMarkdown2.FindStringSubmatch(str)
|
||||
str = strings.Replace(str, eachFind[0], pre+"["+eachFind[1]+"]("+baseUrl+"/api/file/"+eachPattern["to"]+eachFind[2]+")", 1)
|
||||
|
||||
// fmt.Println(str)
|
||||
return str
|
||||
})
|
||||
|
||||
/*
|
||||
findsImageMarkdown := regImageMarkdown.FindAllStringSubmatch(content, -1) // 查找所有的
|
||||
// [[ 5503537b38f4111dcb0000d1] [ 5503537b38f4111dcb0000d1]]
|
||||
for _, eachFind := range findsImageMarkdown {
|
||||
// [ 你好啊, 我很好, 为什么? 5503537b38f4111dcb0000d1]
|
||||
if len(eachFind) == 3 {
|
||||
content = strings.Replace(content, eachFind[0], pre+"["+eachFind[1]+"]("+baseUrl+"/api/file/"+eachPattern["to"]+eachFind[2]+")", 1)
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
return content
|
||||
}
|
||||
@@ -156,9 +156,13 @@ func (this *NotebookService) GetNotebooksByNotebookIds(notebookIds []bson.Object
|
||||
}
|
||||
|
||||
// 添加
|
||||
// [ok]
|
||||
func (this *NotebookService) AddNotebook(notebook info.Notebook) (bool, info.Notebook) {
|
||||
notebook.UrlTitle = GetUrTitle(notebook.UserId.Hex(), notebook.Title, "notebook")
|
||||
|
||||
if notebook.NotebookId == "" {
|
||||
notebook.NotebookId = bson.NewObjectId()
|
||||
}
|
||||
|
||||
notebook.UrlTitle = GetUrTitle(notebook.UserId.Hex(), notebook.Title, "notebook", notebook.NotebookId.Hex())
|
||||
notebook.Usn = userService.IncrUsn(notebook.UserId.Hex())
|
||||
now := time.Now()
|
||||
notebook.CreatedTime = now
|
||||
|
||||
@@ -34,6 +34,7 @@ func (this *PwdService) FindPwd(email string) (ok bool, msg string) {
|
||||
return
|
||||
}
|
||||
|
||||
// 重置密码时
|
||||
// 修改密码
|
||||
// 先验证
|
||||
func (this *PwdService) UpdatePwd(token, pwd string) (bool, string) {
|
||||
@@ -45,11 +46,12 @@ func (this *PwdService) UpdatePwd(token, pwd string) (bool, string) {
|
||||
if ok, msg, tokenInfo = tokenService.VerifyToken(token, info.TokenPwd); !ok {
|
||||
return ok, msg
|
||||
}
|
||||
digest, err := GenerateHash(pwd)
|
||||
if err != nil {
|
||||
|
||||
passwd := GenPwd(pwd)
|
||||
if passwd == "" {
|
||||
return false, "GenerateHash error"
|
||||
}
|
||||
passwd := string(digest)
|
||||
|
||||
// 修改密码之
|
||||
ok = db.UpdateByQField(db.Users, bson.M{"_id": tokenInfo.UserId}, "Pwd", passwd)
|
||||
|
||||
|
||||
@@ -470,7 +470,8 @@ func (this *ShareService) GetShareNoteContent(noteId, myUserId, sharedUserId str
|
||||
// 或者, 其notebook共享了我
|
||||
// Log(this.HasSharedNote(noteId, myUserId))
|
||||
// Log(this.HasSharedNotebook(noteId, myUserId, sharedUserId))
|
||||
Log(this.HasReadPerm(sharedUserId, myUserId, noteId))
|
||||
// Log(this.HasReadPerm(sharedUserId, myUserId, noteId))
|
||||
|
||||
if this.HasReadPerm(sharedUserId, myUserId, noteId) {
|
||||
// if this.HasSharedNote(noteId, myUserId) || this.HasSharedNotebook(noteId, myUserId, sharedUserId) {
|
||||
db.Get(db.NoteContents, noteId, ¬eContent)
|
||||
|
||||
@@ -618,8 +618,6 @@ func (this *ThemeService) hasRound(vector [][]int, size int) (ok bool) {
|
||||
for i := 0; i < size; i++ {
|
||||
visited := make([]int, size)
|
||||
if this.hasRoundEach(vector, i, size, visited) {
|
||||
Log(">>")
|
||||
Log(i)
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -629,8 +627,6 @@ func (this *ThemeService) hasRound(vector [][]int, size int) (ok bool) {
|
||||
// 从每个节点出发, 判断是否有环
|
||||
func (this *ThemeService) hasRoundEach(vector [][]int, index int, size int, visited []int) (ok bool) {
|
||||
if visited[index] > 0 {
|
||||
Log("<")
|
||||
Log(index)
|
||||
return true
|
||||
}
|
||||
visited[index] = 1
|
||||
|
||||
@@ -85,6 +85,9 @@ func (this *TrashService) DeleteTrash(noteId, userId string) bool {
|
||||
// delete content
|
||||
ok = db.DeleteByIdAndUserId(db.NoteContents, noteId, userId)
|
||||
|
||||
// 删除content history
|
||||
ok = db.DeleteByIdAndUserId(db.NoteContentHistories, noteId, userId)
|
||||
|
||||
// 重新统计tag's count
|
||||
// TODO 这里会改变tag's Usn
|
||||
tagService.reCountTagCount(userId, note.Tags)
|
||||
@@ -115,6 +118,13 @@ func (this *TrashService) DeleteTrashApi(noteId, userId string, usn int) (bool,
|
||||
// delete content
|
||||
ok = db.DeleteByIdAndUserId(db.NoteContents, noteId, userId)
|
||||
|
||||
// 删除content history
|
||||
ok = db.DeleteByIdAndUserId(db.NoteContentHistories, noteId, userId)
|
||||
|
||||
// 一个BUG, iOS删除直接调用这个API, 结果没有重新recount
|
||||
// recount notebooks' notes number
|
||||
notebookService.ReCountNotebookNumberNotes(note.NotebookId.Hex())
|
||||
|
||||
return ok, "", afterUsn
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ func (this *UpgradeService) UpgradeBetaToBeta2(userId string) (ok bool, msg stri
|
||||
data["RecommendTime"] = note.UpdatedTime
|
||||
Log("Time " + noteId)
|
||||
}
|
||||
data["UrlTitle"] = GetUrTitle(note.UserId.Hex(), note.Title, "note")
|
||||
data["UrlTitle"] = GetUrTitle(note.UserId.Hex(), note.Title, "note", noteId)
|
||||
db.UpdateByIdAndUserIdMap2(db.Notes, note.NoteId, note.UserId, data)
|
||||
Log(noteId)
|
||||
}
|
||||
@@ -77,7 +77,7 @@ func (this *UpgradeService) UpgradeBetaToBeta2(userId string) (ok bool, msg stri
|
||||
for _, notebook := range notebooks {
|
||||
notebookId := notebook.NotebookId.Hex()
|
||||
data := bson.M{}
|
||||
data["UrlTitle"] = GetUrTitle(notebook.UserId.Hex(), notebook.Title, "notebook")
|
||||
data["UrlTitle"] = GetUrTitle(notebook.UserId.Hex(), notebook.Title, "notebook", notebookId)
|
||||
db.UpdateByIdAndUserIdMap2(db.Notebooks, notebook.NotebookId, notebook.UserId, data)
|
||||
Log(notebookId)
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ func (this *UserService) AddUser(user info.User) bool {
|
||||
go func() {
|
||||
emailService.RegisterSendActiveEmail(user, user.Email)
|
||||
// 发送给我 life@leanote.com
|
||||
emailService.SendEmail("life@leanote.com", "新增用户", "{header}用户名"+user.Email+"{footer}")
|
||||
// emailService.SendEmail("life@leanote.com", "新增用户", "{header}用户名"+user.Email+"{footer}")
|
||||
}()
|
||||
}
|
||||
|
||||
@@ -412,26 +412,6 @@ func (this *UserService) UpdateEmail(token string) (ok bool, msg, email string)
|
||||
return
|
||||
}
|
||||
|
||||
//---------
|
||||
// 第三方添加账号
|
||||
func (this *UserService) ThirdAddUser(userId, email, pwd string) (ok bool, msg string) {
|
||||
// 判断该用户是否已有了帐户
|
||||
userInfo := this.GetUserInfo(userId)
|
||||
if userInfo.Email != "" {
|
||||
msg = "你已有帐户"
|
||||
return
|
||||
}
|
||||
|
||||
// 判断email是否存在
|
||||
if this.IsExistsUser(email) {
|
||||
msg = "该用户已存在"
|
||||
return
|
||||
}
|
||||
|
||||
ok = db.UpdateByQMap(db.Users, bson.M{"_id": bson.ObjectIdHex(userId)}, bson.M{"Email": email, "Pwd": Md5(pwd)})
|
||||
return
|
||||
}
|
||||
|
||||
//------------
|
||||
// 偏好设置
|
||||
|
||||
|
||||
+18
-1
@@ -2,6 +2,7 @@ package service
|
||||
|
||||
import (
|
||||
"github.com/leanote/leanote/app/db"
|
||||
. "github.com/leanote/leanote/app/lea"
|
||||
"gopkg.in/mgo.v2"
|
||||
"gopkg.in/mgo.v2/bson"
|
||||
"net/url"
|
||||
@@ -150,12 +151,28 @@ func getUniqueUrlTitle(userId string, urlTitle string, types string, padding int
|
||||
return urlTitle2
|
||||
}
|
||||
|
||||
// 截取id 24位变成12位
|
||||
// 先md5, 再取12位
|
||||
func subIdHalf(id string) string {
|
||||
idMd5 := Md5(id)
|
||||
return idMd5[:12]
|
||||
}
|
||||
|
||||
// types == note,notebook,single
|
||||
func GetUrTitle(userId string, title string, types string) string {
|
||||
// id noteId, notebookId, singleId 当title没的时候才有用, 用它来替换
|
||||
func GetUrTitle(userId string, title string, types string, id string) string {
|
||||
urlTitle := strings.Trim(title, " ")
|
||||
if urlTitle == "" {
|
||||
if id == "" {
|
||||
urlTitle = "Untitled-" + userId
|
||||
} else {
|
||||
urlTitle = subIdHalf(id)
|
||||
}
|
||||
// 不允许title是ObjectId
|
||||
} else if bson.IsObjectIdHex(title) {
|
||||
urlTitle = subIdHalf(id)
|
||||
}
|
||||
|
||||
urlTitle = fixUrlTitle(urlTitle)
|
||||
return getUniqueUrlTitle(userId, urlTitle, types, 1)
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<section id="box" class="animated fadeInUp">
|
||||
<div>
|
||||
<h1 id="logo">leanote</h1>
|
||||
<h1 id="logo">Leanote</h1>
|
||||
<div id="boxForm">
|
||||
<div id="boxHeader">{{msg . "findPassword"}}</div>
|
||||
<form>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<section id="box" class="animated fadeInUp">
|
||||
<div>
|
||||
<h1 id="logo">leanote</h1>
|
||||
<h1 id="logo">Leanote</h1>
|
||||
<div id="boxForm">
|
||||
<div id="boxHeader">{{msg . "updatePassword"}}</div>
|
||||
<form>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<section id="box" class="animated fadeInUp">
|
||||
<div>
|
||||
<h1 id="logo">leanote</h1>
|
||||
<h1 id="logo">Leanote</h1>
|
||||
<div id="boxForm">
|
||||
<div id="boxHeader">{{msg . "findPasswordTimeout"}}</div>
|
||||
<form>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<h2>Join Us</h2>
|
||||
<a href="https://github.com/leanote/leanote">Github Leanote</a>
|
||||
<br />
|
||||
QQ Group: 158716820, 158716820
|
||||
QQ Group: <span id="qqGrup">256076853, <s>158716820</s></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</div>
|
||||
-->
|
||||
<div>
|
||||
<h1 id="logo">leanote</h1>
|
||||
<h1 id="logo">Leanote</h1>
|
||||
<div id="boxForm">
|
||||
<div id="boxHeader">{{msg . "login"}}</div>
|
||||
<form>
|
||||
@@ -134,12 +134,6 @@ $(function() {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// github
|
||||
$("#github").click(function() {
|
||||
$(this).button("loading");
|
||||
location.href="https://github.com/login/oauth/authorize?access_type=&approval_prompt=&client_id=3790fbf1fc14bc6c5d85&redirect_uri=http%3A%2F%2Fleanote.com%2Foauth%2FgithubCallback&response_type=code&scope=user&state=";
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
</div>
|
||||
-->
|
||||
<div>
|
||||
<h1 id="logo">leanote</h1>
|
||||
<h1 id="logo">Leanote</h1>
|
||||
<div id="boxForm">
|
||||
<div id="boxHeader">{{msg . "register"}}</div>
|
||||
<form>
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
{{end}}
|
||||
</h3></div>
|
||||
|
||||
<link rel="stylesheet" href="/tinymce/skins/custom/skin.min.css" type="text/css">
|
||||
<link rel="stylesheet" href="/css/tinymce/skin.min.css" type="text/css">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-10">
|
||||
<form id="formData">
|
||||
@@ -28,8 +29,10 @@
|
||||
|
||||
<div class="form-group">
|
||||
<label for="content1">{{msg . "content"}}</label>
|
||||
<div id="popularToolbar"></div>
|
||||
<textarea id="content1" name="content">{{.single.Content}}</textarea>
|
||||
<div class="toolbar-content">
|
||||
<div id="popularToolbar" class="tool-bar"></div>
|
||||
<div id="content1" class="content-ctn" name="content">{{if .single}}{{.single.Content|raw}}{{end}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="panel-footer text-right bg-light lter">
|
||||
@@ -40,28 +43,17 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<style>
|
||||
.mce-btn.mce-active, .mce-btn.mce-active:hover {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
.mce-btn {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
</style>
|
||||
{{template "member/footer.html" .}}
|
||||
<script type="text/javascript" src="/tinymce/tinymce.js"></script>
|
||||
<script>
|
||||
var urlPrefix = "{{.siteUrl}}";
|
||||
var LeaAce = {nowIsInAce: function() {return false;}};
|
||||
var LeaAce = null;
|
||||
$(function() {
|
||||
tinymce.init({
|
||||
inline: true,
|
||||
selector : "#content1",
|
||||
content_css : ["/css/editor/editor.css" ],
|
||||
theme : "leanote",
|
||||
theme: 'leanote',
|
||||
language : "{{.locale}}",
|
||||
height : 300,
|
||||
width : "100%",
|
||||
// skin : "custom",
|
||||
plugins : [
|
||||
"advlist autolink link lists charmap hr ",
|
||||
"searchreplace visualblocks visualchars tabfocus",
|
||||
@@ -95,12 +87,12 @@ $(function() {
|
||||
ajaxPost("/member/blog/doAddOrUpdateSingle/", data, function(re) {
|
||||
if(reIsOk(re)) {
|
||||
// 添加成功后, 跳转之
|
||||
art.tips("Success")
|
||||
art.tips(getMsg("Success"));
|
||||
if(!data.pageId) {
|
||||
location.href = "/member/blog/single";
|
||||
}
|
||||
} else {
|
||||
art.alert(re.Msg || "error")
|
||||
art.alert(re.Msg || getMsg("Error"));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -69,7 +69,6 @@
|
||||
|
||||
</div>
|
||||
{{template "member/footer.html" .}}
|
||||
<script type="text/javascript" src="/tinymce/tinymce.min.js"></script>
|
||||
<script>
|
||||
var urlPrefix = "{{.siteUrl}}";
|
||||
$(function() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "cate"}}</h3></div>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "Category"}}</h3></div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
@@ -46,9 +46,9 @@ $(function() {
|
||||
});
|
||||
ajaxPost("/member/blog/upateCateIds", {cateIds: ids}, function(re){
|
||||
if(reIsOk(re)) {
|
||||
art.tips("Success");
|
||||
art.tips(getMsg("Success"));
|
||||
} else {
|
||||
art.alert(re.Msg || "error");
|
||||
art.alert(re.Msg || getMsg("Error"));
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -61,7 +61,7 @@ $(function() {
|
||||
if(reIsOk(re)) {
|
||||
$t.val(re.Item);
|
||||
} else {
|
||||
art.alert(re.Msg || "error");
|
||||
art.alert(re.Msg || getMsg("Error"));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"><h3 class="m-b-none">{{msg . "postList"}}</h3></div>
|
||||
<div class="m-b-md"><h3 class="m-b-none">{{msg . "Posts"}}</h3></div>
|
||||
<style>
|
||||
.url-title {
|
||||
width: 260px;
|
||||
@@ -15,7 +15,7 @@
|
||||
<div class="input-group search-group">
|
||||
<input type="text" class="input-sm form-control" placeholder="{{msg . "title"}}" id="keywords" value="{{.keywords}}" />
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-sm btn-default" type="button" data-url="/member/blog/index">Search</button>
|
||||
<button class="btn btn-sm btn-default" type="button" data-url="/member/blog/index">{{leaMsg $ "Search"}}</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -92,7 +92,7 @@
|
||||
{{end}}
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{$.userAndBlog.PostUrl}}/{{$.urlTitle}}" class="post" target="_blank">{{.Title|raw}}</a>
|
||||
<a href="{{$.userAndBlog.PostUrl}}/{{$.urlTitle}}" class="post" target="_blank">{{.Title}}</a>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "single"}}</h3></div>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "Single"}}</h3></div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
@@ -47,22 +47,22 @@ $(function() {
|
||||
});
|
||||
ajaxPost("/member/blog/sortSingles", {singleIds: ids}, function(re){
|
||||
if(reIsOk(re)) {
|
||||
art.tips("Success");
|
||||
art.tips(getMsg("Success"));
|
||||
} else {
|
||||
art.alert(re.Msg || "error");
|
||||
art.alert(re.Msg || getMsg("Error"));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(".page-delete").click(function() {
|
||||
var singleId = $(this).data('id');
|
||||
art.confirm("Are you sure ?", function() {
|
||||
art.confirm(getMsg("Are you sure ?"), function() {
|
||||
ajaxPost("/member/blog/deleteSingle", {singleId: singleId}, function(re){
|
||||
if(reIsOk(re)) {
|
||||
art.tips("Success");
|
||||
art.tips(getMsg("Success"));
|
||||
location.reload();
|
||||
} else {
|
||||
art.alert(re.Msg || "error");
|
||||
art.alert(re.Msg || getMsg("Error"));
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -76,7 +76,7 @@ $(function() {
|
||||
if(reIsOk(re)) {
|
||||
$t.val(re.Item);
|
||||
} else {
|
||||
art.alert(re.Msg || "error");
|
||||
art.alert(re.Msg || getMsg("Error"));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md clearfix">
|
||||
<h3 class="m-b-none">
|
||||
{{msg . "themeSet"}}
|
||||
{{msg . "theme"}}
|
||||
<small>
|
||||
(<a href="http://blog.leanote.com/post/545f1a5c380782565e000000" target="_blank">{{msg . "needHelp"}}</a>
|
||||
<a target="_blank" href="https://github.com/leanote/leanote/wiki/leanote-blog-theme-api">Leanote Blog Theme Api</a>)
|
||||
@@ -138,7 +138,7 @@
|
||||
|
||||
</div>
|
||||
{{template "member/footer.html" .}}
|
||||
<script src="/js/require.js"></script>
|
||||
|
||||
<script>
|
||||
var urlPrefix = "{{.siteUrl}}";
|
||||
$(function() {
|
||||
@@ -169,7 +169,7 @@ $(".btn-export").click(function() {
|
||||
$(".btn-delete").click(function() {
|
||||
var id = $(this).parent().data('id');
|
||||
var t = $(this);
|
||||
art.confirm("Are you sure ?", function() {
|
||||
art.confirm(getMsg("Are you sure ?"), function() {
|
||||
t.button("loading");
|
||||
ajaxPost("/member/blog/deleteTheme", {themeId: id}, function(re) {
|
||||
t.button("reset");
|
||||
@@ -187,15 +187,15 @@ $(".btn-delete").click(function() {
|
||||
$(".btn-install").click(function() {
|
||||
var id = $(this).parent().data('id');
|
||||
var t = $(this);
|
||||
art.confirm("Are you sure ?", function() {
|
||||
art.confirm(getMsg("Are you sure to install it ?"), function() {
|
||||
t.button("loading");
|
||||
ajaxPost("/member/blog/installTheme", {themeId: id}, function(re) {
|
||||
t.button("reset");
|
||||
if(reIsOk(re)) {
|
||||
art.tips("Success");
|
||||
art.tips(getMsg("Success"));
|
||||
location.reload();
|
||||
} else {
|
||||
art.alert("Error");
|
||||
art.alert(getMsg("Error"));
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -206,15 +206,15 @@ $(".btn-install").click(function() {
|
||||
$(".btn-public").click(function() {
|
||||
var id = $(this).parent().data('id');
|
||||
var t = $(this);
|
||||
art.confirm("Are you sure ?", function() {
|
||||
art.confirm(getMsg("Are you sure ?"), function() {
|
||||
t.button("loading");
|
||||
ajaxPost("/member/blog/publicTheme", {themeId: id}, function(re) {
|
||||
t.button("reset");
|
||||
if(reIsOk(re)) {
|
||||
art.tips("Success");
|
||||
art.tips(getMsg("Success"));
|
||||
location.reload();
|
||||
} else {
|
||||
art.alert("Error");
|
||||
art.alert(getMsg("Error"));
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -222,19 +222,17 @@ $(".btn-public").click(function() {
|
||||
{{end}}
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<script src="/js/require.js"></script>
|
||||
<script>
|
||||
// 导入主题
|
||||
require.config({
|
||||
baseUrl: '/public',
|
||||
paths: {
|
||||
'import_theme': 'js/app/import_theme',
|
||||
'jquery.ui.widget': 'tinymce/plugins/leaui_image/public/js/jquery.ui.widget',
|
||||
'fileupload': '/tinymce/plugins/leaui_image/public/js/jquery.fileupload',
|
||||
'iframe-transport': '/tinymce/plugins/leaui_image/public/js/jquery.iframe-transport'
|
||||
'import_theme': 'member/js/import_theme',
|
||||
'fileupload': 'js/plugins/libs-min/fileupload',
|
||||
},
|
||||
shim: {
|
||||
'fileupload': {deps: ['jquery.ui.widget', 'iframe-transport']}
|
||||
}
|
||||
});
|
||||
$(function() {
|
||||
require(['import_theme'], function(import_theme) {});
|
||||
|
||||
@@ -7,38 +7,46 @@
|
||||
</style>
|
||||
|
||||
<div class="m-b-md"> <h3 class="m-b-none">
|
||||
{{.note.Title}} - 摘要设置
|
||||
{{.note.Title}} - {{msg $ "setAbstract"}}
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<link rel="stylesheet" href="/tinymce/skins/custom/skin.min.css" type="text/css">
|
||||
<link rel="stylesheet" href="/css/tinymce/skin.min.css" type="text/css">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-10">
|
||||
<form id="formData">
|
||||
<section class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
以下内容设置后, 以后修改笔记时将不自动获取. 若将该文章取消为博客后, 以下内容会自动获取.
|
||||
|
||||
{{leaMsg . "Once the abstract has been updated, it will not set the abstract automatically other than you cancel it."}}
|
||||
|
||||
<hr />
|
||||
<div class="alert alert-danger" id="baseMsg" style="display: none"></div>
|
||||
<div class="form-group">
|
||||
|
||||
<div class="form-group" id="mainImg">
|
||||
<label>
|
||||
主图片
|
||||
<a class="btn btn-default btn-select-img">从笔记中自动获取下一张</a>
|
||||
{{leaMsg $ "Main Image"}}
|
||||
<a class="btn btn-default btn-select-img">
|
||||
{{leaMsg $ "Get next image as main image from content"}}
|
||||
</a>
|
||||
</label>
|
||||
<div>
|
||||
<div style="border: 2px dashed #ccc; padding: 5px;">
|
||||
<img src="{{.note.ImgSrc}}" class="img-src" id="imgSrc"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>描述</label>
|
||||
<label>{{leaMsg $ "Description" }}</label>
|
||||
<textarea type="text" rows="6" class="form-control" id="desc" name="desc">{{.note.Desc}}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="content1">摘要</label>
|
||||
<div id="popularToolbar"></div>
|
||||
<textarea id="content1" name="content">{{.note.Abstract}}</textarea>
|
||||
<label for="content1">{{leaMsg $ "Abstract"}}</label>
|
||||
<div class="toolbar-content">
|
||||
<div id="popularToolbar" class="tool-bar"></div>
|
||||
<div id="content1" class="content-ctn" name="content">{{raw .note.Abstract}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="panel-footer text-right bg-light lter">
|
||||
@@ -47,10 +55,15 @@
|
||||
|
||||
<div class="panel-body">
|
||||
<p>
|
||||
原文:
|
||||
{{leaMsg . "Raw Content"}}:
|
||||
<hr />
|
||||
</p>
|
||||
<div id="rawContent">
|
||||
{{if .note.IsMarkdown}}
|
||||
<pre>{{.note.Content|raw}}</pre>
|
||||
{{else}}
|
||||
{{.note.Content|raw}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -62,20 +75,18 @@
|
||||
<script type="text/javascript" src="/tinymce/tinymce.js"></script>
|
||||
<script>
|
||||
var UrlPrefix = "{{.siteUrl}}";
|
||||
var LeaAce = null;
|
||||
$(function() {
|
||||
tinymce.init({
|
||||
inline: true,
|
||||
selector : "#content1",
|
||||
content_css : [ "/css/bootstrap.css", "/css/editor/editor.css" ],
|
||||
skin : "custom",
|
||||
theme: 'leanote',
|
||||
language : "{{.locale}}",
|
||||
height : 300,
|
||||
width : "100%",
|
||||
skin : "custom",
|
||||
plugins : [
|
||||
"advlist autolink link leanote_image lists charmap hr ",
|
||||
"advlist autolink link lists charmap hr ",
|
||||
"searchreplace visualblocks visualchars tabfocus",
|
||||
"table contextmenu directionality textcolor paste fullpage textcolor"],
|
||||
toolbar1 : "formatselect |fontselect fontsizeselect| forecolor backcolor | bold italic underline strikethrough | bullist numlist",
|
||||
"table contextmenu directionality textcolor fullpage textcolor"],
|
||||
toolbar1 : "formatselect |fontselect fontsizeselect| forecolor backcolor | bold italic underline strikethrough | bullist numlist |",
|
||||
menubar : false,
|
||||
statusbar : false,
|
||||
font_formats : "Arial=arial,helvetica,sans-serif;"
|
||||
@@ -100,7 +111,7 @@ $(function() {
|
||||
}
|
||||
ajaxPost("/member/blog/doUpdateBlogAbstract/", data, function(re) {
|
||||
if(reIsOk(re)) {
|
||||
art.tips("Success");
|
||||
art.tips(getMsg("Success"));
|
||||
location.href = "/member/blog/index";
|
||||
} else {
|
||||
art.alert(re.Msg || "error")
|
||||
@@ -108,19 +119,39 @@ $(function() {
|
||||
});
|
||||
});
|
||||
|
||||
// 选择主图
|
||||
var $imgs = $("#rawContent").find("img");
|
||||
var imgLen = $imgs.length;
|
||||
var imgSeq = 0;
|
||||
var $imgSrc = $("#imgSrc");
|
||||
$(".btn-select-img").click(function() {
|
||||
if(imgLen == 0) {
|
||||
return;
|
||||
var isMarkdown = {{$.note.IsMarkdown}};
|
||||
|
||||
var images = [];
|
||||
if (isMarkdown) {
|
||||
var content = $('#rawContent').html();
|
||||
var reg = /!\[.*?\]\((.*)\)/g;
|
||||
var ret = reg.exec(content);
|
||||
while(ret) {
|
||||
images.push(ret[1]);
|
||||
ret = reg.exec(content);
|
||||
}
|
||||
// console.log(images);
|
||||
}
|
||||
// 选择主图
|
||||
$("#rawContent").find("img").each(function () {
|
||||
if($(this).attr('src')) {
|
||||
images.push($(this).attr('src'));
|
||||
}
|
||||
});;
|
||||
var imgLen = images.length;
|
||||
var imgSeq = 0;
|
||||
$imgSrc = $('#imgSrc');
|
||||
|
||||
if (imgLen) {
|
||||
$(".btn-select-img").click(function() {
|
||||
imgSeq++;
|
||||
imgSeq = imgSeq%imgLen;
|
||||
$imgSrc.attr("src", $imgs.eq(imgSeq).attr("src"));
|
||||
imgSeq = imgSeq % imgLen;
|
||||
$imgSrc.attr("src", images[imgSeq]);
|
||||
});
|
||||
}
|
||||
else {
|
||||
$(".btn-select-img").hide();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
<a class="btn btn-default" href="{{$.siteUrl}}/preview?themeId={{.themeId}}" target="_blank"><span class="fa fa-eye"></span> {{msg . "preview"}}</a>
|
||||
|
||||
<small>
|
||||
(<a href="http://blog.leanote.com/post/545f1a5c380782565e000000" target="_blank">{{msg . "needHelp"}}</a>
|
||||
<a target="_blank" href="https://github.com/leanote/leanote/wiki/leanote-blog-theme-api">Leanote Blog Theme Api</a>)
|
||||
|
||||
<a target="_blank" href="https://github.com/leanote/leanote/wiki/leanote-blog-theme-api">{{msg . "needHelp"}} {{msg . "Leanote Blog Theme Api"}}</a>
|
||||
</small>
|
||||
</h3>
|
||||
</div>
|
||||
@@ -49,7 +49,7 @@
|
||||
<header class="panel-heading">
|
||||
{{msg . "tplStyleScript"}}:
|
||||
</header>
|
||||
<div class="panel-body" style="height:430px;overflow: auto;">
|
||||
<div class="panel-body" style="<!--height:430px;-->overflow: auto;">
|
||||
|
||||
<div class="list-group bg-white file-list">
|
||||
{{range .myTpls}}
|
||||
@@ -67,6 +67,7 @@
|
||||
</footer>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-8">
|
||||
<section class="panel panel-default">
|
||||
<header class="panel-heading">
|
||||
@@ -74,7 +75,7 @@
|
||||
<span id="msg"></span>
|
||||
</header>
|
||||
<div class="panel-body">
|
||||
<div id="tplContent" class="form-control" style="width: 100%; height: 400px;"></div>
|
||||
<div id="tplContent" class="form-control" style="width: 100%; height: 500px;"></div>
|
||||
</div>
|
||||
<footer class="panel-footer text-right bg-light lter">
|
||||
<button type="submit" id="saveBtn" class="btn btn-success">{{msg . "save"}}</button>
|
||||
@@ -107,7 +108,7 @@
|
||||
</div>
|
||||
|
||||
{{template "member/footer.html" .}}
|
||||
<script src="/public/libs/ace/ace.js" type="text/javascript"></script>
|
||||
<script src="/public/libs/ace/ace.js"></script>
|
||||
<script>
|
||||
var editor = ace.edit("tplContent");
|
||||
editor.setTheme("ace/theme/tomorrow");
|
||||
@@ -118,6 +119,7 @@ var themeId = "{{.themeId}}";
|
||||
var themeBasePath = "/{{$.theme.Path}}";
|
||||
var theme = {
|
||||
cache: {}, // filename => content
|
||||
inited: {}, // filename => bool, 是否已初始化, 防止未加载完就切换到其它
|
||||
curTplO: $("#curTpl"),
|
||||
tplContentO: $("#tplContent"),
|
||||
saveBtnO: $("#saveBtn"),
|
||||
@@ -153,10 +155,10 @@ var theme = {
|
||||
e.stopPropagation();
|
||||
var $a = $(this).closest("a");
|
||||
var file = $a.data('file');
|
||||
art.confirm("Are you sure to delete " + file + " ?", function() {
|
||||
art.confirm(getMsg("Are you sure to delete") + ' ' + file + " ?", function() {
|
||||
ajaxPost("/member/blog/deleteTpl", {themeId: themeId, filename: file}, function(re) {
|
||||
// if(reIsOk(re)) {
|
||||
art.tips("Success");
|
||||
art.tips(getMsg("Success"));
|
||||
$a.remove();
|
||||
if(self.curTpl == file) {
|
||||
$(".file-list a").eq(0).trigger("click");
|
||||
@@ -173,18 +175,20 @@ var theme = {
|
||||
self.newFileO.click(function() {
|
||||
// 文件是否存在?
|
||||
|
||||
|
||||
art.prompt("Filename", function(file) {
|
||||
art.prompt(getMsg("Filename"), function(file) {
|
||||
if(!file) {
|
||||
return;
|
||||
}
|
||||
if($('[data-filename="' + file + '"]').length > 0) {
|
||||
art.alert('File exists');
|
||||
art.alert(getMsg('File exists'));
|
||||
return;
|
||||
}
|
||||
var t = $('<a href="#" class="list-group-item " data-file="' + file + '"> <i class="fa fa-remove icon-muted remove-file" title="delete file" ></i> <span class="filename" data-filename="' + file + '">' + file + '</span><span class="badge"></span></a>');
|
||||
var t = $('<a href="#" class="list-group-item " data-file="' + file + '"> <i class="fa fa-remove icon-muted remove-file" title="' + getMsg("Delete file") + '" ></i> <span class="filename" data-filename="' + file + '">' + file + '</span><span class="badge"></span></a>');
|
||||
$(".file-list").append(t);
|
||||
|
||||
self.cache[file] = "";
|
||||
self.inited[file] = true;
|
||||
|
||||
// trigger click, 选中之
|
||||
t.click();
|
||||
});
|
||||
@@ -221,6 +225,12 @@ var theme = {
|
||||
}
|
||||
// 之前的内容是否有改动
|
||||
if(self.cache[filename] == content) {
|
||||
// console.log('content is same');
|
||||
return;
|
||||
}
|
||||
// 内容都没有加载进来
|
||||
if(!self.inited[filename]) {
|
||||
// console.log('not inited');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -247,7 +257,7 @@ var theme = {
|
||||
renderContent: function(name, content) {
|
||||
var self = this;
|
||||
self.curTplO.html(name);
|
||||
self.curTpl = name; // 这里才设置
|
||||
// self.curTpl = name; // 这里才设置
|
||||
var lang = "html";
|
||||
if(name.indexOf(".js") > 0 || name.indexOf(".json") > 0) {
|
||||
lang = "javascript";
|
||||
@@ -255,6 +265,7 @@ var theme = {
|
||||
lang = "css";
|
||||
}
|
||||
editor.setValue(content);
|
||||
editor.getSession().setUndoManager(new ace.UndoManager());
|
||||
editor.session.setMode("ace/mode/" + lang);
|
||||
editor.gotoLine(1);
|
||||
setTimeout(function() {
|
||||
@@ -264,7 +275,7 @@ var theme = {
|
||||
renderTpl: function(name) {
|
||||
var self = this;
|
||||
var content = "";
|
||||
self.curTpl = ""; // 这里设置为空
|
||||
self.curTpl = name; // 这里设置为空
|
||||
if(self.cache[name] != undefined) {
|
||||
content = self.cache[name];
|
||||
self.renderContent(name, content);
|
||||
@@ -273,7 +284,13 @@ var theme = {
|
||||
ajaxGet("/member/blog/getTplContent", {themeId: themeId, filename: name}, function(re){
|
||||
if(reIsOk(re)) {
|
||||
self.cache[name] = re.Item;
|
||||
self.inited[name] = true;
|
||||
// 以防点击过快, 响应不按顺序
|
||||
if (self.curTpl == name) {
|
||||
self.renderContent(name, re.Item);
|
||||
} else {
|
||||
alert(getMsg('Error'));
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -287,10 +304,10 @@ var theme = {
|
||||
self.imageListO.on("click", ".delete-image", function(re) {
|
||||
var file = $(this).data('image');
|
||||
var t = this;
|
||||
art.confirm("Are you sure to delete it " + file + " ?", function() {
|
||||
art.confirm(getMsg("Are you sure to delete") + ' ' + file + " ?", function() {
|
||||
ajaxPost("/member/blog/deleteThemeImage", {themeId: themeId, filename: file}, function(re) {
|
||||
if(reIsOk(re)) {
|
||||
art.tips("Success");
|
||||
art.tips(getMsg("Success"));
|
||||
$(t).closest("li").remove();
|
||||
} else {
|
||||
art.alert(re.Msg);
|
||||
@@ -302,7 +319,7 @@ var theme = {
|
||||
renderImages: function(images) {
|
||||
var self = this;
|
||||
if(!images || images.length == 0) {
|
||||
self.imageListO.html("无图片");
|
||||
self.imageListO.html(getMsg("No images"));
|
||||
return;
|
||||
}
|
||||
var html = "";
|
||||
@@ -346,7 +363,7 @@ function uploadFinish(ret) {
|
||||
return;
|
||||
}
|
||||
// 上传出错
|
||||
art.alert("error");
|
||||
art.alert(getMsg("Error"));
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -23,9 +23,11 @@ $(function() {
|
||||
|
||||
if(fullPath == "/member/index") {
|
||||
fullPath = "/member";
|
||||
} else if (fullPath == '/member/blog/updateTheme') {
|
||||
fullPath = '/member/blog/theme';
|
||||
}
|
||||
|
||||
$("#nav > li").removeClass("active");
|
||||
// alert(fullPath);
|
||||
// 自己
|
||||
var $thisLi = $('#nav a[href="' + fullPath + '"]').parent();
|
||||
$thisLi.addClass("active");
|
||||
|
||||
@@ -113,7 +113,7 @@ var group = {
|
||||
addGroupEvent: function() {
|
||||
var self = this;
|
||||
$('.btn-add-group').click(function() {
|
||||
ajaxPost("/member/group/addGroup", {title: "Group Title"}, function(re) {
|
||||
ajaxPost("/member/group/addGroup", {title: getMsg("Group Title")}, function(re) {
|
||||
if(reIsOk(re)) {
|
||||
var group = re.Item;
|
||||
self.groupsO.prepend(self.tGroupO.render(group))
|
||||
@@ -136,7 +136,7 @@ var group = {
|
||||
var groupId = $(this).closest(".each-group").data("id");
|
||||
ajaxPost("/member/group/updateGroupTitle", {groupId: groupId, title: val}, function(re) {
|
||||
if(reIsOk(re)) {
|
||||
art.tips("Success")
|
||||
art.tips(getMsg("Success"));
|
||||
t.data('ever', val)
|
||||
}
|
||||
})
|
||||
@@ -147,11 +147,11 @@ var group = {
|
||||
var self = this;
|
||||
self.groupsO.on("click", ".delete-group", function() {
|
||||
var t = $(this);
|
||||
art.confirm("Are you sure ?", function() {
|
||||
art.confirm(getMsg("Are you sure ?"), function() {
|
||||
var groupId = t.closest(".each-group").data("id");
|
||||
ajaxPost("/member/group/deleteGroup", {groupId: groupId}, function(re) {
|
||||
if(reIsOk(re)) {
|
||||
art.tips("Success");
|
||||
art.tips(getMsg("Success"));
|
||||
t.closest(".each-group").remove();
|
||||
} else {
|
||||
art.alert(re.Msg);
|
||||
@@ -182,7 +182,7 @@ var group = {
|
||||
var p = t.closest("li");
|
||||
ajaxPost("/member/group/addUser", {groupId: groupId, email: email}, function(re) {
|
||||
if(reIsOk(re)) {
|
||||
art.tips("Success");
|
||||
art.tips(getMsg("Success"));
|
||||
var html = self.tUserO.render(re.Item)
|
||||
p.before(html);
|
||||
t.val("");
|
||||
@@ -198,12 +198,12 @@ var group = {
|
||||
var self = this;
|
||||
self.groupsO.on("click", ".delete-user", function() {
|
||||
var t = $(this);
|
||||
art.confirm("Are you sure ?", function() {
|
||||
art.confirm(getMsg("Are you sure ?"), function() {
|
||||
var groupId = t.closest(".each-group").data("id");
|
||||
var userId = t.closest("li").data("id");
|
||||
ajaxPost("/member/group/deleteUser", {groupId: groupId, userId: userId}, function(re) {
|
||||
if(reIsOk(re)) {
|
||||
art.tips("Success");
|
||||
art.tips(getMsg("Success"));
|
||||
t.closest("li").remove();
|
||||
} else {
|
||||
art.alert(re.Msg);
|
||||
|
||||
+11
-21
@@ -1,4 +1,4 @@
|
||||
<nav class="nav-primary hidden-xs">
|
||||
<nav class="nav-primary">
|
||||
<ul class="nav" id="nav">
|
||||
|
||||
<li class="active">
|
||||
@@ -34,16 +34,15 @@
|
||||
<li>
|
||||
<a href="/member/user/avatar">
|
||||
<span>
|
||||
{{msg . "avatar"}}
|
||||
{{msg . "Avatar"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
{{if $.userInfo.Email}}
|
||||
<li>
|
||||
<a href="/member/user/username">
|
||||
<span>
|
||||
{{msg . "username"}}
|
||||
{{msg . "Username"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -51,26 +50,18 @@
|
||||
<li>
|
||||
<a href="/member/user/email">
|
||||
<span>
|
||||
{{msg . "email"}}
|
||||
{{msg . "Email"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/member/user/password">
|
||||
<span>
|
||||
{{msg . "password"}}
|
||||
{{msg . "Password"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{{else}}
|
||||
<li>
|
||||
<a href="/member/user/addAccount">
|
||||
<span>
|
||||
{{msg . "addLeanoteAccount"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{{end}}
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@@ -94,7 +85,7 @@
|
||||
<li>
|
||||
<a href="/member/blog/index">
|
||||
<span>
|
||||
{{msg . "postList"}}
|
||||
{{msg . "Posts"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -109,22 +100,21 @@
|
||||
<li>
|
||||
<a href="/member/blog/comment">
|
||||
<span>
|
||||
{{msg . "comment"}}
|
||||
{{msg . "Comment"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="/member/blog/cate">
|
||||
<span>
|
||||
{{msg . "cate"}}
|
||||
{{msg . "Category"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/member/blog/single">
|
||||
<span>
|
||||
{{msg . "single"}}
|
||||
{{msg . "Single"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
@@ -138,7 +128,7 @@
|
||||
<li>
|
||||
<a href="/member/blog/theme">
|
||||
<span>
|
||||
{{msg . "theme"}}
|
||||
{{msg . "Theme"}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<section>
|
||||
<section class="hbox stretch">
|
||||
<!-- .aside -->
|
||||
<aside class="bg-light lter b-r aside-md hidden-print hidden-xs" id="nav">
|
||||
<aside class="bg-light lter b-r aside-md hidden-print" id="nav">
|
||||
<section class="vbox">
|
||||
<!--
|
||||
<header class="header bg-primary lter text-center clearfix">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{{template "member/top.html" .}}
|
||||
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "avatar"}}</h3></div>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "Avatar"}}</h3></div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "email"}}</h3></div>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "Email"}}</h3></div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "password"}}</h3></div>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "Password"}}</h3></div>
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
<form id="formData">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{{template "member/top.html" .}}
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "username"}}</h3></div>
|
||||
<div class="m-b-md"> <h3 class="m-b-none">{{msg . "Username"}}</h3></div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<div class="panel-body">
|
||||
<div class="alert alert-danger" id="usernameMsg" style="display: none"></div>
|
||||
<div class="form-group">
|
||||
<label>{{msg . "username"}}</label>
|
||||
<!-- <label>{{msg . "Username"}}</label> -->
|
||||
<input type="text" class="form-control" id="username"
|
||||
value="{{.userInfo.Username}}"
|
||||
data-rules='[
|
||||
|
||||
Whitespace-only changes.
@@ -12,7 +12,7 @@
|
||||
|
||||
<link href="/css/bootstrap-min.css" rel="stylesheet" />
|
||||
<!-- 先加载, 没有样式, 宽度不定 -->
|
||||
<link rel="stylesheet" href="/tinymce/skins/custom/skin.min.css" rel="stylesheet"/>
|
||||
<link rel="stylesheet" href="/css/tinymce/skin.min.css" rel="stylesheet"/>
|
||||
<!-- leanote css -->
|
||||
<link href="/css/font-awesome-4.2.0/css/font-awesome-min.css" rel="stylesheet" />
|
||||
<link href="/css/zTreeStyle/zTreeStyle-min.css" rel="stylesheet" />
|
||||
@@ -154,7 +154,7 @@ function log(o) {
|
||||
<li role="presentation" id="setTheme">
|
||||
<a>
|
||||
<i class="fa fa-sun-o"></i>
|
||||
{{msg . "themeSetting"}}
|
||||
{{leaMsg . "Theme"}}
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@@ -198,7 +198,7 @@ function log(o) {
|
||||
|
||||
<div class="pull-right top-nav writting-hide lea-blog">
|
||||
<a target="_blank" href="http://lea.leanote.com">
|
||||
lea++
|
||||
Lea++
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -598,9 +598,7 @@ function log(o) {
|
||||
</form>
|
||||
|
||||
<!-- 由此可以算高度 -->
|
||||
<div id="editorContent" name="editorContent" tabindex="2" />
|
||||
{{.noteContent}}
|
||||
</div>
|
||||
<div id="editorContent" name="editorContent" tabindex="2" /></div>
|
||||
</div>
|
||||
|
||||
<div id="mdEditor" class="read-only">
|
||||
@@ -614,7 +612,7 @@ function log(o) {
|
||||
<span class="lang">{{msg . "updated"}}</span>: <span class="updated-time"></span>
|
||||
</div>
|
||||
|
||||
<div class="wmd-button-bar-inner">
|
||||
<div class="wmd-button-bar-inner clearfix">
|
||||
<ul class="nav left-buttons">
|
||||
<li class="wmd-button-group1 btn-group"></li>
|
||||
</ul>
|
||||
@@ -659,6 +657,8 @@ function log(o) {
|
||||
<div class="layout-wrapper-l3">
|
||||
<div id="left-column">
|
||||
<pre id="wmd-input" class="form-control"><div class="editor-content mousetrap" contenteditable=true></div><div class="editor-margin"></div></pre>
|
||||
<!-- v2 markdown lightmode需要 -->
|
||||
<div class="textarea-helper"></div>
|
||||
</div>
|
||||
<div id="right-column">
|
||||
<div class="preview-panel panel-open" id="preview-panel">
|
||||
@@ -887,9 +887,10 @@ var GlobalConfigs = {{.globalConfigs|jsonJs}};
|
||||
<script src="/js/jquery-1.9.0.min.js"></script>
|
||||
<script src="/js/jquery.ztree.all-3.5.js"></script>
|
||||
<script src="/js/object_id-min.js"></script>
|
||||
<script src="/public/tinymce/tinymce.js"></script>
|
||||
<!-- /dev -->
|
||||
|
||||
<script src="/tinymce/tinymce.js"></script>
|
||||
|
||||
<script src="/public/libs/ace/ace.js"></script>
|
||||
|
||||
<!-- dev -->
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<title>Leanote, {{msg $ "moto"}}</title>
|
||||
<link href="/css/bootstrap-min.css" rel="stylesheet" />
|
||||
<!-- 先加载, 没有样式, 宽度不定 -->
|
||||
<link rel="stylesheet" href="/tinymce/skins/custom/skin.min.css" rel="stylesheet"/>
|
||||
<link rel="stylesheet" href="/css/tinymce/skin.min.css" rel="stylesheet"/>
|
||||
<!-- leanote css -->
|
||||
<link href="/css/font-awesome-4.2.0/css/font-awesome-min.css" rel="stylesheet" />
|
||||
<link href="/css/zTreeStyle/zTreeStyle-min.css" rel="stylesheet" />
|
||||
@@ -144,7 +144,7 @@ function log(o) {
|
||||
<li role="presentation" id="setTheme">
|
||||
<a>
|
||||
<i class="fa fa-sun-o"></i>
|
||||
{{msg . "themeSetting"}}
|
||||
{{leaMsg . "Theme"}}
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@@ -187,7 +187,7 @@ function log(o) {
|
||||
</div>
|
||||
<div class="pull-right top-nav writting-hide lea-blog">
|
||||
<a target="_blank" href="http://lea.leanote.com">
|
||||
lea++
|
||||
Lea++
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -573,9 +573,7 @@ function log(o) {
|
||||
</form>
|
||||
|
||||
<!-- 由此可以算高度 -->
|
||||
<div id="editorContent" name="editorContent" tabindex="2" />
|
||||
{{.noteContent}}
|
||||
</div>
|
||||
<div id="editorContent" name="editorContent" tabindex="2" /></div>
|
||||
</div>
|
||||
|
||||
<div id="mdEditor" class="read-only">
|
||||
@@ -589,7 +587,7 @@ function log(o) {
|
||||
<span class="lang">{{msg . "updated"}}</span>: <span class="updated-time"></span>
|
||||
</div>
|
||||
|
||||
<div class="wmd-button-bar-inner">
|
||||
<div class="wmd-button-bar-inner clearfix">
|
||||
<ul class="nav left-buttons">
|
||||
<li class="wmd-button-group1 btn-group"></li>
|
||||
</ul>
|
||||
@@ -634,6 +632,8 @@ function log(o) {
|
||||
<div class="layout-wrapper-l3">
|
||||
<div id="left-column">
|
||||
<pre id="wmd-input" class="form-control"><div class="editor-content mousetrap" contenteditable=true></div><div class="editor-margin"></div></pre>
|
||||
<!-- v2 markdown lightmode需要 -->
|
||||
<div class="textarea-helper"></div>
|
||||
</div>
|
||||
<div id="right-column">
|
||||
<div class="preview-panel panel-open" id="preview-panel">
|
||||
@@ -853,6 +853,7 @@ var tinyMCEPreInit = {base: '/public/tinymce', suffix: '.min'};
|
||||
</script>
|
||||
<script src="/js/i18n/msg.{{.locale}}.js"></script>
|
||||
<script src="/js/dep.min.js"></script>
|
||||
<script src="/tinymce/tinymce.full.min.js"></script>
|
||||
<script src="/public/libs/ace/ace.js"></script>
|
||||
<script src="/js/app.min.js"></script>
|
||||
<script>
|
||||
|
||||
+2
-2
@@ -34,8 +34,8 @@ cookie.httponly=false
|
||||
cookie.prefix=LEANOTE
|
||||
cookie.domain= # for share cookie with sub-domain
|
||||
cookie.secure=false
|
||||
format.date=01/02/2006
|
||||
format.datetime=01/02/2006 15:04
|
||||
format.date=2006-01-02
|
||||
format.datetime=2006-01-02 15:04:05 # 必须这样配置
|
||||
results.chunked=false
|
||||
|
||||
log.trace.prefix = "TRACE "
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
####################
|
||||
# Member Center
|
||||
####################
|
||||
|
||||
|
||||
# post abstract
|
||||
|
||||
Abstract=Abstract
|
||||
Description=Description
|
||||
Once the abstract has been updated, it will not set the abstract automatically other than you cancel it.=Once the abstract has been updated, it will not set the abstract automatically other than you cancel it.
|
||||
Main Image=Main Image
|
||||
Get next image as main image from content=Get next image as main image from content
|
||||
Raw Content=Raw Content
|
||||
@@ -0,0 +1,13 @@
|
||||
####################
|
||||
# Member Center
|
||||
####################
|
||||
|
||||
|
||||
# post abstract
|
||||
|
||||
Abstract=Abstract
|
||||
Description=Description
|
||||
Once the abstract has been updated, it will not set the abstract automatically other than you cancel it.=Once the abstract has been updated, it will not set the abstract automatically other than you cancel it.
|
||||
Main Image=Main Image
|
||||
Get next image as main image from content=Get next image as main image from content
|
||||
Raw Content=Raw Content
|
||||
@@ -0,0 +1,14 @@
|
||||
####################
|
||||
# 个人中心
|
||||
####################
|
||||
|
||||
# 博客列表
|
||||
|
||||
# 博客摘要设置
|
||||
|
||||
Abstract=摘要
|
||||
Description=描述
|
||||
Once the abstract has been updated, it will not set the abstract automatically other than you cancel it.=以下内容设置后, 以后修改笔记时将不自动获取. 若将该文章取消为博客后, 以下内容会自动获取.
|
||||
Main Image=主图
|
||||
Get next image as main image from content=从笔记中自动获取下一张
|
||||
Raw Content=原文
|
||||
+26
-6
@@ -20,9 +20,9 @@ suggestions=Suggestions
|
||||
yourSuggestions=Suggestions
|
||||
leanoteBlog=Blog
|
||||
knowledge=Knowledge
|
||||
knowledgeInfo=Use leanote as a note, manage your knowledge in leanote.
|
||||
knowledgeInfo=Use Leanote as a note, manage your knowledge in Leanote.
|
||||
share=Share
|
||||
shareInfo=Share your knowledge to your friends in leanote.
|
||||
shareInfo=Share your knowledge to your friends in Leanote.
|
||||
cooperation=Cooperation
|
||||
cooperationInfo=Collaborate with friends to improve your knowledge.
|
||||
blog=Blog
|
||||
@@ -137,15 +137,11 @@ green=green
|
||||
|
||||
# 设置
|
||||
accountSetting=Account
|
||||
themeSetting=Theme
|
||||
setAvatar=Avatar
|
||||
logout=Logout
|
||||
basicInfo=Basic
|
||||
basicInfoSet=Blog Basic Setting
|
||||
updateEmail=Update email
|
||||
usernameSetting=Update username
|
||||
username=Username
|
||||
avatar=Avatar
|
||||
chooseImage=Choose Image
|
||||
oldPassword=Old password
|
||||
newPassword=New password
|
||||
@@ -256,6 +252,7 @@ memberCenter=Member Center
|
||||
userNotExists=The user is not exists
|
||||
hasUsers=The user already exists
|
||||
Leanote Blog Theme Api=Leanote Blog Theme Api
|
||||
My Group=My Group
|
||||
|
||||
# yu
|
||||
service=Service
|
||||
@@ -339,11 +336,34 @@ themeJson=Theme settings
|
||||
paging=Paging
|
||||
highlight=Code highlight
|
||||
|
||||
# member title
|
||||
Leanote Member Center=Leanote Member Center
|
||||
Username=Username
|
||||
Email=Email
|
||||
Password=Password
|
||||
Avatar=Avatar
|
||||
Add Account=Add Account
|
||||
Update Post Abstract=Update Post Abstract
|
||||
Blog Base Info=Blog Base Info
|
||||
Comment=Comment
|
||||
Posts=Posts
|
||||
Domain=Domain
|
||||
Paging=Paging
|
||||
Category=Category
|
||||
Add Single=Add Single
|
||||
Update Single=Update Single
|
||||
Single=Single
|
||||
Theme=Theme
|
||||
Upate Theme=Upate Theme
|
||||
|
||||
group=Group
|
||||
newGroup=New group
|
||||
deleteGroup=Delete group
|
||||
addMemberTips=Input username or email to add member
|
||||
deleteMember=Delete member
|
||||
forbiddenNotMyGroup=You have no authority to access, cause you are not the group owner
|
||||
userExistsInGroup=The member is already exists in this group
|
||||
notMyGroup=You are not the group owner
|
||||
|
||||
created=Created
|
||||
updated=Updated
|
||||
|
||||
+25
-4
@@ -131,15 +131,11 @@ green=vert
|
||||
|
||||
# 设置
|
||||
accountSetting=Compte
|
||||
themeSetting=Thème
|
||||
setAvatar=Avatar
|
||||
logout=Déconnexion
|
||||
basicInfo=Basique
|
||||
basicInfoSet=Réglages de base du blog
|
||||
updateEmail=Mettre à jour le courriel
|
||||
usernameSetting=Mettre à jour le nom d'utilisateur
|
||||
username=Nom d'utilisateur
|
||||
avatar=Avatar
|
||||
chooseImage=Choisir une image
|
||||
oldPassword=Ancien mot de passe
|
||||
newPassword=Nouveau mot de passe
|
||||
@@ -255,6 +251,7 @@ latest=Plus récent.
|
||||
memberCenter=Espace Membre
|
||||
userNotExists=L'utilisateur n'existe pas
|
||||
hasUsers=L'utilisateur existe déjà
|
||||
My Group=My Group
|
||||
|
||||
# yu
|
||||
service=Service
|
||||
@@ -337,11 +334,35 @@ themeJson=Réglages du thème
|
||||
paging=Mise en page
|
||||
highlight=Surlignage du code
|
||||
|
||||
# member title
|
||||
Leanote Member Center=Leanote Member Center
|
||||
Username=Username
|
||||
Email=Email
|
||||
Password=Password
|
||||
Avatar=Avatar
|
||||
Add Account=Add Account
|
||||
Update Post Abstract=Update Post Abstract
|
||||
Blog Base Info=Blog Base Info
|
||||
Comment=Comment
|
||||
Posts=Posts
|
||||
Domain=Domain
|
||||
Paging=Paging
|
||||
Category=Category
|
||||
Add Single=Add Single
|
||||
Update Single=Update Single
|
||||
Single=Single
|
||||
Theme=Theme
|
||||
Upate Theme=Upate Theme
|
||||
|
||||
|
||||
group=Groupe
|
||||
newGroup=Nouveau groupe
|
||||
deleteGroup=Effacer groupe
|
||||
addMemberTips=Rentrer le nom d'utilisateur et le courriel pour ajouter un membre
|
||||
deleteMember=Effacer membre
|
||||
forbiddenNotMyGroup=You have no authority to access, cause you are not the group owner
|
||||
userExistsInGroup=The member is already exists in this group
|
||||
notMyGroup=You are not the group owner
|
||||
|
||||
created=Créé
|
||||
updated=Mis à jour
|
||||
|
||||
+52
-10
@@ -165,15 +165,11 @@ green=绿色
|
||||
|
||||
# 设置
|
||||
accountSetting=帐户设置
|
||||
themeSetting=主题设置
|
||||
setAvatar=头像设置
|
||||
logout=退出
|
||||
basicInfo=基本信息
|
||||
basicInfoSet=博客基本设置
|
||||
updateEmail=修改Email
|
||||
usernameSetting=用户名设置
|
||||
username=用户名
|
||||
avatar=头像
|
||||
chooseImage=选择图片
|
||||
oldPassword=旧密码
|
||||
newPassword=新密码
|
||||
@@ -290,6 +286,16 @@ memberCenter=个人中心
|
||||
userNotExists=该成员沿未注册
|
||||
hasUsers=已存在该成员
|
||||
Leanote Blog Theme Api=Leanote博客主题API
|
||||
My Group=我的分组
|
||||
group=用户组
|
||||
newGroup=新建组
|
||||
deleteGroup=删除组
|
||||
addMemberTips=输入用户名或邮箱添加成员
|
||||
deleteMember=删除成员
|
||||
forbiddenNotMyGroup=无权限操作, 非该组的所有者
|
||||
userExistsInGroup=已存在该成员
|
||||
notMyGroup=非该组的所有者
|
||||
|
||||
|
||||
# yu
|
||||
service=服务
|
||||
@@ -360,7 +366,7 @@ script=脚本
|
||||
header=头部
|
||||
footer=底部
|
||||
index=首页
|
||||
cate=分类页
|
||||
cate=分类
|
||||
search=搜索页
|
||||
single=单页
|
||||
archive=归档页
|
||||
@@ -372,11 +378,25 @@ themeJson=主题配置
|
||||
paging=分页
|
||||
highlight=高亮
|
||||
|
||||
group=用户组
|
||||
newGroup=新建组
|
||||
deleteGroup=删除组
|
||||
addMemberTips=输入用户名或邮箱添加成员
|
||||
deleteMember=删除成员
|
||||
# member title
|
||||
Leanote Member Center=Leanote 个人中心
|
||||
Username=用户名
|
||||
Email=Email
|
||||
Password=密码
|
||||
Avatar=头像
|
||||
Add Account=添加Leanote帐户
|
||||
Update Post Abstract=更新博文摘要
|
||||
Blog Base Info=博客基本设置
|
||||
Comment=评论设置
|
||||
Posts=博文管理
|
||||
Domain=域名
|
||||
Paging=分页
|
||||
Category=分类管理
|
||||
Add Single=添加单页
|
||||
Update Single=修改单页
|
||||
Single=单页管理
|
||||
Theme=主题
|
||||
Update Theme=修改主题
|
||||
|
||||
created=创建
|
||||
updated=更新
|
||||
@@ -429,6 +449,9 @@ Edit mode=编辑模式
|
||||
Vim mode=Vim模式
|
||||
Emacs mode=Emacs模式
|
||||
Normal mode=普通模式
|
||||
Normal=普通
|
||||
Light=轻量
|
||||
Light editor=轻量编辑器
|
||||
|
||||
Insert Image=插入
|
||||
|
||||
@@ -463,5 +486,24 @@ Error=错误
|
||||
Prev=上一页
|
||||
Next=下一页
|
||||
|
||||
# view js
|
||||
Are you sure ?=你确定执行该操作?
|
||||
Are you sure to install it ?=你确定安装该主题?
|
||||
Are you sure to delete=你确定删除
|
||||
Success=成功
|
||||
Error=错误
|
||||
File exists=文件已存在
|
||||
Delete file=删除文件
|
||||
No images=无图片
|
||||
Filename=文件名
|
||||
Group Title=分组名
|
||||
|
||||
#############
|
||||
# 通用
|
||||
#############
|
||||
|
||||
Search=搜索
|
||||
Save Success=保存成功
|
||||
|
||||
# 必须要加这个, 奇怪
|
||||
[CN]
|
||||
+78
-85
@@ -3,6 +3,7 @@
|
||||
@import "includes/animation.less";
|
||||
@import "includes/common.less";
|
||||
@import "includes/header.less";
|
||||
@import "includes/page.less";
|
||||
|
||||
@import "includes/editor.less";
|
||||
@import "includes/tinymce.less";
|
||||
@@ -16,86 +17,9 @@
|
||||
@import "includes/note.less";
|
||||
@import "includes/mask.less";
|
||||
|
||||
|
||||
@fontFamily: 'Open Sans', Helvetica, Tahoma, Arial, Hiragino Sans GB, "Microsoft YaHei", "微软雅黑", "Micro Hei", SimSun, "宋体", Heiti, "黑体", sans-serif;
|
||||
// @fontFamily: Helvetica, Tahoma, Arial, Hiragino Sans GB, "Microsoft YaHei", "微软雅黑", "Micro Hei", SimSun, "宋体", Heiti, "黑体", sans-serif;
|
||||
@aceFontFamily: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', "Microsoft YaHei", "微软雅黑";
|
||||
|
||||
// header
|
||||
@headerTextColor: #fff;
|
||||
@headerAColor: #ccc;
|
||||
@dropdownTextColor: #000;
|
||||
|
||||
@headerHeight: 60px;
|
||||
@headerHeightNoBorder: 59px;
|
||||
@logoColor: #000;
|
||||
|
||||
@searchNoteInputBorder: none;
|
||||
@searchNoteInputBgColor: #000;
|
||||
@searchNoteInputTextColor: #ccc;
|
||||
|
||||
@switcherBgColor: #000;
|
||||
|
||||
@newNoteBgColor: #000;
|
||||
@newNoteBgColorHover: #3D3B3B;
|
||||
@newNoteBBorderColorHover: transparent;
|
||||
@newNoteBorder: 1px solid #080303;
|
||||
@newNoteTextColor: #fff;
|
||||
|
||||
// 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;
|
||||
}
|
||||
*/
|
||||
|
||||
@font-face {
|
||||
font-family: 'leanote';
|
||||
src:url('../../fonts/leanote-font2/leanote.eot?-vcf23i');
|
||||
src:url('../../fonts/leanote-font2/leanote.eot?#iefix-vcf23i') format('embedded-opentype'),
|
||||
url('../../fonts/leanote-font2/leanote.ttf?-vcf23i') format('truetype'),
|
||||
url('../../fonts/leanote-font2/leanote.woff?-vcf23i') format('woff'),
|
||||
url('../../fonts/leanote-font2/leanote.svg?-vcf23i#leanote') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
// 字体
|
||||
@import "includes/readonly.less";
|
||||
@import "includes/tag.less";
|
||||
@import "includes/batch.less";
|
||||
|
||||
#logo,
|
||||
#switcher span,
|
||||
@@ -134,8 +58,6 @@
|
||||
content: "\e601";
|
||||
}
|
||||
|
||||
html,body {
|
||||
}
|
||||
*,.h1,
|
||||
.h2,
|
||||
.h3,
|
||||
@@ -179,6 +101,77 @@ h1, h2, h3 {
|
||||
}
|
||||
|
||||
|
||||
@import "includes/readonly.less";
|
||||
@import "includes/tag.less";
|
||||
@import "includes/batch.less";
|
||||
@fontFamily: 'Open Sans', Helvetica, Tahoma, Arial, Hiragino Sans GB, "Microsoft YaHei", "微软雅黑", "Micro Hei", SimSun, "宋体", Heiti, "黑体", sans-serif;
|
||||
// @fontFamily: Helvetica, Tahoma, Arial, Hiragino Sans GB, "Microsoft YaHei", "微软雅黑", "Micro Hei", SimSun, "宋体", Heiti, "黑体", sans-serif;
|
||||
@aceFontFamily: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', Hiragino Sans GB, "Microsoft YaHei", "微软雅黑";
|
||||
|
||||
// header
|
||||
@headerTextColor: #fff;
|
||||
@headerAColor: #ccc;
|
||||
@dropdownTextColor: #000;
|
||||
|
||||
@headerHeight: 60px;
|
||||
@headerHeightNoBorder: 59px;
|
||||
@logoColor: #000;
|
||||
|
||||
|
||||
@searchNoteInputBorder: none;
|
||||
@searchNoteInputBgColor: #000;
|
||||
@searchNoteInputTextColor: #ccc;
|
||||
|
||||
@switcherBgColor: #000;
|
||||
|
||||
@newNoteBgColor: #000;
|
||||
@newNoteBgColorHover: #3D3B3B;
|
||||
@newNoteBBorderColorHover: transparent;
|
||||
@newNoteBorder: 1px solid #080303;
|
||||
@newNoteTextColor: #fff;
|
||||
|
||||
|
||||
@bgColor: #fff;
|
||||
@headerBgColor: #25313e;
|
||||
|
||||
@aWhiteColor: #fff;
|
||||
@aBlackColor: #000;
|
||||
@borderColor: #EBEFF2;
|
||||
@headerBottomBorderColor: @headerBgColor;
|
||||
@headerHeight: 60px;
|
||||
@headerHeightNoBorder: 59px;
|
||||
@hColor: #0fb264; // #47a447;// 更深 #198764; // boostrap: #5cb85c; bootstrap:hover #47a447; // #5AD4A0; // #47a447
|
||||
@titleColor: @hColor;
|
||||
@fontSize: 14px;
|
||||
@leftNotebookWidth: 170px;
|
||||
@noteListWidth: 250px;
|
||||
@noteActiveBg: #65bd77;
|
||||
|
||||
@selectionBg: @aBlackColor;
|
||||
@selectionColor: #fff;
|
||||
|
||||
// header
|
||||
@headerTextColor: #fff;
|
||||
@headerAColor: #ccc;
|
||||
@dropdownTextColor: #000;
|
||||
@loadingUrl: url(../../images/loading-a-20.gif);
|
||||
|
||||
@notebookBgColor: #41586e;
|
||||
@notebookBodyBgColor: #37485e;
|
||||
|
||||
@addNotebookColor: #ADBECE;
|
||||
|
||||
@notebookListBorder: 1px solid rgba(255, 255, 255, 0.05);
|
||||
|
||||
@notebookInputBorder: 1px solid rgba(0,0,0,0.1);
|
||||
@notebookInputColor: #fff;
|
||||
|
||||
@notebookMinBgColor: #41586e;
|
||||
@notebookMinContainerBorder: 1px solid rgba(255, 255, 255, 0.3);
|
||||
@notebookMinIconColor: #fff;
|
||||
|
||||
@folderHeaderHeight: 35px;
|
||||
@folderHeaderBorderColor: rgba(255,255,255,0.05);
|
||||
@folderHeaderIconColor: #fff;
|
||||
|
||||
@eachUserBorderColor: rgba(0, 0, 0, 0.09);
|
||||
|
||||
@noteListBorderColor: #cfcfcf;
|
||||
@noteAndSortBgColor: #eee;
|
||||
@@ -1 +1 @@
|
||||
::selection{background:#000;color:#fff}::-moz-selection{background:#000;color:#fff}::-webkit-selection{background:#000;color:#fff}@-webkit-keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@-moz-keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@-ms-keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@-webkit-keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@-moz-keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@-ms-keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-moz-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-o-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes fadeInUp{0%{opacity:0;-webkit-transform:translateY(20px)}100%{opacity:1;-webkit-transform:translateY(0)}}@-moz-keyframes fadeInUp{0%{opacity:0;-moz-transform:translateY(20px)}100%{opacity:1;-moz-transform:translateY(0)}}@-o-keyframes fadeInUp{0%{opacity:0;-o-transform:translateY(20px)}100%{opacity:1;-o-transform:translateY(0)}}@keyframes fadeInUp{0%{opacity:0;transform:translateY(20px)}100%{opacity:1;transform:translateY(0)}}.animated{-webkit-animation-fill-mode:both;-moz-animation-fill-mode:both;-ms-animation-fill-mode:both;-o-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.5s;-moz-animation-duration:.5s;-ms-animation-duration:.5s;-o-animation-duration:.5s;animation-duration:.5s}.fadeIn{-webkit-animation-name:fadeIn;-moz-animation-name:fadeIn;-o-animation-name:fadeIn;animation-name:fadeIn}.fadeInUp{-webkit-animation-name:fadeInUp;-moz-animation-name:fadeInUp;-o-animation-name:fadeInUp;animation-name:fadeInUp}.close:focus{outline:0}.invisible{visibility:hidden}.btn{border-radius:2px}.alert{margin-bottom:10px}.btn *{cursor:pointer!important}.dropdown-submenu{position:relative}.dropdown-submenu>ul.dropdown-menu{top:0;left:100%;margin-left:-3px!important;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;padding-top:10px!important}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropdown-submenu:after{display:block;content:" ";position:absolute;right:0;top:10px;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;border-left-color:#666}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown-submenu.pull-left{float:none}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.open>.dropdown-menu,.dropdown-submenu:hover>.dropdown-menu{visibility:visible;-webkit-animation:pulldown .2s;animation:pulldown .2s}.dropdown-menu{visibility:hidden;display:block}.dropdown-list{width:530px;border-radius:3px}.dropdown-list ul{margin:0;padding:0}.dropdown-list ul li{float:left;width:120px;margin-left:10px;margin-bottom:10px;border:1px dashed #ccc}.dropdown-menu .divider{margin:3px 0}.dropdown-menu{border-radius:3px;margin:0;border:1px solid #e6eaed;box-shadow:rgba(0,0,0,.172549)0 6px 12px 0}.dropdown-menu:before{content:"";width:20px;height:12px;position:absolute;top:-12px;right:8px;background-image:url(../../images/triangle_2x.png);background-size:20px 12px}.dropdown-submenu .dropdown-menu:before{background:0 0}#searchNotebookForAddDropdownList,#searchNotebookForAddShareDropdownList{left:-200px}#searchNotebookForAddDropdownList:before,#searchNotebookForAddShareDropdownList:before{left:190px;right:inherit}.dropdown-menu li{list-style:none;padding-left:10px;width:100%;height:30px;line-height:30px}.dropdown-menu li>a{color:#000;display:block;padding-right:20px}.dropdown-menu>li>a{padding:3px 20px 3px 0}.noteSplit{position:absolute;top:0;width:5px;height:100%;overflow:hidden;z-index:3333;cursor:col-resize}a.raw{color:#428bca}a.raw:hover{color:#2a6496}.cm-item{position:relative}.cm-item .cm-text{position:absolute;left:23px;right:10px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.cm-item .cm-text .c-text{display:initial}.b-m-mpanel{border-radius:3px}#listNotebookDropdownMenu{display:none}#themeForm td{padding:5px;text-align:center}#themeForm img{border:1px solid #eee;padding:2px}#logo{font-size:36px}#avatar{height:60px;max-width:200px;display:inline-block;margin:10px}.new-split{display:none}.new-note-right{padding:0 5px;padding-left:3px}#leanoteMsg{line-height:40px;margin-top:10px;margin-left:10px}#newNoteWrap{line-height:40px;margin-top:10px}.new-note{background-color:#000;border-radius:3px;padding:3px 5px;border:1px solid #080303}.new-note,.new-note a{color:#fff}.new-note:hover{background:#3d3b3b;border-color:transparent}.new-note:hover,.new-note:hoLine truncated
|
||||
::selection{background:#000;color:#fff}::-moz-selection{background:#000;color:#fff}::-webkit-selection{background:#000;color:#fff}@-webkit-keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@-moz-keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@-ms-keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@-webkit-keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@-moz-keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@-ms-keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-moz-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-o-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes fadeInUp{0%{opacity:0;-webkit-transform:translateY(20px)}100%{opacity:1;-webkit-transform:translateY(0)}}@-moz-keyframes fadeInUp{0%{opacity:0;-moz-transform:translateY(20px)}100%{opacity:1;-moz-transform:translateY(0)}}@-o-keyframes fadeInUp{0%{opacity:0;-o-transform:translateY(20px)}100%{opacity:1;-o-transform:translateY(0)}}@keyframes fadeInUp{0%{opacity:0;transform:translateY(20px)}100%{opacity:1;transform:translateY(0)}}.animated{-webkit-animation-fill-mode:both;-moz-animation-fill-mode:both;-ms-animation-fill-mode:both;-o-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.5s;-moz-animation-duration:.5s;-ms-animation-duration:.5s;-o-animation-duration:.5s;animation-duration:.5s}.fadeIn{-webkit-animation-name:fadeIn;-moz-animation-name:fadeIn;-o-animation-name:fadeIn;animation-name:fadeIn}.fadeInUp{-webkit-animation-name:fadeInUp;-moz-animation-name:fadeInUp;-o-animation-name:fadeInUp;animation-name:fadeInUp}@font-face{font-family:leanote;src:url(../../fonts/leanote-font2/leanote.eot?-vcf23i);src:url(../../fonts/leanote-font2/leanote.eot?#iefix-vcf23i) format('embedded-opentype'),url(../../fonts/leanote-font2/leanote.ttf?-vcf23i) format('truetype'),url(../../fonts/leanote-font2/leanote.woff?-vcf23i) format('woff'),url(../../fonts/leanote-font2/leanote.svg?-vcf23i#leanote) format('svg');font-weight:400;font-style:normal}.close:focus{outline:0}.invisible{visibility:hidden}.btn{border-radius:2px}.alert{margin-bottom:10px}.btn *{cursor:pointer!important}.dropdown-submenu{position:relative}.dropdown-submenu>ul.dropdown-menu{top:0;left:100%;margin-left:-3px!important;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;padding-top:10px!important}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropdown-submenu:after{display:block;content:" ";position:absolute;right:0;top:10px;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;border-left-color:#666}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown-submenu.pull-left{float:none}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.open>.dropdown-menu,.dropdown-submenu:hover>.dropdown-menu{visibility:visible;-webkit-animation:pulldown .2s;animation:pulldown .2s}.dropdown-menu{visibility:hidden;display:block}.dropdown-list{width:530px;border-radius:3px}.dropdown-list ul{margin:0;padding:0}.dropdown-list ul li{float:left;width:120px;margin-left:10px;margin-bottom:10px;border:1px dashed #ccc}.dropdown-menu .divider{margin:3px 0}.dropdown-menu{border-radius:3px;margin:0;border:1px solid #e6eaed;box-shadow:rgba(0,0,0,.172549)0 6px 12px 0}.dropdown-menu:before{content:"";width:20px;height:12px;position:absolute;top:-12px;right:8px;background-image:url(../../images/triangle_2x.png);background-size:20px 12px}.dropdown-submenu .dropdown-menu:before{background:0 0}#searchNotebookForAddDropdownList,#searchNotebookForAddShareDropdownList{left:-200px}#searchNotebookForAddDropdownList:before,#searchNotebookForAddShareDropdownList:before{left:190px;right:inherit}.dropdown-menu li{list-style:none;padding-left:10px;width:100%;height:30px;line-height:30px}.dropdown-menu li>a{color:#000;display:block;padding-right:20px}.dropdown-menu>li>a{padding:3px 20px 3px 0}.noteSplit{position:absolute;top:0;width:5px;height:100%;overflow:hidden;z-index:3333;cursor:col-resize}a.raw{color:#428bca}a.raw:hover{color:#2a6496}.cm-item{position:relative}.cm-item .cm-text{position:absolute;left:23px;right:10px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.cm-item .cm-text .c-text{display:initial}.b-m-mpanel{border-radius:3px}.modal-content{background-color:#f8f8f8}.modal-body{background-color:#fff;padding-bottom:30px}.modal-footer{margin-top:0}#listNotebookDropdownMenu{display:none}#themeForm td{padding:5px;text-aliLine truncated
|
||||
+22
-477
@@ -1,276 +1,35 @@
|
||||
@import "basic.less";
|
||||
|
||||
@bgColor: #fff;
|
||||
@headerBgColor: #25313e;
|
||||
@aWhiteColor: #fff;
|
||||
@aBlackColor: #000;
|
||||
@borderColor: #EBEFF2;
|
||||
@headerHeight: 60px;
|
||||
@headerHeightNoBorder: 59px;
|
||||
@hColor: #0fb264; // #47a447;// 更深 #198764; // boostrap: #5cb85c; bootstrap:hover #47a447; // #5AD4A0; // #47a447
|
||||
@titleColor: @hColor;
|
||||
@fontSize: 14px;
|
||||
@leftNotebookWidth: 170px;
|
||||
@noteListWidth: 250px;
|
||||
@noteActiveBg: #65bd77;
|
||||
|
||||
@selectionBg: @aBlackColor;
|
||||
@selectionColor: #fff;
|
||||
|
||||
// header
|
||||
@headerTextColor: #fff;
|
||||
@headerAColor: #ccc;
|
||||
@dropdownTextColor: #000;
|
||||
|
||||
/* header */
|
||||
|
||||
/*********************/
|
||||
#page {
|
||||
overflow: auto;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
}
|
||||
#pageInner {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
#mainContainer {
|
||||
position: absolute;
|
||||
top: @headerHeightNoBorder;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
overflow: auto;
|
||||
zoom: 1;
|
||||
}
|
||||
#mainMask {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
background-color: #fff;
|
||||
text-align: center;
|
||||
padding-top: 100px;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
#notebookSplitter {
|
||||
left: @leftNotebookWidth;
|
||||
}
|
||||
#noteSplitter {
|
||||
left: @noteListWidth;
|
||||
}
|
||||
|
||||
#leftNotebook {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: @leftNotebookWidth;
|
||||
}
|
||||
#notebook, #notebookMin {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
// bottom: 30px; 为了给bottom
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
/*border: 1px solid #ccc;*/
|
||||
background-color: #41586e;
|
||||
/*
|
||||
overflow-y: auto;
|
||||
overflow-x: auto;
|
||||
*/
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
|
||||
#notebookMin {
|
||||
z-index: 1;
|
||||
overflow-y: visible;
|
||||
overflow-x: visible;
|
||||
background-color: #41586e;
|
||||
div.minContainer {
|
||||
border-bottom: 1px solid transparent;
|
||||
border-color: rgba(255, 255, 255, 0.3);
|
||||
padding: 5px;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
i {
|
||||
font-size: 20px;
|
||||
.folderBody a:hover, .folderBody .contextmenu-hover {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
i {
|
||||
color: @hColor;
|
||||
}
|
||||
}
|
||||
ul {
|
||||
background-color: #fff;
|
||||
opacity: 0.8;
|
||||
display: none;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
margin-left: 20px;
|
||||
padding: 5px 0px;
|
||||
border: 1px solid @hColor;
|
||||
position: absolute;
|
||||
z-index: 1000;
|
||||
top: 0;
|
||||
left: 10px;
|
||||
width: 150px;
|
||||
li {
|
||||
padding: 0 5px;
|
||||
cursor: pointer;
|
||||
span {
|
||||
cursor: pointer;
|
||||
}
|
||||
a {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
background-color: rgba(0,0,0,0.1) !important;
|
||||
}
|
||||
|
||||
#notebookBottom {
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
height: 30px;
|
||||
right: 0;
|
||||
left: 0;
|
||||
line-height: 30px;
|
||||
text-align: right;
|
||||
padding-right: 5px;
|
||||
background-color: #eee;
|
||||
#leftSwitcher {
|
||||
border: 1px solid #ccc;
|
||||
padding: 3px 8px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
#noteAndEditor {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: @leftNotebookWidth;
|
||||
}
|
||||
#noteList {
|
||||
width: @noteListWidth;
|
||||
border-right: 1px solid #cfcfcf;
|
||||
border-left: 1px solid #cfcfcf;
|
||||
}
|
||||
#note {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
left: @noteListWidth;
|
||||
right: 0;
|
||||
padding-left: 5px;
|
||||
overflow-y: hidden;
|
||||
overflow-x: auto;
|
||||
background-color: @bgColor;
|
||||
}
|
||||
.folderNote {
|
||||
// padding-bottom: 5px;
|
||||
}
|
||||
@folderHeaderHeight: 35px;
|
||||
.folderHeader {
|
||||
min-height: @folderHeaderHeight;
|
||||
line-height: @folderHeaderHeight;
|
||||
cursor: pointer;
|
||||
border-bottom: 1px solid transparent;
|
||||
border-color: rgba(255,255,255,0.05);
|
||||
}
|
||||
.folderHeader span {
|
||||
display: inline-block;
|
||||
line-height: @folderHeaderHeight;
|
||||
color: #fff; // @hColor;
|
||||
font-size: 16px;
|
||||
}
|
||||
.folderHeader .fa-left, .friend-header i.fa {
|
||||
display: inline-block;
|
||||
line-height: @folderHeaderHeight;
|
||||
font-size: 16px;
|
||||
width: @folderHeaderHeight;
|
||||
border-right: 1px solid rgba(255,255,255,0.05);
|
||||
text-align: center;
|
||||
.folderBody a.active, .folderBody a.active:hover {
|
||||
background-color: #25313e !important; // @bgColor;
|
||||
color: #fff; // @hColor;
|
||||
}
|
||||
|
||||
.each-user div {
|
||||
cursor: pointer;
|
||||
border-bottom: 1px solid transparent;
|
||||
border-color: rgba(255,255,255,0.05);
|
||||
span {
|
||||
line-height: @folderHeaderHeight;
|
||||
//----------------------
|
||||
#searchNotebookForList {
|
||||
color: #ccc;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
background-color: @notebookBodyBgColor;
|
||||
&:focus {
|
||||
outline: none !important;
|
||||
border: 1px solid rgba(255, 255, 255, 0.3);
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
.label-default {
|
||||
background-color: #191D2B;
|
||||
}
|
||||
#myShareNotebooks .folderBody {
|
||||
background: none;
|
||||
}
|
||||
.tmpzTreeMove_arrow {
|
||||
color: #fff;
|
||||
padding-left: 3px;
|
||||
font-size: 14px;
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 23px;
|
||||
top: 0;
|
||||
right: 23px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.fa {
|
||||
width: 20px;
|
||||
border-right: none;
|
||||
}
|
||||
}
|
||||
|
||||
#myNotebooks.opened .fa-left {
|
||||
/*
|
||||
background-color: #65bd77;
|
||||
color: #e2f3e5;
|
||||
*/
|
||||
}
|
||||
|
||||
#myNotebooks .folderBody {
|
||||
/*
|
||||
max-height: 600px;
|
||||
overflow: auto;
|
||||
*/
|
||||
}
|
||||
#addNotebookPlus {
|
||||
padding-right: 10px;
|
||||
.fa {
|
||||
font-size: 16px;
|
||||
}
|
||||
color: #ADBECE;
|
||||
}
|
||||
.closed .folder-icon { /* 折叠状态 */
|
||||
width: 9px;
|
||||
height: 11px;
|
||||
background-position: -108px -149px;
|
||||
}
|
||||
.closed .folderBody {
|
||||
display: none;
|
||||
}
|
||||
@leftBgColor: #37485e;
|
||||
.folderBody {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: @leftBgColor;
|
||||
}
|
||||
|
||||
.folderBody li {
|
||||
line-height: 30px;
|
||||
}
|
||||
.ztree > li {
|
||||
border-bottom: 1px solid transparent;
|
||||
border-color: rgba(255,255,255,0.05);
|
||||
@@ -283,220 +42,6 @@
|
||||
.ztree li a {
|
||||
color: #ADBECE;
|
||||
}
|
||||
.folderBody a:hover, .folderBody .contextmenu-hover {
|
||||
color: #fff;
|
||||
background-color: rgba(0,0,0,0.1) !important;
|
||||
}
|
||||
.folderBody a.active, .folderBody a.active:hover {
|
||||
background-color: #25313e !important; // @bgColor;
|
||||
color: #fff; // @hColor;
|
||||
}
|
||||
|
||||
// 重命名, 添加notebook
|
||||
#notebookList input, #notebookListForSearch input {
|
||||
border: 1px solid rgba(0,0,0,0.1);
|
||||
width: 90%;
|
||||
padding-left:3px;
|
||||
box-shadow: none;
|
||||
background: none;
|
||||
color: #fff;
|
||||
&:focus {
|
||||
outline: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
#myTag .folderBody {
|
||||
/*
|
||||
max-height: 200px;
|
||||
overflow: auto;
|
||||
*/
|
||||
li {
|
||||
position: relative
|
||||
}
|
||||
}
|
||||
|
||||
#myTag .folderBody li .badge {
|
||||
width: 40px;
|
||||
position: absolute; right:3px; top: 7px;
|
||||
font-weight: normal;
|
||||
background-color: @bgColor;
|
||||
color: @aBlackColor;
|
||||
border: 1px solid @borderColor;
|
||||
}
|
||||
/* notelist */
|
||||
|
||||
|
||||
#search {
|
||||
border: #bababa 1px solid;
|
||||
background-color: #fff;
|
||||
white-space: nowrap;
|
||||
position: absolute;
|
||||
height: 30px;
|
||||
left:3px;
|
||||
right:60px;
|
||||
margin-top: 3px;
|
||||
}
|
||||
#search label {
|
||||
display: none;
|
||||
}
|
||||
#searchButton {
|
||||
border: 0 none;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
right:3px;
|
||||
top: 5px;
|
||||
}
|
||||
#searchInput {
|
||||
border: 0 none;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
right:20px;
|
||||
left: 0px;
|
||||
padding-left: 10px;
|
||||
height: 28px;
|
||||
}
|
||||
#searchInput:focus {
|
||||
border: none;
|
||||
outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px
|
||||
}
|
||||
|
||||
#notesAndSort {
|
||||
background-color: #eee; // #65bd77; // @bgColor;
|
||||
border-bottom: 1px solid @borderColor;
|
||||
a.dropdown-toggle {
|
||||
// color: #fff;
|
||||
}
|
||||
}
|
||||
#sortType {
|
||||
/* position: absolute;
|
||||
right:0;*/
|
||||
float: right;
|
||||
}
|
||||
|
||||
#noteTitleDiv {
|
||||
height: 30px;
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
#noteTitle {
|
||||
height: 100%;
|
||||
padding: 0px 3px;
|
||||
width: 100%;
|
||||
border: none;
|
||||
background-color: @bgColor;
|
||||
}
|
||||
#noteTitle:focus {
|
||||
// outline:thin dotted #333;outline:1px auto -webkit-focus-ring-color;outline-offset:-2px
|
||||
outline: none !important;
|
||||
// border: 1px solid @hColor;
|
||||
}
|
||||
|
||||
#editorContent {
|
||||
position: absolute;
|
||||
top:30px;
|
||||
bottom: 10px;
|
||||
right: 0;
|
||||
left: 0;
|
||||
overflow: auto; // 不设置editor隐藏时没有scroll
|
||||
}
|
||||
|
||||
@sbc: @bgColor;
|
||||
|
||||
.fa-calendar {
|
||||
color: #666;
|
||||
}
|
||||
.dropdown-menu .fa {
|
||||
width: 15px;
|
||||
}
|
||||
.dropdown-menu span, .dropdown-menu a, .dropdown-menu li {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
|
||||
.tab-pane {
|
||||
padding: 5px 0 0 0;
|
||||
}
|
||||
|
||||
.mce-container-body iframe {
|
||||
//overflow-x: hidden; // firefox 不能要
|
||||
//overflow-y: hidden;
|
||||
}
|
||||
// 新建笔记item
|
||||
#notebookNavForNewNote li, #notebookNavForNewSharedNote > li {
|
||||
padding-left: 0;
|
||||
border-bottom: 1px solid @borderColor;
|
||||
}
|
||||
#notebookNavForNewNote > li:hover, #notebookNavForNewNote > li:focus,
|
||||
#notebookNavForNewSharedNote > li:hover, #notebookNavForNewSharedNote > li:focus {
|
||||
background: none;
|
||||
}
|
||||
|
||||
.new-note-left {
|
||||
padding: 0 5px;
|
||||
width: 95px;
|
||||
overflow: hidden;
|
||||
white-space:nowrap;
|
||||
border-right: 1px dashed @borderColor;
|
||||
&:hover {
|
||||
background-color:@borderColor;
|
||||
}
|
||||
}
|
||||
.new-note-right {
|
||||
&:hover {
|
||||
background-color:@borderColor;
|
||||
}
|
||||
}
|
||||
|
||||
// 历史记录
|
||||
#historyList {
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
.btns{
|
||||
border-top: 1px dashed #eee;
|
||||
padding: 5px 0;
|
||||
}
|
||||
}
|
||||
|
||||
#loading {
|
||||
display: inline-block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
content: url(../../images/loading-a-20.gif);
|
||||
vertical-align: middle;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
#toggleEditorMode {
|
||||
margin: 0 10px !important;
|
||||
}
|
||||
|
||||
//----------------------
|
||||
#searchNotebookForList {
|
||||
color: #ccc;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
background-color: @leftBgColor;
|
||||
&:focus {
|
||||
outline: none !important;
|
||||
border: 1px solid rgba(255, 255, 255, 0.3);
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
.label-default {
|
||||
background-color: #191D2B;
|
||||
}
|
||||
.each-user {
|
||||
border: 1px solid rgba(0, 0, 0, 0.09);
|
||||
background-color: @leftBgColor;
|
||||
}
|
||||
#myShareNotebooks .folderBody {
|
||||
background: none;
|
||||
}
|
||||
.tmpzTreeMove_arrow {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.ztree li a.tmpTargetNode_inner {
|
||||
padding-top:0px;
|
||||
|
||||
@@ -2,6 +2,60 @@
|
||||
* 通用的
|
||||
*/
|
||||
|
||||
// 字体
|
||||
/*
|
||||
@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;
|
||||
}
|
||||
*/
|
||||
|
||||
@font-face {
|
||||
font-family: 'leanote';
|
||||
src:url('../../fonts/leanote-font2/leanote.eot?-vcf23i');
|
||||
src:url('../../fonts/leanote-font2/leanote.eot?#iefix-vcf23i') format('embedded-opentype'),
|
||||
url('../../fonts/leanote-font2/leanote.ttf?-vcf23i') format('truetype'),
|
||||
url('../../fonts/leanote-font2/leanote.woff?-vcf23i') format('woff'),
|
||||
url('../../fonts/leanote-font2/leanote.svg?-vcf23i#leanote') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
|
||||
.close:focus {
|
||||
outline: none;
|
||||
}
|
||||
@@ -219,3 +273,16 @@ a.raw:hover {
|
||||
.b-m-mpanel {
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
// modal
|
||||
|
||||
.modal-content {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
.modal-body {
|
||||
background-color: #ffffff;
|
||||
padding-bottom: 30px;
|
||||
}
|
||||
.modal-footer {
|
||||
margin-top: 0;
|
||||
}
|
||||
@@ -97,3 +97,25 @@
|
||||
.scrollTo-a {
|
||||
cursor: pointer !important;
|
||||
}
|
||||
|
||||
// 内容table
|
||||
.preview-container table,
|
||||
.mce-item-table {
|
||||
&, td, th, caption {
|
||||
border: 1px solid #ddd;
|
||||
border-collapse: collapse;
|
||||
padding: 5px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
tr {
|
||||
background-color: none;
|
||||
border-top: 1px solid #ccc;
|
||||
}
|
||||
tr:nth-child(2n) {
|
||||
background-color: rgb(247, 247, 249);
|
||||
}
|
||||
}
|
||||
.preview-container th {
|
||||
padding: 10px;
|
||||
}
|
||||
@@ -136,7 +136,7 @@ a:hover {
|
||||
#header {
|
||||
height: @headerHeight;
|
||||
background-color: @headerBgColor;
|
||||
border-bottom: 1px solid @borderColor;
|
||||
border-bottom: 1px solid @headerBottomBorderColor;
|
||||
color: @headerTextColor;
|
||||
|
||||
a {
|
||||
@@ -175,7 +175,7 @@ a:hover {
|
||||
}
|
||||
span {
|
||||
border-radius: 5px;
|
||||
background-color: @switcherBgColor;
|
||||
// background-color: @switcherBgColor;
|
||||
cursor: pointer;
|
||||
font-size: 18px;
|
||||
line-height: 34px;
|
||||
@@ -263,3 +263,11 @@ a:hover {
|
||||
background-color: @borderColor;
|
||||
}
|
||||
|
||||
#loading {
|
||||
display: inline-block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
content: @loadingUrl;
|
||||
vertical-align: middle;
|
||||
visibility: hidden;
|
||||
}
|
||||
@@ -141,9 +141,9 @@
|
||||
}
|
||||
// 编辑模式下拉
|
||||
.wmd-mode {
|
||||
min-width: 100px;
|
||||
min-width: 150px;
|
||||
left: 50%;
|
||||
margin-left: -50px !important; // 为什么要!important, 因为writting模式下要用
|
||||
margin-left: -75px !important; // 为什么要!important, 因为writting模式下要用
|
||||
// 小箭头
|
||||
&:before {
|
||||
right: auto;
|
||||
@@ -157,12 +157,25 @@
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
|
||||
textarea#wmd-input {
|
||||
color: #000 !important;
|
||||
font-family: @aceFontFamily;
|
||||
}
|
||||
|
||||
// markdown editor ace
|
||||
@mdAceTextColor: #2C3E50; // #04294E; // #384654;
|
||||
@mdAceHeadingColor: #000; // 1a2026
|
||||
@mdAceBlockquoteColor: #003873;
|
||||
@mdAceCursorColor: #243342;
|
||||
|
||||
@mdAceTextColor: #000;
|
||||
@mdAceTagColor: rgba(87, 108, 130, 0.6);
|
||||
|
||||
textarea#wmd-input {
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
#wmd-input {
|
||||
.ace_searchbtn_close {
|
||||
margin: 0px;
|
||||
@@ -191,14 +204,17 @@
|
||||
// background-color: rgba(89, 128, 166, 0.05);
|
||||
}
|
||||
&.ace-tm .ace_markup.ace_heading {
|
||||
color: @mdAceHeadingColor;
|
||||
color: @mdAceTextColor;
|
||||
font-weight: bold;
|
||||
&.ace_1,&.ace_2,&.ace_3,&.ace_4,&.ace_5 {
|
||||
color: @mdAceTagColor;
|
||||
}
|
||||
}
|
||||
&.ace-tm .ace_markup.ace_list {
|
||||
color: #576c82;
|
||||
color: @mdAceTextColor;
|
||||
}
|
||||
&.ace-tm .ace_constant.ace_language {
|
||||
color: rgba(87, 108, 130, 0.6);
|
||||
color: @mdAceTagColor;
|
||||
font-weight: normal;
|
||||
}
|
||||
&.ace-tm .ace_meta.ace_tag {
|
||||
@@ -231,15 +247,15 @@
|
||||
background: inherit;
|
||||
}
|
||||
&.ace-tm .ace_strong {
|
||||
color: #384654;
|
||||
color: @mdAceTextColor;
|
||||
font-weight: bold;
|
||||
}
|
||||
&.ace-tm .ace_emphasis {
|
||||
color: #1a2026;
|
||||
color: @mdAceTextColor;
|
||||
font-style: italic;
|
||||
}
|
||||
&.ace-tm .ace_blockquote {
|
||||
color: @mdAceBlockquoteColor;
|
||||
color: @mdAceTextColor;
|
||||
}
|
||||
&.ace-tm .ace_code {
|
||||
color: #1a2026;
|
||||
|
||||
@@ -3,3 +3,87 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#noteTitleDiv {
|
||||
height: 30px;
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
#noteTitle {
|
||||
height: 100%;
|
||||
padding: 0px 3px;
|
||||
width: 100%;
|
||||
border: none;
|
||||
background-color: @bgColor;
|
||||
}
|
||||
#noteTitle:focus {
|
||||
// outline:thin dotted #333;outline:1px auto -webkit-focus-ring-color;outline-offset:-2px
|
||||
outline: none !important;
|
||||
// border: 1px solid @hColor;
|
||||
}
|
||||
|
||||
#editorContent {
|
||||
position: absolute;
|
||||
top:30px;
|
||||
bottom: 10px;
|
||||
right: 0;
|
||||
left: 0;
|
||||
overflow: auto; // 不设置editor隐藏时没有scroll
|
||||
}
|
||||
|
||||
|
||||
@sbc: @bgColor;
|
||||
|
||||
.fa-calendar {
|
||||
color: #666;
|
||||
}
|
||||
.dropdown-menu .fa {
|
||||
width: 15px;
|
||||
}
|
||||
.dropdown-menu span, .dropdown-menu a, .dropdown-menu li {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
|
||||
.tab-pane {
|
||||
padding: 5px 0 0 0;
|
||||
}
|
||||
|
||||
// 新建笔记item
|
||||
#notebookNavForNewNote li, #notebookNavForNewSharedNote > li {
|
||||
padding-left: 0;
|
||||
border-bottom: 1px solid @borderColor;
|
||||
}
|
||||
#notebookNavForNewNote > li:hover, #notebookNavForNewNote > li:focus,
|
||||
#notebookNavForNewSharedNote > li:hover, #notebookNavForNewSharedNote > li:focus {
|
||||
background: none;
|
||||
}
|
||||
|
||||
.new-note-left {
|
||||
padding: 0 5px;
|
||||
width: 95px;
|
||||
overflow: hidden;
|
||||
white-space:nowrap;
|
||||
border-right: 1px dashed @borderColor;
|
||||
&:hover {
|
||||
background-color:@borderColor;
|
||||
}
|
||||
}
|
||||
.new-note-right {
|
||||
&:hover {
|
||||
background-color:@borderColor;
|
||||
}
|
||||
}
|
||||
|
||||
// 历史记录
|
||||
#historyList {
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
.btns{
|
||||
border-top: 1px dashed #eee;
|
||||
padding: 5px 0;
|
||||
}
|
||||
}
|
||||
|
||||
#toggleEditorMode {
|
||||
margin: 0 10px !important;
|
||||
}
|
||||
@@ -2,14 +2,43 @@
|
||||
* 笔记列表
|
||||
*/
|
||||
|
||||
|
||||
#notesAndSort {
|
||||
height: 36px;
|
||||
#noteAndEditor {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: @leftNotebookWidth;
|
||||
}
|
||||
|
||||
// 为了显示右侧的线条
|
||||
|
||||
#noteList {
|
||||
z-index: 333;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
width: @noteListWidth;
|
||||
border-right: 1px solid @noteListBorderColor;
|
||||
border-left: 1px solid @noteListBorderColor;
|
||||
z-index: 333; // 为了显示右侧的线条
|
||||
}
|
||||
#note {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
left: @noteListWidth;
|
||||
right: 0;
|
||||
padding-left: 5px;
|
||||
overflow-y: hidden;
|
||||
overflow-x: auto;
|
||||
background-color: @bgColor;
|
||||
}
|
||||
|
||||
#notesAndSort {
|
||||
background-color: @noteAndSortBgColor; // #65bd77; // @bgColor;
|
||||
border-bottom: 1px solid @borderColor;
|
||||
height: 36px;
|
||||
}
|
||||
#sortType {
|
||||
float: right;
|
||||
}
|
||||
|
||||
#noteItemListWrap {
|
||||
@@ -17,11 +46,6 @@
|
||||
top: 36px; bottom: 3px;
|
||||
}
|
||||
|
||||
#noteList {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
}
|
||||
// 笔记列表与editor的遮罩
|
||||
#noteAndEditorMask {
|
||||
position: absolute;
|
||||
@@ -33,7 +57,7 @@
|
||||
text-align: center;
|
||||
padding-top: 60px;
|
||||
opacity: .3;
|
||||
z-index: 20;
|
||||
z-index: 500;
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,140 @@
|
||||
#leftNotebook {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: @leftNotebookWidth;
|
||||
}
|
||||
|
||||
#notebook, #notebookMin {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
background-color: @notebookBgColor;
|
||||
overflow-y: auto;
|
||||
overflow-x: auto;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
// 添加笔记本
|
||||
#addNotebookPlus {
|
||||
padding-right: 10px;
|
||||
.fa {
|
||||
font-size: 16px;
|
||||
}
|
||||
color: @addNotebookColor;
|
||||
}
|
||||
|
||||
// 重命名, 添加notebook
|
||||
#notebookList input, #notebookListForSearch input {
|
||||
border: @notebookInputBorder;
|
||||
width: 90%;
|
||||
padding-left:3px;
|
||||
box-shadow: none;
|
||||
background: none;
|
||||
color: @notebookInputColor;
|
||||
&:focus {
|
||||
outline: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
// 最小化
|
||||
|
||||
#notebookMin {
|
||||
z-index: 1;
|
||||
overflow-y: visible;
|
||||
overflow-x: visible;
|
||||
background-color: @notebookMinBgColor;
|
||||
div.minContainer {
|
||||
border-bottom: @notebookMinContainerBorder;
|
||||
padding: 5px;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
i {
|
||||
font-size: 20px;
|
||||
color: @notebookMinIconColor;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
i {
|
||||
color: @hColor;
|
||||
}
|
||||
}
|
||||
ul {
|
||||
background-color: #fff;
|
||||
opacity: 0.8;
|
||||
display: none;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
margin-left: 20px;
|
||||
padding: 5px 0px;
|
||||
border: 1px solid @hColor;
|
||||
position: absolute;
|
||||
z-index: 1000;
|
||||
top: 0;
|
||||
left: 10px;
|
||||
width: 150px;
|
||||
li {
|
||||
padding: 0 5px;
|
||||
cursor: pointer;
|
||||
span {
|
||||
cursor: pointer;
|
||||
}
|
||||
a {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#notebookBottom {
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
height: 30px;
|
||||
right: 0;
|
||||
left: 0;
|
||||
line-height: 30px;
|
||||
text-align: right;
|
||||
padding-right: 5px;
|
||||
background-color: #eee;
|
||||
#leftSwitcher {
|
||||
border: 1px solid #ccc;
|
||||
padding: 3px 8px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
//------------
|
||||
// folder
|
||||
|
||||
.folderHeader {
|
||||
min-height: @folderHeaderHeight;
|
||||
line-height: @folderHeaderHeight;
|
||||
cursor: pointer;
|
||||
border-bottom: 1px solid transparent;
|
||||
border-color: @folderHeaderBorderColor;
|
||||
}
|
||||
.folderHeader span {
|
||||
display: inline-block;
|
||||
line-height: @folderHeaderHeight;
|
||||
color: @folderHeaderIconColor;
|
||||
font-size: 16px;
|
||||
}
|
||||
.folderHeader .fa-left, .friend-header i.fa {
|
||||
display: inline-block;
|
||||
line-height: @folderHeaderHeight;
|
||||
font-size: 16px;
|
||||
width: @folderHeaderHeight;
|
||||
border-right: 1px solid @folderHeaderBorderColor;
|
||||
text-align: center;
|
||||
color: @folderHeaderIconColor;
|
||||
}
|
||||
|
||||
//-------------
|
||||
// 分享
|
||||
|
||||
// share
|
||||
.friend-header {
|
||||
@@ -20,10 +157,38 @@
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
margin-top: 3px;
|
||||
border: 1px solid #eee;
|
||||
border-radius: 3px;
|
||||
border: 1px solid @eachUserBorderColor;
|
||||
background-color: @notebookBodyBgColor;
|
||||
}
|
||||
|
||||
.each-user div {
|
||||
cursor: pointer;
|
||||
border-bottom: 1px solid transparent;
|
||||
border-color: @folderHeaderBorderColor;
|
||||
span {
|
||||
line-height: @folderHeaderHeight;
|
||||
color: @folderHeaderIconColor;
|
||||
padding-left: 3px;
|
||||
font-size: 14px;
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 23px;
|
||||
top: 0;
|
||||
right: 23px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.fa {
|
||||
width: 20px;
|
||||
border-right: none;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
//------------
|
||||
|
||||
//
|
||||
.notebook-number-notes {
|
||||
position: absolute;
|
||||
@@ -66,13 +231,12 @@
|
||||
line-height: normal;
|
||||
}
|
||||
#notebookList {
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.05);
|
||||
border-top: @notebookListBorder;
|
||||
}
|
||||
.ztree {
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
|
||||
#searchNotebookForAdd {
|
||||
line-height: normal;
|
||||
width: 200px;
|
||||
@@ -102,3 +266,36 @@
|
||||
#notebookNavForNewNote li:hover {
|
||||
background: none;
|
||||
}
|
||||
|
||||
.folderBody {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: @notebookBodyBgColor;
|
||||
}
|
||||
|
||||
.folderBody li {
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
// 关闭状态
|
||||
|
||||
.closed .folderBody {
|
||||
display: none;
|
||||
}
|
||||
|
||||
// tag
|
||||
#myTag .folderBody {
|
||||
li {
|
||||
position: relative
|
||||
}
|
||||
}
|
||||
|
||||
#myTag .folderBody li .badge {
|
||||
width: 40px;
|
||||
position: absolute; right:3px; top: 7px;
|
||||
font-weight: normal;
|
||||
background-color: @bgColor;
|
||||
color: @aBlackColor;
|
||||
border: 1px solid @borderColor;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
#page {
|
||||
overflow: auto;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
}
|
||||
#pageInner {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
#mainContainer {
|
||||
position: absolute;
|
||||
top: @headerHeight;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
overflow: auto;
|
||||
zoom: 1;
|
||||
}
|
||||
#mainMask {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
background-color: #fff;
|
||||
text-align: center;
|
||||
padding-top: 100px;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
#notebookSplitter {
|
||||
left: @leftNotebookWidth;
|
||||
}
|
||||
#noteSplitter {
|
||||
left: @noteListWidth;
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
.info-toolbar {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
line-height: 30px;
|
||||
padding-left: 5px;
|
||||
height: 30px;
|
||||
display: none;
|
||||
}
|
||||
.info-toolbar .toolbar-update {
|
||||
color: inherit;
|
||||
float: right;
|
||||
padding: 0 10px;
|
||||
}
|
||||
.info-toolbar .toolbar-update:hover {
|
||||
background: #fff;
|
||||
color: #000;
|
||||
}
|
||||
.info-toolbar .created-time {
|
||||
display: inline-block;
|
||||
padding-right: 10px;
|
||||
}
|
||||
#editorContent {
|
||||
-webkit-user-select: text;
|
||||
}
|
||||
#editor.read-only #mceToolbarContainer {
|
||||
display: none;
|
||||
}
|
||||
#editor.read-only .info-toolbar {
|
||||
display: block;
|
||||
}
|
||||
#note.read-only #editor,
|
||||
#note.read-only #mdEditor {
|
||||
top: 60px;
|
||||
}
|
||||
#note.read-only #tool {
|
||||
display: none;
|
||||
}
|
||||
#note.read-only .toolbar-update {
|
||||
display: none;
|
||||
}
|
||||
#note.read-only #noteReadTop {
|
||||
display: block;
|
||||
}
|
||||
#note.read-only #infoToolbar,
|
||||
#note.read-only #mceToolbar,
|
||||
#note.read-only .navbar {
|
||||
display: none;
|
||||
}
|
||||
#note.read-only #editorContent,
|
||||
#note.read-only #mdEditor .layout-wrapper-l3 {
|
||||
top: 0;
|
||||
}
|
||||
#noteRead {
|
||||
position: absolute;
|
||||
left: 5px;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
display: none;
|
||||
z-index: 100;
|
||||
padding-left: 5px;
|
||||
background-color: #fff;
|
||||
}
|
||||
#noteReadTop {
|
||||
position: absolute;
|
||||
height: 60px;
|
||||
left: 5px;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
z-index: 2;
|
||||
display: none;
|
||||
background: #fff;
|
||||
padding-left: 5px;
|
||||
}
|
||||
#noteReadTitle {
|
||||
margin: 3px 0;
|
||||
height: 26px;
|
||||
}
|
||||
@@ -54,21 +54,6 @@
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
// 内容table
|
||||
.mce-item-table tr {
|
||||
background-color: none;
|
||||
border-top: 1px solid #ccc;
|
||||
}
|
||||
.mce-item-table tr:nth-child(2n) {
|
||||
background-color: rgb(247, 247, 249);
|
||||
}
|
||||
.mce-item-table, .mce-item-table td, .mce-item-table th, .mce-item-table caption {
|
||||
border: 1px solid #ddd;
|
||||
border-collapse: collapse;
|
||||
padding: 5px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
|
||||
#moreBtn {
|
||||
dispaly: block; position: absolute;
|
||||
|
||||
@@ -33,14 +33,17 @@
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
th {
|
||||
min-width: 80px;
|
||||
min-width: 100px;
|
||||
}
|
||||
th, td {
|
||||
border-top: none;
|
||||
border-bottom: 1px solid #dddddd;
|
||||
padding: 8px;
|
||||
line-height: 20px;
|
||||
vertical-align: top;
|
||||
}
|
||||
td {
|
||||
max-width: 300px;
|
||||
max-width: 280px;
|
||||
}
|
||||
}
|
||||
a {
|
||||
|
||||
@@ -1 +1 @@
|
||||
::selection{background:#000;color:#fff}::-moz-selection{background:#000;color:#fff}::-webkit-selection{background:#000;color:#fff}@-webkit-keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@-moz-keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@-ms-keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@-webkit-keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@-moz-keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@-ms-keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-moz-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-o-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes fadeInUp{0%{opacity:0;-webkit-transform:translateY(20px)}100%{opacity:1;-webkit-transform:translateY(0)}}@-moz-keyframes fadeInUp{0%{opacity:0;-moz-transform:translateY(20px)}100%{opacity:1;-moz-transform:translateY(0)}}@-o-keyframes fadeInUp{0%{opacity:0;-o-transform:translateY(20px)}100%{opacity:1;-o-transform:translateY(0)}}@keyframes fadeInUp{0%{opacity:0;transform:translateY(20px)}100%{opacity:1;transform:translateY(0)}}.animated{-webkit-animation-fill-mode:both;-moz-animation-fill-mode:both;-ms-animation-fill-mode:both;-o-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.5s;-moz-animation-duration:.5s;-ms-animation-duration:.5s;-o-animation-duration:.5s;animation-duration:.5s}.fadeIn{-webkit-animation-name:fadeIn;-moz-animation-name:fadeIn;-o-animation-name:fadeIn;animation-name:fadeIn}.fadeInUp{-webkit-animation-name:fadeInUp;-moz-animation-name:fadeInUp;-o-animation-name:fadeInUp;animation-name:fadeInUp}.close:focus{outline:0}.invisible{visibility:hidden}.btn{border-radius:2px}.alert{margin-bottom:10px}.btn *{cursor:pointer!important}.dropdown-submenu{position:relative}.dropdown-submenu>ul.dropdown-menu{top:0;left:100%;margin-left:-3px!important;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;padding-top:10px!important}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropdown-submenu:after{display:block;content:" ";position:absolute;right:0;top:10px;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;border-left-color:#666}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown-submenu.pull-left{float:none}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.open>.dropdown-menu,.dropdown-submenu:hover>.dropdown-menu{visibility:visible;-webkit-animation:pulldown .2s;animation:pulldown .2s}.dropdown-menu{visibility:hidden;display:block}.dropdown-list{width:530px;border-radius:3px}.dropdown-list ul{margin:0;padding:0}.dropdown-list ul li{float:left;width:120px;margin-left:10px;margin-bottom:10px;border:1px dashed #ccc}.dropdown-menu .divider{margin:3px 0}.dropdown-menu{border-radius:3px;margin:0;border:1px solid #e6eaed;box-shadow:rgba(0,0,0,.172549)0 6px 12px 0}.dropdown-menu:before{content:"";width:20px;height:12px;position:absolute;top:-12px;right:8px;background-image:url(../../images/triangle_2x.png);background-size:20px 12px}.dropdown-submenu .dropdown-menu:before{background:0 0}#searchNotebookForAddDropdownList,#searchNotebookForAddShareDropdownList{left:-200px}#searchNotebookForAddDropdownList:before,#searchNotebookForAddShareDropdownList:before{left:190px;right:inherit}.dropdown-menu li{list-style:none;padding-left:10px;width:100%;height:30px;line-height:30px}.dropdown-menu li>a{color:#000;display:block;padding-right:20px}.dropdown-menu>li>a{padding:3px 20px 3px 0}.noteSplit{position:absolute;top:0;width:5px;height:100%;overflow:hidden;z-index:3333;cursor:col-resize}a.raw{color:#428bca}a.raw:hover{color:#2a6496}.cm-item{position:relative}.cm-item .cm-text{position:absolute;left:23px;right:10px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.cm-item .cm-text .c-text{display:initial}.b-m-mpanel{border-radius:3px}#listNotebookDropdownMenu{display:none}#themeForm td{padding:5px;text-align:center}#themeForm img{border:1px solid #eee;padding:2px}#logo{font-size:36px}#avatar{height:60px;max-width:200px;display:inline-block;margin:10px}.new-split{display:none}.new-note-right{padding:0 5px;padding-left:3px}#leanoteMsg{line-height:40px;margin-top:10px;margin-left:10px}#newNoteWrap{line-height:40px;margin-top:10px}.new-note{background-color:#eee;border-radius:3px;padding:3px 5px;border:1px solid transparent}.new-note,.new-note a{color:#000}.new-note:hover{background:#e0e0e0;border-color:transparent}.new-note:hover,.new-notLine truncated
|
||||
::selection{background:#000;color:#fff}::-moz-selection{background:#000;color:#fff}::-webkit-selection{background:#000;color:#fff}@-webkit-keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@-moz-keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@-ms-keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@-webkit-keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@-moz-keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@-ms-keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-moz-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-o-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes fadeInUp{0%{opacity:0;-webkit-transform:translateY(20px)}100%{opacity:1;-webkit-transform:translateY(0)}}@-moz-keyframes fadeInUp{0%{opacity:0;-moz-transform:translateY(20px)}100%{opacity:1;-moz-transform:translateY(0)}}@-o-keyframes fadeInUp{0%{opacity:0;-o-transform:translateY(20px)}100%{opacity:1;-o-transform:translateY(0)}}@keyframes fadeInUp{0%{opacity:0;transform:translateY(20px)}100%{opacity:1;transform:translateY(0)}}.animated{-webkit-animation-fill-mode:both;-moz-animation-fill-mode:both;-ms-animation-fill-mode:both;-o-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.5s;-moz-animation-duration:.5s;-ms-animation-duration:.5s;-o-animation-duration:.5s;animation-duration:.5s}.fadeIn{-webkit-animation-name:fadeIn;-moz-animation-name:fadeIn;-o-animation-name:fadeIn;animation-name:fadeIn}.fadeInUp{-webkit-animation-name:fadeInUp;-moz-animation-name:fadeInUp;-o-animation-name:fadeInUp;animation-name:fadeInUp}@font-face{font-family:leanote;src:url(../../fonts/leanote-font2/leanote.eot?-vcf23i);src:url(../../fonts/leanote-font2/leanote.eot?#iefix-vcf23i) format('embedded-opentype'),url(../../fonts/leanote-font2/leanote.ttf?-vcf23i) format('truetype'),url(../../fonts/leanote-font2/leanote.woff?-vcf23i) format('woff'),url(../../fonts/leanote-font2/leanote.svg?-vcf23i#leanote) format('svg');font-weight:400;font-style:normal}.close:focus{outline:0}.invisible{visibility:hidden}.btn{border-radius:2px}.alert{margin-bottom:10px}.btn *{cursor:pointer!important}.dropdown-submenu{position:relative}.dropdown-submenu>ul.dropdown-menu{top:0;left:100%;margin-left:-3px!important;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;padding-top:10px!important}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropdown-submenu:after{display:block;content:" ";position:absolute;right:0;top:10px;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;border-left-color:#666}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown-submenu.pull-left{float:none}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.open>.dropdown-menu,.dropdown-submenu:hover>.dropdown-menu{visibility:visible;-webkit-animation:pulldown .2s;animation:pulldown .2s}.dropdown-menu{visibility:hidden;display:block}.dropdown-list{width:530px;border-radius:3px}.dropdown-list ul{margin:0;padding:0}.dropdown-list ul li{float:left;width:120px;margin-left:10px;margin-bottom:10px;border:1px dashed #ccc}.dropdown-menu .divider{margin:3px 0}.dropdown-menu{border-radius:3px;margin:0;border:1px solid #e6eaed;box-shadow:rgba(0,0,0,.172549)0 6px 12px 0}.dropdown-menu:before{content:"";width:20px;height:12px;position:absolute;top:-12px;right:8px;background-image:url(../../images/triangle_2x.png);background-size:20px 12px}.dropdown-submenu .dropdown-menu:before{background:0 0}#searchNotebookForAddDropdownList,#searchNotebookForAddShareDropdownList{left:-200px}#searchNotebookForAddDropdownList:before,#searchNotebookForAddShareDropdownList:before{left:190px;right:inherit}.dropdown-menu li{list-style:none;padding-left:10px;width:100%;height:30px;line-height:30px}.dropdown-menu li>a{color:#000;display:block;padding-right:20px}.dropdown-menu>li>a{padding:3px 20px 3px 0}.noteSplit{position:absolute;top:0;width:5px;height:100%;overflow:hidden;z-index:3333;cursor:col-resize}a.raw{color:#428bca}a.raw:hover{color:#2a6496}.cm-item{position:relative}.cm-item .cm-text{position:absolute;left:23px;right:10px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.cm-item .cm-text .c-text{display:initial}.b-m-mpanel{border-radius:3px}.modal-content{background-color:#f8f8f8}.modal-body{background-color:#fff;padding-bottom:30px}.modal-footer{margin-top:0}#listNotebookDropdownMenu{display:none}#themeForm td{padding:5px;text-aliLine truncated
|
||||
+16
-412
@@ -2,11 +2,10 @@
|
||||
|
||||
@bgColor: #fff;
|
||||
@headerBgColor: #fff;
|
||||
// @fontFamily: 'Open Sans','Helvetica Neue',Arial,'Hiragino Sans GB','Microsoft YaHei','WenQuanYi Micro Hei',sans-serif;
|
||||
@fontFamily: Helvetica, Tahoma, Arial, Hiragino Sans GB, "Microsoft YaHei", "微软雅黑", "Micro Hei", SimSun, "宋体", Heiti, "黑体", sans-serif;
|
||||
@aWhiteColor: #fff;
|
||||
@aBlackColor: #000;
|
||||
@borderColor: #EBEFF2;
|
||||
@headerBottomBorderColor: @borderColor;
|
||||
@headerHeight: 60px;
|
||||
@hColor: #0fb264; // #47a447;// 更深 #198764; // boostrap: #5cb85c; bootstrap:hover #47a447; // #5AD4A0; // #47a447
|
||||
@titleColor: @hColor;
|
||||
@@ -23,6 +22,7 @@
|
||||
@headerAColor: #000;
|
||||
@switcherBgColor: #fff;
|
||||
@logoColor: #fff;
|
||||
@loadingUrl: url(../../images/loading-a-20-black.gif);
|
||||
|
||||
@searchNoteInputBorder: 1px solid @borderColor;
|
||||
@searchNoteInputBgColor: #fff;
|
||||
@@ -33,245 +33,28 @@
|
||||
@newNoteBorder: 1px solid transparent;
|
||||
@newNoteTextColor: #000;
|
||||
|
||||
/*********************/
|
||||
#page {
|
||||
overflow: auto;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
}
|
||||
#pageInner {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
#mainContainer {
|
||||
position: absolute;
|
||||
top: @headerHeight;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
overflow: auto;
|
||||
zoom: 1;
|
||||
}
|
||||
#mainMask {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
background-color: #fff;
|
||||
text-align: center;
|
||||
padding-top: 100px;
|
||||
z-index: 1000;
|
||||
}
|
||||
@notebookBgColor: @bgColor;
|
||||
@notebookBodyBgColor: #fff;
|
||||
|
||||
#notebookSplitter {
|
||||
left: @leftNotebookWidth;
|
||||
}
|
||||
#noteSplitter {
|
||||
left: @noteListWidth;
|
||||
}
|
||||
@addNotebookColor: #666;
|
||||
|
||||
#leftNotebook {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: @leftNotebookWidth;
|
||||
}
|
||||
#notebook, #notebookMin {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
// bottom: 30px; 为了给bottom
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
/*border: 1px solid #ccc;*/
|
||||
background-color: @bgColor;
|
||||
overflow-y: auto;
|
||||
overflow-x: auto;
|
||||
z-index: 2;
|
||||
}
|
||||
@notebookListBorder: #eee;
|
||||
|
||||
#notebookMin {
|
||||
z-index: 1;
|
||||
overflow-y: visible;
|
||||
overflow-x: visible;
|
||||
background-color: #eee;
|
||||
div.minContainer {
|
||||
border-bottom: 1px solid #ccc;
|
||||
padding: 5px;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
i {
|
||||
font-size: 20px;
|
||||
color: #000;
|
||||
}
|
||||
@notebookInputBorder: none;
|
||||
@notebookInputColor: #000;
|
||||
|
||||
&:hover {
|
||||
i {
|
||||
color: @hColor;
|
||||
}
|
||||
}
|
||||
ul {
|
||||
background-color: #fff;
|
||||
opacity: 0.8;
|
||||
display: none;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
margin-left: 20px;
|
||||
padding: 5px 0px;
|
||||
border: 1px solid @hColor;
|
||||
position: absolute;
|
||||
z-index: 1000;
|
||||
top: 0;
|
||||
left: 10px;
|
||||
width: 150px;
|
||||
li {
|
||||
padding: 0 5px;
|
||||
cursor: pointer;
|
||||
span {
|
||||
cursor: pointer;
|
||||
}
|
||||
a {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@notebookMinBgColor: #eee;
|
||||
@notebookMinContainerBorder: 1px solid #ccc;
|
||||
@notebookMinIconColor: #000;
|
||||
|
||||
#notebookBottom {
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
height: 30px;
|
||||
right: 0;
|
||||
left: 0;
|
||||
line-height: 30px;
|
||||
text-align: right;
|
||||
padding-right: 5px;
|
||||
background-color: #eee;
|
||||
#leftSwitcher {
|
||||
border: 1px solid #ccc;
|
||||
padding: 3px 8px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
@folderHeaderBorderColor: rgba(0,0,0,0.05);
|
||||
@folderHeaderIconColor: #000;
|
||||
|
||||
#noteAndEditor {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
right: 0;
|
||||
left: @leftNotebookWidth;
|
||||
}
|
||||
@eachUserBorderColor: #eee;
|
||||
|
||||
#noteList {
|
||||
width: @noteListWidth;
|
||||
border-right: 1px solid @borderColor;
|
||||
border-left: 1px solid @borderColor;
|
||||
}
|
||||
@noteListBorderColor: @borderColor;
|
||||
@noteAndSortBgColor: @bgColor;
|
||||
|
||||
#note {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
left: @noteListWidth;
|
||||
right: 0;
|
||||
padding-left: 5px;
|
||||
overflow-y: hidden;
|
||||
overflow-x: auto;
|
||||
background-color: @bgColor;
|
||||
}
|
||||
.folderNote {
|
||||
// padding-bottom: 5px;
|
||||
}
|
||||
@folderHeaderHeight: 35px;
|
||||
.folderHeader {
|
||||
min-height: @folderHeaderHeight;
|
||||
line-height: @folderHeaderHeight;
|
||||
cursor: pointer;
|
||||
border-bottom: 1px solid transparent;
|
||||
border-color: rgba(0,0,0,0.05);
|
||||
}
|
||||
.folderHeader span {
|
||||
display: inline-block;
|
||||
line-height: @folderHeaderHeight;
|
||||
color: #000; // @hColor;
|
||||
font-size: 16px;
|
||||
}
|
||||
.folderHeader .fa-left, .friend-header i.fa {
|
||||
display: inline-block;
|
||||
line-height: @folderHeaderHeight;
|
||||
font-size: 16px;
|
||||
width: @folderHeaderHeight;
|
||||
border-right: 1px solid rgba(0,0,0,0.05);
|
||||
text-align: center;
|
||||
color: #000; // @hColor;
|
||||
}
|
||||
|
||||
.each-user div {
|
||||
cursor: pointer;
|
||||
border-bottom: 1px solid transparent;
|
||||
border-color: rgba(0,0,0,0.05);
|
||||
span {
|
||||
display: inline-block;
|
||||
line-height: @folderHeaderHeight;
|
||||
color: #000;
|
||||
padding-left: 3px;
|
||||
font-size: 14px;
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 23px;
|
||||
top: 0;
|
||||
right: 23px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.fa {
|
||||
width: 20px;
|
||||
border-right: none;
|
||||
}
|
||||
}
|
||||
|
||||
#myNotebooks.opened .fa-left {
|
||||
/*
|
||||
background-color: #65bd77;
|
||||
color: #e2f3e5;
|
||||
*/
|
||||
}
|
||||
#myNotebooks .folderBody {
|
||||
}
|
||||
#addNotebookPlus {
|
||||
padding-right: 10px;
|
||||
.fa {
|
||||
font-size: 16px;
|
||||
}
|
||||
color: #666;
|
||||
}
|
||||
.closed .folder-icon { /* 折叠状态 */
|
||||
width: 9px;
|
||||
height: 11px;
|
||||
background-position: -108px -149px;
|
||||
}
|
||||
.closed .folderBody {
|
||||
display: none;
|
||||
}
|
||||
.folderBody {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.folderBody li {
|
||||
line-height: 30px;
|
||||
}
|
||||
.folderBody a.active {
|
||||
background-color: @bgColor;
|
||||
color: @hColor;
|
||||
@@ -281,183 +64,4 @@
|
||||
background-color: @borderColor !important;
|
||||
}
|
||||
|
||||
// 重命名, 添加notebook
|
||||
#notebookList input, #notebookListForSearch input {
|
||||
width: 90%;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
padding-left:3px;
|
||||
background: none;
|
||||
&:focus {
|
||||
outline: none !important;
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
|
||||
#myTag .folderBody {
|
||||
li {
|
||||
position: relative
|
||||
}
|
||||
}
|
||||
|
||||
#myTag .folderBody li .badge {
|
||||
width: 40px;
|
||||
position: absolute; right:3px; top: 7px;
|
||||
font-weight: normal;
|
||||
background-color: @bgColor;
|
||||
color: @aBlackColor;
|
||||
border: 1px solid @borderColor;
|
||||
}
|
||||
/* notelist */
|
||||
|
||||
|
||||
#search {
|
||||
border: #bababa 1px solid;
|
||||
background-color: #fff;
|
||||
white-space: nowrap;
|
||||
position: absolute;
|
||||
height: 30px;
|
||||
left:3px;
|
||||
right:60px;
|
||||
margin-top: 3px;
|
||||
}
|
||||
#search label {
|
||||
display: none;
|
||||
}
|
||||
#searchButton {
|
||||
border: 0 none;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
right:3px;
|
||||
top: 5px;
|
||||
}
|
||||
#searchInput {
|
||||
border: 0 none;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
right:20px;
|
||||
left: 0px;
|
||||
padding-left: 10px;
|
||||
height: 28px;
|
||||
}
|
||||
#searchInput:focus {
|
||||
border: none;
|
||||
outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px
|
||||
}
|
||||
|
||||
#notesAndSort {
|
||||
background-color: @bgColor;
|
||||
border-bottom: 1px solid @borderColor;
|
||||
}
|
||||
#sortType {
|
||||
/* position: absolute;
|
||||
right:0;*/
|
||||
float: right;
|
||||
}
|
||||
|
||||
#noteTitleDiv {
|
||||
height: 30px;
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
#noteTitle {
|
||||
height: 100%;
|
||||
padding: 0px 3px;
|
||||
width: 100%;
|
||||
border: none;
|
||||
background-color: @bgColor;
|
||||
min-width: 300px;
|
||||
}
|
||||
#noteTitle:focus {
|
||||
// outline:thin dotted #333;outline:1px auto -webkit-focus-ring-color;outline-offset:-2px
|
||||
outline: none !important;
|
||||
// border: 1px solid @hColor;
|
||||
}
|
||||
|
||||
#editorContent {
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
bottom: 10px;
|
||||
right: 0;
|
||||
left: 0;
|
||||
overflow: auto; // 不设置editor隐藏时没有scroll
|
||||
}
|
||||
|
||||
@sbc: @bgColor;
|
||||
|
||||
.fa-calendar {
|
||||
color: #666;
|
||||
}
|
||||
.dropdown-menu .fa {
|
||||
width: 15px;
|
||||
}
|
||||
.dropdown-menu span, .dropdown-menu a, .dropdown-menu li {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
// 顶部导航, 博客
|
||||
#topNav a {
|
||||
display: inline-block;
|
||||
line-height: 60px;
|
||||
}
|
||||
|
||||
.tab-pane {
|
||||
padding: 5px 0 0 0;
|
||||
}
|
||||
|
||||
// 新建笔记item
|
||||
#notebookNavForNewNote li, #notebookNavForNewSharedNote > li {
|
||||
padding-left: 0;
|
||||
border-bottom: 1px solid @borderColor;
|
||||
}
|
||||
#notebookNavForNewNote > li:hover, #notebookNavForNewNote > li:focus,
|
||||
#notebookNavForNewSharedNote > li:hover, #notebookNavForNewSharedNote > li:focus {
|
||||
background: none;
|
||||
}
|
||||
.new-note-left {
|
||||
padding: 0 5px;
|
||||
width: 95px;
|
||||
overflow: hidden;
|
||||
white-space:nowrap;
|
||||
border-right: 1px dashed @borderColor;
|
||||
&:hover {
|
||||
background-color:@borderColor;
|
||||
}
|
||||
}
|
||||
.new-note-right {
|
||||
&:hover {
|
||||
background-color:@borderColor;
|
||||
}
|
||||
}
|
||||
|
||||
// 历史记录
|
||||
#historyList {
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
.btns{
|
||||
border-top: 1px dashed #eee;
|
||||
padding: 5px 0;
|
||||
}
|
||||
}
|
||||
|
||||
#loading {
|
||||
display: inline-block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
content: url(../../images/loading-a-20-black.gif);
|
||||
vertical-align: middle;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
#toggleEditorMode {
|
||||
margin: 0 10px !important;
|
||||
}
|
||||
|
||||
#notebookList {
|
||||
border-top: 1px dashed #eee;
|
||||
}
|
||||
|
||||
@import "mobile.less";
|
||||
@@ -1 +1 @@
|
||||
::selection{background:#000;color:#fff}::-moz-selection{background:#000;color:#fff}::-webkit-selection{background:#000;color:#fff}@-webkit-keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@-moz-keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@-ms-keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@-webkit-keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@-moz-keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@-ms-keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-moz-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-o-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes fadeInUp{0%{opacity:0;-webkit-transform:translateY(20px)}100%{opacity:1;-webkit-transform:translateY(0)}}@-moz-keyframes fadeInUp{0%{opacity:0;-moz-transform:translateY(20px)}100%{opacity:1;-moz-transform:translateY(0)}}@-o-keyframes fadeInUp{0%{opacity:0;-o-transform:translateY(20px)}100%{opacity:1;-o-transform:translateY(0)}}@keyframes fadeInUp{0%{opacity:0;transform:translateY(20px)}100%{opacity:1;transform:translateY(0)}}.animated{-webkit-animation-fill-mode:both;-moz-animation-fill-mode:both;-ms-animation-fill-mode:both;-o-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.5s;-moz-animation-duration:.5s;-ms-animation-duration:.5s;-o-animation-duration:.5s;animation-duration:.5s}.fadeIn{-webkit-animation-name:fadeIn;-moz-animation-name:fadeIn;-o-animation-name:fadeIn;animation-name:fadeIn}.fadeInUp{-webkit-animation-name:fadeInUp;-moz-animation-name:fadeInUp;-o-animation-name:fadeInUp;animation-name:fadeInUp}.close:focus{outline:0}.invisible{visibility:hidden}.btn{border-radius:2px}.alert{margin-bottom:10px}.btn *{cursor:pointer!important}.dropdown-submenu{position:relative}.dropdown-submenu>ul.dropdown-menu{top:0;left:100%;margin-left:-3px!important;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;padding-top:10px!important}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropdown-submenu:after{display:block;content:" ";position:absolute;right:0;top:10px;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;border-left-color:#666}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown-submenu.pull-left{float:none}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.open>.dropdown-menu,.dropdown-submenu:hover>.dropdown-menu{visibility:visible;-webkit-animation:pulldown .2s;animation:pulldown .2s}.dropdown-menu{visibility:hidden;display:block}.dropdown-list{width:530px;border-radius:3px}.dropdown-list ul{margin:0;padding:0}.dropdown-list ul li{float:left;width:120px;margin-left:10px;margin-bottom:10px;border:1px dashed #ccc}.dropdown-menu .divider{margin:3px 0}.dropdown-menu{border-radius:3px;margin:0;border:1px solid #e6eaed;box-shadow:rgba(0,0,0,.172549)0 6px 12px 0}.dropdown-menu:before{content:"";width:20px;height:12px;position:absolute;top:-12px;right:8px;background-image:url(../../images/triangle_2x.png);background-size:20px 12px}.dropdown-submenu .dropdown-menu:before{background:0 0}#searchNotebookForAddDropdownList,#searchNotebookForAddShareDropdownList{left:-200px}#searchNotebookForAddDropdownList:before,#searchNotebookForAddShareDropdownList:before{left:190px;right:inherit}.dropdown-menu li{list-style:none;padding-left:10px;width:100%;height:30px;line-height:30px}.dropdown-menu li>a{color:#000;display:block;padding-right:20px}.dropdown-menu>li>a{padding:3px 20px 3px 0}.noteSplit{position:absolute;top:0;width:5px;height:100%;overflow:hidden;z-index:3333;cursor:col-resize}a.raw{color:#428bca}a.raw:hover{color:#2a6496}.cm-item{position:relative}.cm-item .cm-text{position:absolute;left:23px;right:10px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.cm-item .cm-text .c-text{display:initial}.b-m-mpanel{border-radius:3px}#listNotebookDropdownMenu{display:none}#themeForm td{padding:5px;text-align:center}#themeForm img{border:1px solid #eee;padding:2px}#logo{font-size:36px}#avatar{height:60px;max-width:200px;display:inline-block;margin:10px}.new-split{display:none}.new-note-right{padding:0 5px;padding-left:3px}#leanoteMsg{line-height:40px;margin-top:10px;margin-left:10px}#newNoteWrap{line-height:40px;margin-top:10px}.new-note{background-color:#000;border-radius:3px;padding:3px 5px;border:1px solid #080303}.new-note,.new-note a{color:#fff}.new-note:hover{background:#3d3b3b;border-color:transparent}.new-note:hover,.new-note:hoLine truncated
|
||||
::selection{background:#000;color:#fff}::-moz-selection{background:#000;color:#fff}::-webkit-selection{background:#000;color:#fff}@-webkit-keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@-moz-keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@-ms-keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@-webkit-keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@-moz-keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@-ms-keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-moz-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-o-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes fadeInUp{0%{opacity:0;-webkit-transform:translateY(20px)}100%{opacity:1;-webkit-transform:translateY(0)}}@-moz-keyframes fadeInUp{0%{opacity:0;-moz-transform:translateY(20px)}100%{opacity:1;-moz-transform:translateY(0)}}@-o-keyframes fadeInUp{0%{opacity:0;-o-transform:translateY(20px)}100%{opacity:1;-o-transform:translateY(0)}}@keyframes fadeInUp{0%{opacity:0;transform:translateY(20px)}100%{opacity:1;transform:translateY(0)}}.animated{-webkit-animation-fill-mode:both;-moz-animation-fill-mode:both;-ms-animation-fill-mode:both;-o-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.5s;-moz-animation-duration:.5s;-ms-animation-duration:.5s;-o-animation-duration:.5s;animation-duration:.5s}.fadeIn{-webkit-animation-name:fadeIn;-moz-animation-name:fadeIn;-o-animation-name:fadeIn;animation-name:fadeIn}.fadeInUp{-webkit-animation-name:fadeInUp;-moz-animation-name:fadeInUp;-o-animation-name:fadeInUp;animation-name:fadeInUp}@font-face{font-family:leanote;src:url(../../fonts/leanote-font2/leanote.eot?-vcf23i);src:url(../../fonts/leanote-font2/leanote.eot?#iefix-vcf23i) format('embedded-opentype'),url(../../fonts/leanote-font2/leanote.ttf?-vcf23i) format('truetype'),url(../../fonts/leanote-font2/leanote.woff?-vcf23i) format('woff'),url(../../fonts/leanote-font2/leanote.svg?-vcf23i#leanote) format('svg');font-weight:400;font-style:normal}.close:focus{outline:0}.invisible{visibility:hidden}.btn{border-radius:2px}.alert{margin-bottom:10px}.btn *{cursor:pointer!important}.dropdown-submenu{position:relative}.dropdown-submenu>ul.dropdown-menu{top:0;left:100%;margin-left:-3px!important;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;padding-top:10px!important}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropdown-submenu:after{display:block;content:" ";position:absolute;right:0;top:10px;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;border-left-color:#666}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown-submenu.pull-left{float:none}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.open>.dropdown-menu,.dropdown-submenu:hover>.dropdown-menu{visibility:visible;-webkit-animation:pulldown .2s;animation:pulldown .2s}.dropdown-menu{visibility:hidden;display:block}.dropdown-list{width:530px;border-radius:3px}.dropdown-list ul{margin:0;padding:0}.dropdown-list ul li{float:left;width:120px;margin-left:10px;margin-bottom:10px;border:1px dashed #ccc}.dropdown-menu .divider{margin:3px 0}.dropdown-menu{border-radius:3px;margin:0;border:1px solid #e6eaed;box-shadow:rgba(0,0,0,.172549)0 6px 12px 0}.dropdown-menu:before{content:"";width:20px;height:12px;position:absolute;top:-12px;right:8px;background-image:url(../../images/triangle_2x.png);background-size:20px 12px}.dropdown-submenu .dropdown-menu:before{background:0 0}#searchNotebookForAddDropdownList,#searchNotebookForAddShareDropdownList{left:-200px}#searchNotebookForAddDropdownList:before,#searchNotebookForAddShareDropdownList:before{left:190px;right:inherit}.dropdown-menu li{list-style:none;padding-left:10px;width:100%;height:30px;line-height:30px}.dropdown-menu li>a{color:#000;display:block;padding-right:20px}.dropdown-menu>li>a{padding:3px 20px 3px 0}.noteSplit{position:absolute;top:0;width:5px;height:100%;overflow:hidden;z-index:3333;cursor:col-resize}a.raw{color:#428bca}a.raw:hover{color:#2a6496}.cm-item{position:relative}.cm-item .cm-text{position:absolute;left:23px;right:10px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.cm-item .cm-text .c-text{display:initial}.b-m-mpanel{border-radius:3px}.modal-content{background-color:#f8f8f8}.modal-body{background-color:#fff;padding-bottom:30px}.modal-footer{margin-top:0}#listNotebookDropdownMenu{display:none}#themeForm td{padding:5px;text-aliLine truncated
|
||||
@@ -116,7 +116,9 @@ a.raw:hover {
|
||||
|
||||
#searchWrap, #logo, #switcher,
|
||||
#leftNotebook,
|
||||
.noteSplit
|
||||
.noteSplit,
|
||||
.for-split,
|
||||
#curNotebookForNewNote
|
||||
{
|
||||
display: none !important;
|
||||
}
|
||||
@@ -792,6 +794,15 @@ background-position:-1px -670px
|
||||
background: none;
|
||||
}
|
||||
|
||||
.new-note {
|
||||
background-color: #FBFCF7;
|
||||
border: 1px solid #ddd;
|
||||
&:hover {
|
||||
background-color: #FBFCF7;
|
||||
border-color: rgba(103, 95, 95, 1);
|
||||
}
|
||||
}
|
||||
|
||||
.new-note-left {
|
||||
padding: 0 5px;
|
||||
width: 95px;
|
||||
@@ -992,6 +1003,7 @@ html,body {
|
||||
}
|
||||
#noteTitleDiv {
|
||||
height: 30px;
|
||||
border: none;
|
||||
}
|
||||
#noteTitle {
|
||||
height: 100%;
|
||||
@@ -1014,6 +1026,7 @@ html,body {
|
||||
opacity: 0.8;
|
||||
overflow-x: hidden;
|
||||
overflow-y: hidden;
|
||||
border: none;
|
||||
#notesAndSort {
|
||||
display: none;
|
||||
}
|
||||
@@ -1055,7 +1068,7 @@ html,body {
|
||||
#leanoteNav {
|
||||
background-color: @bgColor;
|
||||
opacity: 0.3;
|
||||
right: -30px;
|
||||
// right: -30px;
|
||||
}
|
||||
|
||||
.new-note-right {
|
||||
@@ -1170,6 +1183,10 @@ body {
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
#noteAndEditor {
|
||||
position: static;
|
||||
}
|
||||
|
||||
// tool-bar
|
||||
#editor {
|
||||
#mceToolbar {
|
||||
|
||||
@@ -1 +1 @@
|
||||
::selection{background:#000;color:#fff}::-moz-selection{background:#000;color:#fff}::-webkit-selection{background:#000;color:#fff}@-webkit-keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@-moz-keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@-ms-keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@-webkit-keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@-moz-keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@-ms-keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-moz-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-o-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes fadeInUp{0%{opacity:0;-webkit-transform:translateY(20px)}100%{opacity:1;-webkit-transform:translateY(0)}}@-moz-keyframes fadeInUp{0%{opacity:0;-moz-transform:translateY(20px)}100%{opacity:1;-moz-transform:translateY(0)}}@-o-keyframes fadeInUp{0%{opacity:0;-o-transform:translateY(20px)}100%{opacity:1;-o-transform:translateY(0)}}@keyframes fadeInUp{0%{opacity:0;transform:translateY(20px)}100%{opacity:1;transform:translateY(0)}}.animated{-webkit-animation-fill-mode:both;-moz-animation-fill-mode:both;-ms-animation-fill-mode:both;-o-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.5s;-moz-animation-duration:.5s;-ms-animation-duration:.5s;-o-animation-duration:.5s;animation-duration:.5s}.fadeIn{-webkit-animation-name:fadeIn;-moz-animation-name:fadeIn;-o-animation-name:fadeIn;animation-name:fadeIn}.fadeInUp{-webkit-animation-name:fadeInUp;-moz-animation-name:fadeInUp;-o-animation-name:fadeInUp;animation-name:fadeInUp}.close:focus{outline:0}.invisible{visibility:hidden}.btn{border-radius:2px}.alert{margin-bottom:10px}.btn *{cursor:pointer!important}.dropdown-submenu{position:relative}.dropdown-submenu>ul.dropdown-menu{top:0;left:100%;margin-left:-3px!important;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;padding-top:10px!important}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropdown-submenu:after{display:block;content:" ";position:absolute;right:0;top:10px;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;border-left-color:#666}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown-submenu.pull-left{float:none}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.open>.dropdown-menu,.dropdown-submenu:hover>.dropdown-menu{visibility:visible;-webkit-animation:pulldown .2s;animation:pulldown .2s}.dropdown-menu{visibility:hidden;display:block}.dropdown-list{width:530px;border-radius:3px}.dropdown-list ul{margin:0;padding:0}.dropdown-list ul li{float:left;width:120px;margin-left:10px;margin-bottom:10px;border:1px dashed #ccc}.dropdown-menu .divider{margin:3px 0}.dropdown-menu{border-radius:3px;margin:0;border:1px solid #e6eaed;box-shadow:rgba(0,0,0,.172549)0 6px 12px 0}.dropdown-menu:before{content:"";width:20px;height:12px;position:absolute;top:-12px;right:8px;background-image:url(../../images/triangle_2x.png);background-size:20px 12px}.dropdown-submenu .dropdown-menu:before{background:0 0}#searchNotebookForAddDropdownList,#searchNotebookForAddShareDropdownList{left:-200px}#searchNotebookForAddDropdownList:before,#searchNotebookForAddShareDropdownList:before{left:190px;right:inherit}.dropdown-menu li{list-style:none;padding-left:10px;width:100%;height:30px;line-height:30px}.dropdown-menu li>a{color:#000;display:block;padding-right:20px}.dropdown-menu>li>a{padding:3px 20px 3px 0}.noteSplit{position:absolute;top:0;width:5px;height:100%;overflow:hidden;z-index:3333;cursor:col-resize}a.raw{color:#428bca}a.raw:hover{color:#2a6496}.cm-item{position:relative}.cm-item .cm-text{position:absolute;left:23px;right:10px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.cm-item .cm-text .c-text{display:initial}.b-m-mpanel{border-radius:3px}#listNotebookDropdownMenu{display:none}#themeForm td{padding:5px;text-align:center}#themeForm img{border:1px solid #eee;padding:2px}#logo{font-size:36px}#avatar{height:60px;max-width:200px;display:inline-block;margin:10px}.new-split{display:none}.new-note-right{padding:0 5px;padding-left:3px}#leanoteMsg{line-height:40px;margin-top:10px;margin-left:10px}#newNoteWrap{line-height:40px;margin-top:10px}.new-note{background-color:#000;border-radius:3px;padding:3px 5px;border:1px solid #080303}.new-note,.new-note a{color:#fff}.new-note:hover{background:#3d3b3b;border-color:transparent}.new-note:hover,.new-note:hoLine truncated
|
||||
::selection{background:#000;color:#fff}::-moz-selection{background:#000;color:#fff}::-webkit-selection{background:#000;color:#fff}@-webkit-keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@-moz-keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@-ms-keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@keyframes dropdown{0%{margin-top:-25px;opacity:0}90%{margin-top:2px}100%{margin-top:0;opacity:1}}@-webkit-keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@-moz-keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@-ms-keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@keyframes pulldown{0%{top:0;opacity:0}90%{top:90%}100%{top:100%;opacity:1}}@-webkit-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-moz-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-o-keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes fadeInUp{0%{opacity:0;-webkit-transform:translateY(20px)}100%{opacity:1;-webkit-transform:translateY(0)}}@-moz-keyframes fadeInUp{0%{opacity:0;-moz-transform:translateY(20px)}100%{opacity:1;-moz-transform:translateY(0)}}@-o-keyframes fadeInUp{0%{opacity:0;-o-transform:translateY(20px)}100%{opacity:1;-o-transform:translateY(0)}}@keyframes fadeInUp{0%{opacity:0;transform:translateY(20px)}100%{opacity:1;transform:translateY(0)}}.animated{-webkit-animation-fill-mode:both;-moz-animation-fill-mode:both;-ms-animation-fill-mode:both;-o-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-duration:.5s;-moz-animation-duration:.5s;-ms-animation-duration:.5s;-o-animation-duration:.5s;animation-duration:.5s}.fadeIn{-webkit-animation-name:fadeIn;-moz-animation-name:fadeIn;-o-animation-name:fadeIn;animation-name:fadeIn}.fadeInUp{-webkit-animation-name:fadeInUp;-moz-animation-name:fadeInUp;-o-animation-name:fadeInUp;animation-name:fadeInUp}@font-face{font-family:leanote;src:url(../../fonts/leanote-font2/leanote.eot?-vcf23i);src:url(../../fonts/leanote-font2/leanote.eot?#iefix-vcf23i) format('embedded-opentype'),url(../../fonts/leanote-font2/leanote.ttf?-vcf23i) format('truetype'),url(../../fonts/leanote-font2/leanote.woff?-vcf23i) format('woff'),url(../../fonts/leanote-font2/leanote.svg?-vcf23i#leanote) format('svg');font-weight:400;font-style:normal}.close:focus{outline:0}.invisible{visibility:hidden}.btn{border-radius:2px}.alert{margin-bottom:10px}.btn *{cursor:pointer!important}.dropdown-submenu{position:relative}.dropdown-submenu>ul.dropdown-menu{top:0;left:100%;margin-left:-3px!important;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;padding-top:10px!important}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropdown-submenu:after{display:block;content:" ";position:absolute;right:0;top:10px;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;border-left-color:#666}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown-submenu.pull-left{float:none}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.open>.dropdown-menu,.dropdown-submenu:hover>.dropdown-menu{visibility:visible;-webkit-animation:pulldown .2s;animation:pulldown .2s}.dropdown-menu{visibility:hidden;display:block}.dropdown-list{width:530px;border-radius:3px}.dropdown-list ul{margin:0;padding:0}.dropdown-list ul li{float:left;width:120px;margin-left:10px;margin-bottom:10px;border:1px dashed #ccc}.dropdown-menu .divider{margin:3px 0}.dropdown-menu{border-radius:3px;margin:0;border:1px solid #e6eaed;box-shadow:rgba(0,0,0,.172549)0 6px 12px 0}.dropdown-menu:before{content:"";width:20px;height:12px;position:absolute;top:-12px;right:8px;background-image:url(../../images/triangle_2x.png);background-size:20px 12px}.dropdown-submenu .dropdown-menu:before{background:0 0}#searchNotebookForAddDropdownList,#searchNotebookForAddShareDropdownList{left:-200px}#searchNotebookForAddDropdownList:before,#searchNotebookForAddShareDropdownList:before{left:190px;right:inherit}.dropdown-menu li{list-style:none;padding-left:10px;width:100%;height:30px;line-height:30px}.dropdown-menu li>a{color:#000;display:block;padding-right:20px}.dropdown-menu>li>a{padding:3px 20px 3px 0}.noteSplit{position:absolute;top:0;width:5px;height:100%;overflow:hidden;z-index:3333;cursor:col-resize}a.raw{color:#428bca}a.raw:hover{color:#2a6496}.cm-item{position:relative}.cm-item .cm-text{position:absolute;left:23px;right:10px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.cm-item .cm-text .c-text{display:initial}.b-m-mpanel{border-radius:3px}.modal-content{background-color:#f8f8f8}.modal-body{background-color:#fff;padding-bottom:30px}.modal-footer{margin-top:0}#listNotebookDropdownMenu{display:none}#themeForm td{padding:5px;text-aliLine truncated
|
||||
Vendored
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Vendored
+3
-3
@@ -1,6 +1,6 @@
|
||||
function trimLeft(t,e){if(!e||" "==e)return $.trim(t);for(;0==t.indexOf(e);)t=t.substring(e.length);return t}function json(str){return eval("("+str+")")}function t(){var t=arguments;if(t.length<=1)return t[0];var e=t[0];if(!e)return e;var n="LEAAEL";e=e.replace(/\?/g,n);for(var o=1;o<=t.length;++o)e=e.replace(n,t[o]);return e}function arrayEqual(t,e){return t=t||[],e=e||[],t.join(",")==e.join(",")}function isArray(t){return"[object Array]"===Object.prototype.toString.call(t)}function isEmpty(t){return t?isArray(t)&&0==t.length?!0:!1:!0}function getFormJsonData(t){var e=formArrDataToJson($("#"+t).serializeArray());return e}function formArrDataToJson(t){var e={},n={};for(var o in t){var r=t[o].name,i=t[o].value;"[]"!=r.substring(r.length-2,r.length)?e[r]=i:(r=r.substring(0,r.length-2),void 0==n[r]?n[r]=[i]:n[r].push(i))}return $.extend(e,n)}function formSerializeDataToJson(t){for(var e=t.split("&"),n={},o={},r=0;r<e.length;++r){var i=e[r].split("="),a=decodeURI(i[0]),s=decodeURI(i[1]);"[]"!=a.substring(a.length-2,a.length)?n[a]=s:(a=a.substring(0,a.length-2),void 0==o[a]?o[a]=[s]:o[a].push(s))}return $.extend(n,o)}function _ajaxCallback(t,e,n){if(t===!0||"true"==t||"object"==typeof t){if(t&&"object"==typeof t&&"NOTLOGIN"==t.Msg)return void alert("你还没有登录, 请先登录!");"function"==typeof e&&e(t)}else"function"==typeof n?n(t):alert("error!")}function _ajax(t,e,n,o,r,i){return i="undefined"==typeof i?!0:!1,$.ajax({type:t,url:e,data:n,async:i,success:function(t){_ajaxCallback(t,o,r)},error:function(t){_ajaxCallback(t,o,r)}})}function ajaxGet(t,e,n,o,r){return _ajax("GET",t,e,n,o,r)}function ajaxPost(t,e,n,o,r){_ajax("POST",t,e,n,o,r)}function ajaxPostJson(t,e,n,o,r){r="undefined"==typeof r?!0:!1,$.ajax({url:t,type:"POST",contentType:"application/json; charset=utf-8",datatype:"json",async:r,data:JSON.stringify(e),success:function(t,e){_ajaxCallback(t,n,o)},error:function(t){_ajaxCallback(t,n,o)}})}function findParents(t,e){if($(t).is(e))return $(t);for(var n=$(t).parents(),o=0;o<n.length;++o)if(log(n.eq(o)),n.eq(o).is(e))return n.seq(o);return null}function getVendorPrefix(){for(var t=document.body||document.documentElement,e=t.style,n=["webkit","khtml","moz","ms","o"],o=0;o<n.length;){if("string"==typeof e[n[o]+"Transition"])return n[o];o++}}function switchEditor(t){LEA.isM=t,t?($("#mdEditor").css("z-index",3).show(),$("#leanoteNav").hide()):($("#editor").show(),$("#mdEditor").css("z-index",1).hide(),$("#leanoteNav").show())}function setEditorContent(t,e,n,o){if(t||(t=""),clearIntervalForSetContent&&clearInterval(clearIntervalForSetContent),e)MD?(MD.setContent(t),o&&o()):clearIntervalForSetContent=setTimeout(function(){setEditorContent(t,!0,!1,o)},100);else if("undefined"!=typeof tinymce&&tinymce.activeEditor){var r=tinymce.activeEditor;r.setContent(t),o&&o(),r.undoManager.clear()}else clearIntervalForSetContent=setTimeout(function(){setEditorContent(t,!1,!1,o)},100)}function previewIsEmpty(t){return t&&t.substr(0,previewToken.length)!=previewToken?!1:!0}function isAceError(t){return t?-1!=t.indexOf("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"):!1}function getEditorContent(t){var e=_getEditorContent(t);return'<p><br data-mce-bogus="1"></p>'===e?"<p><br></p>":e}function _getEditorContent(t){if(t)return[MD.getContent(),"<div>"+$("#preview-contents").html()+"</div>"];var e=tinymce.activeEditor;if(e){var n=$(e.getBody()).clone();if(n.find(".toggle-raw").remove(),window.LeaAce&&LeaAce.getAce)for(var o=n.find("pre"),r=0;r<o.length;++r){var i=o.eq(r),a=i.attr("id"),s=LeaAce.getAce(a);if(s){var l=s.getValue();isAceError(l)&&(l=i.html()),l=l.replace(/</g,"<").replace(/>/g,">"),i.removeAttr("style","").removeAttr("contenteditable").removeClass("ace_editor"),i.html(l)}}if(n.find("pinit").remove(),n.find(".thunderpin").remove(),n.find(".pin").parent().remove(),n=$(n).html())for(;;){var c=n.lastIndexOf("</script>");if(-1==c)return n;var u=n.length;if(u-9!=c)return n;var f=n.lastIndexOf("<script ");if(-1==f&&(f=n.lastIndexOf("<script>")),-1==f)return n;n=n.substring(0,f)}return n}}function disableEditor(){var t=tinymce.activeEditor;t&&(t.hide(),LEA.editorStatus=!1,$("#mceTollbarMark").show().css("z-index",1e3))}function enableEditor(){if(!LEA.editorStatus){$("#mceTollbarMark").css("z-index",-1).hide();var t=tinymce.activeEditor;t&&t.show()}}function showDialog(t,e){$("#leanoteDialog #modalTitle").html(e.title),$("#leanoteDialog .modal-body").html($("#"+t+" .modal-body").html()),$("#leanoteDialog .modal-footer").html($("#"+t+" .modal-footer").html()),delete e.title,e.show=!0,$("#leanoteDialog").modal(e)}function hideDialog(t){t||(t=0),setTimeout(function(){$("#leanoteDialog").modal("hide")},t)}function closeDialog(){$(".modal").modal("hide")}function showDialog2(t,e){e=e||{},e.show=!0,$(t).modal(e)}function hideDialog2(t,e){e||(e=0),setTimeout(function(){$(t).modal("hide")},e)}function showDialogRemote(t,e){e=e||{},t+="?";for(var n in e)t+=n+"="+e[n]+"&";$("#leanoteDialogRemote").modal({remote:t})}funLine truncated
|
||||
Note.curNoteId="",Note.interval="",Note.itemIsBlog='<div class="item-blog"><i class="fa fa-bold" title="blog"></i></div><div class="item-setting"><i class="fa fa-cog" title="setting"></i></div>',Note.itemTplNoImg='<li href="#" class="item ?" data-seq="?" noteId="?">',Note.itemTplNoImg+=Note.itemIsBlog+'<div class="item-desc"><p class="item-title">?</p><p class="item-info"><i class="fa fa-book"></i> <span class="note-notebook">?</span> <i class="fa fa-clock-o"></i> <span class="updated-time">?</span></p><p class="desc">?</p></div></li>',Note.itemTpl='<li href="#" class="item ? item-image" data-seq="?" noteId="?"><div class="item-thumb" style=""><img src="?"/></div>',Note.itemTpl+=Note.itemIsBlog+'<div class="item-desc" style=""><p class="item-title">?</p><p class="item-info"><i class="fa fa-book"></i> <span class="note-notebook">?</span> <i class="fa fa-clock-o"></i> <span class="updated-time">?</span></p><p class="desc">?</p></div></li>',Note.newItemTpl='<li href="#" class="item item-active ?" data-seq="?" fromUserId="?" noteId="?">',Note.newItemTpl+=Note.itemIsBlog+'<div class="item-desc" style="right: 0px;"><p class="item-title">?</p><p class="item-info"><i class="fa fa-book"></i> <span class="note-notebook">?</span> <i class="fa fa-clock-o"></i> <span class="updated-time">?</span></p><p class="desc">?</p></div></li>',Note.noteItemListO=$("#noteItemList"),Note.cacheByNotebookId={all:{}},Note.notebookIds={},Note.isReadOnly=!1,Note.intervalTime=0,Note.intervalTime=1e4,Note.startInterval=function(){clearInterval(Note.interval),Note.interval=setInterval(function(){log("自动保存开始..."),Note.curChangedSaveIt()},Note.intervalTime)},Note.stopInterval=function(){clearInterval(Note.interval),setTimeout(function(){Note.startInterval()},Note.intervalTime)},Note.addNoteCache=function(t){Note.cache[t.NoteId]=t,Note.clearCacheByNotebookId(t.NotebookId)},Note.setNoteCache=function(t,e){Note.cache[t.NoteId]?$.extend(Note.cache[t.NoteId],t):Note.cache[t.NoteId]=t,void 0==e&&(e=!0),e&&Note.clearCacheByNotebookId(t.NotebookId)},Note.setCurNoteId=function(t){this.curNoteId=t},Note.clearCurNoteId=function(){this.curNoteId=null},Note.getCurNote=function(){var t=this;return""==t.curNoteId?null:t.cache[t.curNoteId]},Note.getNote=function(t){var e=this;return e.cache[t]},Note.clearCacheByNotebookId=function(t){t&&(Note.cacheByNotebookId[t]={},Note.cacheByNotebookId.all={},Note.notebookIds[t]=!0)},Note.notebookHasNotes=function(t){var e=Note.getNotesByNotebookId(t);return!isEmpty(e)},Note.getNotesByNotebookId=function(t,e,o){if(e||(e="UpdatedTime"),"undefined"==o&&(o=!1),t||(t="all"),!Note.cacheByNotebookId[t])return[];if(Note.cacheByNotebookId[t][e])return Note.cacheByNotebookId[t][e];var a=[];for(var n in Note.cache)if(n){var i=Note.cache[n];i.IsTrash||i.IsShared||("all"==t||i.NotebookId==t)&&a.push(i)}return a.sort(function(t,a){var n=t[e],i=a[e];if(o){if(i>n)return-1;if(n>i)return 1}else{if(i>n)return 1;if(n>i)return-1}return 0}),Note.cacheByNotebookId[t][e]=a,a},Note.renderNotesAndFirstOneContent=function(t){isArray(t)&&(Note.renderNotes(t),isEmpty(t[0])||Note.changeNoteForPjax(t[0].NoteId,!0,!1))},Note.curHasChanged=function(t){var e=Note.getCurNote();if(!e)return!1;var o=$("#noteTitle").val(),a=Tag.getTags(),n={hasChanged:!1,IsNew:e.IsNew,IsMarkdown:e.IsMarkdown,FromUserId:e.FromUserId,NoteId:e.NoteId,NotebookId:e.NotebookId};e.IsNew&&(n.hasChanged=!0),e.Title!=o&&(n.hasChanged=!0,n.Title=o),arrayEqual(e.Tags,a)||(n.hasChanged=!0,n.Tags=a.join(","));var i=!1;if((e.IsNew||t||!Note.readOnly)&&(i=!0),!n.hasChanged&&!i)return!1;if(!i)return n;var r,s,c=getEditorContent(e.IsMarkdown);if(isArray(c)?(r=c[0],s=c[1],r&&previewIsEmpty(s)&&Converter&&(s=Converter.makeHtml(r)),r||(s=""),e.Preview=s):r=c,e.Content!=r){n.hasChanged=!0,n.Content=r;var l=s||r;e.HasSelfDefined&&e.IsBlog||(n.Desc=Note.genDesc(l),n.ImgSrc=Note.getImgSrc(l),n.Abstract=Note.genAbstract(l))}else log("text相同");return n.hasChanged?n:!1},Note.genDesc=function(t){return t?(t=t.replace(/<br \/>/g," <br />"),t=t.replace(/<\/p>/g," </p>"),t=t.replace(/<\/div>/g," </div>"),t=$("<div></div>").html(t).text(),t=t.replace(/</g,"<"),t=t.replace(/>/g,">"),t.length<300?t:t.substring(0,300)):""},Note.genAbstract=function(t,e){if(!t)return"";if(void 0==e&&(e=1e3),t.length<e)return t;for(var o=!1,a=!1,n=0,i="",r=e,s=0;s<t.length;++s){var c=t[s];if("<"==c?o=!0:"&"==c?a=!0:">"==c&&o?(n-=1,o=!1):";"==c&&a&&(a=!1),o||a||(n+=1),i+=c,n>=r)break}var l=document.createElement("div");return l.innerHTML=i,l.innerHTML},Note.getImgSrc=function(t){if(!t)return"";var e=$(t).find("img");for(var o in e){var a=e.eq(o).attr("src");if(a)return a}return""},Note.saveInProcess={},Note.savePool={},Note.curChangedSaveIt=function(t,e){var o=this;if(!Note.curNoteId||Note.isReadOnly)return void log(Note.curNoteId?"共享只读":"无当前笔记");var a;try{a=Note.curHasChanged(t)}catch(n){return console.error("获取当前改变的笔记错误!"),void(e&&e(!1))}return a&&a.hasChanged?(log(Line truncated
|
||||
function editorMode(){this.writingHash="writing",this.normalHash="normal",this.isWritingMode=location.hash.indexOf(this.writingHash)>=0,this.toggleA=null}function initSlimScroll(){Mobile.isMobile()||($("#notebook").slimScroll({height:"100%"}),$("#noteItemList").slimScroll({height:"100%"}),$("#wmd-panel-preview").slimScroll({height:"100%"}),$("#wmd-panel-preview").css("width","100%"))}function initEditor(){$("#moreBtn").click(function(){saveBookmark();var e=$("#editor");e.hasClass("all-tool")?e.removeClass("all-tool"):e.addClass("all-tool"),restoreBookmark()}),tinymce.init({inline:!0,theme:"leanote",valid_children:"+pre[div|#text|p|span|textarea|i|b|strong]",setup:function(e){e.on("keydown",function(e){var t=e.which?e.which:e.keyCode;return!Note.readOnly||(e.ctrlKey||e.metaKey)&&67==t?void LeaAce.removeCurToggleRaw():void e.preventDefault()}),e.on("cut",function(e){return $(e.target).hasClass("ace_text-input")?void e.preventDefault():void 0})},convert_urls:!0,relative_urls:!1,remove_script_host:!1,selector:"#editorContent",skin:"custom",language:LEA.locale,plugins:["autolink link leaui_image lists hr","paste","searchreplace leanote_nav leanote_code tabfocus","table textcolor"],toolbar1:"formatselect | forecolor backcolor | bold italic underline strikethrough | leaui_image | leanote_code leanote_inline_code | bullist numlist | alignleft aligncenter alignright alignjustify",toolbar2:"outdent indent blockquote | link unlink | table | hr removeformat | subscript superscript |searchreplace | pastetext | leanote_ace_pre | fontselect fontsizeselect",menubar:!1,toolbar_items_size:"small",statusbar:!1,url_converter:!1,font_formats:"Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Times New Roman=times new roman,times;Courier New=courier new,courier;Tahoma=tahoma,arial,helvetica,sans-serif;Verdana=verdana,geneva;宋体=SimSun;新宋体=NSimSun;黑体=SimHei;微软雅黑=Microsoft YaHei",block_formats:"Header 1=h1;Header 2=h2;Header 3=h3;Header 4=h4;Paragraph=p",paste_data_images:!0}),window.onbeforeunload=function(e){Note.curChangedSaveIt(!0)},$("body").on("keydown",function(e){var t=e.which?e.which:e.keyCode,o=e.ctrlKey||e.metaKey;if(o){if(83==t)return Note.curChangedSaveIt(),e.preventDefault(),!1;if(69==t)return Note.toggleWriteableAndReadOnly(),e.preventDefault(),!1}})}function scrollTo(e,t,o){var i=$("#editorContent"),n=i.find(t+":contains("+o+")");random++;for(var r=$('#leanoteNavContent [data-a="'+t+"-"+encodeURI(o)+'"]'),s=r.size(),a=0;s>a&&r[a]!=e;++a);if(n.size()>=a+1){n=n.eq(a);var l=i.scrollTop()-i.offset().top+n.offset().top;return void i.animate({scrollTop:l},300)}}function updateLeftIsMin(e){ajaxGet("/user/updateLeftIsMin",{leftIsMin:e})}function minLeft(e){$page.addClass("mini-left"),e&&updateLeftIsMin(!0)}function maxLeft(e){$page.removeClass("mini-left"),$("#noteAndEditor").css("left",UserInfo.NotebookWidth),$("#leftNotebook").width(UserInfo.NotebookWidth),e&&updateLeftIsMin(!1)}function getMaxDropdownHeight(e){var t=$(e).offset(),o=$(document).height()-t.top;o-=70,0>o&&(o=0);var i=$(e).find("ul").height();return o>i?i:o}function initPage(){if(Notebook.renderNotebooks(notebooks),Share.renderShareNotebooks(sharedUserInfos,shareNotebooks),curSharedNoteNotebookId?Share.firstRenderShareNote(curSharedUserId,curSharedNoteNotebookId,curNoteId):(Note.setNoteCache(noteContentJson),Note.renderNotes(notes),curNoteId&&(setTimeout(function(){Note.changeNoteForPjax(curNoteId,!0,curNotebookId)}),curNotebookId||Notebook.selectNotebook($(tt('#notebook [notebookId="?"]',Notebook.allNotebookId))))),latestNotes.length>0)for(var e=0;e<latestNotes.length;++e)Note.addNoteCache(latestNotes[e]);Tag.renderTagNav(tagsJson),initSlimScroll(),LeaAce.handleEvent()}editorMode.prototype.toggleAText=function(e){var t=this;setTimeout(function(){var o=$(".toggle-editor-mode a"),i=$(".toggle-editor-mode span");e?(o.attr("href","#"+t.normalHash),i.text(getMsg("normalMode"))):(o.attr("href","#"+t.writingHash),i.text(getMsg("writingMode")))},0)},editorMode.prototype.isWriting=function(e){return e||(e=location.hash),e.indexOf(this.writingHash)>=0},editorMode.prototype.init=function(){this.$themeLink=$("#themeLink"),this.changeMode(this.isWritingMode);var e=this;$(".toggle-editor-mode").click(function(t){t.preventDefault(),saveBookmark();var o=$(this).find("a"),i=e.isWriting(o.attr("href"));e.changeMode(i),i?setHash("m",e.writingHash):setHash("m",e.normalHash),restoreBookmark()})},editorMode.prototype.changeMode=function(e){this.toggleAText(e),e?this.writtingMode():this.normalMode()},editorMode.prototype.resizeEditor=function(){setTimeout(function(){resizeEditor()},10),setTimeout(function(){resizeEditor()},20),setTimeout(function(){resizeEditor()},500)},editorMode.prototype.normalMode=function(){$("#noteItemListWrap, #notesAndSort").show(),$("#noteList").unbind("mouseenter").unbind("mouseleave");var e=UserInfo.Theme||"default";e+=".css";$("#themeLink");-1!=this.$themeLink.attr("href").indexOf("writting-overwrite.css")&&thLine truncated
|
||||
function trimLeft(t,e){if(!e||" "==e)return $.trim(t);for(;0==t.indexOf(e);)t=t.substring(e.length);return t}function json(str){return eval("("+str+")")}function t(){var t=arguments;if(t.length<=1)return t[0];var e=t[0];if(!e)return e;var n="LEAAEL";e=e.replace(/\?/g,n);for(var o=1;o<=t.length;++o)e=e.replace(n,t[o]);return e}function arrayEqual(t,e){return t=t||[],e=e||[],t.join(",")==e.join(",")}function isArray(t){return"[object Array]"===Object.prototype.toString.call(t)}function isEmpty(t){return t?isArray(t)&&0==t.length?!0:!1:!0}function getFormJsonData(t){var e=formArrDataToJson($("#"+t).serializeArray());return e}function formArrDataToJson(t){var e={},n={};for(var o in t){var r=t[o].name,i=t[o].value;"[]"!=r.substring(r.length-2,r.length)?e[r]=i:(r=r.substring(0,r.length-2),void 0==n[r]?n[r]=[i]:n[r].push(i))}return $.extend(e,n)}function formSerializeDataToJson(t){for(var e=t.split("&"),n={},o={},r=0;r<e.length;++r){var i=e[r].split("="),a=decodeURI(i[0]),s=decodeURI(i[1]);"[]"!=a.substring(a.length-2,a.length)?n[a]=s:(a=a.substring(0,a.length-2),void 0==o[a]?o[a]=[s]:o[a].push(s))}return $.extend(n,o)}function _ajaxCallback(t,e,n){if(t===!0||"true"==t||"object"==typeof t){if(t&&"object"==typeof t&&"NOTLOGIN"==t.Msg)return void alert("你还没有登录, 请先登录!");"function"==typeof e&&e(t)}else"function"==typeof n?n(t):alert("error!")}function _ajax(t,e,n,o,r,i){return i="undefined"==typeof i?!0:!1,$.ajax({type:t,url:e,data:n,async:i,success:function(t){_ajaxCallback(t,o,r)},error:function(t){_ajaxCallback(t,o,r)}})}function ajaxGet(t,e,n,o,r){return _ajax("GET",t,e,n,o,r)}function ajaxPost(t,e,n,o,r){_ajax("POST",t,e,n,o,r)}function ajaxPostJson(t,e,n,o,r){r="undefined"==typeof r?!0:!1,$.ajax({url:t,type:"POST",contentType:"application/json; charset=utf-8",datatype:"json",async:r,data:JSON.stringify(e),success:function(t,e){_ajaxCallback(t,n,o)},error:function(t){_ajaxCallback(t,n,o)}})}function findParents(t,e){if($(t).is(e))return $(t);for(var n=$(t).parents(),o=0;o<n.length;++o)if(log(n.eq(o)),n.eq(o).is(e))return n.seq(o);return null}function getVendorPrefix(){for(var t=document.body||document.documentElement,e=t.style,n=["webkit","khtml","moz","ms","o"],o=0;o<n.length;){if("string"==typeof e[n[o]+"Transition"])return n[o];o++}}function switchEditor(t){LEA.isM=t,t?($("#mdEditor").css("z-index",3).show(),$("#leanoteNav").hide()):($("#editor").show(),$("#mdEditor").css("z-index",1).hide(),$("#leanoteNav").show())}function setEditorContent(t,e,n,o){if(t||(t=""),clearIntervalForSetContent&&clearInterval(clearIntervalForSetContent),e)MD?(MD.setContent(t),MD.clearUndo&&MD.clearUndo(),o&&o()):clearIntervalForSetContent=setTimeout(function(){setEditorContent(t,!0,!1,o)},100);else if("undefined"!=typeof tinymce&&tinymce.activeEditor){var r=tinymce.activeEditor;r.setContent(t),o&&o(),r.undoManager.clear()}else clearIntervalForSetContent=setTimeout(function(){setEditorContent(t,!1,!1,o)},100)}function previewIsEmpty(t){return t&&t.substr(0,previewToken.length)!=previewToken?!1:!0}function isAceError(t){return t?-1!=t.indexOf("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"):!1}function getEditorContent(t){var e=_getEditorContent(t);return'<p><br data-mce-bogus="1"></p>'===e?"<p><br></p>":e}function _getEditorContent(t){if(t)return[MD.getContent(),"<div>"+$("#preview-contents").html()+"</div>"];var e=tinymce.activeEditor;if(e){var n=$(e.getBody()).clone();if(n.find(".toggle-raw").remove(),window.LeaAce&&LeaAce.getAce)for(var o=n.find("pre"),r=0;r<o.length;++r){var i=o.eq(r),a=i.attr("id"),s=LeaAce.getAce(a);if(s){var l=s.getValue();isAceError(l)&&(l=i.html()),l=l.replace(/</g,"<").replace(/>/g,">"),i.removeAttr("style","").removeAttr("contenteditable").removeClass("ace_editor"),i.html(l)}}if(n.find("pinit").remove(),n.find(".thunderpin").remove(),n.find(".pin").parent().remove(),n=$(n).html())for(;;){var c=n.lastIndexOf("</script>");if(-1==c)return n;var u=n.length;if(u-9!=c)return n;var f=n.lastIndexOf("<script ");if(-1==f&&(f=n.lastIndexOf("<script>")),-1==f)return n;n=n.substring(0,f)}return n}}function disableEditor(){var t=tinymce.activeEditor;t&&(t.hide(),LEA.editorStatus=!1,$("#mceTollbarMark").show().css("z-index",1e3))}function enableEditor(){if(!LEA.editorStatus){$("#mceTollbarMark").css("z-index",-1).hide();var t=tinymce.activeEditor;t&&t.show()}}function showDialog(t,e){$("#leanoteDialog #modalTitle").html(e.title),$("#leanoteDialog .modal-body").html($("#"+t+" .modal-body").html()),$("#leanoteDialog .modal-footer").html($("#"+t+" .modal-footer").html()),delete e.title,e.show=!0,$("#leanoteDialog").modal(e)}function hideDialog(t){t||(t=0),setTimeout(function(){$("#leanoteDialog").modal("hide")},t)}function closeDialog(){$(".modal").modal("hide")}function showDialog2(t,e){e=e||{},e.show=!0,$(t).modal(e)}function hideDialog2(t,e){e||(e=0),setTimeout(function(){$(t).modal("hide")},e)}function showDialogRemote(t,e){e=e||{},t+="?";for(var n in e)t+=n+"="+e[n]+"&";$("#leanoteDialogRLine truncated
|
||||
Note.curNoteId="",Note.interval="",Note.itemIsBlog='<div class="item-blog"><i class="fa fa-bold" title="blog"></i></div><div class="item-setting"><i class="fa fa-cog" title="setting"></i></div>',Note.itemTplNoImg='<li href="#" class="item ?" data-seq="?" noteId="?">',Note.itemTplNoImg+=Note.itemIsBlog+'<div class="item-desc"><p class="item-title">?</p><p class="item-info"><i class="fa fa-book"></i> <span class="note-notebook">?</span> <i class="fa fa-clock-o"></i> <span class="updated-time">?</span></p><p class="desc">?</p></div></li>',Note.itemTpl='<li href="#" class="item ? item-image" data-seq="?" noteId="?"><div class="item-thumb" style=""><img src="?"/></div>',Note.itemTpl+=Note.itemIsBlog+'<div class="item-desc" style=""><p class="item-title">?</p><p class="item-info"><i class="fa fa-book"></i> <span class="note-notebook">?</span> <i class="fa fa-clock-o"></i> <span class="updated-time">?</span></p><p class="desc">?</p></div></li>',Note.newItemTpl='<li href="#" class="item item-active ?" data-seq="?" fromUserId="?" noteId="?">',Note.newItemTpl+=Note.itemIsBlog+'<div class="item-desc" style="right: 0px;"><p class="item-title">?</p><p class="item-info"><i class="fa fa-book"></i> <span class="note-notebook">?</span> <i class="fa fa-clock-o"></i> <span class="updated-time">?</span></p><p class="desc">?</p></div></li>',Note.noteItemListO=$("#noteItemList"),Note.cacheByNotebookId={all:{}},Note.notebookIds={},Note.isReadOnly=!1,Note.intervalTime=0,Note.intervalTime=1e4,Note.startInterval=function(){clearInterval(Note.interval),Note.interval=setInterval(function(){log("自动保存开始..."),Note.curChangedSaveIt()},Note.intervalTime)},Note.stopInterval=function(){clearInterval(Note.interval),setTimeout(function(){Note.startInterval()},Note.intervalTime)},Note.addNoteCache=function(t){Note.cache[t.NoteId]=t,Note.clearCacheByNotebookId(t.NotebookId)},Note.setNoteCache=function(t,e){Note.cache[t.NoteId]?$.extend(Note.cache[t.NoteId],t):Note.cache[t.NoteId]=t,void 0==e&&(e=!0),e&&Note.clearCacheByNotebookId(t.NotebookId)},Note.setCurNoteId=function(t){this.curNoteId=t},Note.clearCurNoteId=function(){this.curNoteId=null},Note.getCurNote=function(){var t=this;return""==t.curNoteId?null:t.cache[t.curNoteId]},Note.getNote=function(t){var e=this;return e.cache[t]},Note.clearCacheByNotebookId=function(t){t&&(Note.cacheByNotebookId[t]={},Note.cacheByNotebookId.all={},Note.notebookIds[t]=!0)},Note.notebookHasNotes=function(t){var e=Note.getNotesByNotebookId(t);return!isEmpty(e)},Note.getNotesByNotebookId=function(t,e,o){if(e||(e="UpdatedTime"),"undefined"==o&&(o=!1),t||(t="all"),!Note.cacheByNotebookId[t])return[];if(Note.cacheByNotebookId[t][e])return Note.cacheByNotebookId[t][e];var a=[];for(var n in Note.cache)if(n){var i=Note.cache[n];i.IsTrash||i.IsShared||("all"==t||i.NotebookId==t)&&a.push(i)}return a.sort(function(t,a){var n=t[e],i=a[e];if(o){if(i>n)return-1;if(n>i)return 1}else{if(i>n)return 1;if(n>i)return-1}return 0}),Note.cacheByNotebookId[t][e]=a,a},Note.renderNotesAndFirstOneContent=function(t){isArray(t)&&(Note.renderNotes(t),isEmpty(t[0])||Note.changeNoteForPjax(t[0].NoteId,!0,!1))},Note.curHasChanged=function(t){var e=Note.getCurNote();if(!e)return!1;var o=$("#noteTitle").val(),a=Tag.getTags(),n={hasChanged:!1,IsNew:e.IsNew,IsMarkdown:e.IsMarkdown,FromUserId:e.FromUserId,NoteId:e.NoteId,NotebookId:e.NotebookId};e.IsNew&&(n.hasChanged=!0),e.Title!=o&&(n.hasChanged=!0,n.Title=o),arrayEqual(e.Tags,a)||(n.hasChanged=!0,n.Tags=a.join(","));var i=!1;if((e.IsNew||t||!Note.readOnly)&&(i=!0),!n.hasChanged&&!i)return!1;if(!i)return n;var r,s,c=getEditorContent(e.IsMarkdown);if(isArray(c)?(r=c[0],s=c[1],r&&previewIsEmpty(s)&&Converter&&(s=Converter.makeHtml(r)),r||(s=""),e.Preview=s):r=c,e.Content!=r){n.hasChanged=!0,n.Content=r;var l=s||r;e.HasSelfDefined&&e.IsBlog||(n.Desc=Note.genDesc(l),n.ImgSrc=Note.getImgSrc(l),n.Abstract=Note.genAbstract(l))}else log("text相同");return n.hasChanged?n:!1},Note.genDesc=function(t){return t?(t=t.replace(/<br \/>/g," <br />"),t=t.replace(/<\/p>/g," </p>"),t=t.replace(/<\/div>/g," </div>"),t=$("<div></div>").html(t).text(),t=t.replace(/</g,"<"),t=t.replace(/>/g,">"),t.length<300?t:t.substring(0,300)):""},Note.genAbstract=function(t,e){if(!t)return"";if(void 0==e&&(e=1e3),t.length<e)return t;for(var o=!1,a=!1,n=0,i="",r=e,s=0;s<t.length;++s){var c=t[s];if("<"==c?o=!0:"&"==c?a=!0:">"==c&&o?(n-=1,o=!1):";"==c&&a&&(a=!1),o||a||(n+=1),i+=c,n>=r)break}var l=document.createElement("div");return l.innerHTML=i,l.innerHTML},Note.getImgSrc=function(t){if(!t)return"";var e=$(t).find("img");for(var o in e){var a=e.eq(o).attr("src");if(a)return a}return""},Note.saveInProcess={},Note.savePool={},Note.curChangedSaveIt=function(t,e){var o=this;if(!Note.curNoteId||Note.isReadOnly)return void log(Note.curNoteId?"共享只读":"无当前笔记");var a;try{a=Note.curHasChanged(t)}catch(n){return console.error("获取当前改变的笔记错误!"),void(e&&e(!1))}return a&&a.hasChanged?(log(Line truncated
|
||||
function editorMode(){this.writingHash="writing",this.normalHash="normal",this.isWritingMode=location.hash.indexOf(this.writingHash)>=0,this.toggleA=null}function initSlimScroll(){Mobile.isMobile()||($("#notebook").slimScroll({height:"100%"}),$("#noteItemList").slimScroll({height:"100%"}),$("#wmd-panel-preview").slimScroll({height:"100%"}),$("#wmd-panel-preview").css("width","100%"))}function initEditor(){$("#moreBtn").click(function(){saveBookmark();var e=$("#editor");e.hasClass("all-tool")?e.removeClass("all-tool"):e.addClass("all-tool"),restoreBookmark()}),tinymce.init({inline:!0,theme:"leanote",valid_children:"+pre[div|#text|p|span|textarea|i|b|strong]",setup:function(e){e.on("keydown",function(e){var t=e.which?e.which:e.keyCode;return!Note.readOnly||(e.ctrlKey||e.metaKey)&&67==t?void LeaAce.removeCurToggleRaw():void e.preventDefault()}),e.on("cut",function(e){return $(e.target).hasClass("ace_text-input")?void e.preventDefault():void 0})},convert_urls:!0,relative_urls:!1,remove_script_host:!1,selector:"#editorContent",skin:"custom",language:LEA.locale,plugins:["autolink link leaui_image lists hr","paste","searchreplace leanote_nav leanote_code tabfocus","table textcolor"],toolbar1:"formatselect | forecolor backcolor | bold italic underline strikethrough | leaui_image | leanote_code leanote_inline_code | bullist numlist | alignleft aligncenter alignright alignjustify",toolbar2:"outdent indent blockquote | link unlink | table | hr removeformat | subscript superscript |searchreplace | pastetext | leanote_ace_pre | fontselect fontsizeselect",menubar:!1,toolbar_items_size:"small",statusbar:!1,url_converter:!1,font_formats:"Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Times New Roman=times new roman,times;Courier New=courier new,courier;Tahoma=tahoma,arial,helvetica,sans-serif;Verdana=verdana,geneva;宋体=SimSun;新宋体=NSimSun;黑体=SimHei;微软雅黑=Microsoft YaHei",block_formats:"Header 1=h1;Header 2=h2;Header 3=h3;Header 4=h4;Paragraph=p",paste_data_images:!0}),window.onbeforeunload=function(e){Note.curChangedSaveIt(!0)},$("body").on("keydown",function(e){var t=e.which?e.which:e.keyCode,o=e.ctrlKey||e.metaKey;if(o){if(83==t)return Note.curChangedSaveIt(),e.preventDefault(),!1;if(69==t)return Note.toggleWriteableAndReadOnly(),e.preventDefault(),!1}})}function scrollTo(e,t,o){var i=$("#editorContent"),n=i.find(t+":contains("+o+")");random++;for(var r=$('#leanoteNavContent [data-a="'+t+"-"+encodeURI(o)+'"]'),s=r.size(),a=0;s>a&&r[a]!=e;++a);if(n.size()>=a+1){n=n.eq(a);var l=i.scrollTop()-i.offset().top+n.offset().top;return void i.animate({scrollTop:l},300)}}function updateLeftIsMin(e){ajaxGet("/user/updateLeftIsMin",{leftIsMin:e})}function minLeft(e){$page.addClass("mini-left"),e&&updateLeftIsMin(!0)}function maxLeft(e){$page.removeClass("mini-left"),$("#noteAndEditor").css("left",UserInfo.NotebookWidth),$("#leftNotebook").width(UserInfo.NotebookWidth),e&&updateLeftIsMin(!1)}function getMaxDropdownHeight(e){var t=$(e).offset(),o=$(document).height()-t.top;o-=70,0>o&&(o=0);var i=$(e).find("ul").height();return o>i?i:o}function initPage(){if(Notebook.renderNotebooks(notebooks),Share.renderShareNotebooks(sharedUserInfos,shareNotebooks),curSharedNoteNotebookId?Share.firstRenderShareNote(curSharedUserId,curSharedNoteNotebookId,curNoteId):(Note.setNoteCache(noteContentJson),Note.renderNotes(notes),curNoteId&&(setTimeout(function(){Note.changeNoteForPjax(curNoteId,!0,curNotebookId)}),curNotebookId||Notebook.selectNotebook($(tt('#notebook [notebookId="?"]',Notebook.allNotebookId))))),latestNotes.length>0)for(var e=0;e<latestNotes.length;++e)Note.addNoteCache(latestNotes[e]);Tag.renderTagNav(tagsJson),initSlimScroll(),LeaAce.handleEvent()}editorMode.prototype.toggleAText=function(e){var t=this;setTimeout(function(){var o=$(".toggle-editor-mode a"),i=$(".toggle-editor-mode span");e?(o.attr("href","#"+t.normalHash),i.text(getMsg("normalMode"))):(o.attr("href","#"+t.writingHash),i.text(getMsg("writingMode")))},0)},editorMode.prototype.isWriting=function(e){return e||(e=location.hash),e.indexOf(this.writingHash)>=0},editorMode.prototype.init=function(){this.$themeLink=$("#themeLink"),this.changeMode(this.isWritingMode);var e=this;$(".toggle-editor-mode").click(function(t){t.preventDefault(),saveBookmark();var o=$(this).find("a"),i=e.isWriting(o.attr("href"));e.changeMode(i),i?setHash("m",e.writingHash):setHash("m",e.normalHash),restoreBookmark()})},editorMode.prototype.changeMode=function(e){this.toggleAText(e),e?this.writtingMode():this.normalMode()},editorMode.prototype.resizeEditor=function(){setTimeout(function(){resizeEditor()},10),setTimeout(function(){resizeEditor()},20),setTimeout(function(){resizeEditor()},500)},editorMode.prototype.normalMode=function(){$("#noteItemListWrap, #notesAndSort").show(),$("#noteList").unbind("mouseenter").unbind("mouseleave");var e=UserInfo.Theme||"default";e+=".css";$("#themeLink");-1!=this.$themeLink.attr("href").indexOf("writting-overwrite.css")&&thLine truncated
|
||||
function revertTagStatus(){$("#addTagTrigger").show(),$("#addTagInput").hide()}function hideTagList(a){$("#tagDropdown").removeClass("open"),a&&a.stopPropagation()}function showTagList(a){$("#tagDropdown").addClass("open"),a&&a.stopPropagation()}function reRenderTags(){var a=["label label-default","label label-info"],e=0;$("#tags").children().each(function(){var t=$(this).attr("class");("label label-default"==t||"label label-info"==t)&&($(this).removeClass(t).addClass(a[e%2]),e++)})}Tag.classes={"蓝色":"label label-blue","红色":"label label-red","绿色":"label label-green","黄色":"label label-yellow",blue:"label label-blue",red:"label label-red",green:"label label-green",yellow:"label label-yellow"},Tag.mapCn2En={"蓝色":"blue","红色":"red","绿色":"green","黄色":"yellow"},Tag.mapEn2Cn={blue:"蓝色",red:"红色",green:"绿色",yellow:"黄色"},Tag.t=$("#tags"),Tag.getTags=function(){var a=[];return Tag.t.children().each(function(){var e=$(this).data("tag");e=Tag.mapCn2En[e]||e,a.push(e)}),a},Tag.clearTags=function(){Tag.t.html("")},Tag.renderTags=function(a){if(Tag.t.html(""),!isEmpty(a))for(var e=0;e<a.length;++e){var t=a[e];Tag.appendTag(t)}},Tag.renderReadOnlyTags=function(a){function e(){return t?"label label-default":(t=!0,"label label-info")}$("#noteReadTags").html(""),(isEmpty(a)||1==a.length&&""==a[0])&&$("#noteReadTags").html(getMsg("noTag"));var t=!0;for(var t in a){var l=a[t];l=Tag.mapEn2Cn[l]||l;var n=Tag.classes[l];n||(n=e()),tag=tt('<span class="?">?</span>',n,trimTitle(l)),$("#noteReadTags").append(tag)}},Tag.appendTag=function(a,e){var t,l,n=!1;if("object"==typeof a){if(t=a.classes,l=a.text,!l)return}else{if(a=$.trim(a),l=a,!l)return;var t=Tag.classes[l];t?n=!0:t="label label-default"}var g=l;"zh"==LEA.locale&&(l=Tag.mapEn2Cn[l]||l,g=Tag.mapCn2En[g]||g),a=tt('<span class="?" data-tag="?">?<i title="'+getMsg("delete")+'">X</i></span>',t,l,l);var r=!1;$("#tags").children().each(function(){if(n){var e=$("<div></div>").append($(this).clone()).html();e==a&&($(this).remove(),r=!0)}else l+"X"==$(this).text()&&($(this).remove(),r=!0)}),$("#tags").append(a),hideTagList(),n||reRenderTags(),e&&(r||Note.curChangedSaveIt(!0,function(){ajaxPost("/tag/updateTag",{tag:g},function(a){reIsOk(a)&&Tag.addTagNav(a.Item)})}))},Tag.removeTag=function(a){var e=a.data("tag");a.remove(),reRenderTags(),"zh"==LEA.locale&&(e=Tag.mapCn2En[e]||e),Note.curChangedSaveIt(!0,function(){ajaxPost("/tag/updateTag",{tag:e},function(a){reIsOk(a)&&Tag.addTagNav(a.Item)})})},Tag.tags=[],Tag.renderTagNav=function(a){a=a||[],Tag.tags=a,$("#tagNav").html("");for(var e in a){var t=a[e],l=t.Tag,n=l;if("zh"==LEA.locale)var n=Tag.mapEn2Cn[l]||n;n=trimTitle(n);var g=Tag.classes[l]||"label label-default";$("#tagNav").append(tt('<li data-tag="?"><a> <span class="?">?</span> <span class="tag-delete">X</span></li>',l,g,n))}},Tag.addTagNav=function(a){var e=this;for(var t in e.tags){var l=e.tags[t];if(l.Tag==a.Tag){e.tags.splice(t,1);break}}e.tags.unshift(a),e.renderTagNav(e.tags)},$(function(){function a(){$li=$(this).closest("li");var a=$.trim($li.data("tag"));confirm("Are you sure ?")&&ajaxPost("/tag/deleteTag",{tag:a},function(e){if(reIsOk(e)){var t=e.Item;Note.deleteNoteTag(t,a),$li.remove()}})}function e(){var a=$(this).closest("li"),e=$.trim(a.data("tag"));Note.curChangedSaveIt(),Note.clearAll(),$("#tagSearch").html(a.html()).show(),$("#tagSearch .tag-delete").remove(),showLoading(),ajaxGet("/note/searchNoteByTags",{tags:[e]},function(a){hideLoading(),a&&(Note.renderNotes(a),isEmpty(a)||Note.changeNote(a[0].NoteId))})}$("#addTagTrigger").click(function(){$(this).hide(),$("#addTagInput").show().focus().val("")}),$("#addTagInput").click(function(a){showTagList(a)}),$("#addTagInput").blur(function(){var a=$(this).val();a&&Tag.appendTag(a,!0)}),$("#addTagInput").keydown(function(a){13==a.keyCode&&(hideTagList(),$("#addTagInput").val()?($(this).trigger("blur"),$("#addTagTrigger").trigger("click")):$(this).trigger("blur"))}),$("#tagColor li").click(function(a){var e;e=$(this).attr("role")?$(this).find("span"):$(this),Tag.appendTag({classes:e.attr("class"),text:e.text()},!0)}),$("#tags").on("click","i",function(){Tag.removeTag($(this).parent())}),$("#myTag .folderBody").on("click","li .label",e),$("#myTag .folderBody").on("click","li .tag-delete",a)});
|
||||
Notebook.curNotebookId="",Notebook.cache={},Notebook.notebooks=[],Notebook.notebookNavForListNote="",Notebook.notebookNavForNewNote="",Notebook.setCache=function(o){var e=o.NotebookId;e&&(Notebook.cache[e]||(Notebook.cache[e]={}),$.extend(Notebook.cache[e],o))},Notebook.getCurNotebookId=function(){return Notebook.curNotebookId},Notebook.getCurNotebook=function(){return Notebook.cache[Notebook.curNotebookId]},Notebook._updateNotebookNumberNotes=function(o,e){var t=this,N=t.getNotebook(o);N&&(N.NumberNotes+=e,N.NumberNotes<0&&(N.NumberNotes=0),$("#numberNotes_"+o).html(N.NumberNotes))},Notebook.incrNotebookNumberNotes=function(o){var e=this;e._updateNotebookNumberNotes(o,1)},Notebook.minusNotebookNumberNotes=function(o){var e=this;e._updateNotebookNumberNotes(o,-1)},Notebook.getNotebook=function(o){return Notebook.cache[o]},Notebook.getNotebookTitle=function(o){var e=Notebook.cache[o];return e?e.Title:"未知"},Notebook.getTreeSetting=function(o,e){function t(o,t){var N=5,n=$("#"+o+" #"+t.tId+"_switch"),a=$("#"+o+" #"+t.tId+"_ico");if(n.remove(),a.before(n),e?Share.isDefaultNotebookId(t.NotebookId)||a.after($('<span class="fa notebook-setting" title="setting"></span>')):Notebook.isAllNotebookId(t.NotebookId)||Notebook.isTrashNotebookId(t.NotebookId)||(a.after($('<span class="notebook-number-notes" id="numberNotes_'+t.NotebookId+'">'+(t.NumberNotes||0)+"</span>")),a.after($('<span class="fa notebook-setting" title="setting"></span>'))),t.level>1){var r="<span style='display: inline-block;width:"+N*t.level+"px'></span>";n.before(r)}}function N(o,e){for(var t=0,N=e.length;N>t;t++)if(e[t].drag===!1)return!1;return!0}function n(o,e,t,N){return t?t.drop!==!1:!0}function a(o,e,t,N,n){function a(o){return o.level==d}var r=t[0];if(N){var i,k=b.tree,s={curNotebookId:r.NotebookId};if(i="inner"==n?N:N.getParentNode()){s.parentNotebookId=i.NotebookId;var d=i.level+1,c=k.getNodesByFilter(a,!1,i)}else var c=k.getNodes();s.siblings=[];for(var l in c){var h=c[l].NotebookId;Notebook.isAllNotebookId(h)||Notebook.isTrashNotebookId(h)||s.siblings.push(h)}ajaxPost("/notebook/dragNotebooks",{data:JSON.stringify(s)}),setTimeout(function(){Notebook.changeNav()},100)}}var r=!o,b=this;if(e)var i=function(o,e,t){var N=t.NotebookId,n=$(o.target).closest(".friend-notebooks").attr("fromUserId");Share.changeNotebook(n,N)},k=null;else var i=function(o,e,t){var N=t.NotebookId;Notebook.changeNotebook(N)},k=function(o){var e=$(o.target).attr("notebookId");Notebook.isAllNotebookId(e)||Notebook.isTrashNotebookId(e)||b.updateNotebookTitle(o.target)};var s={view:{showLine:!1,showIcon:!1,selectedMulti:!1,dblClickExpand:!1,addDiyDom:t},data:{key:{name:"Title",children:"Subs"}},edit:{enable:!0,showRemoveBtn:!1,showRenameBtn:!1,drag:{isMove:r,prev:r,inner:r,next:r}},callback:{beforeDrag:N,beforeDrop:n,onDrop:a,onClick:i,onDblClick:k,beforeRename:function(o,e,t,N){if(""==t)return e.IsNew?(b.tree.removeNode(e),!0):!1;if(e.Title==t)return!0;if(e.IsNew){var n=e.getParentNode(),a=n?n.NotebookId:"";b.doAddNotebook(e.NotebookId,t,a)}else b.doUpdateNotebookTitle(e.NotebookId,t);return!0}}};return s},Notebook.allNotebookId="0",Notebook.trashNotebookId="-1",Notebook.curNotebookIsTrashOrAll=function(){return Notebook.curNotebookId==Notebook.trashNotebookId||Notebook.curNotebookId==Notebook.allNotebookId},Notebook.renderNotebooks=function(o){var e=this;(!o||"object"!=typeof o||o.length<0)&&(o=[]);for(var t=0,N=o.length;N>t;++t){var n=o[t];n.Title=trimTitle(n.Title)}o=[{NotebookId:Notebook.allNotebookId,Title:getMsg("all"),drop:!1,drag:!1}].concat(o),o.push({NotebookId:Notebook.trashNotebookId,Title:getMsg("trash"),drop:!1,drag:!1}),Notebook.notebooks=o,e.tree=$.fn.zTree.init($("#notebookList"),e.getTreeSetting(),o);var a=$("#notebookList");a.hover(function(){$(this).hasClass("showIcon")||$(this).addClass("showIcon")},function(){$(this).removeClass("showIcon")}),isEmpty(o)||(Notebook.curNotebookId=o[0].NotebookId,e.cacheAllNotebooks(o)),Notebook.renderNav(),Notebook.changeNotebookNavForNewNote(o[0].NotebookId)},Notebook.cacheAllNotebooks=function(o){var e=this;for(var t in o){var N=o[t];Notebook.cache[N.NotebookId]=N,isEmpty(N.Subs)||e.cacheAllNotebooks(N.Subs)}},Notebook.expandNotebookTo=function(o,e){var t=this,N=!1,n=t.tree;if(e&&(n=Share.trees[e]),n){var a=n.getNodeByTId(o);if(a)for(;;){var r=a.getParentNode();if(!r){N||Notebook.changeNotebookNav(o);break}n.expandNode(r,!0),N||(Notebook.changeNotebookNav(o),N=!0),a=r}}},Notebook.renderNav=function(o){var e=this;e.changeNav()},Notebook.searchNotebookForAddNote=function(o){var e=this;if(o){var t=e.tree.getNodesByParamFuzzy("Title",o);t=t||[];var N=[];for(var n in t){var a=t[n].NotebookId;e.isAllNotebookId(a)||e.isTrashNotebookId(a)||N.push(t[n])}isEmpty(N)?$("#notebookNavForNewNote").html(""):$("#notebookNavForNewNote").html(e.getChangedNotebooks(N))}else $("#notebookNavForNewNote").html(e.everNavForNewNote)},Notebook.searchNotebookForList=function(o){var e=this,t=$("#notebookListForSearch"),N=$("#notebookList")Line truncated
|
||||
function addShareNoteOrNotebook(e){var t="#tr"+e,o=Share.dialogNoteOrNotebookId,r=isEmailFromInput(t+" #friendsEmail","#shareMsg",getMsg("inputFriendEmail"));if(r){var a=$(t+' input[name="perm'+e+'"]:checked').val()||0,n=a,s="/share/addShareNote",i={noteId:o,emails:[r],perm:a};Share.dialogIsNote||(s="/share/addShareNotebook",i={notebookId:o,emails:[r],perm:a}),hideAlert("#shareMsg"),post(s,i,function(e){var e=e[r];if(e)if(e.Ok){var a=tt("<td>?</td>","#");a+=tt("<td>?</td>",r),a+=tt('<td><a href="#" noteOrNotebookId="?" perm="?" toUserId="?" title="'+getMsg("clickToChangePermission")+'" class="btn btn-default change-perm">?</a></td>',o,n,e.Id,n&&"0"!=n?getMsg("writable"):getMsg("readOnly")),a+=tt('<td><a href="#" noteOrNotebookId="?" toUserId="?" class="btn btn-warning delete-share">'+getMsg("delete")+"</a></td>",o,e.Id),$(t).html(a)}else{var s=UrlPrefix+"/register?iu="+UserInfo.Username;showAlert("#shareMsg",getMsg("friendNotExits",[getMsg("app"),'<input style="background: none;border: 1px solid #ccc;width: 300px;padding: 3px;border-radius: 3px;outline: none;" onclick="$(this).focus().select()" type="text" value="'+s+'" />'])+"</a> <br /> "+getMsg("sendInviteEmailToYourFriend")+', <a href="#" onclick="sendRegisterEmail(\''+r+"')\">"+getMsg("send"),"warning")}},t+" .btn-success")}}function sendRegisterEmail(e){showDialog2("#sendRegisterEmailDialog",{postShow:function(){$("#emailContent").val(getMsg("inviteEmailBody",[UserInfo.Username,getMsg("app")])),setTimeout(function(){$("#emailContent").focus()},500),$("#toEmail").val(e)}})}function deleteShareNoteOrNotebook(e){$("#tr"+e).remove()}Share.defaultNotebookId="share0",Share.defaultNotebookTitle=getMsg("defaultShare"),Share.sharedUserInfos={},Share.userNavs={},Share.notebookCache={},Share.cache={},Share.dialogIsNote=!0,Share.setCache=function(e){e&&e.NoteId&&(Share.cache[e.NoteId]=e)},Share.getNotebooksForNew=function(e,t){for(var o=this,r="",a=t.length,n=0;a>n;++n){var s=t[n];s.IsShared=!0,s.UserId=e,o.notebookCache[s.NotebookId]=s,Notebook.cache[s.NotebookId]=s;var i="",d=!1;if(!isEmpty(s.Subs)){log(11),log(s.Subs);var d=o.getNotebooksForNew(e,s.Subs);d&&(i="dropdown-submenu")}var h="";if(s.Perm){var h=tt('<li role="presentation" class="clearfix ?" userId="?" notebookId="?"><div class="new-note-left pull-left" title="为该笔记本新建笔记" href="#">?</div><div title="为该笔记本新建markdown笔记" class="new-note-right pull-left">M</div>',i,e,s.NotebookId,s.Title);d&&(h+="<ul class='dropdown-menu'>",h+=d,h+="</ul>"),h+="</li>"}r+=h}return r},Share.trees={},Share.renderShareNotebooks=function(e,t){function o(e){}function r(){var e=$(this).attr("notebookId");return!Share.isDefaultNotebookId(e)}var a=Share;if(!isEmpty(e)){(!t||"object"!=typeof t||t.length<0)&&(t={});var n=$("#shareNotebooks");for(var s in e){var i=e[s],d=t[i.UserId]||[];userNotebooks=[{NotebookId:a.defaultNotebookId,Title:Share.defaultNotebookTitle}].concat(d),a.notebookCache[a.defaultNotebookId]=userNotebooks[0];var h=i.Username||i.Email;i.Username=h,Share.sharedUserInfos[i.UserId]=i;var l=i.UserId,c=tt('<li class="each-user"><div class="friend-header" fromUserId="?"><i class="fa fa-angle-down"></i><span>?</span> <span class="fa notebook-setting" title="setting"></span> </div>',i.UserId,h),N="friendContainer_"+l,u='<ul class="friend-notebooks ztree" id="'+N+'" fromUserId="'+l+'"></ul>';n.append(c+u+"</li>"),a.trees[l]=$.fn.zTree.init($("#"+N),Notebook.getTreeSetting(!0,!0),userNotebooks),a.userNavs[l]={forNew:a.getNotebooksForNew(l,d)},log(a.userNavs)}$(".friend-notebooks").hover(function(){$(this).hasClass("showIcon")||$(this).addClass("showIcon")},function(){$(this).removeClass("showIcon")}),$(".friend-header i").click(function(){var e=$(this),t=$(this).parent().next();t.is(":hidden")?(t.slideDown("fast"),e.removeClass("fa-angle-right fa-angle-down").addClass("fa-angle-down")):(t.slideUp("fast"),e.removeClass("fa-angle-right fa-angle-down").addClass("fa-angle-right"))});var f={width:180,items:[{text:getMsg("deleteSharedNotebook"),icon:"",faIcon:"fa-trash-o",action:Share.deleteShareNotebook}],onShow:o,onContextMenu:r,parent:"#shareNotebooks",children:".notebook-item"},b=$("#shareNotebooks").contextmenu(f),k={width:180,items:[{text:getMsg("deleteAllShared"),icon:"",faIcon:"fa-trash-o",action:Share.deleteUserShareNoteAndNotebook}],parent:"#shareNotebooks",children:".friend-header"},g=$("#shareNotebooks").contextmenu(k);$(".friend-header").on("click",".notebook-setting",function(e){e.preventDefault(),e.stopPropagation();var t=$(this).parent();g.showMenu(e,t)}),$("#shareNotebooks .notebook-item").on("click",".notebook-setting",function(e){e.preventDefault(),e.stopPropagation();var t=$(this).parent();b.showMenu(e,t)})}},Share.isDefaultNotebookId=function(e){return Share.defaultNotebookId==e},Share.toggleToSharedNav=function(e,t){$("#curNotebookForListNote").html(Share.notebookCache[t].Title+"("+Share.sharedUserInfos[e].Username+")");var o=Share.userNavs[e].forNew;if(o){$("#notebookNaLine truncated
|
||||
@@ -1280,8 +1280,10 @@ Note.searchNote = function() {
|
||||
// 发送请求之
|
||||
// 先取消上一个
|
||||
showLoading();
|
||||
Notebook.showNoteAndEditorLoading();
|
||||
Note.lastSearch = $.post("/note/searchNote", {key: val}, function(notes) {
|
||||
hideLoading();
|
||||
Notebook.hideNoteAndEditorLoading();
|
||||
if(notes) {
|
||||
// 成功后设为空
|
||||
Note.lastSearch = null;
|
||||
|
||||
Loaded 100 of 120 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user