只读模式
group, 分享
评论更多问题
博客标签总是存在一个
This commit is contained in:
lealife committed 2015-06-15 18:01:48 +08:00
1 parent 7e458bb433
commit 6987a38820
1452 files changed
+112513 -89488

No files matched your search

+5 -1
View File
@@ -824,7 +824,7 @@ func (c Blog) LikePost(noteId string, callback string) revel.Result {
re.Ok, re.Item = blogService.LikeBlog(noteId, userId)
return c.RenderJsonP(callback, re)
}
func (c Blog) GetComments(noteId string) revel.Result {
func (c Blog) GetComments(noteId string, callback string) revel.Result {
// 评论
userId := c.GetUserId()
page := c.GetPage()
@@ -837,6 +837,10 @@ func (c Blog) GetComments(noteId string) revel.Result {
result["commentUserInfo"] = commentUserInfo
re.Item = result
if callback != "" {
return c.RenderJsonP(callback, result)
}
return c.RenderJson(re)
}
+2 -1
View File
@@ -49,10 +49,11 @@ func (c Note) Index(noteId string) revel.Result {
hasRightNoteId := false
if IsObjectId(noteId) {
note := noteService.GetNoteById(noteId)
if note.NoteId != "" {
var noteOwner = note.UserId.Hex()
noteContent = noteService.GetNoteContent(noteId, noteOwner)
if note.NoteId != "" {
hasRightNoteId = true
c.RenderArgs["curNoteId"] = noteId
c.RenderArgs["curNotebookId"] = note.NotebookId.Hex()
+12 -4
View File
@@ -335,8 +335,12 @@ func (c ApiNote) AddNote(noteOrContent info.ApiNote) revel.Result {
Abstract: noteOrContent.Abstract}
// 通过内容得到Desc, abstract
note.Desc = SubStringHTMLToRaw(noteContent.Content, 50)
if noteOrContent.Abstract == "" {
note.Desc = SubStringHTMLToRaw(noteContent.Content, 200)
noteContent.Abstract = SubStringHTML(noteContent.Content, 200, "")
} else {
note.Desc = SubStringHTMLToRaw(noteContent.Abstract, 200)
}
note = noteService.AddNoteAndContentApi(note, noteContent, myUserId)
@@ -352,7 +356,7 @@ func (c ApiNote) AddNote(noteOrContent info.ApiNote) revel.Result {
noteOrContent.UpdatedTime = note.UpdatedTime
noteOrContent.UserId = c.getUserId()
noteOrContent.IsMarkdown = note.IsMarkdown
// 删除一些不要返回的
// 删除一些不要返回的, 删除Desc?
noteOrContent.Content = ""
noteOrContent.Abstract = ""
// apiNote := info.NoteToApiNote(note, noteOrContent.Files)
@@ -494,8 +498,12 @@ func (c ApiNote) UpdateNote(noteOrContent info.ApiNote) revel.Result {
}
if c.Has("Content") {
// 通过内容得到Desc, abstract
noteUpdate["Desc"] = SubStringHTMLToRaw(noteOrContent.Content, 50)
// 通过内容得到Desc, 如果有Abstract, 则用Abstract生成Desc
if noteOrContent.Abstract == "" {
noteUpdate["Desc"] = SubStringHTMLToRaw(noteOrContent.Content, 200)
} else {
noteUpdate["Desc"] = SubStringHTMLToRaw(noteOrContent.Abstract, 200)
}
}
afterNoteUsn := 0
@@ -460,7 +460,7 @@ func (c MemberBlog) ImportTheme() revel.Result {
var ext string
_, ext = SplitFilename(filename)
if ext != ".zip" {
re.Msg = "请上传zip文件"
re.Msg = "Please upload zip file"
return c.RenderJson(re)
}
@@ -472,7 +472,7 @@ func (c MemberBlog) ImportTheme() revel.Result {
// > 10M?
if len(data) > 10*1024*1024 {
re.Msg = "文件大于10M"
re.Msg = "File is big than 10M"
return c.RenderJson(re)
}
+1 -1
View File
@@ -14,7 +14,7 @@ type Theme struct {
Version string `Version`
Author string `Author`
AuthorUrl string `AuthorUrl`
Path string `Path` // 文件夹路径
Path string `Path` // 文件夹路径, public/upload/54d7620d99c37b030600002c/themes/54d867c799c37b533e000001
Info map[string]interface{} `Info` // 所有信息
IsActive bool `IsActive` // 是否在用
+42 -3
View File
@@ -51,6 +51,18 @@ func init() {
revel.TemplateFuncs["raw"] = func(str string) template.HTML {
return template.HTML(str)
}
revel.TemplateFuncs["trim"] = func(str string) string {
str = strings.Trim(str, " ")
str = strings.Trim(str, " ")
str = strings.Trim(str, "\n")
str = strings.Trim(str, " ")
// 以下两个空格不一样
str = strings.Trim(str, " ")
str = strings.Trim(str, " ")
return str
}
revel.TemplateFuncs["add"] = func(i int) string {
i = i + 1;
return fmt.Sprintf("%v", i)
@@ -145,8 +157,33 @@ func init() {
return template.HTML(tagStr)
}
revel.TemplateFuncs["blogTagsForExport"] = func(renderArgs map[string]interface{}, tags []string) template.HTML {
if tags == nil || len(tags) == 0 {
return ""
}
tagStr := ""
lenTags := len(tags)
for i, tag := range tags {
str := tag
var classes = "label"
if InArray([]string{"red", "blue", "yellow", "green"}, tag) {
classes += " label-" + tag
} else {
classes += " label-default"
}
classes += " label-post"
tagStr += "<span class=\"" + classes + "\" >" + str + "</span>";
if i != lenTags - 1 {
tagStr += " "
}
}
return template.HTML(tagStr)
}
// lea++
revel.TemplateFuncs["blogTagsLea"] = func(renderArgs map[string]interface{}, tags []string, isRecommend bool) template.HTML {
revel.TemplateFuncs["blogTagsLea"] = func(renderArgs map[string]interface{}, tags []string, typeStr string) template.HTML {
if tags == nil || len(tags) == 0 {
return ""
}
@@ -155,10 +192,12 @@ func init() {
lenTags := len(tags)
tagPostUrl := "http://lea.leanote.com/"
if isRecommend {
if typeStr == "recommend" {
tagPostUrl += "?tag=";
} else {
} else if typeStr == "latest" {
tagPostUrl += "latest?tag=";
} else {
tagPostUrl += "subscription?tag=";
}
for i, tag := range tags {
+8
View File
@@ -56,6 +56,14 @@ func ClearDir(dir string) bool {
return true
}
func MkdirAll(dir string) bool {
err := os.MkdirAll(dir, 0777)
if err != nil {
return false
}
return true
}
// list dir's all file, return filenames
func ListDir(dir string) []string {
f, err := os.Open(dir)
+21
View File
@@ -10,6 +10,7 @@ import (
"io"
"gopkg.in/mgo.v2/bson"
"time"
"strings"
math_rand "math/rand"
)
@@ -315,3 +316,23 @@ func InArray(arr []string, str string) bool {
}
return false
}
// 将名称的特殊字符去掉
func FixFilename(filename string) string {
if filename != "" {
// 把特殊字段给替换掉
// str := `life "%&()+,/:;<>=?@\|`
// . == \\.
// $ === \\$
reg, _ := regexp.Compile("\\.|/|#|\\$|!|\\^|\\*|'| |\"|%|&|\\(|\\)|\\+|\\,|/|:|;|<|>|=|\\?|@|\\||\\\\")
filename = reg.ReplaceAllString(filename, "-")
filename = strings.Trim(filename, "-") // 左右单独的-去掉
// 把空格替换成-
// filename = strings.Replace(filename, " ", "-", -1)
for strings.Index(filename, "--") >= 0 { // 防止出现连续的--
filename = strings.Replace(filename, "--", "-", -1)
}
return filename
}
return filename
}
+16 -20
View File
@@ -6,6 +6,7 @@ import (
"os/exec"
"io/ioutil"
"strings"
// "time"
)
/*
@@ -32,7 +33,7 @@ import (
//var jss = []string{"js/jquery-cookie", "js/bootstrap"}
var jss = []string{"js/jquery-cookie", "js/bootstrap",
"js/common", "js/app/note", "js/app/tag", "js/app/notebook", "js/app/share",
"js/object_id"}
"js/object_id", "js/ZeroClipboard/ZeroClipboard"}
var base1 = "/Users/life/Documents/Go/package2/src/github.com/leanote/leanote/"
var base = "/Users/life/Documents/Go/package2/src/github.com/leanote/leanote/public/"
@@ -91,7 +92,6 @@ func dev() {
"notebook.js": "notebook-min.js",
"share.js": "share-min.js",
"tag.js": "tag-min.js",
"main.js": "main-min.js",
"jquery.slimscroll.js": "jquery.slimscroll-min.js",
"jquery.contextmenu.js": "jquery.contextmenu-min.js",
"editor/editor.js": "editor/editor-min.js",
@@ -107,6 +107,13 @@ func dev() {
for key, value := range m {
content = strings.Replace(content, key, value, -1)
}
// var time = time.Now().Unix() % 1000
// content = strings.Replace(content, "-min.js", fmt.Sprintf("-min.js?r=%d", time), -1)
// content = strings.Replace(content, "default{{end}}.css", fmt.Sprintf("default{{end}}.css?r=%d", time), 1)
// content = strings.Replace(content, "writting-overwrite.css", fmt.Sprintf("writting-overwrite.css?r=%d", time), 1)
ioutil.WriteFile(target, []byte(content), os.ModeAppend)
}
@@ -114,8 +121,10 @@ func dev() {
func tinymce() {
// cmdStr := "node_modules/jake/bin/cli.js minify bundle[themes:modern,plugins:table,paste,advlist,autolink,link,image,lists,charmap,hr,searchreplace,visualblocks,visualchars,code,nav,tabfocus,contextmenu,directionality,codemirror,codesyntax,textcolor,fullpage]"
// cmd := exec.Command("/Users/life/Documents/eclipse-workspace/go/leanote_release/tinymce-master/node_modules/jake/bin/cli.js", "minify", "bundle[themes:modern,plugins:table,paste,advlist,autolink,link,image,lists,charmap,hr,searchreplace,visualblocks,visualchars,code,nav,tabfocus,contextmenu,directionality,codemirror,codesyntax,textcolor,fullpage]")
cmd := exec.Command("/Users/life/Documents/eclipse-workspace/go/leanote_release/tinymce-master/node_modules/jake/bin/cli.js", "minify")
cmd.Dir = "/Users/life/Documents/eclipse-workspace/go/leanote_release/tinymce-master"
cmd := exec.Command("/bin/sh", "-c", "grunt minify");
cmd.Dir = base + "/tinymce_4.1.9"
fmt.Println("正在build tinymce");
// 必须要先删除
cmd2 := exec.Command("/bin/sh", "-c", "rm " + cmd.Dir + "/js/tinymce/tinymce.dev.js")
@@ -123,32 +132,19 @@ func tinymce() {
cmd2 = exec.Command("/bin/sh", "-c", "rm " + cmd.Dir + "/js/tinymce/tinymce.jquery.dev.js")
c, _ := cmd2.CombinedOutput()
fmt.Println(string(c))
c, _ = cmd.CombinedOutput()
fmt.Println(string(c))
}
func main() {
// 压缩tinymce
tinymce()
// tinymce()
dev();
// 其它零散的需要压缩的js
otherJss := []string{"tinymce/tinymce", "js/main", "js/app/page", "js/contextmenu/jquery.contextmenu",
"mdeditor/editor/scrollLink",
"mdeditor/editor/editor",
"mdeditor/editor/jquery.waitforimages",
"mdeditor/editor/pagedown/local/Markdown.local.zh",
"mdeditor/editor/pagedown/local/Markdown.local.en",
"mdeditor/editor/pagedown/Markdown.Editor",
"mdeditor/editor/pagedown/Markdown.Sanitizer",
"mdeditor/editor/pagedown/Markdown.Converter",
"mdeditor/editor/Markdown.Extra",
"mdeditor/editor/underscore",
"mdeditor/editor/mathJax",
"js/jQuery-slimScroll-1.3.0/jquery.slimscroll",
"js/app/editor_drop_paste",
"js/app/attachment_upload",
otherJss := []string{"js/main", "js/app/page", "js/contextmenu/jquery.contextmenu",
"js/jquery.ztree.all-3.5",
"js/jQuery-slimScroll-1.3.0/jquery.slimscroll",
}
+4
View File
@@ -1197,6 +1197,10 @@ func (this *BlogService) FixBlog(blog info.BlogItem) info.Post {
LikeNum: blog.LikeNum,
IsMarkdown: blog.IsMarkdown,
}
if blog2.Tags != nil && len(blog2.Tags) > 0 && blog2.Tags[0] != "" {
} else {
blog2.Tags = nil
}
return blog2
}
+64 -10
View File
@@ -32,11 +32,21 @@ func (this *GroupService) DeleteGroup(userId, groupId string) (ok bool, msg stri
return false, "groupHasUsers"
}
*/
if !this.isMyGroup(userId, groupId) {
return false, "notMyGroup"
}
// 删除分组后, 需要删除所有用户分享到该组的笔记本, 笔记
shareService.DeleteAllShareNotebookGroup(groupId);
shareService.DeleteAllShareNoteGroup(groupId);
db.DeleteAll(db.GroupUsers, bson.M{"GroupId": bson.ObjectIdHex(groupId)})
return db.DeleteByIdAndUserId(db.Groups, groupId, userId), ""
// TODO 删除分组后, 在shareNote, shareNotebook中也要删除
}
// 修改group标题
func (this *GroupService) UpdateGroupTitle(userId, groupId, title string) (ok bool) {
return db.UpdateByIdAndUserIdField(db.Groups, groupId, userId, "Title", title)
@@ -44,9 +54,14 @@ func (this *GroupService) UpdateGroupTitle(userId, groupId, title string) (ok bo
// 得到用户的所有分组(包括下的所有用户)
func (this *GroupService) GetGroupsAndUsers(userId string) ([]info.Group) {
// 得到分组s
/*
// 得到我的分组
groups := []info.Group{}
db.ListByQ(db.Groups, bson.M{"UserId": bson.ObjectIdHex(userId)}, &groups)
*/
// 我的分组, 及我所属的分组
groups := this.GetGroupsContainOf(userId);
// 得到其下的用户
for i, group := range groups {
group.Users = this.GetUsers(group.GroupId.Hex())
@@ -62,6 +77,28 @@ func (this *GroupService) GetGroups(userId string) ([]info.Group) {
return groups
}
// 得到我的和我所属组的ids
func (this *GroupService) GetMineAndBelongToGroupIds(userId string) ([]bson.ObjectId) {
// 所属组
groupIds := this.GetBelongToGroupIds(userId)
m := map[bson.ObjectId]bool{}
for _, groupId := range groupIds {
m[groupId] = true
}
// 我的组
myGroups := this.GetGroups(userId)
for _, group := range myGroups {
if !m[group.GroupId] {
groupIds = append(groupIds, group.GroupId)
}
}
return groupIds
}
// 获取包含此用户的组对象数组
// 获取该用户所属组, 和我的组
func (this *GroupService) GetGroupsContainOf(userId string) []info.Group {
@@ -130,10 +167,25 @@ func (this *GroupService) GetBelongToGroupIds(userId string) ([]bson.ObjectId) {
func (this *GroupService) isMyGroup(ownUserId, groupId string) (ok bool) {
return db.Has(db.Groups, bson.M{"_id": bson.ObjectIdHex(groupId), "UserId": bson.ObjectIdHex(ownUserId)})
}
// 判断组中是否包含指定用户
func (this *GroupService) IsExistsGroupUser(userId, groupId string) (ok bool) {
// 如果我拥有这个组, 那也行
if this.isMyGroup(userId, groupId) {
return true
}
return db.Has(db.GroupUsers, bson.M{"UserId": bson.ObjectIdHex(userId), "GroupId": bson.ObjectIdHex(groupId)})
}
// 为group添加用户
// 用户是否已存在?
func (this *GroupService) AddUser(ownUserId, groupId, userId string) (ok bool, msg string) {
// groupId是否是ownUserId的?
/*
if !this.IsExistsGroupUser(ownUserId, groupId) {
return false, "forbidden"
}
*/
if !this.isMyGroup(ownUserId, groupId) {
return false, "forbidden"
}
@@ -150,20 +202,22 @@ func (this *GroupService) AddUser(ownUserId, groupId, userId string) (ok bool, m
CreatedTime: time.Now(),
}), ""
}
// 删除用户
func (this *GroupService) DeleteUser(ownUserId, groupId, userId string) (ok bool, msg string) {
// groupId是否是ownUserId的?
/*
if !this.IsExistsGroupUser(ownUserId, groupId) {
return false, "forbidden"
}
*/
if !this.isMyGroup(ownUserId, groupId) {
return false, "forbidden"
}
// 删除该用户分享到本组的笔记本, 笔记
shareService.DeleteShareNotebookGroupWhenDeleteGroupUser(userId, groupId);
shareService.DeleteShareNoteGroupWhenDeleteGroupUser(userId, groupId);
return db.Delete(db.GroupUsers, bson.M{"GroupId": bson.ObjectIdHex(groupId), "UserId": bson.ObjectIdHex(userId)}), ""
}
// 判断组中是否包含指定用户
func (this *GroupService) IsExistsGroupUser(userId, groupId string) (ok bool) {
// 如果我拥有这个组, 那也行
if this.isMyGroup(userId, groupId) {
return true
}
return db.Has(db.GroupUsers, bson.M{"UserId": bson.ObjectIdHex(userId), "GroupId": bson.ObjectIdHex(groupId)})
}
+5 -1
View File
@@ -8,6 +8,8 @@ import (
. "github.com/leanote/leanote/app/lea"
"sort"
"time"
"strings"
// "html"
)
// 笔记本
@@ -40,7 +42,9 @@ func ParseAndSortNotebooks(userNotebooks []info.Notebook, noParentDelete, needSo
for _, each := range userNotebooks {
newNotebooks := info.Notebooks{Subs: info.SubNotebooks{}}
newNotebooks.NotebookId = each.NotebookId
newNotebooks.Title = each.Title
newNotebooks.Title = each.Title;
// newNotebooks.Title = html.EscapeString(each.Title)
newNotebooks.Title = strings.Replace(strings.Replace(each.Title, "<script>", "", -1), "</script", "", -1)
newNotebooks.Seq = each.Seq
newNotebooks.UserId = each.UserId
newNotebooks.ParentNotebookId = each.ParentNotebookId
+51 -2
View File
@@ -33,8 +33,9 @@ type ShareService struct {
// 谁共享给了我的Query
func (this *ShareService) getOrQ(userId string) bson.M {
// 得到我参与的组织
groupIds := groupService.GetBelongToGroupIds(userId)
// 得到我和和我参与的组织
groupIds := groupService.GetMineAndBelongToGroupIds(userId)
q := bson.M{}
if len(groupIds) > 0 {
orQ := []bson.M{
@@ -51,6 +52,8 @@ func (this *ShareService) getOrQ(userId string) bson.M {
// 得到共享给我的笔记本和用户(谁共享给了我)
func (this *ShareService) GetShareNotebooks(userId string) (info.ShareNotebooksByUser, []info.User) {
myUserId := userId
// 得到共享给我的用户s信息
// 得到我参与的组织
q := this.getOrQ(userId)
@@ -64,7 +67,15 @@ func (this *ShareService) GetShareNotebooks(userId string) (info.ShareNotebooksB
db.Distinct(db.ShareNotebooks, q, "UserId", &userIds2) // BUG之前是userId1, 2014/12/29
userIds := append(userIds1, userIds2...)
userInfos := userService.GetUserInfosOrderBySeq(userIds);
// 不要我的id
for i, userInfo := range userInfos {
if userInfo.UserId.Hex() == myUserId {
userInfos = append(userInfos[:i], userInfos[i+1:]...)
break;
}
}
//--------------------
// 得到他们共享给我的notebooks
@@ -102,6 +113,11 @@ func (this *ShareService) GetShareNotebooks(userId string) (info.ShareNotebooksB
// 先建立userId => []
for _, eachSub := range subShareNotebooks {
userId := eachSub.Notebook.UserId
// 我自己的, 算了
if userId.Hex() == myUserId {
continue;
}
if _, ok := shareNotebooksByUsersMap[userId]; ok {
shareNotebooksByUsersMap[userId] = append(shareNotebooksByUsersMap[userId], eachSub)
} else {
@@ -779,3 +795,36 @@ func (this *ShareService) DeleteShareNotebookGroup(userId, notebookId, groupId s
"ToGroupId": bson.ObjectIdHex(groupId),
});
}
//--------------------
// 删除组时, 删除所有的
//--------------------
func (this *ShareService) DeleteAllShareNotebookGroup(groupId string) bool {
return db.Delete(db.ShareNotebooks, bson.M{
"ToGroupId": bson.ObjectIdHex(groupId),
});
}
func (this *ShareService) DeleteAllShareNoteGroup(groupId string) bool {
return db.Delete(db.ShareNotes, bson.M{
"ToGroupId": bson.ObjectIdHex(groupId),
});
}
//--------------------
// 删除组内用户时, 删除其分享的
//--------------------
func (this *ShareService) DeleteShareNotebookGroupWhenDeleteGroupUser(userId, groupId string) bool {
return db.Delete(db.ShareNotebooks, bson.M{
"UserId": bson.ObjectIdHex(userId),
"ToGroupId": bson.ObjectIdHex(groupId),
});
}
func (this *ShareService) DeleteShareNoteGroupWhenDeleteGroupUser(userId, groupId string) bool {
return db.Delete(db.ShareNotes, bson.M{
"UserId": bson.ObjectIdHex(userId),
"ToGroupId": bson.ObjectIdHex(groupId),
});
}
+2 -3
View File
@@ -7,9 +7,8 @@
<a href="http://weibo.com/leanotecom" target="_blank"><i class="fa fa-weibo"></i></a>
<br />
leanote@leanote.com
<div id="beian">
<a href="http://www.miibeian.gov.cn" target="_blank">沪ICP备14006011号</a>
</div>
<br />
Copyright © 2014-2015 <a href="http://leanote.com">Leanote</a>
</div>
<div class="col-md-6">
<i class="fa fa-globe fa-3x icon-muted"></i>
+20 -18
View File
@@ -5,7 +5,8 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="keywords" content="leanote,leanote.com">
<meta name="description" content="leanote, {{msg $ "moto"}}">
<meta name="description" content="Leanote, {{msg $ "moto"}}">
<meta property="qc:admins" content="2451332115167456375" />
<meta name="author" content="leanote">
<title>{{.title}}</title>
@@ -37,30 +38,29 @@ function log(o) {
</div>
<div id="navbar" class="navbar-collapse collapse">
<div id="lang"><a data-lang="en-us">English</a><a data-lang="zh-cn">中文</a></div>
<ul class="nav navbar-nav navbar-left">
<li><a href="/index#" target="body" class="smooth-scroll">{{msg . "home"}}</a></li>
<!--
<li><a href="/index#aboutLeanote" target="#aboutLeanote" class="smooth-scroll">{{msg . "aboutLeanote"}}</a> </li>
-->
<li><a href="/index#donate" target="#donate" class="smooth-scroll">{{msg . "donate"}}</a> </li>
<li><a id="leanoteBlog" href="http://lea.leanote.com" target="_blank" title="lea++, leanote博客平台" class="">lea++</a></li>
<li style="position: relative; margin-right: 3px;">
<a href="http://bbs.leanote.com" target="_blank" class="">{{msg . "discussion"}}</a>
<li><a href="/index#" data-target="body" class="smooth-scroll">{{msg . "home"}}</a></li>
<li style="position: relative;">
<a id="" href="http://leanote.com/service" title="" class="">{{msg . "service"}}</a>
<div class="red-circle" style=""></div>
</li>
<li id="loginBtns">
<li style="position: relative; margin-right: 3px;">
<a href="http://bbs.leanote.com" target="_blank" class="">{{msg . "discussion"}}</a>
</li>
<li><a id="leanoteBlog" href="http://lea.leanote.com" target="_blank" title="lea++, leanote blog platform" class="">lea++</a></li>
<li><a id="leanoteApp" href="http://app.leanote.com" target="_blank" title="Leanote App" class="">{{msg . "desktopApp"}}</a></li>
<li><a href="http://leanote.org" target="_blank" title="leanote.org" class="">leanote.org</a></li>
{{if .userInfo.Email}}
<li id="loginBtns">
{{msg . "hi"}}, {{.userInfo.Username}}
<a href="{{$.noteUrl}}">{{msg . "myNote"}}</a>
<a href="/logout">{{msg . "logout"}}</a>
{{else}}
<a href="/login">{{msg . "login"}}</a>
{{if .openRegister}}
<a href="/register" class="btn-register">{{msg . "register"}}</a>
{{end}}
{{end}}
</li>
{{end}}
</ul>
</div>
</div>
@@ -90,9 +90,11 @@ function log(o) {
</div>
<ul id="blogNav" class="pull-right">
<li><a href="/index#" target="body" class="smooth-scroll">{{msg . "home"}}</a></li>
<li><a href="/index#donate" target="#donate" class="smooth-scroll">{{msg . "donate"}}</a> </li>
<li><a href="#" target="body" class="smooth-scroll">{{msg . "home"}}</a></li>
<li><a href="#download" target="#download" class="smooth-scroll">{{msg . "download"}}</a> </li>
<li><a href="#donate" target="#donate" class="smooth-scroll">{{msg . "donate"}}</a> </li>
<li><a id="leanoteBlog" href="{{.leaUrl}}/index" target="_blank" title="lea++, leanote博客平台" class="">lea++</a></li>
<li style="position: relative; margin-right: 3px;">
<a href="http://bbs.leanote.com" target="_blank" class="">{{msg . "discussion"}}</a>
<div style="position: absolute;
+14 -1
View File
@@ -4,7 +4,7 @@
</style>
<section>
<div class="header">
<h2>leanote, {{msg . "moto"}}</h2>
<h2>Leanote, {{msg . "moto"}}</h2>
<p>{{msg . "moto3"}}</p>
<p>
Knowledge, Blog, Sharing, Cooperation... all in leanote
@@ -120,6 +120,19 @@ $(function() {
var targetOffset = $(t).offset().top - 80;
$('html,body').animate({scrollTop: targetOffset}, 300);
});
function setCookie(name, value) {
var Days = 10*365;
var exp = new Date();
exp.setTime(exp.getTime() + Days*24*60*60*1000);
document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
}
$('#lang a').click(function() {
var lang = $(this).data('lang');
setCookie('LEANOTE_LANG', lang);
location.reload();
});
});
</script>
</body>
+14 -1
View File
@@ -4,7 +4,7 @@
</style>
<section>
<div class="header">
<h2>leanote, {{msg . "moto"}}</h2>
<h2>Leanote, {{msg . "moto"}}</h2>
<p>{{msg . "moto3"}}</p>
<p>{{msg . "moto2"}}</p>
@@ -119,6 +119,19 @@ $(function() {
var targetOffset = $(t).offset().top - 80;
$('html,body').animate({scrollTop: targetOffset}, 300);
});
function setCookie(name, value) {
var Days = 10*365;
var exp = new Date();
exp.setTime(exp.getTime() + Days*24*60*60*1000);
document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
}
$('#lang a').click(function() {
var lang = $(this).data('lang');
setCookie('LEANOTE_LANG', lang);
location.reload();
});
});
</script>
</body>
-102
View File
@@ -1,102 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="keywords" content="leanote,leanote.com">
<meta name="description" content="leanote, {{msg $ "moto"}}">
<meta name="author" content="leanote">
<title>{{.title}}</title>
<link href="{{.siteUrl}}/css/bootstrap.css" rel="stylesheet">
<link id="styleLink" href="{{.siteUrl}}/css/toImage.css" rel="stylesheet">
</head>
<body>
<div id="content">
<h1 class="title">
{{.blog.Title}}
</h1>
<div class="created-time">
{{ if .userBlog.Logo}}
<img src="{{.userBlog.Logo}}" id="logo">
{{else}}
<img src="{{$.siteUrl}}/images/blog/default_avatar.png" id="logo">
{{end}}
{{.userInfo.Username}}
{{if .blog.Tags}}
<img src="{{$.siteUrl}}/images/blog/tag.png" id="tag">
{{blogTags .blog.Tags}}
{{end}}
</div>
<div class="desc">
{{if .blog.IsMarkdown }}
<div id="markdownContent" style="display: none">
<!-- 用textarea装html, 防止得到的值失真 -->
<textarea>
{{.content | raw}}
</textarea>
</div>
<div id="parsedContent">
</div>
{{else}}
{{.content | raw}}
{{end}}
</div>
</div>
<div id="footer">
<p>
{{ if .userBlog.Logo}}
<img src="{{.userBlog.Logo}}" id="logo">
{{else}}
<img src="{{$.siteUrl}}/images/blog/default_avatar.png" id="logo">
{{end}}
(<a href="#">http://blog.leanote.com/{{.userInfo.Username}}</a>)
</p>
<img src="{{.siteUrl}}/images/logo/leanote_white.png" id="leanote_logo"/>
<p>
leanote, {{msg $ "moto"}}
</p>
</div>
<script src="{{.siteUrl}}/js/jquery-1.9.0.min.js"></script>
<script src="{{.siteUrl}}/js/bootstrap-min.js"></script>
<link href="{{.siteUrl}}/public/mdeditor/editor/google-code-prettify/prettify.css" type="text/css" rel="stylesheet">
<script src="{{.siteUrl}}/public/mdeditor/editor/google-code-prettify/prettify.js"></script>
<script>
$("pre").addClass("prettyprint linenums");
prettyPrint();
</script>
{{if .blog.IsMarkdown }}
<script src="{{.siteUrl}}/public/mdeditor/editor/google-code-prettify/prettify.js"></script>
<script src="{{.siteUrl}}/public/mdeditor/editor/pagedown/Markdown.Converter.js"></script>
<script src="{{.siteUrl}}/public/mdeditor/editor/pagedown/Markdown.Sanitizer.js"></script>
<script src="{{.siteUrl}}/public/mdeditor/editor/pagedown/Markdown.Editor.js"></script>
<script src="{{.siteUrl}}/public/mdeditor/editor/pagedown/local/Markdown.local.zh.js"></script>
<script src="{{.siteUrl}}/public/mdeditor/editor/Markdown.Extra.js"></script>
<!--mathjax-->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ["\\(","\\)"]], processEscapes: true }, messageStyle: "none"});
</script>
<script src="{{.siteUrl}}/public/mdeditor/editor/mathJax.js"></script>
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script>
var content = $.trim($("#markdownContent textarea").val());
var converter = Markdown.getSanitizingConverter();
Markdown.Extra.init(converter, {extensions: ["tables", "fenced_code_gfm", "def_list"]});
var html = converter.makeHtml(content);
$("#parsedContent").html(html);
$("pre").addClass("prettyprint linenums");
prettyPrint();
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"wmd-preview"]);
</script>
{{end}}
</body>
</html>
-4
View File
@@ -1,4 +0,0 @@
lif------------
e
you can
+14 -5
View File
@@ -40,23 +40,32 @@
</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;}};
$(function() {
tinymce.init({
selector : "#content1",
content_css : [ "/css/bootstrap.css", "/css/editor/editor.css" ],
skin : "custom",
content_css : ["/css/editor/editor.css" ],
theme : "leanote",
language : "{{.locale}}",
height : 300,
width : "100%",
skin : "custom",
// 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"],
"table contextmenu directionality textcolor fullpage textcolor"],
toolbar1 : "formatselect |fontselect fontsizeselect| forecolor backcolor | bold italic underline strikethrough | bullist numlist |",
menubar : false,
statusbar : false,
+21 -7
View File
@@ -55,7 +55,7 @@
{{range .myTpls}}
<a href="#" class="list-group-item " data-file="{{.}}">
<i class="fa fa-remove icon-muted remove-file" title="delete file" ></i>
{{.}}
<span class="filename" data-filename="{{.}}">{{.}}</span>
<span class="badge"></span>
</a>
{{end}}
@@ -123,7 +123,7 @@ var theme = {
saveBtnO: $("#saveBtn"),
newFileO: $("#newFile"),
curTpl: "",
tplInfos: {"header.html": "{{msg . "header"}}", "footer.html": "{{msg . "footer"}}", "index.html": "{{msg . "header"}}", "cate.html": "{{msg . "cate"}}", "search.html": "{{msg . "search"}}", "single.html": "{{msg . "single"}}", "archive.html": "{{msg . "archive"}}", "post.html": "{{msg . "post"}}", "tags.html": "{{msg . "tags"}}", "tag_posts.html": "{{msg . "tag_posts"}}", "share_comment.html": "{{msg . "share_comment"}}", "404.html":"404", "theme.json": "{{msg . "themeJson"}}", "paging.html": "{{msg . "paging"}}", "highlight.html": "{{msg . "highlight"}}"},
tplInfos: {"header.html": "{{msg . "header"}}", "footer.html": "{{msg . "footer"}}", "index.html": "{{msg . "index"}}", "cate.html": "{{msg . "cate"}}", "search.html": "{{msg . "search"}}", "single.html": "{{msg . "single"}}", "archive.html": "{{msg . "archive"}}", "post.html": "{{msg . "post"}}", "tags.html": "{{msg . "tags"}}", "tag_posts.html": "{{msg . "tag_posts"}}", "share_comment.html": "{{msg . "share_comment"}}", "404.html":"404", "theme.json": "{{msg . "themeJson"}}", "paging.html": "{{msg . "paging"}}", "highlight.html": "{{msg . "highlight"}}"},
init: function() {
var self = this;
self.showTplInfo();
@@ -171,12 +171,22 @@ var theme = {
newFile: function() {
var self = this;
self.newFileO.click(function() {
art.prompt("文件名", function(file){
// 文件是否存在?
art.prompt("Filename", function(file) {
if(!file) {
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> ' + file + '<span class="badge"></span></a>';
if($('[data-filename="' + file + '"]').length > 0) {
art.alert('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>');
$(".file-list").append(t);
self.cache[file] = "";
// trigger click, 选中之
t.click();
});
});
},
@@ -206,6 +216,9 @@ var theme = {
var content = editor.getValue()
var filename = self.curTpl;
if(!filename) {
return;
}
// 之前的内容是否有改动
if(self.cache[filename] == content) {
return;
@@ -234,7 +247,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";
@@ -251,8 +264,8 @@ var theme = {
renderTpl: function(name) {
var self = this;
var content = "";
self.curTpl = name; // 这里设置
if(self.cache[name]) {
self.curTpl = ""; // 这里设置为空
if(self.cache[name] != undefined) {
content = self.cache[name];
self.renderContent(name, content);
return;
@@ -264,6 +277,7 @@ var theme = {
}
});
},
//-----------------
// theme images
imageListO: $("#imageList"),
+42 -36
View File
@@ -7,8 +7,8 @@
<meta name="apple-touch-fullscreen" content="yes">
<meta name=”apple-mobile-web-app-capable” content=”yes” />
<meta name="keywords" content="leanote,leanote.com">
<meta name="description" content="leanote, Not Just A Notebook">
<title>leanote, Not Just A Notebook</title>
<meta name="description" content="Leanote, {{msg $ "moto"}}">
<title>Leanote, {{msg $ "moto"}}</title>
<link href="/css/bootstrap.css" rel="stylesheet" />
<!-- 先加载, 没有样式, 宽度不定 -->
@@ -186,13 +186,11 @@ function log(o) {
</div>
</div>
<!--
<div class="pull-right top-nav writting-hide lea-blog">
<a target="_blank" href="http://lea.leanote.com">
lea++
</a>
</div>
-->
<div class="pull-right top-nav writting-hide" id="myBlog">
<a target="_blank" href="{{$.blogUrl}}/{{.userInfo.Username}}">
@@ -416,29 +414,7 @@ function log(o) {
<div class="noteSplit" id="noteSplitter"></div>
<div id="note">
<!-- 只读模式 -->
<div id="noteRead">
<div id="noteReadContainer">
<div id="noteReadTop">
<h2 id="noteReadTitle"></h2>
<div class="clearfix" id="noteReadInfo">
<i class="fa fa-bookmark-o"></i>
<span id="noteReadTags"></span>
<!-- 修改时间 -->
<i class="fa fa-clock-o"></i>{{msg . "update"}}
<span id="noteReadUpdatedTime"></span>
<!-- 修改时间 -->
<i class="fa fa-clock-o"></i>{{msg . "create"}}
<span id="noteReadCreatedTime"></span>
</div>
</div>
<div id="noteReadContent">
</div>
</div>
</div>
<!-- 遮罩, 为了resize3Columns用 -->
<div id="noteMask" class="note-mask"></div>
<div id="noteMaskForLoading" class="note-mask">
@@ -546,17 +522,38 @@ function log(o) {
<div id="noteTitleDiv">
<input name="noteTitle" id="noteTitle" value="" placeholder="{{msg . "unTitled"}}" tabindex="1" />
</div>
<!-- 只读时 -->
<div id="noteReadTop">
<h2 id="noteReadTitle"></h2>
<div class="clearfix" id="noteReadInfo">
<i class="fa fa-bookmark-o"></i>
<span id="noteReadTags"></span>
<!-- 修改时间 -->
<i class="fa fa-clock-o"></i> {{msg . "update"}}
<span id="noteReadUpdatedTime"></span>
<!-- 修改时间 -->
<i class="fa fa-clock-o"></i> {{msg . "create"}}
<span id="noteReadCreatedTime"></span>
</div>
</div>
</div>
<div id="editor">
<!-- 编辑器 -->
<div id="mceToolbar">
<div id="popularToolbar"
style="position: absolute; right: 30px; left: 0"></div>
<a
style="dispaly: block; position: absolute; cursor: pointer; right: 10px; padding: 3px 10px"
id="moreBtn"> <i class="fa fa-angle-down"></i>
</a>
<div id="mceToolbarContainer">
<div id="popularToolbar" style="position: absolute; right: 30px; left: 0"></div>
<a id="moreBtn"> <i class="fa more-fa"></i></a>
</div>
<!-- 查看信息 -->
<div id="infoToolbar" class="info-toolbar">
<a class="toolbar-update"><i class="fa fa-pencil"></i> <span class="lang">{{msg . "modify"}}</span></a>
<span class="lang">{{msg . "created"}}</span>: <span class="created-time">2015-04-03</span>
<span class="lang">{{msg . "updated"}}</span>: <span class="updated-time">2015-05-01</span>
</div>
</div>
<div class="editorBg"></div>
<div id="leanoteNav" class="leanoteNav">
@@ -586,11 +583,17 @@ function log(o) {
<div id="mdEditor">
<div class="layout-wrapper-l1">
<div class="layout-wrapper-l2">
<div class="navbar navbar-default">
<div class="navbar-inner" id="wmd-button-bar">
<div id="mdInfoToolbar" class="info-toolbar">
<a class="toolbar-update"><i class="fa fa-pencil"></i> <span class="lang">{{msg . "modify"}}</span></a>
<span class="lang">{{msg . "created"}}</span>: <span class="created-time">2015-04-03</span>
<span class="lang">{{msg . "updated"}}</span>: <span class="updated-time">2015-05-01</span>
</div>
<div class="wmd-button-bar-inner">
<ul class="nav left-buttons">
<li class="wmd-button-group1 btn-group"></li>
</ul>
@@ -629,6 +632,7 @@ function log(o) {
</ul>
-->
</div>
</div>
<div class="editorBg"></div>
</div>
<div class="layout-wrapper-l3">
@@ -900,6 +904,7 @@ var GlobalConfigs = {{.globalConfigs|jsonJs}}; // 2014/11/9 beta2
<!-- 渲染view -->
<script src="/tinymce/tinymce.js"></script>
<script src="/public/libs/ace/ace.js"></script>
<script src="/js/app/page.js"></script>
<script src="/js/jQuery-slimScroll-1.3.0/jquery.slimscroll.js"></script>
@@ -919,13 +924,14 @@ initPage();
<!-- v2 use require.js, mdeditor -->
<script>
window.baseDir = '/public/dist';
// 当tinymce.dev.js时, 请注释require
window.require = {
baseUrl: window.baseDir,
deps: ['main']
baseUrl: '/public',
};
</script>
<script src="/js/require.js"></script>
<script src="/public/dist/main.min.js"></script>
<script src="/public/js/upload_paste/main.js"></script>
</script>
</body>
</html>
+42 -36
View File
@@ -7,8 +7,8 @@
<meta name="apple-touch-fullscreen" content="yes">
<meta name=”apple-mobile-web-app-capable” content=”yes” />
<meta name="keywords" content="leanote,leanote.com">
<meta name="description" content="leanote, Not Just A Notebook">
<title>leanote, Not Just A Notebook</title>
<meta name="description" content="Leanote, {{msg $ "moto"}}">
<title>Leanote, {{msg $ "moto"}}</title>
<link href="/css/bootstrap.css" rel="stylesheet" />
<!-- 先加载, 没有样式, 宽度不定 -->
@@ -186,13 +186,11 @@ function log(o) {
</div>
</div>
<!--
<div class="pull-right top-nav writting-hide lea-blog">
<a target="_blank" href="http://lea.leanote.com">
lea++
</a>
</div>
-->
<div class="pull-right top-nav writting-hide" id="myBlog">
<a target="_blank" href="{{$.blogUrl}}/{{.userInfo.Username}}">
@@ -416,29 +414,7 @@ function log(o) {
<div class="noteSplit" id="noteSplitter"></div>
<div id="note">
<!-- 只读模式 -->
<div id="noteRead">
<div id="noteReadContainer">
<div id="noteReadTop">
<h2 id="noteReadTitle"></h2>
<div class="clearfix" id="noteReadInfo">
<i class="fa fa-bookmark-o"></i>
<span id="noteReadTags"></span>
<!-- 修改时间 -->
<i class="fa fa-clock-o"></i>{{msg . "update"}}
<span id="noteReadUpdatedTime"></span>
<!-- 修改时间 -->
<i class="fa fa-clock-o"></i>{{msg . "create"}}
<span id="noteReadCreatedTime"></span>
</div>
</div>
<div id="noteReadContent">
</div>
</div>
</div>
<!-- 遮罩, 为了resize3Columns用 -->
<div id="noteMask" class="note-mask"></div>
<div id="noteMaskForLoading" class="note-mask">
@@ -546,17 +522,38 @@ function log(o) {
<div id="noteTitleDiv">
<input name="noteTitle" id="noteTitle" value="" placeholder="{{msg . "unTitled"}}" tabindex="1" />
</div>
<!-- 只读时 -->
<div id="noteReadTop">
<h2 id="noteReadTitle"></h2>
<div class="clearfix" id="noteReadInfo">
<i class="fa fa-bookmark-o"></i>
<span id="noteReadTags"></span>
<!-- 修改时间 -->
<i class="fa fa-clock-o"></i> {{msg . "update"}}
<span id="noteReadUpdatedTime"></span>
<!-- 修改时间 -->
<i class="fa fa-clock-o"></i> {{msg . "create"}}
<span id="noteReadCreatedTime"></span>
</div>
</div>
</div>
<div id="editor">
<!-- 编辑器 -->
<div id="mceToolbar">
<div id="popularToolbar"
style="position: absolute; right: 30px; left: 0"></div>
<a
style="dispaly: block; position: absolute; cursor: pointer; right: 10px; padding: 3px 10px"
id="moreBtn"> <i class="fa fa-angle-down"></i>
</a>
<div id="mceToolbarContainer">
<div id="popularToolbar" style="position: absolute; right: 30px; left: 0"></div>
<a id="moreBtn"> <i class="fa more-fa"></i></a>
</div>
<!-- 查看信息 -->
<div id="infoToolbar" class="info-toolbar">
<a class="toolbar-update"><i class="fa fa-pencil"></i> <span class="lang">{{msg . "modify"}}</span></a>
<span class="lang">{{msg . "created"}}</span>: <span class="created-time">2015-04-03</span>
<span class="lang">{{msg . "updated"}}</span>: <span class="updated-time">2015-05-01</span>
</div>
</div>
<div class="editorBg"></div>
<div id="leanoteNav" class="leanoteNav">
@@ -586,11 +583,17 @@ function log(o) {
<div id="mdEditor">
<div class="layout-wrapper-l1">
<div class="layout-wrapper-l2">
<div class="navbar navbar-default">
<div class="navbar-inner" id="wmd-button-bar">
<div id="mdInfoToolbar" class="info-toolbar">
<a class="toolbar-update"><i class="fa fa-pencil"></i> <span class="lang">{{msg . "modify"}}</span></a>
<span class="lang">{{msg . "created"}}</span>: <span class="created-time">2015-04-03</span>
<span class="lang">{{msg . "updated"}}</span>: <span class="updated-time">2015-05-01</span>
</div>
<div class="wmd-button-bar-inner">
<ul class="nav left-buttons">
<li class="wmd-button-group1 btn-group"></li>
</ul>
@@ -629,6 +632,7 @@ function log(o) {
</ul>
-->
</div>
</div>
<div class="editorBg"></div>
</div>
<div class="layout-wrapper-l3">
@@ -900,6 +904,7 @@ var GlobalConfigs = {{.globalConfigs|jsonJs}}; // 2014/11/9 beta2
<!-- 渲染view -->
<script src="/tinymce/tinymce.min.js"></script>
<script src="/public/libs/ace/ace.js"></script>
<script src="/js/app/page-min.js"></script>
<script src="/js/jQuery-slimScroll-1.3.0/jquery.slimscroll-min.js"></script>
@@ -919,13 +924,14 @@ initPage();
<!-- v2 use require.js, mdeditor -->
<script>
window.baseDir = '/public/dist';
// 当tinymce.min.js时, 请注释require
window.require = {
baseUrl: window.baseDir,
deps: ['main']
baseUrl: '/public',
};
</script>
<script src="/js/require.js"></script>
<script src="/public/dist/main.min.js"></script>
<script src="/public/js/upload_paste/main.js"></script>
</script>
</body>
</html>
-32
View File
@@ -1,32 +0,0 @@
{{template "home/header_box.html" .}}
<section id="box" class="animated fadeInUp">
<div>
<h1 id="logo">leanote</h1>
<div id="boxForm">
<div id="boxHeader">We got a error</div>
<form>
<div class="alert alert-danger" id="loginMsg" style="display: block">
Sorry, we can't get your infomation.
<br />
Please <a href="/login">{{msg . "login"}}</a> Or <a href="/register?email={{.email}}">{{msg . "register"}}</a>
</div>
</form>
</div>
</div>
</section>
<div id="boxFooter">
<p>
<a href="/login">{{msg . "login"}}</a>
&nbsp;
<a href="/index">{{msg . "home"}}</a>
</p>
<p>
<a href="/index">leanote</a> © 2014
</p>
</div>
</body>
</html>
+1 -1
View File
@@ -9,7 +9,7 @@ site.url=http://localhost:9000 # or http://x.com:8080, http://www.xx.com:9000
# mongdb
db.host=localhost
db.port=27017
db.dbname=leanote # required
db.dbname=leanote8 # required
db.username= # if not exists, please leave it blank
db.password= # if not exists, please leave it blank
# or you can set the mongdb url for more complex needs the format is:
+20 -9
View File
@@ -1,9 +1,9 @@
# leanote
app=leanote
moto=Not Just A Notebook!
moto2=Knowledge, Blog, Sharing, Cooperation... all in leanote
app=Leanote
moto=Not Just A Notepad!
moto2=Knowledge, Blog, Sharing, Cooperation... all in Leanote
moto3=Brief But Not Simple
fork github=Fork leanote on Github
fork github=Fork Leanote on Github
# 首页
forgetPassword = Forget password?
@@ -13,7 +13,8 @@ try=Try it
usernameOrEmail=Username or email
password=Password
home=Home
aboutLeanote=About leanote
desktopApp=App
aboutLeanote=About Leanote
suggestions=Suggestions
yourSuggestions=Suggestions
leanoteBlog=Blog
@@ -32,6 +33,7 @@ captcha=Captcha
reloadCaptcha=Reload Captcha
captchaError=Captcha Do Not Match
inputCaptcha=Captcha is required
noTag=No Tags
hi=Hi
welcomeUseLeanote=Welcome!
@@ -56,6 +58,7 @@ ing=processing
use = Use
hadAcount = Already have an account?
hasAcount = Do not have an account?
signInWithThird=Sign in with other account
# 注册
registerSuccessAndRdirectToNote=Register success, redirecting...
@@ -165,6 +168,7 @@ cancelPublic=Cancel public
move=Move
copy=Copy
rename=Rename
exportPdf=Export PDF
addChildNotebook=Add child notebook
deleteAllShared=Delete shared user
deleteSharedNotebook=Delete shared notebook
@@ -244,6 +248,7 @@ themeValidHasRoundInclude=WARNING: Templates have circular references!
leaDesc=leanote blog platform
recommend=Recommend
latest=Latest
subscription=Subscription
# 用户中心
memberCenter=Member Center
@@ -252,8 +257,9 @@ hasUsers=The user already exists
# yu
service=Service
imageSizeOver=Sorry, you have no image opacity, please <a href="/service">upgrade your account</a>.
attachSizeOver=Sorry, you have no attachment opacity, please <a href="/service">upgrade your account</a>.
trafficOver=Sorry, you have no web traffic, please go <a href="/service">upgrade your account</a>.
imageSizeOver=Sorry, you have no image capacity, please go <a href="/service">upgrade your account</a>.
attachSizeOver=Sorry, you have no attachment opacity, please go <a href="/service">upgrade your account</a>.
#memeber
@@ -262,8 +268,9 @@ accountInfo=Account Info
accountType=Account Type
premiumAccountType=Premium
normalAccountType=Normal
imageSize=Image Opacity
attachSize=Attachment Opacity
imageSize=Image Capacity
attachSize=Attachment Capacity
totalTraffic=Web Traffic
upgrade=Upgrade My Account
leanoteEvents=Leanote News
addLeanoteAccount=New Leanote Account
@@ -336,5 +343,9 @@ deleteGroup=Delete group
addMemberTips=Input username or email to add member
deleteMember=Delete member
created=Created
updated=Updated
modify=Modify
# error
notFound=This page cann't found.
+19 -9
View File
@@ -1,7 +1,7 @@
# leanote
app=leanote
app=Leanote
moto=不只是笔记!
moto2=知识管理, 博客, 分享, 协作... 尽在leanote
moto2=知识管理, 博客, 分享, 协作... 尽在Leanote
moto3=简约而不简单
fork github=Github 源码
@@ -13,9 +13,10 @@ try=体验一下
usernameOrEmail=用户名或Email
password=密码
home=主页
aboutLeanote=关于leanote
desktopApp=客户端
aboutLeanote=关于Leanote
suggestions=建议
yourSuggestions=帮助完善leanote
yourSuggestions=帮助完善Leanote
leanoteBlog=官方博客
knowledge=知识
knowledgeInfo=leanote是一个笔记, 你可以用它来管理自己的知识.
@@ -32,6 +33,7 @@ captcha=验证码
reloadCaptcha=刷新验证码
captchaError=验证码错误
inputCaptcha=请输入验证码
noTag=无标签
hi=Hi
welcomeUseLeanote=Welcome!
@@ -76,6 +78,7 @@ ing=正在处理
use = 使用
hadAcount = 已有帐户?
hasAcount = 还无帐户?
signInWithThird=使用第三方帐号登录
# 注册
registerSuccessAndRdirectToNote=注册成功, 正在跳转...
@@ -189,6 +192,7 @@ cancelPublic=取消公开为博客
move=移动
copy=复制
rename=重命名
exportPdf=导出PDF
addChildNotebook=添加子笔记本
deleteAllShared=删除所有共享
deleteSharedNotebook=删除共享笔记本
@@ -268,8 +272,9 @@ themeValidHasRoundInclude=警告: 模板存在循环引用问题!
# lea++
leaDesc=leanote博客平台
recommend=推荐
latest=最新
recommend=推荐文章
latest=最新文章
subscription=我的订阅
# 用户中心
memberCenter=用户中心
@@ -278,17 +283,19 @@ hasUsers=已存在该成员
# yu
service=服务
imageSizeOver=对不起, 您的图片容量不足, 请<a href="/service">升级您的帐户</a>
attachSizeOver=对不起, 您的附件容量不足, 请<a href="/service">升级您的帐户</a>
trafficOver=对不起, 您本月的流量已用完, 请至<a href="/service">升级您的帐户</a>
imageSizeOver=对不起, 您的图片容量不足, 请至<a href="/service">升级您的帐户</a>
attachSizeOver=对不起, 您的附件容量不足, 请至<a href="/service">升级您的帐户</a>
#memeber
welcomeToLeanote=欢迎来到leanote
accountInfo=帐户信息
accountType=帐户类型
premiumAccountType=彩色套餐
premiumAccountType=旗舰套餐
normalAccountType=共享套餐
imageSize=图片空间
attachSize=附件空间
totalTraffic=流量
upgrade=升级套餐
leanoteEvents=Leanote动态
addLeanoteAccount=新建Leanote帐户
@@ -361,6 +368,9 @@ deleteGroup=删除组
addMemberTips=输入用户名或邮箱添加成员
deleteMember=删除成员
created=创建
updated=更新
modify=修改
# 必须要加这个, 奇怪
[CN]
-1
View File
@@ -1 +0,0 @@
function log(t){console.log(t)}function openDialog(t){if(t=t||{},t.id||(t.id=ARTDIALOG.id++),t.content&&"object"==typeof t.content)try{t.content=t.content.get(0)}catch(e){}t=$.extend({},ARTDIALOG.defaultConfig,t);var a=art.dialog(t);return t.url&&$.get(t.url,{},function(t){a.content(t)}),ARTDIALOG.stack.push(t.id),a}function closeDialog(){var t=art.dialog.list;if(t)for(;;){var e=ARTDIALOG.stack.pop();if(!e)return;if(t[e])return void t[e].close()}}function closeLatestLoadingDialog(){var t=art.dialog.list;if(t)for(;;){var e=ARTDIALOG.stack.pop();if(!e)return;if(t[e]){var a=t[e];return void("loading.."==$(a.content()).text()&&a.close())}}}function drop_confirm(t,e){art?art.confirm(t,function(){var t=this;return t.content("正在处理..."),ajaxGet(e,{},function(e){e.done?(t.content("操作成功, 正在刷新..."),location.reload()):art.alert(e.msg),t.close()}),!1}):confirm(t)&&(window.location=e)}function init_validator(t,e,a){var o={errorElement:"div",errorClass:"help-block alert alert-warning",focusInvalid:!1,ignore:".ignore",highlight:function(t){var e=$(t).closest(".control-group");e.removeClass("success").addClass("error")},success:function(t){var e=t.closest(".control-group");e.removeClass("error"),e.addClass("success"),e.find(".help-block").hide(),$(t).hide()},errorPlacement:function(t,e){var a=e.parent("div");e.parent("div").append(t),log(e),log(a)},submitHandler:function(t){t.submit()}};return e&&(o.rules=e),a&&(o.messages=a),$(t).validate(o)}function enter_submit(t){var e=window.event||arguments.callee.caller.arguments[0];(13==e.keyCode||108==e.keyCode)&&$(t).trigger("click")}function openSendEmailDialog(t){openDialog({width:500,url:"/adminEmail/sendEmailDialog?emails="+t,title:"Send Email"})}function goNowToDatetime(t){return t?t.substr(0,10)+" "+t.substr(11,8):""}var ARTDIALOG={stack:[],id:1};ARTDIALOG.defaultConfig={title:"",draggable:!1,padding:0,fixed:!1,lock:!1,opacity:.3},"undefined"!=typeof art&&(art.alert=function(t,e){return artDialog({id:"Alert",icon:"warning",fixed:!0,lock:!0,content:t,ok:!0,opacity:.3,close:e})},art.confirm=function(t,e,a){return artDialog({id:"Confirm",icon:"question",fixed:!0,lock:!0,opacity:.3,content:t,ok:function(t){return e.call(this,t)},cancel:function(t){return a&&a.call(this,t)}})},art.prompt=function(t,e,a){a=a||"";var o;return artDialog({id:"Prompt",icon:"question",fixed:!0,lock:!0,opacity:.3,content:['<div style="margin-bottom:5px;font-size:12px">',t,"</div>","<div>",'<input value="',a,'" style="width:18em;padding:6px 4px" />',"</div>"].join(""),init:function(){o=this.DOM.content.find("input")[0],o.select(),o.focus()},ok:function(t){return e&&e.call(this,o.value,t)},cancel:!0})},art.tips=function(t,e){return artDialog({id:"Tips",title:!1,cancel:!1,fixed:!0,lock:!0,opacity:.3}).content('<div style="padding: 0 1em;">'+t+"</div>").time(e||1)},$(function(){$(".art-dialog").click(function(){var t=$(this).data("title"),e=$(this).data("url"),a=+$(this).data("lock"),o=$(this).data("width"),n={url:e,title:t,lock:a};o&&(n.width=o),openDialog(n)})})),!function($){$(function(){function addMsg(t){var e=$(".nav-user"),a=$(".count:first",e),o=parseInt(a.text());$(".count",e).fadeOut().fadeIn().text(o+1),$(t).hide().prependTo(e.find(".list-group")).slideDown().css("display","block")}$(".nav li > a").click(function(t){$p=$(this).closest("ul");var e=$(this).closest("li");if(0==e.find("ul").length)return!0;t.preventDefault();var a=e.hasClass("active");$p.find("li").removeClass("active"),a||e.addClass("active")}),$(".th-sortable").click(function(){var t=$(this).hasClass("th-sort-up"),e=$(this).hasClass("th-sort-down"),a=$(this).data("url"),o=$(this).data("sorter"),n="th-sort-up";if(t){n="th-sort-down";var i="sorter="+o+"-down"}else var i="sorter="+o+"-up";location.href=a.indexOf("?")>0?a+"&"+i:a+"?"+i,$(this).removeClass("th-sort-up th-sort-down").addClass(n)}),$(".search-group input").keyup(function(t){enter_submit(".search-group button")}),$(".search-group button").click(function(t){var e=$(this).data("url");$input=$(this).closest(".search-group").find("input");var a=$input.val();location.href=e.indexOf("?")>0?e+"&keywords="+a:e+"?keywords="+a});var sr,sparkline=function($re){$(".sparkline").each(function(){var $data=$(this).data();(!$re||$data.resize)&&("pie"==$data.type&&$data.sliceColors&&($data.sliceColors=eval($data.sliceColors)),"bar"==$data.type&&$data.stackedBarColor&&($data.stackedBarColor=eval($data.stackedBarColor)),$data.valueSpots={"0:":$data.spotColor},$(this).sparkline("html",$data))})};$(window).resize(function(t){clearTimeout(sr),sr=setTimeout(function(){sparkline(!0)},500)}),sparkline(!1),$(".easypiechart").each(function(){var t=$(this),e=t.data(),a=t.find(".step"),o=parseInt($(e.target).text()),n=0;e.barColor||(e.barColor=function(t){return t/=100,"rgb("+Math.round(200*t)+", 200, "+Math.round(200*(1-t))+")"}),e.onStep=function(t){n=t,a.text(parseInt(t)),e.target&&$(e.target).text(parseInt(t)+o)},e.onStop=function(){o=parseInt($(e.target).text()),e.update&&Line truncated
+2
View File
@@ -3,3 +3,5 @@
themes 是默认主题, 有3个
用户自定义的主题不在这里, 在public/upload/userId/thmems下
test
+2 -2
View File
@@ -379,8 +379,8 @@ function getLikesAndComments(noteId, callback) {
ajaxGetP(getLeanoteUrl() + "/blog/getLikesAndComments", {noteId: noteId}, callback);
}
// 得到评论
function getComments(noteId, page) {
ajaxGetP(getLeanoteUrl() + "/blog/listComments", {noteId: noteId, page: page}, callback);
function getComments(noteId, page, callback) {
ajaxGetP(getLeanoteUrl() + "/blog/getComments", {noteId: noteId, page: page}, callback);
}
// 点赞
function likePost(noteId, callback) {
+20 -3
View File
@@ -108,17 +108,34 @@ var commentNum = +"{{$.post.CommentNum}}";
markdown
调用markdown来解析得到html
-->
{{if $.post.IsMarkdown }}
<script src="/public/libs/md2html/md2html.js"></script>
<script src="/public/mdeditor/editor/pagedown/Markdown.Converter.js"></script>
<script src="/public/mdeditor/editor/pagedown/Markdown.Sanitizer.js"></script>
<script src="/public/mdeditor/editor/pagedown/Markdown.Editor.js"></script>
<script src="/public/mdeditor/editor/pagedown/local/Markdown.local.zh.js"></script>
<script src="/public/mdeditor/editor/Markdown.Extra.js"></script>
<!--mathjax-->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ["\\(","\\)"]], processEscapes: true }, messageStyle: "none"});
</script>
<script src="/public/mdeditor/editor/mathJax.js"></script>
<script src="/public/libs/MathJax/MathJax.js?config=TeX-AMS_HTML"></script>
<script>
var content = $.trim($("#markdownContent textarea").val());
md2Html(content, $("#content"), function(html) {
var converter = Markdown.getSanitizingConverter();
Markdown.Extra.init(converter, {extensions: ["tables", "fenced_code_gfm", "def_list"]});
var html = converter.makeHtml(content);
$("#content").html(html);
$("pre").addClass("prettyprint linenums");
prettyPrint();
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"wmd-preview"]);
initNav();
weixin();
});
</script>
<!-- 不是markdown -->
{{else}}
<script>
-5
View File
@@ -530,8 +530,3 @@ table tr:nth-child(2n) {
border-collapse: collapse;
padding: 6px 13px;
}
.desc *, #content * {
word-wrap: break-word;
}
+22 -4
View File
@@ -107,17 +107,35 @@ var commentNum = +"{{$.post.CommentNum}}";
<!--
markdown
调用markdown来解析得到html
-->{{if $.post.IsMarkdown }}
<script src="/public/libs/md2html/md2html.js"></script>
-->
{{if $.post.IsMarkdown }}
<script src="/public/mdeditor/editor/pagedown/Markdown.Converter.js"></script>
<script src="/public/mdeditor/editor/pagedown/Markdown.Sanitizer.js"></script>
<script src="/public/mdeditor/editor/pagedown/Markdown.Editor.js"></script>
<script src="/public/mdeditor/editor/pagedown/local/Markdown.local.zh.js"></script>
<script src="/public/mdeditor/editor/Markdown.Extra.js"></script>
<!--mathjax-->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ["\\(","\\)"]], processEscapes: true }, messageStyle: "none"});
</script>
<script src="/public/mdeditor/editor/mathJax.js"></script>
<script src="/public/libs/MathJax/MathJax.js?config=TeX-AMS_HTML"></script>
<script>
var content = $.trim($("#markdownContent textarea").val());
md2Html(content, $("#content"), function(html) {
var converter = Markdown.getSanitizingConverter();
Markdown.Extra.init(converter, {extensions: ["tables", "fenced_code_gfm", "def_list"]});
var html = converter.makeHtml(content);
$("#content").html(html);
$("pre").addClass("prettyprint linenums");
prettyPrint();
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"wmd-preview"]);
initNav();
weixin();
});
</script>
<!-- 不是markdown -->
{{else}}
<script>
-3
View File
@@ -541,6 +541,3 @@ table tr:nth-child(2n) {
border-collapse: collapse;
padding: 6px 13px;
}
.desc *, #content * {
word-wrap: break-word;
}
+20 -3
View File
@@ -108,17 +108,34 @@ var commentNum = +"{{$.post.CommentNum}}";
markdown
调用markdown来解析得到html
-->
{{if $.post.IsMarkdown }}
<script src="/public/libs/md2html/md2html.js"></script>
<script src="/public/mdeditor/editor/pagedown/Markdown.Converter.js"></script>
<script src="/public/mdeditor/editor/pagedown/Markdown.Sanitizer.js"></script>
<script src="/public/mdeditor/editor/pagedown/Markdown.Editor.js"></script>
<script src="/public/mdeditor/editor/pagedown/local/Markdown.local.zh.js"></script>
<script src="/public/mdeditor/editor/Markdown.Extra.js"></script>
<!--mathjax-->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ["\\(","\\)"]], processEscapes: true }, messageStyle: "none"});
</script>
<script src="/public/mdeditor/editor/mathJax.js"></script>
<script src="/public/libs/MathJax/MathJax.js?config=TeX-AMS_HTML"></script>
<script>
var content = $.trim($("#markdownContent textarea").val());
md2Html(content, $("#content"), function(html) {
var converter = Markdown.getSanitizingConverter();
Markdown.Extra.init(converter, {extensions: ["tables", "fenced_code_gfm", "def_list"]});
var html = converter.makeHtml(content);
$("#content").html(html);
$("pre").addClass("prettyprint linenums");
prettyPrint();
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"wmd-preview"]);
initNav();
weixin();
});
</script>
<!-- 不是markdown -->
{{else}}
<script>
-3
View File
@@ -580,6 +580,3 @@ table tr:nth-child(2n) {
border-collapse: collapse;
padding: 6px 13px;
}
.desc *, #content * {
word-wrap: break-word;
}
+159 -15
View File
@@ -155,7 +155,7 @@ a:hover {
}
.thumbnails {
padding: 0;
margin: 25px 0 0;
padding-top: 25px;
}
.thumbnails > li {
position: relative;
@@ -195,32 +195,176 @@ a:hover {
.article .article-info > a {
margin-right: 10px;
}
.avatar {
.user-card {
position: absolute;
top: 1px;
right: 1px;
padding-right: 50px;
right: -50px;
}
.user-card .dropdown-menu {
width: 310px;
left: -140px;
}
.user-card .dropdown-menu:before {
content: "";
width: 0;
height: 0;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-bottom: 10px solid #eaedef;
background: none;
background-image: none;
top: -7px;
left: 145px;
right: auto;
}
.user-card .user-card-content {
width: 310px;
padding: 0;
background: #eaedef;
top: 35px;
border-radius: 6px;
word-break: break-all;
}
.user-card .user-card-content .loading {
display: none;
}
.user-card .user-card-content.loading .loading {
display: block;
}
.user-card .user-card-content.loading .header,
.user-card .user-card-content.loading .content {
display: none;
}
.user-card .user-card-content .loading {
text-align: center;
padding: 10px 0;
}
.user-card .user-card-content .loading:before {
content: "";
width: 17px;
height: 11px;
background: url(http://baijii-common.b0.upaiyun.com/loaders/tiny.gif);
background-size: 17px 11px;
display: inline-block;
}
.user-card .user-card-content .header {
padding: 10px;
overflow: hidden;
border-bottom: 1px solid #d9d9d9;
border-radius: 6px 6px 0 0;
}
.user-card .user-card-content .header .btn {
box-sizing: border-box;
width: 95px;
}
.user-card .user-card-content .header .follow-btn {
display: none;
}
.user-card .user-card-content .header.not-followed .follow-btn {
display: block;
}
.user-card .user-card-content .header.not-followed .following-btn {
display: none;
}
.user-card .user-card-content .header .following-btn .unfollow {
display: none;
}
.user-card .user-card-content .header .following-btn:hover .following {
display: none;
}
.user-card .user-card-content .header .following-btn:hover .unfollow {
display: block;
}
.user-card .user-card-content .header .follow-btn,
.user-card .user-card-content .header .following-btn {
float: right;
padding: 4px 10px 2px;
margin: 0;
}
.user-card .user-card-content .header .avatar {
float: left;
}
.user-card .user-card-content .username {
line-height: 32px;
padding-left: 10px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-right: 100px;
display: block;
}
.user-card .user-card-content .header > span {
position: relative;
top: 6px;
font-weight: bold;
}
.user-card .user-card-content .content {
padding: 0 10px 10px;
font-size: 12px;
font-family: "lucida grande", "lucida sans unicode", lucida, helvetica, "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
}
.user-card .user-card-content .content p {
margin-bottom: 0;
}
.user-card .user-card-content .content .intro {
padding: 10px 12px 7px;
margin: 0 -10px 0;
background: white;
border-bottom: 1px solid #d9d9d9;
}
.user-card .user-card-content .content ul {
padding: 1px 10px 2px 10px;
margin: 0 -10px 10px;
background: #ffffff;
}
.user-card .user-card-content .content ul li {
border-bottom: 1px dashed #d9d9d9;
}
.user-card .user-card-content .content ul li a {
margin: 5px 0;
line-height: 20px;
display: block;
}
.user-card .user-card-content .content ul time {
position: absolute;
right: 10px;
color: #999999;
font-size: 12px;
}
.user-card .user-card-content .content h5 {
margin: 0;
padding-top: 3px;
margin-right: 63px;
font-size: 12px;
font-family: "lucida grande", "lucida sans unicode", lucida, helvetica, "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
font-weight: normal;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.user-card .user-card-content .content a {
color: #999999;
}
.avatar {
width: 32px;
height: 32px;
line-height: 32px;
text-align: center;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
overflow: hidden;
}
.avatar img {
width: 32px;
display: inline-block;
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
/*
}
.avatar img {
width: 30px;
border-radius: 50%;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
-webkit-transition: border-color 0.3s !important;
-moz-transition: border-color 0.3s !important;
-ms-transition: border-color 0.3s !important;
-o-transition: border-color 0.3s !important;
transition: border-color 0.3s !important;
*/
}
#pagination {
text-align: center;
+194 -14
View File
@@ -1,6 +1,7 @@
@bgColor: #fff;
@headerBgColor: #fff;
@fontFamily: 'Open Sans','Helvetica Neue',Arial,'Hiragino Sans GB','Microsoft YaHei','WenQuanYi Micro Hei',sans-serif;
@fontFamily: "lucida grande", "lucida sans unicode", lucida, helvetica, "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
@aWhiteColor: #fff;
@aBlackColor: #000;
@borderColor: #EBEFF2;
@@ -103,11 +104,12 @@ a:hover {
margin: auto;
padding: 0;
}
@navbarBg: #fafbfc;
.navbar, .navbar-default {
margin: 0;
border-bottom: 1px solid #DEDDDF;
box-shadow: 0 1px 2px rgba(0,0,0,.04),inset 0 1px 0 #fff;
background-color: #fafbfc;
background-color: @navbarBg;
a {
font-size: 16px;
}
@@ -174,7 +176,7 @@ a:hover {
// 文章列表
.thumbnails {
padding: 0;
margin: 25px 0 0;
padding-top: 25px;
}
.thumbnails > li {
position: relative;
@@ -218,31 +220,209 @@ a:hover {
margin-right: 10px;
}
}
.avatar {
@cardBg: #EAEDEF;
.user-card {
position: absolute;
top: 1px;
right: 1px;
padding-right: 50px;
right: -50px;
.dropdown-menu {
width: 310px;
left: -140px;
&:before {
content: "";
width: 0;
height: 0;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-bottom: 10px solid @cardBg;
background: none;
background-image: none;
top: -7px;
left: 145px;
right: auto;
}
}
.user-card-content {
width: 310px;
padding: 0;
background: @cardBg;
top: 35px;
border-radius: 6px;
word-break: break-all;
.loading {
display: none;
}
&.loading {
.loading {
display: block;
}
.header,
.content {
display: none;
}
}
}
.user-card-content .loading {
text-align: center;
padding: 10px 0;
&:before {
content: "";
width: 17px;
height: 11px;
background: url(http://7xj51o.com1.z0.glb.clouddn.com/bar-loading.gif);
background-size: 17px 11px;
display: inline-block;
}
}
.user-card-content .header {
padding: 10px;
overflow: hidden;
border-bottom: 1px solid #d9d9d9;
border-radius: 6px 6px 0 0;
.btn {
box-sizing: border-box;
width: 95px;
}
.follow-btn {
display: none;
}
&.not-followed {
.follow-btn {
display: block;
}
.following-btn {
display: none;
}
}
.following-btn {
.unfollow {
display: none;
}
&:hover {
.following {
display: none;
}
.unfollow {
display: block;
}
}
}
}
.user-card-content .header .follow-btn,
.user-card-content .header .following-btn {
float: right;
padding: 4px 10px 2px;
margin: 0
}
.user-card-content .header .avatar {
float: left;
}
.user-card-content .username {
line-height: 32px;
padding-left: 10px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-right: 100px;
display: block;
}
.user-card-content .header>span {
position: relative;
top: 6px;
font-weight: bold
}
.user-card-content .content {
padding: 0 10px 10px;
font-size: 12px;
}
.user-card-content .content p {
margin-bottom: 0
}
.user-card-content .content .intro {
padding: 10px 12px 7px;
margin: 0 -10px 0;
background: white;
border-bottom: 1px solid #d9d9d9
}
.user-card-content .content ul {
padding: 1px 10px 2px 10px;
margin: 0 -10px 10px;
background: white
}
.user-card-content .content ul li {
border-bottom: 1px dashed #d9d9d9;
a {
margin: 5px 0;
line-height: 20px;
display: block;
}
}
.user-card-content .content ul time {
position: absolute;
right: 10px;
color: #999999;
font-size: 12px;
}
.user-card-content .content h5 {
margin: 0;
padding-top: 3px;
margin-right: 63px;
font-size: 12px;
font-weight: normal;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap
}
.user-card-content .content a {
color: #999999
}
}
.avatar {
width: 32px;
height: 32px;
line-height: 32px;
text-align: center;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
overflow: hidden;
img {
width: 32px;
// border: 2px solid white;
display: inline-block;
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
img {
width: 30px;
/*
border-radius: 50%;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
-webkit-transition: border-color 0.3s !important;
-moz-transition: border-color 0.3s !important;
-ms-transition: border-color 0.3s !important;
-o-transition: border-color 0.3s !important;
transition: border-color 0.3s !important;
*/
}
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+16 -2
View File
@@ -37,7 +37,7 @@
}
*,
body {
font-family: 'Open Sans', '微软雅黑', Arial, Tahoma, sans-serif;
font-family: "lucida sans unicode", lucida, helvetica, "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
font-weight: 300;
font-size: 14px;
-webkit-font-smoothing: antialiased;
@@ -45,7 +45,7 @@ body {
h1,
h2,
h3 {
font-family: 'Open Sans', '微软雅黑', Arial, Tahoma, sans-serif;
font-family: "lucida sans unicode", lucida, helvetica, "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
}
a {
cursor: pointer;
@@ -73,6 +73,16 @@ a:hover {
line-height: 60px;
padding: 0 10px;
}
#lang {
position: absolute;
right: 10px;
top: -2px;
z-index: 11111;
}
#lang a {
font-size: 12px;
padding-left: 10px;
}
#postsContainer,
#suggestion {
background: #f5f5f5 url("../images/noise.png");
@@ -161,6 +171,7 @@ section {
#navbar {
float: right;
background: #fff;
padding-right: 0;
}
#loginBtns {
border-left: 1px solid #eee;
@@ -214,6 +225,9 @@ section {
padding-right: 10px;
padding-bottom: 5px;
}
#lang {
display: none;
}
}
@media screen and (max-width: 600px) {
.header .btn {
+19
View File
@@ -1,6 +1,7 @@
@bgColor: #fff;
@headerBgColor: #fff;
@fontFamily: 'Open Sans', '微软雅黑', Arial, Tahoma, sans-serif;
@fontFamily: "lucida sans unicode", lucida, helvetica, "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
@aWhiteColor: #fff;
@aBlackColor: #000;
@borderColor: #EBEFF2;
@@ -87,6 +88,18 @@ a:hover {
padding: 0 10px;
}
}
#lang {
position: absolute;
right: 10px;
top: -2px;
z-index: 11111;
a {
font-size: 12px;
padding-left: 10px;
}
}
#header, #posts, #loginContainer {
}
#postsContainer, #suggestion {
@@ -182,6 +195,7 @@ section {
#navbar {
float: right;
background: #fff;
padding-right: 0;
}
#loginBtns {
@@ -237,6 +251,10 @@ section {
padding-bottom: 5px;
}
}
#lang {
display: none;
}
}
@media screen and (max-width:600px) {
.header .btn {
@@ -246,6 +264,7 @@ section {
.mobile {
top: 0 !important;
}
}
/* posts */
#posts {
+190 -3
View File
@@ -147,7 +147,7 @@ h1, h2, h3 {
width: 5px;
height: 100%;
overflow: hidden;
z-index: 5;
z-index: 3333;
cursor: col-resize;
}
.dropdown-menu {
@@ -401,6 +401,9 @@ h1, h2, h3 {
position: relative;
.notebook-setting {
display: none;
position: absolute;
right: 0;
left: auto;
}
&:hover {
.notebook-setting {
@@ -691,6 +694,7 @@ h1, h2, h3 {
#noteReadInfo {
white-space: nowrap;text-overflow:ellipsis; overflow:hidden;
color: #666;
margin-top: 8px;
}
.my-link, .new-markdown-text-abbr, .new-note-text-abbr {
display: none;
@@ -965,6 +969,7 @@ top: 4px;
}
.desc {
margin: 0;
word-wrap: break-word;
}
//--------
@@ -1014,8 +1019,8 @@ top: 4px;
}
// ace 重置css, 必须
.ace_eidtor, .ace_editor * {
font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
.ace_editor, .ace_editor * {
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro';
}
@@ -1128,6 +1133,9 @@ top: 4px;
}
}
// 字体设置不起作用
* {font-family: inherit; }
}
// 不显示空白
.ace_invisible_space {
@@ -1208,3 +1216,182 @@ top: 4px;
background: none !important;
}
}
// 新建不要显示笔记本下拉了, 没用
#listNotebookDropdownMenu {
display: none;
}
// more btn下怎么会有<span data-mce-type="bookmark" id="mce_1_start" data-mce-style="overflow:hidden;line-height:0px" style="overflow:hidden;line-height:0px"></span> ?
#moreBtn span {
display: none;
}
// 没有颜色, tinymce
.mce-colorbtn-trans div {
line-height: 11px;
text-align: center;
}
.mce-btn-small .mce-caret {
margin-top: 8px;
}
.mce-listbox.mce-btn-small .mce-caret {
margin-top: -2px;
}
// 字体没有shadow
.mce-btn i {
text-shadow: none;
}
.mce-colorbutton.mce-btn-small .mce-preview {
width: 15px;
}
// 为了显示右侧的线条
#noteList {
z-index: 333;
}
#moreBtn {
dispaly: block; position: absolute;
cursor: pointer;
right: 5px;
padding: 3px 10px;
}
// readonly
// readonly
.info-toolbar {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
line-height: 30px;
padding-left: 5px;
height: 30px;
display: none;
.toolbar-update {
color: inherit;
float: right;
padding: 0 10px;
&:hover {
background: #fff;
color: #000;
}
}
.created-time {
display: inline-block;
padding-right: 10px;
}
}
#editorContent {
-webkit-user-select: text;
}
#editor.read-only {
#mceToolbarContainer {
display: none;
}
.info-toolbar {
display: block;
}
}
#mdEditor.read-only {
.info-toolbar {
display: block;
}
.wmd-button-bar-inner,
#mdSplitter2, // 拖动
.btn-info // 拖动
{
display: none;
}
#left-column {
// display: none;
visibility: hidden;
}
#right-column {
left: 0 !important;
}
.preview-container {
left: 10px;
}
}
// 工具栏
#editor {
#mceToolbar {
height: 30px;
}
// 所有都展开
&.all-tool {
#mceToolbar {
height: 60px;
}
.more-fa:before {
content: "\f106";
}
#editorContent {
top: 60px;
}
}
.more-fa:before {
content: "\f107";
}
}
//---------------
// note for read
#note.read-only {
#editor, #mdEditor {
top: 60px;
}
#tool {
display: none;
}
.toolbar-update {
display: none;
}
#noteReadTop {
display: block;
}
#infoToolbar, #mceToolbar, .navbar {
display: none;
}
#editorContent, #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;
}
@noteReadTopHeight: 60px;
#noteReadTop {
position: absolute;
height: @noteReadTopHeight;
left: 5px;
right: 0;
top: 0;
bottom: 0;
z-index: 2;
display: none;
background: #fff;
padding-left: 5px;
}
#noteReadTitle {
margin: 3px 0;
height: 26px;
}
+198 -44
View File
@@ -143,7 +143,7 @@ h3 {
width: 5px;
height: 100%;
overflow: hidden;
z-index: 5;
z-index: 3333;
cursor: col-resize;
}
.dropdown-menu {
@@ -373,6 +373,9 @@ h3 {
}
.friend-header .notebook-setting {
display: none;
position: absolute;
right: 0;
left: auto;
}
.friend-header:hover .notebook-setting {
display: block;
@@ -636,6 +639,7 @@ h3 {
text-overflow: ellipsis;
overflow: hidden;
color: #666;
margin-top: 8px;
}
.my-link,
.new-markdown-text-abbr,
@@ -889,6 +893,7 @@ h3 {
}
.desc {
margin: 0;
word-wrap: break-word;
}
#editorMask {
position: absolute;
@@ -941,9 +946,9 @@ h3 {
.dropdown-menu .divider {
margin: 3px 0;
}
.ace_eidtor,
.ace_editor,
.ace_editor * {
font: 12px / normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro';
}
/* leanote nav */
.leanoteNav {
@@ -1034,6 +1039,9 @@ h3 {
#editorContent pre:hover .toggle-raw {
display: block;
}
#editorContent * {
font-family: inherit;
}
.ace_invisible_space {
visibility: hidden !important;
}
@@ -1095,6 +1103,152 @@ h3 {
#tagNav a:hover {
background: none !important;
}
#listNotebookDropdownMenu {
display: none;
}
#moreBtn span {
display: none;
}
.mce-colorbtn-trans div {
line-height: 11px;
text-align: center;
}
.mce-btn-small .mce-caret {
margin-top: 8px;
}
.mce-listbox.mce-btn-small .mce-caret {
margin-top: -2px;
}
.mce-btn i {
text-shadow: none;
}
.mce-colorbutton.mce-btn-small .mce-preview {
width: 15px;
}
#noteList {
z-index: 333;
}
#moreBtn {
dispaly: block;
position: absolute;
cursor: pointer;
right: 5px;
padding: 3px 10px;
}
.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;
}
#mdEditor.read-only .info-toolbar {
display: block;
}
#mdEditor.read-only .wmd-button-bar-inner,
#mdEditor.read-only #mdSplitter2,
#mdEditor.read-only .btn-info {
display: none;
}
#mdEditor.read-only #left-column {
visibility: hidden;
}
#mdEditor.read-only #right-column {
left: 0 !important;
}
#mdEditor.read-only .preview-container {
left: 10px;
}
#editor #mceToolbar {
height: 30px;
}
#editor.all-tool #mceToolbar {
height: 60px;
}
#editor.all-tool .more-fa:before {
content: "\f106";
}
#editor.all-tool #editorContent {
top: 60px;
}
#editor .more-fa:before {
content: "\f107";
}
#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;
}
::selection {
background: #000000;
color: #ffffff;
@@ -1411,11 +1565,18 @@ a.raw:hover {
border-color: rgba(255, 255, 255, 0.05);
}
.each-user div span {
display: inline-block;
line-height: 35px;
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;
}
.each-user div .fa {
width: 20px;
@@ -1696,41 +1857,6 @@ a.raw:hover {
.label i:hover {
opacity: 1;
}
#noteRead {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
display: none;
z-index: 100;
padding-left: 5px;
background-color: #fff;
}
#noteReadContainer {
position: relative;
width: 100%;
height: 100%;
}
#noteReadTop {
position: absolute;
height: 60px;
left: 0;
right: 0;
border-bottom: 1px solid #ebeff2;
}
#noteReadTitle {
margin: 3px 0;
}
#noteReadContent {
position: absolute;
top: 60px;
bottom: 0;
right: 0;
left: 0;
overflow: auto;
padding: 3px;
}
/*scroll*/
/*
::-webkit-scrollbar {
@@ -1935,7 +2061,6 @@ background-position:-1px -670px
#notebookMin,
.ui-loader,
#md-section-helper,
#right-column,
.writing-mobile-hide {
display: none !important;
}
@@ -2122,7 +2247,8 @@ background-position:-1px -670px
.wmd-input,
#noteReadContent,
#attachList,
#tags {
#tags,
.wmd-input-section {
-webkit-overflow-scrolling: touch !important;
overflow: auto !important;
}
@@ -2166,6 +2292,20 @@ background-position:-1px -670px
#editorContent .ace-tomorrow {
padding: 0;
}
#mdEditor #right-column {
display: none;
}
#mdEditor.read-only #left-column {
visibility: hidden;
}
#mdEditor.read-only #right-column {
left: 0 !important;
display: block;
-webkit-overflow-scrolling: touch !important;
}
#mdEditor.read-only .preview-container {
left: 10px;
}
}
@media screen and (max-width: 1024px) {
#noteItemList,
@@ -2234,7 +2374,8 @@ background-position:-1px -670px
.wmd-input,
#noteReadContent,
#attachList,
#tags {
#tags,
.wmd-input-section {
overflow: auto !important;
-webkit-overflow-scrolling: touch !important;
}
@@ -2252,8 +2393,7 @@ background-position:-1px -670px
#listShareNotebookDropdownMenu,
.username,
.ui-loader,
#md-section-helper,
#right-column {
#md-section-helper {
display: none !important;
}
#tag {
@@ -2327,4 +2467,18 @@ background-position:-1px -670px
#themeForm img {
height: 70px !important;
}
#mdEditor #right-column {
display: none;
}
#mdEditor.read-only #left-column {
visibility: hidden;
}
#mdEditor.read-only #right-column {
left: 0 !important;
display: block;
-webkit-overflow-scrolling: touch !important;
}
#mdEditor.read-only .preview-container {
left: 10px;
}
}
+8 -39
View File
@@ -358,11 +358,18 @@ a.raw:hover {
border-bottom: 1px solid transparent;
border-color: rgba(255,255,255,0.05);
span {
display: inline-block;
line-height: @folderHeaderHeight;
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;
@@ -678,44 +685,6 @@ a.raw:hover {
// font-weight: bold;
}
//---------------
// note for read
#noteRead {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
display: none;
z-index: 100;
padding-left: 5px;
background-color: #fff;
}
#noteReadContainer {
position: relative;
width: 100%;
height: 100%;
}
@noteReadTopHeight: 60px;
#noteReadTop {
position: absolute;
height: @noteReadTopHeight;
left:0;
right: 0;
border-bottom: 1px solid @borderColor;
}
#noteReadTitle {
margin: 3px 0;
}
#noteReadContent {
position: absolute;
top: @noteReadTopHeight;
bottom: 0;
right: 0;
left: 0;
overflow: auto;
padding: 3px;
}
@sbc: @bgColor;
-1
View File
@@ -1 +0,0 @@
@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')}::selection{background:#000;color:#fff}::-moz-selection{background:#000;color:#fff}::-webkit-selection{background:#000;color:#fff}*,body{font-family:'Open Sans','Helvetica Neue',Arial,'Hiragino Sans GB','Microsoft YaHei','WenQuanYi Micro Hei',sans-serif;font-weight:300;font-size:14px}h1,h2,h3{font-family:'Open Sans','Helvetica Neue',Arial,'Hiragino Sans GB','Microsoft YaHei','WenQuanYi Micro Hei',sans-serif;font-weight:300!important}a{color:#000;cursor:pointer}a:hover{text-decoration:none!important;color:#000}a.raw{color:#428bca}a.raw:hover{color:#2a6496}#header{height:60px;background-color:#25313e;color:#fff;border-bottom:1px solid #ebeff2;webkit-user-select:none;-webkit-app-region:drag}#header a{color:#ccc}#header li{color:#000}#header li a{color:#000}#logo,#logo span{line-height:50px;font-size:28px}#logo{width:140px;height:59px;padding-left:10px;padding-top:0;border-bottom:1px solid transparent;border-color:rgba(255,255,255,.1)}#logo span,#switcher span{background-color:#000;border-radius:10px;display:inline-block;padding:4px 0;line-height:1}#switcher{line-height:50px;padding-top:6px;padding-right:5px;width:30px;text-align:center}#switcher i{font-size:16px;cursor:pointer}#switcher i:hover{color:#0fb264}#switcher span{border-radius:5px;padding:8px 4px;cursor:pointer;font-size:16px}#switcher span:hover{color:#0fb264}#searchNote{padding-left:0;line-height:60px;margin:0}#searchNote input{background-size:18px 13px;border-color:#ebeff2;border:0;color:#ccc;background-color:#000;padding-left:14px;border-radius:5px;width:250px;line-height:20px;box-shadow:none}#searchNote input:focus{outline:0!important;border-color:#0fb264;box-shadow:none}#header ul{margin:0;padding:0;list-style:none}#header ul li.dropdown{display:inline-block;height:60px}#header ul>li>a.dropdown-toggle{display:block;padding:15px 5px 0 0;position:relative}#header span.icon{display:inline-block;font-size:28px;color:#999}.dropdown-menu{border-radius:0;margin:0;-webkit-box-shadow:none;box-shadow:none;border:1px solid #0fb264;overflow-x:hidden;overflow-y:auto}.dropdown-menu li{padding-left:10px;width:100%;height:30px;line-height:30px}.dropdown-menu>li>a{color:#000;display:inline-block;padding:3px}.dropdown-menu>li:hover,.dropdown-menu>li:focus{background-color:#ebeff2}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{background-color:#ebeff2}.ios7-a{display:inline-block;padding:0 10px 0 5px;height:40px;vertical-align:middle;line-height:38px;cursor:pointer}#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:59px;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}.noteSplit{position:absolute;top:0;width:5px;height:100%;overflow:hidden;z-index:5;cursor:col-resize}#notebookSplitter{left:170px}#noteSplitter{left:250px}#leftNotebook{position:absolute;left:0;top:0;bottom:0;width:170px}#notebook,#notebookMin{position:absolute;left:0;bottom:0;top:0;right:0;background-color:#41586e;z-index:2}#notebookMin{z-index:1;overflow-y:visible;overflow-x:visible;background-color:#41586e}#notebookMin div.minContainer{border-bottom:1px solid transparent;border-color:rgba(255,255,255,.3);padding:5px;position:relative}#notebookMin div.minContainer i{font-size:20px;color:#fff}#notebookMin div.minContainer:hover i{color:#0fb264}#notebookMin div.minContainer ul{background-color:#fff;opacity:.8;display:none;list-style:none;margin:0;margin-left:20px;padding:5px 0;border:1px solid #0fb264;position:absolute;z-index:1000;top:0;left:10px;width:150px}#notebookMin div.minContainer ul li{padding:0 5px;cursor:pointer}#notebookMin div.minContainer ul li span{cursor:pointer}#notebookMin div.minContainer ul li a{cursor:pointer}#notebookBottom{position:absolute;bottom:0;height:30px;right:0;left:0;line-height:30px;text-align:right;padding-right:5px;background-color:#eee}#notebookBottom #leftSwitcher{border:1px solid #ccc;padding:3px 8px;cursor:pointer}#noteAndEditor{position:absolute;bottom:0;top:0;right:0;lefLine truncated
+54 -4
View File
@@ -20,7 +20,6 @@
#notebookMin,
.ui-loader,
#md-section-helper,
#right-column,
.writing-mobile-hide
{
display: none !important;
@@ -214,7 +213,8 @@ a:focus, a:hover, a:active {
.wmd-input,
#noteReadContent,
#attachList,
#tags
#tags,
.wmd-input-section
{
-webkit-overflow-scrolling: touch !important; // for iphone
overflow: auto !important;
@@ -267,6 +267,31 @@ a:focus, a:hover, a:active {
padding: 0;
}
// readonly
// 正常下, 右侧是隐藏的
#mdEditor {
#right-column {
display: none;
}
}
// readonly下, 左侧是隐藏的
#mdEditor.read-only {
#left-column {
// display: none;
visibility: hidden;
}
#right-column {
left: 0 !important;
display: block;
-webkit-overflow-scrolling: touch !important;
}
.preview-container {
left: 10px;
}
}
}
// ipad
@@ -339,7 +364,8 @@ a:focus, a:hover, a:active {
.wmd-input,
#noteReadContent,
#attachList,
#tags
#tags,
.wmd-input-section
{
overflow: auto !important;
-webkit-overflow-scrolling: touch !important; // for iphone
@@ -360,7 +386,6 @@ a:focus, a:hover, a:active {
.username,
.ui-loader,
#md-section-helper,
#right-column
{
display: none !important;
}
@@ -446,4 +471,29 @@ a:focus, a:hover, a:active {
height: 70px !important;
}
// readonly
// 正常下, 右侧是隐藏的
#mdEditor {
#right-column {
display: none;
}
}
// readonly下, 左侧是隐藏的
#mdEditor.read-only {
#left-column {
// display: none;
visibility: hidden;
}
#right-column {
left: 0 !important;
display: block;
-webkit-overflow-scrolling: touch !important;
}
.preview-container {
left: 10px;
}
}
}
+198 -42
View File
@@ -143,7 +143,7 @@ h3 {
width: 5px;
height: 100%;
overflow: hidden;
z-index: 5;
z-index: 3333;
cursor: col-resize;
}
.dropdown-menu {
@@ -373,6 +373,9 @@ h3 {
}
.friend-header .notebook-setting {
display: none;
position: absolute;
right: 0;
left: auto;
}
.friend-header:hover .notebook-setting {
display: block;
@@ -636,6 +639,7 @@ h3 {
text-overflow: ellipsis;
overflow: hidden;
color: #666;
margin-top: 8px;
}
.my-link,
.new-markdown-text-abbr,
@@ -889,6 +893,7 @@ h3 {
}
.desc {
margin: 0;
word-wrap: break-word;
}
#editorMask {
position: absolute;
@@ -941,9 +946,9 @@ h3 {
.dropdown-menu .divider {
margin: 3px 0;
}
.ace_eidtor,
.ace_editor,
.ace_editor * {
font: 12px / normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro';
}
/* leanote nav */
.leanoteNav {
@@ -1034,6 +1039,9 @@ h3 {
#editorContent pre:hover .toggle-raw {
display: block;
}
#editorContent * {
font-family: inherit;
}
.ace_invisible_space {
visibility: hidden !important;
}
@@ -1095,6 +1103,152 @@ h3 {
#tagNav a:hover {
background: none !important;
}
#listNotebookDropdownMenu {
display: none;
}
#moreBtn span {
display: none;
}
.mce-colorbtn-trans div {
line-height: 11px;
text-align: center;
}
.mce-btn-small .mce-caret {
margin-top: 8px;
}
.mce-listbox.mce-btn-small .mce-caret {
margin-top: -2px;
}
.mce-btn i {
text-shadow: none;
}
.mce-colorbutton.mce-btn-small .mce-preview {
width: 15px;
}
#noteList {
z-index: 333;
}
#moreBtn {
dispaly: block;
position: absolute;
cursor: pointer;
right: 5px;
padding: 3px 10px;
}
.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;
}
#mdEditor.read-only .info-toolbar {
display: block;
}
#mdEditor.read-only .wmd-button-bar-inner,
#mdEditor.read-only #mdSplitter2,
#mdEditor.read-only .btn-info {
display: none;
}
#mdEditor.read-only #left-column {
visibility: hidden;
}
#mdEditor.read-only #right-column {
left: 0 !important;
}
#mdEditor.read-only .preview-container {
left: 10px;
}
#editor #mceToolbar {
height: 30px;
}
#editor.all-tool #mceToolbar {
height: 60px;
}
#editor.all-tool .more-fa:before {
content: "\f106";
}
#editor.all-tool #editorContent {
top: 60px;
}
#editor .more-fa:before {
content: "\f107";
}
#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;
}
::selection {
background: #000000;
color: #ffffff;
@@ -1407,6 +1561,14 @@ a.raw:hover {
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;
}
.each-user div .fa {
width: 20px;
@@ -1657,40 +1819,6 @@ a.raw:hover {
.label i:hover {
opacity: 1;
}
#noteRead {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
display: none;
z-index: 100;
background-color: #fff;
}
#noteReadContainer {
position: relative;
width: 100%;
height: 100%;
}
#noteReadTop {
position: absolute;
height: 60px;
left: 0;
right: 0;
border-bottom: 1px solid #ebeff2;
}
#noteReadTitle {
margin: 3px 0;
}
#noteReadContent {
position: absolute;
top: 60px;
bottom: 0;
right: 0;
left: 0;
overflow: auto;
padding: 3px;
}
/*
::-webkit-scrollbar {
width: 5px;
@@ -1867,7 +1995,6 @@ background-position:-1px -670px
#notebookMin,
.ui-loader,
#md-section-helper,
#right-column,
.writing-mobile-hide {
display: none !important;
}
@@ -2054,7 +2181,8 @@ background-position:-1px -670px
.wmd-input,
#noteReadContent,
#attachList,
#tags {
#tags,
.wmd-input-section {
-webkit-overflow-scrolling: touch !important;
overflow: auto !important;
}
@@ -2098,6 +2226,20 @@ background-position:-1px -670px
#editorContent .ace-tomorrow {
padding: 0;
}
#mdEditor #right-column {
display: none;
}
#mdEditor.read-only #left-column {
visibility: hidden;
}
#mdEditor.read-only #right-column {
left: 0 !important;
display: block;
-webkit-overflow-scrolling: touch !important;
}
#mdEditor.read-only .preview-container {
left: 10px;
}
}
@media screen and (max-width: 1024px) {
#noteItemList,
@@ -2166,7 +2308,8 @@ background-position:-1px -670px
.wmd-input,
#noteReadContent,
#attachList,
#tags {
#tags,
.wmd-input-section {
overflow: auto !important;
-webkit-overflow-scrolling: touch !important;
}
@@ -2184,8 +2327,7 @@ background-position:-1px -670px
#listShareNotebookDropdownMenu,
.username,
.ui-loader,
#md-section-helper,
#right-column {
#md-section-helper {
display: none !important;
}
#tag {
@@ -2259,4 +2401,18 @@ background-position:-1px -670px
#themeForm img {
height: 70px !important;
}
#mdEditor #right-column {
display: none;
}
#mdEditor.read-only #left-column {
visibility: hidden;
}
#mdEditor.read-only #right-column {
left: 0 !important;
display: block;
-webkit-overflow-scrolling: touch !important;
}
#mdEditor.read-only .preview-container {
left: 10px;
}
}
+8 -38
View File
@@ -352,6 +352,14 @@ a.raw:hover {
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;
@@ -629,44 +637,6 @@ a.raw:hover {
// font-weight: bold;
}
//---------------
// note for read
#noteRead {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
display: none;
z-index: 100;
background-color: #fff;
}
#noteReadContainer {
position: relative;
width: 100%;
height: 100%;
}
@noteReadTopHeight: 60px;
#noteReadTop {
position: absolute;
height: @noteReadTopHeight;
left:0;
right: 0;
border-bottom: 1px solid @borderColor;
}
#noteReadTitle {
margin: 3px 0;
}
#noteReadContent {
position: absolute;
top: @noteReadTopHeight;
bottom: 0;
right: 0;
left: 0;
overflow: auto;
padding: 3px;
}
@sbc: @bgColor;
/*
+175 -3
View File
@@ -143,7 +143,7 @@ h3 {
width: 5px;
height: 100%;
overflow: hidden;
z-index: 5;
z-index: 3333;
cursor: col-resize;
}
.dropdown-menu {
@@ -373,6 +373,9 @@ h3 {
}
.friend-header .notebook-setting {
display: none;
position: absolute;
right: 0;
left: auto;
}
.friend-header:hover .notebook-setting {
display: block;
@@ -636,6 +639,7 @@ h3 {
text-overflow: ellipsis;
overflow: hidden;
color: #666;
margin-top: 8px;
}
.my-link,
.new-markdown-text-abbr,
@@ -889,6 +893,7 @@ h3 {
}
.desc {
margin: 0;
word-wrap: break-word;
}
#editorMask {
position: absolute;
@@ -941,9 +946,9 @@ h3 {
.dropdown-menu .divider {
margin: 3px 0;
}
.ace_eidtor,
.ace_editor,
.ace_editor * {
font: 12px / normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro';
}
/* leanote nav */
.leanoteNav {
@@ -1034,6 +1039,9 @@ h3 {
#editorContent pre:hover .toggle-raw {
display: block;
}
#editorContent * {
font-family: inherit;
}
.ace_invisible_space {
visibility: hidden !important;
}
@@ -1095,6 +1103,152 @@ h3 {
#tagNav a:hover {
background: none !important;
}
#listNotebookDropdownMenu {
display: none;
}
#moreBtn span {
display: none;
}
.mce-colorbtn-trans div {
line-height: 11px;
text-align: center;
}
.mce-btn-small .mce-caret {
margin-top: 8px;
}
.mce-listbox.mce-btn-small .mce-caret {
margin-top: -2px;
}
.mce-btn i {
text-shadow: none;
}
.mce-colorbutton.mce-btn-small .mce-preview {
width: 15px;
}
#noteList {
z-index: 333;
}
#moreBtn {
dispaly: block;
position: absolute;
cursor: pointer;
right: 5px;
padding: 3px 10px;
}
.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;
}
#mdEditor.read-only .info-toolbar {
display: block;
}
#mdEditor.read-only .wmd-button-bar-inner,
#mdEditor.read-only #mdSplitter2,
#mdEditor.read-only .btn-info {
display: none;
}
#mdEditor.read-only #left-column {
visibility: hidden;
}
#mdEditor.read-only #right-column {
left: 0 !important;
}
#mdEditor.read-only .preview-container {
left: 10px;
}
#editor #mceToolbar {
height: 30px;
}
#editor.all-tool #mceToolbar {
height: 60px;
}
#editor.all-tool .more-fa:before {
content: "\f106";
}
#editor.all-tool #editorContent {
top: 60px;
}
#editor .more-fa:before {
content: "\f107";
}
#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;
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
@@ -2138,3 +2292,21 @@ body {
#editorContent .ace-tomorrow {
background-color: #fbfcf7;
}
#wmd-input > .editor-content {
padding-top: 20px;
}
#editorContent {
padding-top: 10px;
}
#editor #mceToolbar {
height: 40px;
}
#editor #editorContent {
top: 40px;
}
#editor.all-tool #mceToolbar {
height: 80px;
}
#editor.all-tool #editorContent {
top: 80px;
}
+29
View File
@@ -1155,3 +1155,32 @@ body {
#editorContent .ace-tomorrow {
background-color: #fbfcf7;
}
#wmd-input > .editor-content {
padding-top: 20px;
}
#editorContent {
padding-top: 10px;
}
// tool-bar
#editor {
#mceToolbar {
height: 40px;
}
#editorContent {
top: 40px;
}
// 所有都展开
&.all-tool {
#mceToolbar {
height: 80px;
}
#editorContent {
top: 80px;
}
}
}
+157 -3
View File
@@ -143,7 +143,7 @@ h3 {
width: 5px;
height: 100%;
overflow: hidden;
z-index: 5;
z-index: 3333;
cursor: col-resize;
}
.dropdown-menu {
@@ -373,6 +373,9 @@ h3 {
}
.friend-header .notebook-setting {
display: none;
position: absolute;
right: 0;
left: auto;
}
.friend-header:hover .notebook-setting {
display: block;
@@ -636,6 +639,7 @@ h3 {
text-overflow: ellipsis;
overflow: hidden;
color: #666;
margin-top: 8px;
}
.my-link,
.new-markdown-text-abbr,
@@ -889,6 +893,7 @@ h3 {
}
.desc {
margin: 0;
word-wrap: break-word;
}
#editorMask {
position: absolute;
@@ -941,9 +946,9 @@ h3 {
.dropdown-menu .divider {
margin: 3px 0;
}
.ace_eidtor,
.ace_editor,
.ace_editor * {
font: 12px / normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro';
}
/* leanote nav */
.leanoteNav {
@@ -1034,6 +1039,9 @@ h3 {
#editorContent pre:hover .toggle-raw {
display: block;
}
#editorContent * {
font-family: inherit;
}
.ace_invisible_space {
visibility: hidden !important;
}
@@ -1095,6 +1103,152 @@ h3 {
#tagNav a:hover {
background: none !important;
}
#listNotebookDropdownMenu {
display: none;
}
#moreBtn span {
display: none;
}
.mce-colorbtn-trans div {
line-height: 11px;
text-align: center;
}
.mce-btn-small .mce-caret {
margin-top: 8px;
}
.mce-listbox.mce-btn-small .mce-caret {
margin-top: -2px;
}
.mce-btn i {
text-shadow: none;
}
.mce-colorbutton.mce-btn-small .mce-preview {
width: 15px;
}
#noteList {
z-index: 333;
}
#moreBtn {
dispaly: block;
position: absolute;
cursor: pointer;
right: 5px;
padding: 3px 10px;
}
.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;
}
#mdEditor.read-only .info-toolbar {
display: block;
}
#mdEditor.read-only .wmd-button-bar-inner,
#mdEditor.read-only #mdSplitter2,
#mdEditor.read-only .btn-info {
display: none;
}
#mdEditor.read-only #left-column {
visibility: hidden;
}
#mdEditor.read-only #right-column {
left: 0 !important;
}
#mdEditor.read-only .preview-container {
left: 10px;
}
#editor #mceToolbar {
height: 30px;
}
#editor.all-tool #mceToolbar {
height: 60px;
}
#editor.all-tool .more-fa:before {
content: "\f106";
}
#editor.all-tool #editorContent {
top: 60px;
}
#editor .more-fa:before {
content: "\f107";
}
#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;
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
+28 -19
View File
@@ -1,56 +1,57 @@
@font-face {
font-family: Si;
src: url("/public/fonts/MSYH.TTF");
}
@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');
src: local('Open Sans Light'), local('OpenSans-Light'), url('/public/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');
src: local('Open Sans'), local('OpenSans'), url('/public/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');
src: local('Open Sans Bold'), local('OpenSans-Bold'), url('/public/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');
src: local('Open Sans Italic'), local('OpenSans-Italic'), url('/public/fonts/open-sans2/xjAJXh38I15wypJXxuGMBobN6UDyHWBl620a-IRfuBk.woff') format('woff');
}
*,
body {
font-family: 'Microsoft YaHei', 'WenQuanYi Micro Hei', 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', sans-serif;
font-family: Si, 'Microsoft YaHei', 'WenQuanYi Micro Hei', 'Helvetica Neue', Arial, 'Hiragino Sans GB';
font-weight: 300;
font-size: 14px;
}
h1,
h2,
h3 {
font-family: 'Microsoft YaHei', 'WenQuanYi Micro Hei', 'Open Sans', 'Helvetica Neue', Arial, 'Hiragino Sans GB', sans-serif;
font-family: Si, 'Microsoft YaHei', 'WenQuanYi Micro Hei', 'Helvetica Neue', Arial, 'Hiragino Sans GB';
}
* {
font-size: 18px;
font-size: 16px;
}
body {
width: 500px;
width: 650px;
margin: auto;
}
body * {
line-height: 1.5;
}
#content {
padding: 0 10px;
}
img {
max-width: 100%;
}
h1.title {
font-size: 24px;
font-size: 32px;
border-left: 5px solid #65bd77;
padding-left: 10px;
font-weight: bold;
@@ -64,29 +65,37 @@ h1.title {
#tag {
width: 15px;
display: inline-block;
margin-left: 10px;
margin-top: -3px;
}
.created-time {
margin: 20px 0;
margin-bottom: 20px;
margin: 30px 0;
}
#footer {
background-color: #65bd77;
color: #fff;
margin-top: 50px;
margin-bottom: 20px;
color: #ccc;
padding: 10px 0;
text-align: center;
font-size: 14px !important;
}
#footer #leanote_logo {
height: 50px;
}
#footer .split {
border-top: #ccc 1px solid;
height: 1px;
width: 60px;
margin: auto;
margin-bottom: 10px;
}
#footer p {
margin: 0;
font-size: 12px !important;
}
#footer a {
color: #fff;
color: #ccc;
font-size: 12px !important;
}
pre * {
font-size: 14px;
font-family: "Open Sans";
}
+34 -20
View File
@@ -1,35 +1,39 @@
@bgColor: #fff;
@headerBgColor: #fff;
@fontFamily: 'Microsoft YaHei','WenQuanYi Micro Hei','Open Sans','Helvetica Neue',Arial,'Hiragino Sans GB',sans-serif;
@green: #65bd77;
@font-face {
font-family: Si;
src:url("/public/fonts/MSYH.TTF");
}
// 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');
src: local('Open Sans Light'), local('OpenSans-Light'), url('/public/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');
src: local('Open Sans'), local('OpenSans'), url('/public/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');
src: local('Open Sans Bold'), local('OpenSans-Bold'), url('/public/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');
src: local('Open Sans Italic'), local('OpenSans-Italic'), url('/public/fonts/open-sans2/xjAJXh38I15wypJXxuGMBobN6UDyHWBl620a-IRfuBk.woff') format('woff');
}
@bgColor: #fff;
@headerBgColor: #fff;
@fontFamily: Si, 'Microsoft YaHei','WenQuanYi Micro Hei','Helvetica Neue',Arial,'Hiragino Sans GB';
@green: #65bd77;
*, body {
font-family: @fontFamily;
font-weight: 300;
@@ -39,23 +43,23 @@ h1, h2, h3 {
font-family: @fontFamily;
}
* {
font-size: 18px;
font-size: 16px;
}
body {
width: 500px;
width: 650px;
margin: auto;
* {
line-height: 1.5;
}
}
#content {
padding: 0 10px;
// padding: 0 10px;
}
img {
max-width: 100%;
}
h1.title {
font-size: 24px;
font-size: 32px;
border-left: 5px solid @green;
padding-left: 10px;
font-weight: bold;
@@ -69,30 +73,40 @@ h1.title {
#tag {
width: 15px;
display: inline-block;
margin-left: 10px;
// margin-left: 10px;
margin-top: -3px;
}
.created-time {
margin: 20px 0;
margin-bottom: 20px;
margin: 30px 0;
}
#footer {
background-color: @green;
color: #fff;
margin-top: 50px;
margin-bottom: 20px;
color: #ccc;
padding: 10px 0;
text-align: center;
#leanote_logo {
height: 50px;
}
font-size: 14px !important;
.split {
border-top: #ccc 1px solid;
height: 1px;
width: 60px;
margin: auto;
margin-bottom: 10px;
}
p {
margin: 0;
font-size: 12px !important;
}
a {
color: #fff;
color: #ccc;
font-size: 12px !important;
}
}
// 代码
pre * {
font-size: 14px;
font-family: "Open Sans"
}
+40636 -17
View File
File diff suppressed because it is too large. Load diff
+16
View File
@@ -0,0 +1,16 @@
function diff_match_patch(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32}window.rangy=function(){function t(t,e){var n=typeof t[e];return n==h||!(n!=u||!t[e])||"unknown"==n}function e(t,e){return!(typeof t[e]!=u||!t[e])}function n(t,e){return typeof t[e]!=f}function r(t){return function(e,n){for(var r=n.length;r--;)if(!t(e,n[r]))return!1;return!0}}function i(t){return t&&v(t,m)&&x(t,g)}function a(t){window.alert("Rangy not supported in your browser. Reason: "+t),b.initialized=!0,b.supported=!1}function o(t){var e="Rangy warning: "+t;b.config.alertOnWarn?window.alert(e):typeof window.console!=f&&typeof window.console.log!=f&&window.console.log(e)}function s(){if(!b.initialized){var n,r=!1,o=!1;t(document,"createRange")&&(n=document.createRange(),v(n,p)&&x(n,d)&&(r=!0),n.detach());var s=e(document,"body")?document.body:document.getElementsByTagName("body")[0];s&&t(s,"createTextRange")&&(n=s.createTextRange(),i(n)&&(o=!0)),r||o||a("Neither Range nor TextRange are implemented"),b.initialized=!0,b.features={implementsDomRange:r,implementsTextRange:o};for(var l=_.concat(w),c=0,u=l.length;u>c;++c)try{l[c](b)}catch(h){e(window,"console")&&t(window.console,"log")&&window.console.log("Init listener threw an exception. Continuing.",h)}}}function l(t){t=t||window,s();for(var e=0,n=S.length;n>e;++e)S[e](t)}function c(t){this.name=t,this.initialized=!1,this.supported=!1}var u="object",h="function",f="undefined",d=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer","START_TO_START","START_TO_END","END_TO_START","END_TO_END"],p=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],g=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],m=["collapse","compareEndPoints","duplicate","getBookmark","moveToBookmark","moveToElementText","parentElement","pasteHTML","select","setEndPoint","getBoundingClientRect"],v=r(t),y=r(e),x=r(n),b={version:"1.2.3",initialized:!1,supported:!0,util:{isHostMethod:t,isHostObject:e,isHostProperty:n,areHostMethods:v,areHostObjects:y,areHostProperties:x,isTextRange:i},features:{},modules:{},config:{alertOnWarn:!1,preferTextRange:!1}};b.fail=a,b.warn=o,{}.hasOwnProperty?b.util.extend=function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}:a("hasOwnProperty not supported");var w=[],_=[];b.init=s,b.addInitListener=function(t){b.initialized?t(b):w.push(t)};var S=[];b.addCreateMissingNativeApiListener=function(t){S.push(t)},b.createMissingNativeApi=l,c.prototype.fail=function(t){throw this.initialized=!0,this.supported=!1,new Error("Module '"+this.name+"' failed to load: "+t)},c.prototype.warn=function(t){b.warn("Module "+this.name+": "+t)},c.prototype.createError=function(t){return new Error("Error in Rangy "+this.name+" module: "+t)},b.createModule=function(t,e){var n=new c(t);b.modules[t]=n,_.push(function(t){e(t,n),n.initialized=!0,n.supported=!0})},b.requireModules=function(t){for(var e,n,r=0,i=t.length;i>r;++r){if(n=t[r],e=b.modules[n],!(e&&e instanceof c))throw new Error("Module '"+n+"' not found");if(!e.supported)throw new Error("Module '"+n+"' not supported")}};var C=!1,E=function(){C||(C=!0,b.initialized||s())};return typeof window==f?void a("No window found"):typeof document==f?void a("No document found"):(t(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",E,!1),t(window,"addEventListener")?window.addEventListener("load",E,!1):t(window,"attachEvent")?window.attachEvent("onload",E):a("Window does not have required addEventListener or attachEvent method"),b)}(),rangy.createModule("DomUtil",function(t,e){function n(t){var e;return typeof t.namespaceURI==E||null===(e=t.namespaceURI)||"http://www.w3.org/1999/xhtml"==e}function r(t){var e=t.parentNode;return 1==e.nodeType?e:null}function i(t){for(var e=0;t=t.previousSibling;)e++;return e}function a(t){var e;return c(t)?t.length:(e=t.childNodes)?e.length:0}function o(t,e){var n,r=[];for(n=t;n;n=n.parentNode)r.push(n);for(n=e;n;n=n.parentNode)if(N(r,n))return n;return null}function s(t,e,n){for(var r=n?e:e.parentNode;r;){if(r===t)return!0;r=r.parentNode}return!1}function l(t,e,n){for(var r,i=n?t:t.parentNode;i;){if(r=i.parentNode,r===e)return i;i=r}return null}function c(t){var e=t.nodeType;return 3==e||4==e||8==e}function u(t,e){var n=e.nextSibling,r=e.parentNode;return n?r.insertBefore(t,n):r.appendChild(t),t}function h(t,e){var n=t.cloneNode(!1);return n.deleteData(0,e),t.deleteData(e,t.length-e),u(n,t),n}function f(t){if(9==t.nodeType)return t;if(typeof t.ownerDocument!=E)return t.ownerDocument;if(typeof t.document!=E)return t.document;if(t.parentNode)return f(t.parentNode);throw new Error("getDocument: no document fouLine truncated
else{var n=e.docSelection.createRange();if(u(n))h(e,n);else{e.rangeCount=n.length;for(var r,a=_.getDocument(n.item(0)),s=0;s<e.rangeCount;++s)r=t.createRange(a),r.selectNode(n.item(s)),e._ranges.push(r);e.isCollapsed=1==e.rangeCount&&e._ranges[0].collapsed,i(e,e._ranges[e.rangeCount-1],!1)}}}function d(t,e){for(var n=t.docSelection.createRange(),r=c(e),i=_.getDocument(n.item(0)),a=_.getBody(i).createControlRange(),o=0,s=n.length;s>o;++o)a.add(n.item(o));try{a.add(r)}catch(l){throw new Error("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}a.select(),f(t)}function p(t,e,n){this.nativeSelection=t,this.docSelection=e,this._ranges=[],this.win=n,this.refresh()}function g(t,e){for(var n,r=_.getDocument(e[0].startContainer),i=_.getBody(r).createControlRange(),a=0;rangeCount>a;++a){n=c(e[a]);try{i.add(n)}catch(o){throw new Error("setRanges(): Element within the one of the specified Ranges could not be added to control selection (does it have layout?)")}}i.select(),f(t)}function m(t,e){if(t.anchorNode&&_.getDocument(t.anchorNode)!==_.getDocument(e))throw new k("WRONG_DOCUMENT_ERR")}function v(t){var e=[],n=new T(t.anchorNode,t.anchorOffset),r=new T(t.focusNode,t.focusOffset),i="function"==typeof t.getName?t.getName():"Selection";if("undefined"!=typeof t.rangeCount)for(var a=0,o=t.rangeCount;o>a;++a)e[a]=C.inspect(t.getRangeAt(a));return"["+i+"(Ranges: "+e.join(", ")+")(anchor: "+n.inspect()+", focus: "+r.inspect()+"]"}t.requireModules(["DomUtil","DomRange","WrappedRange"]),t.config.checkSelectionRanges=!0;var y,x,b="boolean",w="_rangySelection",_=t.dom,S=t.util,C=t.DomRange,E=t.WrappedRange,k=t.DOMException,T=_.DomPosition,I="Control",N=t.util.isHostMethod(window,"getSelection"),R=t.util.isHostObject(document,"selection"),A=R&&(!N||t.config.preferTextRange);A?(y=r,t.isSelectionValid=function(t){var e=(t||window).document,n=e.selection;return"None"!=n.type||_.getDocument(n.createRange().parentElement())==e}):N?(y=n,t.isSelectionValid=function(){return!0}):e.fail("Neither document.selection or window.getSelection() detected."),t.getNativeSelection=y;var M=y(),L=t.createNativeRange(document),O=_.getBody(document),D=S.areHostObjects(M,["anchorNode","focusNode"]&&S.areHostProperties(M,["anchorOffset","focusOffset"]));t.features.selectionHasAnchorAndFocus=D;var F=S.isHostMethod(M,"extend");t.features.selectionHasExtend=F;var P="number"==typeof M.rangeCount;t.features.selectionHasRangeCount=P;var B=!1,j=!0;S.areHostMethods(M,["addRange","getRangeAt","removeAllRanges"])&&"number"==typeof M.rangeCount&&t.features.implementsDomRange&&!function(){var t=document.createElement("iframe");t.frameBorder=0,t.style.position="absolute",t.style.left="-10000px",O.appendChild(t);var e=_.getIframeDocument(t);e.open(),e.write("<html><head></head><body>12</body></html>"),e.close();var n=_.getIframeWindow(t).getSelection(),r=e.documentElement,i=r.lastChild,a=i.firstChild,o=e.createRange();o.setStart(a,1),o.collapse(!0),n.addRange(o),j=1==n.rangeCount,n.removeAllRanges();var s=o.cloneRange();o.setStart(a,0),s.setEnd(a,2),n.addRange(o),n.addRange(s),B=2==n.rangeCount,o.detach(),s.detach(),O.removeChild(t)}(),t.features.selectionSupportsMultipleRanges=B,t.features.collapsedNonEditableSelectionsSupported=j;var $,H=!1;O&&S.isHostMethod(O,"createControlRange")&&($=O.createControlRange(),S.areHostProperties($,["item","add"])&&(H=!0)),t.features.implementsControlRange=H,x=D?function(t){return t.anchorNode===t.focusNode&&t.anchorOffset===t.focusOffset}:function(t){return t.rangeCount?t.getRangeAt(t.rangeCount-1).collapsed:!1};var U;S.isHostMethod(M,"getRangeAt")?U=function(t,e){try{return t.getRangeAt(e)}catch(n){return null}}:D&&(U=function(e){var n=_.getDocument(e.anchorNode),r=t.createRange(n);return r.setStart(e.anchorNode,e.anchorOffset),r.setEnd(e.focusNode,e.focusOffset),r.collapsed!==this.isCollapsed&&(r.setStart(e.focusNode,e.focusOffset),r.setEnd(e.anchorNode,e.anchorOffset)),r}),t.getSelection=function(t){t=t||window;var e=t[w],n=y(t),i=R?r(t):null;return e?(e.nativeSelection=n,e.docSelection=i,e.refresh(t)):(e=new p(n,i,t),t[w]=e),e},t.getIframeSelection=function(e){return t.getSelection(_.getIframeWindow(e))};var q=p.prototype;if(!A&&D&&S.areHostMethods(M,["removeAllRanges","addRange"])){q.removeAllRanges=function(){this.nativeSelection.removeAllRanges(),o(this)};var G=function(e,n){var r=C.getRangeDocument(n),i=t.createRange(r);i.collapseToPoint(n.endContainer,n.endOffset),e.nativeSelection.addRange(s(i)),e.nativeSelection.extend(n.startContainer,n.startOffset),e.refresh()};q.addRange=P?function(e,n){if(H&&R&&this.docSelection.type==I)d(this,e);else if(n&&F)G(this,e);else{var r;if(B?r=this.rangeCount:(this.removeAllRanges(),r=0),this.nativeSelection.addRange(s(e)),this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==r+1){if(t.config.checkSelectionRanges){var a=U(this.nativeSelection,this.rangeCount-1);a&&!C.rangesEqual(a,e)&&(e=new E(a))}this._ranges[this.rangeLine truncated
var i=b.exec.call(/\/([a-z]*)$/i,String(t))[1];return r=r||{},r.add&&(i=n(i+r.add)),r.remove&&(i=b.replace.call(i,new RegExp("["+r.remove+"]+","g"),"")),t=e(new RegExp(t.source,i),a(t)?t[y].captureNames.slice(0):null,r.addProto)}function i(){return{captureNames:null}}function a(t){return!(!t[y]||!t[y].captureNames)}function o(t,e){if(Array.prototype.indexOf)return t.indexOf(e);var n,r=t.length;for(n=0;r>n;++n)if(t[n]===e)return n;return-1}function s(t,e){return M.call(t)==="[object "+e+"]"}function l(t,e,n){return b.test.call(n.indexOf("x")>-1?/^(?:\s+|#.*|\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/:/^(?:\(\?#[^)]*\))*(?:[?*+]|{\d+(?:,\d*)?})/,t.slice(e))}function c(t,e){var r;if(n(e)!==e)throw new SyntaxError("Invalid duplicate regex flag "+e);for(t=b.replace.call(t,/^\(\?([\w$]+)\)/,function(t,r){if(b.test.call(/[gy]/,r))throw new SyntaxError("Cannot use flag g or y in mode modifier "+t);return e=n(e+r),""}),r=0;r<e.length;++r)if(!A[e.charAt(r)])throw new SyntaxError("Unknown regex flag "+e.charAt(r));return{pattern:t,flags:e}}function u(t){return t=t||{},s(t,"String")&&(t=m.forEach(t,/[^\s,]+/,function(t){this[t]=!0},{})),t}function h(t){if(!/^[\w$]$/.test(t))throw new Error("Flag must be a single character A-Za-z0-9_$");A[t]=!0}function f(t,e,n,r,i){for(var a,o,s=C.length,l=null;s--;)if(o=C[s],(o.scope===r||"all"===o.scope)&&(!o.flag||e.indexOf(o.flag)>-1)&&(a=m.exec(t,o.regex,n,"sticky"))){l={matchLength:a[0].length,output:o.handler.call(i,a,r,e),reparse:o.reparse};break}return l}function d(t){m.cache.flush("patterns"),x.astral=t}function p(t){RegExp.prototype.exec=(t?w:b).exec,RegExp.prototype.test=(t?w:b).test,String.prototype.match=(t?w:b).match,String.prototype.replace=(t?w:b).replace,String.prototype.split=(t?w:b).split,x.natives=t}function g(t){if(null==t)throw new TypeError("Cannot convert null or undefined to object");return t}var m,v,y="xregexp",x={astral:!1,natives:!1},b={exec:RegExp.prototype.exec,test:RegExp.prototype.test,match:String.prototype.match,replace:String.prototype.replace,split:String.prototype.split},w={},_={},S={},C=[],E="default",k="class",T={"default":/\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9]\d*|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|\(\?[:=!]|[?*+]\?|{\d+(?:,\d*)?}\??|[\s\S]/,"class":/\\(?:[0-3][0-7]{0,2}|[4-7][0-7]?|x[\dA-Fa-f]{2}|u[\dA-Fa-f]{4}|c[A-Za-z]|[\s\S])|[\s\S]/},I=/\$(?:{([\w$]+)}|(\d\d?|[\s\S]))/g,N=b.exec.call(/()??/,"")[1]===t,R=RegExp.prototype.sticky!==t,A={g:!0,i:!0,m:!0,y:R},M={}.toString;return m=function(n,i){var a,o,s,l={hasNamedCapture:!1,captureNames:[]},u=E,h="",d=0;if(m.isRegExp(n)){if(i!==t)throw new TypeError("Cannot supply flags when copying a RegExp");return r(n,{addProto:!0})}if(n=n===t?"":String(n),i=i===t?"":String(i),s=n+"***"+i,!S[s]){for(a=c(n,i),n=a.pattern,i=a.flags;d<n.length;){do a=f(n,i,d,u,l),a&&a.reparse&&(n=n.slice(0,d)+a.output+n.slice(d+a.matchLength));while(a&&a.reparse);a?(h+=a.output,d+=a.matchLength||1):(o=m.exec(n,T[u],d,"sticky")[0],h+=o,d+=o.length,"["===o&&u===E?u=k:"]"===o&&u===k&&(u=E))}S[s]={pattern:b.replace.call(h,/\(\?:\)(?=\(\?:\))|^\(\?:\)|\(\?:\)$/g,""),flags:b.replace.call(i,/[^gimy]+/g,""),captures:l.hasNamedCapture?l.captureNames:null}}return s=S[s],e(new RegExp(s.pattern,s.flags),s.captures,!0)},m.prototype=new RegExp,m.version="3.0.0-pre",m.addToken=function(t,e,n){n=n||{};var i,a=n.optionalFlags;if(n.flag&&h(n.flag),a)for(a=b.split.call(a,""),i=0;i<a.length;++i)h(a[i]);C.push({regex:r(t,{add:"g"+(R?"y":"")}),handler:e,scope:n.scope||E,flag:n.flag,reparse:n.reparse}),m.cache.flush("patterns")},m.cache=function(t,e){var n=t+"***"+(e||"");return _[n]||(_[n]=m(t,e))},m.cache.flush=function(t){"patterns"===t?S={}:_={}},m.escape=function(t){return b.replace.call(g(t),/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},m.exec=function(t,e,n,a){var o,s,l="g";return R&&(a||e.sticky&&a!==!1)&&(l+="y"),e[y]=e[y]||i(),s=e[y][l]||(e[y][l]=r(e,{add:l,remove:a===!1?"y":""})),s.lastIndex=n=n||0,o=w.exec.call(s,t),a&&o&&o.index!==n&&(o=null),e.global&&(e.lastIndex=o?s.lastIndex:0),o},m.forEach=function(t,e,n,r){for(var i,a=0,o=-1;i=m.exec(t,e,a);)n.call(r,i,++o,t,e),a=i.index+(i[0].length||1);return r},m.globalize=function(t){return r(t,{add:"g",addProto:!0})},m.install=function(t){t=u(t),!x.astral&&t.astral&&d(!0),!x.natives&&t.natives&&p(!0)},m.isInstalled=function(t){return!!x[t]},m.isRegExp=function(t){return"[object RegExp]"===M.call(t)},m.match=function(t,e,n){var a,o,s=e.global&&"one"!==n||"all"===n,l=(s?"g":"")+(e.sticky?"y":"");return e[y]=e[y]||i(),o=e[y][l||"noGY"]||(e[y][l||"noGY"]=r(e,{add:l,remove:"one"===n?"g":""})),a=b.match.call(g(t),o),e.global&&(e.lastIndex="one"===n&&a?a.index+a[0].length:0),s?a||[]:a&&a[0]},m.matchChain=function(t,e){return function n(t,r){var i,a=e[r].regex?e[r]:{regex:e[r]},o=[],s=function(t){if(a.backref){if(!(t.hasOwnProperty(a.backref)||+a.backref<t.length))throw new ReferenceError("Backreference to undefined group: "+a.backref);o.push(t[a.backref]||"")}else o.push(t[0])};for(i=0;i<t.lenLine truncated
}(t),function(t){if(!t.addUnicodeData)throw new ReferenceError("Unicode Base must be loaded before Unicode Properties");t.addUnicodeData([{name:"ASCII",bmp:"\x00-"},{name:"Alphabetic",bmp:"A-Za-zªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͅͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևְ-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-ٗٙ-ٟٮ-ۓە-ۜۡ-ۭۨ-ۯۺ-ۼۿܐ-ܿݍ-ޱߊ-ߪߴߵߺࠀ-ࠗࠚ-ࠬࡀ-ࡘࢠࢢ-ࢬࣤ-ࣰࣩ-ࣾऀ-ऻऽ-ौॎ-ॐॕ-ॣॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হঽ-ৄেৈোৌৎৗড়ঢ়য়-ৣৰৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਾ-ੂੇੈੋੌੑਖ਼-ੜਫ਼ੰ-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽ-ૅે-ૉોૌૐૠ-ૣଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽ-ୄେୈୋୌୖୗଡ଼ଢ଼ୟ-ୣୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-ௌௐௗఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-ౌౕౖౘౙౠ-ౣಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೄೆ-ೈೊ-ೌೕೖೞೠ-ೣೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൌൎൗൠ-ൣൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆා-ුූෘ-ෟෲෳก-ฺเ-ๆํກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆໍໜ-ໟༀཀ-ཇཉ-ཬཱ-ཱྀྈ-ྗྙ-ྼက-ံးျ-ဿၐ-ၢၥ-ၨၮ-ႆႎႜႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜓᜠ-ᜳᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-ឳា-ៈៗៜᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-ᤸᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨛᨠ-ᩞᩡ-ᩴᪧᬀ-ᬳᬵ-ᭃᭅ-ᭋᮀ-ᮩᮬ-ᮯᮺ-ᯥᯧ-ᯱᰀ-ᰵᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳳᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⒶ-ⓩⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙴ-ꙻꙿ-ꚗꚟ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠧꡀ-ꡳꢀ-ꣃꣲ-ꣷꣻꤊ-ꤪꤰ-ꥒꥠ-ꥼꦀ-ꦲꦴ-ꦿꧏꨀ-ꨶꩀ-ꩍꩠ-ꩶꩺꪀ-ꪾꫀꫂꫛ-ꫝꫠ-ꫯꫲ-ꫵꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",astral:"�[�-�]|�[�-�]|�[�-�]|�[�-�]|�[�-��-��-��-��-��-�]|[��-��-�][�-�]|�[�-�]|�[�-��-�]|�[�-�]|�[�-�]|�[�-���-�����-��-��-��-����-����-��-��-��-��-��-��-�]|�[�-��-��-����-��-��-��-��-��-��-��-��-��-��-��-�]|�[�-��-��-�]|�[�-��-�������-��-���-��-��-��-��-��-��-��-���-��-��-��-��-��-��-��-��-��-��-��-��-�]|�[�-��-������-��-��������-�������������-��-��-��-���-��-��-��-��-�]|�[�-��-�]|�[��]|�[�-�]|�[�-�]"},{name:"Any",isBmpLast:!0,bmp:"\x00-￿",astral:"[�-�][�-�]"},{name:"Assigned",inverseOf:"Cn"},{name:"Default_Ignorable_Code_Point",bmp:"­͏ᅟᅠ឴឵᠋-᠍​-‏‪-‮⁠-ㅤ︀-️ᅠ￰-￸",astral:"[�-�][�-�]|�[�-�]"},{name:"Lowercase",bmp:"a-zªµºß-öø-ÿāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıijĵķĸĺļľŀłńņňʼnŋōŏőœŕŗřśŝşšţťŧũūŭůűųŵŷźżž-ƀƃƅƈƌƍƒƕƙ-ƛƞơƣƥƨƪƫƭưƴƶƹƺƽ-ƿdžljnjǎǐǒǔǖǘǚǜǝǟǡǣǥǧǩǫǭǯǰdzǵǹǻǽǿȁȃȅȇȉȋȍȏȑȓȕȗșțȝȟȡȣȥȧȩȫȭȯȱȳ-ȹȼȿɀɂɇɉɋɍɏ-ʓʕ-ʸˀˁˠ-ˤͅͱͳͷͺ-ͽΐά-ώϐϑϕ-ϗϙϛϝϟϡϣϥϧϩϫϭϯ-ϳϵϸϻϼа-џѡѣѥѧѩѫѭѯѱѳѵѷѹѻѽѿҁҋҍҏґғҕҗҙқҝҟҡңҥҧҩҫҭүұҳҵҷҹһҽҿӂӄӆӈӊӌӎӏӑӓӕӗәӛӝӟӡӣӥӧөӫӭӯӱӳӵӷӹӻӽӿԁԃԅԇԉԋԍԏԑԓԕԗԙԛԝԟԡԣԥԧա-ևᴀ-ᶿḁḃḅḇḉḋḍḏḑḓḕḗḙḛḝḟḡḣḥḧḩḫḭḯḱḳḵḷḹḻḽḿṁṃṅṇṉṋṍṏṑṓṕṗṙṛṝṟṡṣṥṧṩṫṭṯṱṳṵṷṹṻṽṿẁẃẅẇẉẋẍẏẑẓẕ-ẝẟạảấầẩẫậắằẳẵặẹẻẽếềểễệỉịọỏốồổỗộớờởỡợụủứừửữựỳỵỷỹỻỽỿ-ἇἐ-ἕἠ-ἧἰ-ἷὀ-ὅὐ-ὗὠ-ὧὰ-ώᾀ-ᾇᾐ-ᾗᾠ-ᾧᾰ-ᾴᾶᾷιῂ-ῄῆLine truncated
}),define("settings",["underscore","constants","storage"],function(t,e,n){var r={layoutOrientation:"horizontal",editMode:"ltr",lazyRendering:!0,editorFontClass:"font-rich",fontSizeRatio:1,maxWidthRatio:1,cursorFocusRatio:.5,defaultContent:"\n\n\n> Written with [StackEdit]("+e.MAIN_URL+").",commitMsg:"Published with "+e.MAIN_URL,conflictMode:"merge",markdownMimeType:"text/plain",gdriveMultiAccount:1,gdriveFullAccess:!0,dropboxFullAccess:!0,githubFullAccess:!0,template:["<!DOCTYPE html>","<html>","<head>",'<meta charset="utf-8">','<meta name="viewport" content="width=device-width, initial-scale=1.0">',"<title><%= documentTitle %></title>",'<link rel="stylesheet" href="'+e.MAIN_URL+'res-min/themes/base.css" />','<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>',"</head>",'<body><div class="container"><%= documentHTML %></div></body>',"</html>"].join("\n"),pdfTemplate:["<!DOCTYPE html>","<html>","<head>",'<meta charset="utf-8">',"<title><%= documentTitle %></title>",'<link rel="stylesheet" href="http://localhost/res-min/themes/base.css" />','<script type="text/x-mathjax-config">','MathJax.Hub.Config({ messageStyle: "none" });',"</script>",'<script type="text/javascript" src="http://localhost/res/bower-libs/MathJax/MathJax.js?config=TeX-AMS_HTML"></script>',"</head>","<body><%= documentHTML %></body>","</html>"].join("\n"),pdfOptions:["{",' "marginTop": 25,',' "marginRight": 25,',' "marginBottom": 25,',' "marginLeft": 25,',' "pageSize": "A4"',"}"].join("\n"),couchdbUrl:e.COUCHDB_URL,extensionSettings:{}};try{t.extend(r,JSON.parse(n.settings))}catch(i){}return r}),function(t,e){function n(t,e,n){return t.addEventListener?void t.addEventListener(e,n,!1):void t.attachEvent("on"+e,n)}function r(t){if("keypress"==t.type){var e=String.fromCharCode(t.which);return t.shiftKey||(e=e.toLowerCase()),e}return C[t.which]?C[t.which]:E[t.which]?E[t.which]:String.fromCharCode(t.which).toLowerCase()}function i(t,e){return t.sort().join(",")===e.sort().join(",")}function a(t){t=t||{};var e,n=!1;for(e in R)t[e]?n=!0:R[e]=0;n||(L=!1)}function o(t,e,n,r,a,o){var s,l,c=[],u=n.type;if(!I[t])return[];for("keyup"==u&&d(t)&&(e=[t]),s=0;s<I[t].length;++s)if(l=I[t][s],(r||!l.seq||R[l.seq]==l.level)&&u==l.action&&("keypress"==u&&!n.metaKey&&!n.ctrlKey||i(e,l.modifiers))){var h=!r&&l.combo==a,f=r&&l.seq==r&&l.level==o;(h||f)&&I[t].splice(s,1),c.push(l)}return c}function s(t){var e=[];return t.shiftKey&&e.push("shift"),t.altKey&&e.push("alt"),t.ctrlKey&&e.push("ctrl"),t.metaKey&&e.push("meta"),e}function l(t){return t.preventDefault?void t.preventDefault():void(t.returnValue=!1)}function c(t){return t.stopPropagation?void t.stopPropagation():void(t.cancelBubble=!0)}function u(t,e,n,r){D.stopCallback(e,e.target||e.srcElement,n,r)||t(e,n)===!1&&(l(e),c(e))}function h(t,e,n){var r,i=o(t,e,n),s={},l=0,c=!1;for(r=0;r<i.length;++r)i[r].seq&&(l=Math.max(l,i[r].level));for(r=0;r<i.length;++r)if(i[r].seq){if(i[r].level!=l)continue;c=!0,s[i[r].seq]=1,u(i[r].callback,n,i[r].combo,i[r].seq)}else c||u(i[r].callback,n,i[r].combo);var h="keypress"==n.type&&M;n.type!=L||d(t)||h||a(s),M=c&&"keydown"==n.type}function f(t){"number"!=typeof t.which&&(t.which=t.keyCode);var e=r(t);if(e)return"keyup"==t.type&&A===e?void(A=!1):void D.handleKey(e,s(t),t)}function d(t){return"shift"==t||"ctrl"==t||"alt"==t||"meta"==t}function p(){clearTimeout(S),S=setTimeout(a,1e3)}function g(){if(!_){_={};for(var t in C)t>95&&112>t||C.hasOwnProperty(t)&&(_[C[t]]=t)}return _}function m(t,e,n){return n||(n=g()[t]?"keydown":"keypress"),"keypress"==n&&e.length&&(n="keydown"),n}function v(t,e,n,i){function o(e){return function(){L=e,++R[t],p()}}function s(e){u(n,e,t),"keyup"!==i&&(A=r(e)),setTimeout(a,10)}R[t]=0;for(var l=0;l<e.length;++l){var c=l+1===e.length,h=c?s:o(i||x(e[l+1]).action);b(e[l],h,i,t,l)}}function y(t){return"+"===t?["+"]:t.split("+")}function x(t,e){var n,r,i,a=[];for(n=y(t),i=0;i<n.length;++i)r=n[i],T[r]&&(r=T[r]),e&&"keypress"!=e&&k[r]&&(r=k[r],a.push("shift")),d(r)&&a.push(r);return e=m(r,a,e),{key:r,modifiers:a,action:e}}function b(t,e,n,r,i){N[t+":"+n]=e,t=t.replace(/\s+/g," ");var a,s=t.split(" ");return s.length>1?void v(t,s,e,n):(a=x(t,n),I[a.key]=I[a.key]||[],o(a.key,a.modifiers,{type:a.action},r,t,i),void I[a.key][r?"unshift":"push"]({callback:e,modifiers:a.modifiers,action:a.action,seq:r,level:i,combo:t}))}function w(t,e,n){for(var r=0;r<t.length;++r)b(t[r],e,n)}for(var _,S,C={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},E={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},k={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|Line truncated
},function(t){r.error&&r.error(t)}):n([o],function(t){e.finishLoad(a.moduleName+"."+a.ext,a.strip,t,r)}))},write:function(t,n,r){if(d.hasOwnProperty(n)){var i=e.jsEscape(d[n]);r.asModule(t+"!"+n,"define(function () { return '"+i+"';});\n")}},writeFile:function(t,n,r,i,a){var o=e.parseName(n),s=o.ext?"."+o.ext:"",l=o.moduleName+s,c=r.toUrl(o.moduleName+s)+".js";e.load(l,r,function(){var n=function(t){return i(c,t)};n.asModule=function(t,e){return i.asModule(t,c,e)},e.write(t,l,n,a)},a)}},"node"===p.env||!p.env&&"undefined"!=typeof process&&process.versions&&process.versions.node&&!process.versions["node-webkit"]?(n=require.nodeRequire("fs"),e.get=function(t,e,r){try{var i=n.readFileSync(t,"utf8");""===i[0]&&(i=i.substring(1)),e(i)}catch(a){r&&r(a)}}):"xhr"===p.env||!p.env&&e.createXhr()?e.get=function(t,n,r,i){var a,o=e.createXhr();if(o.open("GET",t,!0),i)for(a in i)i.hasOwnProperty(a)&&o.setRequestHeader(a.toLowerCase(),i[a]);p.onXhr&&p.onXhr(o,t),o.onreadystatechange=function(){var e,i;4===o.readyState&&(e=o.status||0,e>399&&600>e?(i=new Error(t+" HTTP status: "+e),i.xhr=o,r&&r(i)):n(o.responseText),p.onXhrComplete&&p.onXhrComplete(o,t))},o.send(null)}:"rhino"===p.env||!p.env&&"undefined"!=typeof Packages&&"undefined"!=typeof java?e.get=function(t,e){var n,r,i="utf-8",a=new java.io.File(t),o=java.lang.System.getProperty("line.separator"),s=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(a),i)),l="";try{for(n=new java.lang.StringBuffer,r=s.readLine(),r&&r.length()&&65279===r.charAt(0)&&(r=r.substring(1)),null!==r&&n.append(r);null!==(r=s.readLine());)n.append(o),n.append(r);l=String(n.toString())}finally{s.close()}e(l)}:("xpconnect"===p.env||!p.env&&"undefined"!=typeof Components&&Components.classes&&Components.interfaces)&&(r=Components.classes,i=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),a="@mozilla.org/windows-registry-key;1"in r,e.get=function(t,e){var n,o,s,l={};a&&(t=t.replace(/\//g,"\\")),s=new FileUtils.File(t);try{n=r["@mozilla.org/network/file-input-stream;1"].createInstance(i.nsIFileInputStream),n.init(s,1,0,!1),o=r["@mozilla.org/intl/converter-input-stream;1"].createInstance(i.nsIConverterInputStream),o.init(n,"utf-8",n.available(),i.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),o.readString(n.available(),l),o.close(),n.close(),e(l.value)}catch(c){throw new Error((s&&s.path||"")+": "+c)}}),e}),define("text!html/markdownExtraSettingsBlock.html",[],function(){return'<p>Adds extra features to the original Markdown syntax.</p>\n<div class="form-horizontal">\n <div class="form-group">\n <label class="col-sm-4 control-label" for="input-markdownextra-tables">Tables</label>\n <div class="col-sm-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-tables">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-sm-4 control-label"\n for="input-markdownextra-deflist">Definition lists</label>\n <div class="col-sm-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-deflist">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-sm-4 control-label"\n for="input-markdownextra-attrlist">Special attributes</label>\n <div class="col-sm-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-attrlist">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-sm-4 control-label"\n for="input-markdownextra-footnotes">Footnotes</label>\n <div class="col-sm-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-footnotes">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-sm-4 control-label"\n for="input-markdownextra-comments">Comments</label>\n <div class="col-sm-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-comments">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-sm-4 control-label"\n for="input-markdownextra-smartypants">SmartyPants</label>\n <div class="col-sm-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-smartypants">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-sm-4 control-label"\n for="input-markdownextra-newlines">GFM newlines</label>\n <div class="col-sm-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-newlines">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-sm-4 control-label"\n for="input-markdownextra-intraword">GFM intra-word stars/underscores</label>\n <div class="col-sm-7">\n <div class="checkbox">\n <input type="checkbox" id="input-markdownextra-intraword">\n </div>\n </div>\n </div>\n <div class="form-group">\n <label class="col-sm-4 control-label"\n for="input-markdownextra-strikethrough">GFM strikethrough</label>\n <div class="col-sm-7">\n <div class="checkbLine truncated
},Markdown.Extra.init=function(t,e){var n=new Markdown.Extra,i=[],a=[],o=[],s=["unHashExtraBlocks"];return e=e||{},e.extensions=e.extensions||["all"],r(e.extensions,"all")&&(e.extensions=["tables","fenced_code_gfm","def_list","attr_list","footnotes","smartypants","strikethrough","newlines"]),a.push("wrapHeaders"),r(e.extensions,"attr_list")&&(i.push("hashFcbAttributeBlocks"),a.push("hashHeaderAttributeBlocks"),s.push("applyAttributeBlocks"),n.attributeBlocks=!0),r(e.extensions,"fenced_code_gfm")&&(a.push("fencedCodeBlocks"),i.push("fencedCodeBlocks")),r(e.extensions,"tables")&&a.push("tables"),r(e.extensions,"def_list")&&a.push("definitionLists"),r(e.extensions,"footnotes")&&(i.push("stripFootnoteDefinitions"),a.push("doFootnotes"),s.push("printFootnotes")),r(e.extensions,"smartypants")&&s.push("runSmartyPants"),r(e.extensions,"strikethrough")&&o.push("strikethrough"),r(e.extensions,"newlines")&&o.push("newlines"),t.hooks.chain("postNormalization",function(t){return n.doTransform(i,t)+"\n"}),t.hooks.chain("preBlockGamut",function(t,e){return n.blockGamutHookCallback=e,t=u(t),t=n.doTransform(a,t)+"\n",t=h(t)}),t.hooks.chain("postSpanGamut",function(t){return n.doTransform(o,t)}),n.previousPostConversion=t.hooks.postConversion,t.hooks.chain("postConversion",function(t){return t=n.doTransform(s,t),n.hashBlocks=[],n.footnotes={},n.usedFootnotes=[],t}),"highlighter"in e&&(n.googleCodePrettify="prettify"===e.highlighter,n.highlightJs="highlight"===e.highlighter),"table_class"in e&&(n.tableClass=e.table_class),n.converter=t,n},Markdown.Extra.prototype.doTransform=function(t,e){for(var n=0;n<t.length;n++)e=this[t[n]](e);return e},Markdown.Extra.prototype.hashExtraBlock=function(t){return"\n<p>~X"+(this.hashBlocks.push(t)-1)+"X</p>\n"},Markdown.Extra.prototype.hashExtraInline=function(t){return"~X"+(this.hashBlocks.push(t)-1)+"X"},Markdown.Extra.prototype.unHashExtraBlocks=function(t){function e(){var r=!1;t=t.replace(/(?:<p>)?~X(\d+)X(?:<\/p>)?/g,function(t,e){r=!0;var i=parseInt(e,10);return n.hashBlocks[i]}),r===!0&&e()}var n=this;return e(),t},Markdown.Extra.prototype.wrapHeaders=function(t){function e(t){return"\n"+t+"\n"}return t=t.replace(/^.+[ \t]*\n=+[ \t]*\n+/gm,e),t=t.replace(/^.+[ \t]*\n-+[ \t]*\n+/gm,e),t=t.replace(/^\#{1,6}[ \t]*.+?[ \t]*\#*\n+/gm,e)};var m="\\{[ \\t]*((?:[#.][-_:a-zA-Z0-9]+[ \\t]*)+)\\}",v=new RegExp("^(#{1,6}.*#{0,6})[ \\t]+"+m+"[ \\t]*(?:\\n|0x03)","gm"),y=new RegExp("^(.*)[ \\t]+"+m+"[ \\t]*\\n(?=[\\-|=]+\\s*(?:\\n|0x03))","gm"),x=new RegExp("^(```[^`\\n]*)[ \\t]+"+m+"[ \\t]*\\n(?=([\\s\\S]*?)\\n```[ \\t]*(\\n|0x03))","gm");Markdown.Extra.prototype.hashHeaderAttributeBlocks=function(t){function e(t,e,r){return"<p>~XX"+(n.hashBlocks.push(r)-1)+"XX</p>\n"+e+"\n"}var n=this;return t=t.replace(v,e),t=t.replace(y,e)},Markdown.Extra.prototype.hashFcbAttributeBlocks=function(t){function e(t,e,r){return"<p>~XX"+(n.hashBlocks.push(r)-1)+"XX</p>\n"+e+"\n"}var n=this;return t.replace(x,e)},Markdown.Extra.prototype.applyAttributeBlocks=function(t){var e=this,n=new RegExp('<p>~XX(\\d+)XX</p>[\\s]*(?:<(h[1-6]|pre)(?: +class="(\\S+)")?(>[\\s\\S]*?</\\2>))',"gm");return t=t.replace(n,function(t,n,r,i,o){if(!r)return"";for(var s=parseInt(n,10),l=e.hashBlocks[s],c=l.match(/#[^\s#.]+/g)||[],u=c[0]?' id="'+c[0].substr(1,c[0].length-1)+'"':"",h=l.match(/\.[^\s#.]+/g)||[],f=0;f<h.length;f++)h[f]=h[f].substr(1,h[f].length-1);var d="";return i&&(h=a(h,[i])),h.length>0&&(d=' class="'+h.join(" ")+'"'),"<"+r+u+d+o})},Markdown.Extra.prototype.tables=function(e){function n(e,n,i,a){n=n.replace(/^ *[|]/m,""),i=i.replace(/^ *[|]/m,""),a=a.replace(/^ *[|]/gm,""),n=n.replace(/[|] *$/m,""),i=i.replace(/[|] *$/m,""),a=a.replace(/[|] *$/gm,""),alignspecs=i.split(/ *[|] */),align=[];for(var o=0;o<alignspecs.length;o++){var s=alignspecs[o];align[o]=s.match(/^ *-+: *$/m)?' align="right"':s.match(/^ *:-+: *$/m)?' align="center"':s.match(/^ *:-+ *$/m)?' align="left"':""}var c=n.split(/ *[|] */),u=c.length,h=r.tableClass?' class="'+r.tableClass+'"':"",f=["<table",h,">\n","<thead>\n","<tr>\n"].join("");for(o=0;u>o;o++){var d=l(t(c[o]),r);f+=[" <th",align[o],">",d,"</th>\n"].join("")}f+="</tr>\n</thead>\n";var p=a.split("\n");for(o=0;o<p.length;o++)if(!p[o].match(/^\s*$/)){for(var g=p[o].split(/ *[|] */),m=u-g.length,v=0;m>v;v++)g.push("");for(f+="<tr>\n",v=0;u>v;v++){var y=l(t(g[v]),r);f+=[" <td",align[v],">",y,"</td>\n"].join("")}f+="</tr>\n"}return f+="</table>\n",r.hashExtraBlock(f)}var r=this,i=new RegExp(["^","[ ]{0,3}","[|]","(.+)\\n","[ ]{0,3}","[|]([ ]*[-:]+[-| :]*)\\n","(","(?:[ ]*[|].*\\n?)*",")","(?:\\n|$)"].join(""),"gm"),a=new RegExp(["^","[ ]{0,3}","(\\S.*[|].*)\\n","[ ]{0,3}","([-:]+[ ]*[|][-| :]*)\\n","(","(?:.*[|].*\\n?)*",")","(?:\\n|$)"].join(""),"gm");return e=e.replace(i,n),e=e.replace(a,n)},Markdown.Extra.prototype.stripFootnoteDefinitions=function(t){var e=this;return t=t.replace(/\n[ ]{0,3}\[\^(.+?)\]\:[ \t]*\n?([\s\S]*?)\n{1,2}((?=\n[ ]{0,3}\S)|$)/g,function(t,n,r){return n=d(n),r+="\n",r=r.replaLine truncated
},c.onMessage=function(t){s(t)},c.onError=function(e){n.error(e),t.isString(e)?s(e,"icon-attention"):t.isObject(e)&&s(e.message,"icon-attention")};var p=!1;return c.onOfflineChanged=function(t){p=t,l(),p===!0?s("You are offline.","icon-attention-circled msg-offline"):s("You are back online!","icon-signal")},c.onSyncImportSuccess=function(e,n){var r=t.map(e,function(t){return t.title}).join(", ");s(r+" imported successfully from "+n.providerName+".")},c.onSyncExportSuccess=function(t,e){s('"'+t.title+'" will now be synchronized on '+e.provider.providerName+".")},c.onSyncRemoved=function(t,e){s(e.provider.providerName+" synchronized location has been removed.")},c.onPublishSuccess=function(t){s('"'+t.title+'" successfully published.')},c.onNewPublishSuccess=function(t,e){s('"'+t.title+'" is now published on '+e.provider.providerName+".")},c.onPublishRemoved=function(t,e){s(e.provider.providerName+" publish location has been removed.")},c}),define("text!html/umlDiagramsSettingsBlock.html",[],function(){return'<p>Creates UML diagrams from plain text description.</p>\n\n<div class="form-horizontal">\n <div class="form-group">\n <label class="col-sm-4 control-label" for="textarea-umldiagram-flowchart-options">Flow charts options (JSON)\n </label>\n <div class="col-sm-7">\n <textarea id="textarea-umldiagram-flowchart-options" class="form-control"></textarea>\n </div>\n </div>\n</div>\n<br>\n<p>Sequence diagrams:</p>\n<pre><div class="help-block pull-right"><a target="_blank" href="http://bramp.github.io/js-sequence-diagrams/">More info</a></div><code>```sequence\nAlice->Bob: Hello Bob, how are you?\nBob-->Alice: I am good thanks!\n```</code>\n</pre>\n\n<p>Flow charts:</p>\n<pre><div class="help-block pull-right"><a target="_blank" href="http://adrai.github.io/flowchart.js/">More info</a></div><code>```flow\nst=>start: Start\ne=>end\nop=>operation: My Operation\ncond=>condition: Yes or No?\nst->op->cond\ncond(yes)->e\ncond(no)->op\n```</code>\n</pre>\n<blockquote>\n <p><b>Note:</b> Markdown Extra extension has to be enabled with GFM fenced code blocks option.</p>\n</blockquote>\n'}),function(t){var e,n,r="0.4.2",i="hasOwnProperty",a=/[\.\/]/,o="*",s=function(){},l=function(t,e){return t-e},c={n:{}},u=function(t,r){t=String(t);var i,a=n,o=Array.prototype.slice.call(arguments,2),s=u.listeners(t),c=0,h=[],f={},d=[],p=e;e=t,n=0;for(var g=0,m=s.length;m>g;g++)"zIndex"in s[g]&&(h.push(s[g].zIndex),s[g].zIndex<0&&(f[s[g].zIndex]=s[g]));for(h.sort(l);h[c]<0;)if(i=f[h[c++]],d.push(i.apply(r,o)),n)return n=a,d;for(g=0;m>g;g++)if(i=s[g],"zIndex"in i)if(i.zIndex==h[c]){if(d.push(i.apply(r,o)),n)break;do if(c++,i=f[h[c]],i&&d.push(i.apply(r,o)),n)break;while(i)}else f[i.zIndex]=i;else if(d.push(i.apply(r,o)),n)break;return n=a,e=p,d.length?d:null};u._events=c,u.listeners=function(t){var e,n,r,i,s,l,u,h,f=t.split(a),d=c,p=[d],g=[];for(i=0,s=f.length;s>i;i++){for(h=[],l=0,u=p.length;u>l;l++)for(d=p[l].n,n=[d[f[i]],d[o]],r=2;r--;)e=n[r],e&&(h.push(e),g=g.concat(e.f||[]));p=h}return g},u.on=function(t,e){if(t=String(t),"function"!=typeof e)return function(){};for(var n=t.split(a),r=c,i=0,o=n.length;o>i;i++)r=r.n,r=r.hasOwnProperty(n[i])&&r[n[i]]||(r[n[i]]={n:{}});for(r.f=r.f||[],i=0,o=r.f.length;o>i;i++)if(r.f[i]==e)return s;return r.f.push(e),function(t){+t==+t&&(e.zIndex=+t)}},u.f=function(t){var e=[].slice.call(arguments,1);return function(){u.apply(null,[t,null].concat(e).concat([].slice.call(arguments,0)))}},u.stop=function(){n=1},u.nt=function(t){return t?new RegExp("(?:\\.|\\/|^)"+t+"(?:\\.|\\/|$)").test(e):e},u.nts=function(){return e.split(a)},u.off=u.unbind=function(t,e){if(!t)return void(u._events=c={n:{}});var n,r,s,l,h,f,d,p=t.split(a),g=[c];for(l=0,h=p.length;h>l;l++)for(f=0;f<g.length;f+=s.length-2){if(s=[f,1],n=g[f].n,p[l]!=o)n[p[l]]&&s.push(n[p[l]]);else for(r in n)n[i](r)&&s.push(n[r]);g.splice.apply(g,s)}for(l=0,h=g.length;h>l;l++)for(n=g[l];n.n;){if(e){if(n.f){for(f=0,d=n.f.length;d>f;f++)if(n.f[f]==e){n.f.splice(f,1);break}!n.f.length&&delete n.f}for(r in n.n)if(n.n[i](r)&&n.n[r].f){var m=n.n[r].f;for(f=0,d=m.length;d>f;f++)if(m[f]==e){m.splice(f,1);break}!m.length&&delete n.n[r].f}}else{delete n.f;for(r in n.n)n.n[i](r)&&n.n[r].f&&delete n.n[r].f}n=n.n}},u.once=function(t,e){var n=function(){return u.unbind(t,n),e.apply(this,arguments)};return u.on(t,n)},u.version=r,u.toString=function(){return"You are running Eve "+r},"undefined"!=typeof module&&module.exports?module.exports=u:"undefined"!=typeof define?define("eve",[],function(){return u}):t.eve=u}(this),function(t,e){"function"==typeof define&&define.amd?define("raphael",["eve"],function(n){return e(t,n)}):e(t,t.eve)}(this,function(t,e){function n(t){if(n.is(t,"function"))return b?t():e.on("raphael.DOMload",t);if(n.is(t,X))return n._engine.create[N](n,t.splice(0,3+n.is(t[0],z))).add(t);var r=Array.prototype.slice.call(arguments,0);if(n.is(r[r.length-1],"function")){var i=r.pop();return b?i.call(n._engine.creaLine truncated
},n._toback=function(t,e){e.bottom!==t&&(Pe(t,e),t.next=e.bottom,t.prev=null,e.bottom.prev=t,e.bottom=t)},n._insertafter=function(t,e,n){Pe(t,n),e==n.top&&(n.top=t),e.next&&(e.next.prev=t),t.next=e.next,t.prev=e,e.next=t},n._insertbefore=function(t,e,n){Pe(t,n),e==n.bottom&&(n.bottom=t),e.prev&&(e.prev.next=t),t.prev=e.prev,e.prev=t,t.next=e},n.toMatrix=function(t,e){var n=Te(t),r={_:{transform:M},getBBox:function(){return n}};return je(r,e),r.matrix}),je=(n.transformPath=function(t,e){return ve(t,Be(t,e))},n._extractTransform=function(t,e){if(null==e)return t._.transform;e=O(e).replace(/\.{3}|\u2026/g,t._.transform||M);var r=n.parseTransformString(e),i=0,a=0,o=0,s=1,l=1,c=t._,u=new p;if(c.transform=r||[],r)for(var h=0,f=r.length;f>h;h++){var d,g,m,v,y,x=r[h],b=x.length,w=O(x[0]).toLowerCase(),_=x[0]!=w,S=_?u.invert():0;"t"==w&&3==b?_?(d=S.x(0,0),g=S.y(0,0),m=S.x(x[1],x[2]),v=S.y(x[1],x[2]),u.translate(m-d,v-g)):u.translate(x[1],x[2]):"r"==w?2==b?(y=y||t.getBBox(1),u.rotate(x[1],y.x+y.width/2,y.y+y.height/2),i+=x[1]):4==b&&(_?(m=S.x(x[2],x[3]),v=S.y(x[2],x[3]),u.rotate(x[1],m,v)):u.rotate(x[1],x[2],x[3]),i+=x[1]):"s"==w?2==b||3==b?(y=y||t.getBBox(1),u.scale(x[1],x[b-1],y.x+y.width/2,y.y+y.height/2),s*=x[1],l*=x[b-1]):5==b&&(_?(m=S.x(x[3],x[4]),v=S.y(x[3],x[4]),u.scale(x[1],x[2],m,v)):u.scale(x[1],x[2],x[3],x[4]),s*=x[1],l*=x[2]):"m"==w&&7==b&&u.add(x[1],x[2],x[3],x[4],x[5],x[6]),c.dirtyT=1,t.matrix=u}t.matrix=u,c.sx=s,c.sy=l,c.deg=i,c.dx=a=u.e,c.dy=o=u.f,1==s&&1==l&&!i&&c.bbox?(c.bbox.x+=+a,c.bbox.y+=+o):c.dirtyT=1}),$e=function(t){var e=t[0];switch(e.toLowerCase()){case"t":return[e,0,0];case"m":return[e,1,0,0,1,0,0];case"r":return 4==t.length?[e,0,t[2],t[3]]:[e,0];case"s":return 5==t.length?[e,1,1,t[3],t[4]]:3==t.length?[e,1,1]:[e,1]}},He=n._equaliseTransform=function(t,e){e=O(e).replace(/\.{3}|\u2026/g,t),t=n.parseTransformString(t)||[],e=n.parseTransformString(e)||[];for(var r,i,a,o,s=$(t.length,e.length),l=[],c=[],u=0;s>u;u++){if(a=t[u]||$e(e[u]),o=e[u]||$e(a),a[0]!=o[0]||"r"==a[0].toLowerCase()&&(a[2]!=o[2]||a[3]!=o[3])||"s"==a[0].toLowerCase()&&(a[3]!=o[3]||a[4]!=o[4]))return;for(l[u]=[],c[u]=[],r=0,i=$(a.length,o.length);i>r;r++)r in a&&(l[u][r]=a[r]),r in o&&(c[u][r]=o[r])}return{from:l,to:c}};n._getContainer=function(t,e,r,i){var a;return a=null!=i||n.is(t,"object")?t:k.doc.getElementById(t),null!=a?a.tagName?null==e?{container:a,width:a.style.pixelWidth||a.offsetWidth,height:a.style.pixelHeight||a.offsetHeight}:{container:a,width:e,height:r}:{container:1,x:t,y:e,width:r,height:i}:void 0},n.pathToRelative=Ne,n._engine={},n.path2curve=Fe,n.matrix=function(t,e,n,r,i,a){return new p(t,e,n,r,i,a)},function(t){function e(t){return t[0]*t[0]+t[1]*t[1]}function r(t){var n=j.sqrt(e(t));t[0]&&(t[0]/=n),t[1]&&(t[1]/=n)}t.add=function(t,e,n,r,i,a){var o,s,l,c,u=[[],[],[]],h=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],f=[[t,n,i],[e,r,a],[0,0,1]];for(t&&t instanceof p&&(f=[[t.a,t.c,t.e],[t.b,t.d,t.f],[0,0,1]]),o=0;3>o;o++)for(s=0;3>s;s++){for(c=0,l=0;3>l;l++)c+=h[o][l]*f[l][s];u[o][s]=c}this.a=u[0][0],this.b=u[1][0],this.c=u[0][1],this.d=u[1][1],this.e=u[0][2],this.f=u[1][2]},t.invert=function(){var t=this,e=t.a*t.d-t.b*t.c;return new p(t.d/e,-t.b/e,-t.c/e,t.a/e,(t.c*t.f-t.d*t.e)/e,(t.b*t.e-t.a*t.f)/e)},t.clone=function(){return new p(this.a,this.b,this.c,this.d,this.e,this.f)},t.translate=function(t,e){this.add(1,0,0,1,t,e)},t.scale=function(t,e,n,r){null==e&&(e=t),(n||r)&&this.add(1,0,0,1,n,r),this.add(t,0,0,e,0,0),(n||r)&&this.add(1,0,0,1,-n,-r)},t.rotate=function(t,e,r){t=n.rad(t),e=e||0,r=r||0;var i=+j.cos(t).toFixed(9),a=+j.sin(t).toFixed(9);this.add(i,a,-a,i,e,r),this.add(1,0,0,1,-e,-r)},t.x=function(t,e){return t*this.a+e*this.c+this.e},t.y=function(t,e){return t*this.b+e*this.d+this.f},t.get=function(t){return+this[O.fromCharCode(97+t)].toFixed(4)},t.toString=function(){return n.svg?"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")":[this.get(0),this.get(2),this.get(1),this.get(3),0,0].join()},t.toFilter=function(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.get(0)+", M12="+this.get(2)+", M21="+this.get(1)+", M22="+this.get(3)+", Dx="+this.get(4)+", Dy="+this.get(5)+", sizingmethod='auto expand')"},t.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},t.split=function(){var t={};t.dx=this.e,t.dy=this.f;var i=[[this.a,this.c],[this.b,this.d]];t.scalex=j.sqrt(e(i[0])),r(i[0]),t.shear=i[0][0]*i[1][0]+i[0][1]*i[1][1],i[1]=[i[1][0]-i[0][0]*t.shear,i[1][1]-i[0][1]*t.shear],t.scaley=j.sqrt(e(i[1])),r(i[1]),t.shear/=t.scaley;var a=-i[0][1],o=i[1][1];return 0>o?(t.rotate=n.deg(j.acos(o)),0>a&&(t.rotate=360-t.rotate)):t.rotate=n.deg(j.asin(a)),t.isSimple=!(+t.shear.toFixed(9)||t.scalex.toFixed(9)!=t.scaley.toFixed(9)&&t.rotate),t.isSuperSimple=!+t.shear.toFixed(9)&&t.scalex.toFixed(9)==t.scaley.toFixed(9)&&!t.rotate,t.noRotation=!+t.shear.toFixed(9)&&!t.rotate,t},t.toTransformString=function(t){var e=t||this[D]();return e.isSimpleLine truncated
break;case"stroke-dasharray":w(r,g,a);break;case"fill":var R=e(g).match(n._ISURL);if(R){k=m("pattern");var A=m("image");k.id=n.createUUID(),m(k,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),m(A,{x:0,y:0,"xlink:href":R[1]}),k.appendChild(A),function(t){n._preload(R[1],function(){var e=this.offsetWidth,n=this.offsetHeight;m(t,{width:e,height:n}),m(A,{width:e,height:n}),r.paper.safari()})}(k),r.paper.defs.appendChild(k),m(l,{fill:"url(#"+k.id+")"}),r.pattern=k,r.pattern&&y(r);break}var M=n.getRGB(g);if(M.error){if(("circle"==r.type||"ellipse"==r.type||"r"!=e(g).charAt())&&v(r,g)){if("opacity"in u||"fill-opacity"in u){var L=n._g.doc.getElementById(l.getAttribute("fill").replace(/^url\(#|\)$/g,h));if(L){var O=L.getElementsByTagName("stop");m(O[O.length-1],{"stop-opacity":("opacity"in u?u.opacity:1)*("fill-opacity"in u?u["fill-opacity"]:1)})}}u.gradient=g,u.fill="none";break}}else delete a.gradient,delete u.gradient,!n.is(u.opacity,"undefined")&&n.is(a.opacity,"undefined")&&m(l,{opacity:u.opacity}),!n.is(u["fill-opacity"],"undefined")&&n.is(a["fill-opacity"],"undefined")&&m(l,{"fill-opacity":u["fill-opacity"]});M[t]("opacity")&&m(l,{"fill-opacity":M.opacity>1?M.opacity/100:M.opacity});case"stroke":M=n.getRGB(g),l.setAttribute(p,M.hex),"stroke"==p&&M[t]("opacity")&&m(l,{"stroke-opacity":M.opacity>1?M.opacity/100:M.opacity}),"stroke"==p&&r._.arrows&&("startString"in r._.arrows&&x(r,r._.arrows.startString),"endString"in r._.arrows&&x(r,r._.arrows.endString,1));break;case"gradient":("circle"==r.type||"ellipse"==r.type||"r"!=e(g).charAt())&&v(r,g);break;case"opacity":u.gradient&&!u[t]("stroke-opacity")&&m(l,{"stroke-opacity":g>1?g/100:g});case"fill-opacity":if(u.gradient){L=n._g.doc.getElementById(l.getAttribute("fill").replace(/^url\(#|\)$/g,h)),L&&(O=L.getElementsByTagName("stop"),m(O[O.length-1],{"stop-opacity":g}));break}default:"font-size"==p&&(g=i(g,10)+"px");var D=p.replace(/(\-.)/g,function(t){return t.substring(1).toUpperCase()});l.style[D]=g,r._.dirty=1,l.setAttribute(p,g)}}C(r,a),l.style.visibility=f},S=1.2,C=function(r,a){if("text"==r.type&&(a[t]("text")||a[t]("font")||a[t]("font-size")||a[t]("x")||a[t]("y"))){var o=r.attrs,s=r.node,l=s.firstChild?i(n._g.doc.defaultView.getComputedStyle(s.firstChild,h).getPropertyValue("font-size"),10):10;if(a[t]("text")){for(o.text=a.text;s.firstChild;)s.removeChild(s.firstChild);for(var c,u=e(a.text).split("\n"),f=[],d=0,p=u.length;p>d;d++)c=m("tspan"),d&&m(c,{dy:l*S,x:o.x}),c.appendChild(n._g.doc.createTextNode(u[d])),s.appendChild(c),f[d]=c}else for(f=s.getElementsByTagName("tspan"),d=0,p=f.length;p>d;d++)d?m(f[d],{dy:l*S,x:o.x}):m(f[0],{dy:0});m(s,{x:o.x,y:o.y}),r._.dirty=1;var g=r._getBBox(),v=o.y-(g.y+g.height/2);v&&n.is(v,"finite")&&m(f[0],{dy:v})}},E=function(t,e){this[0]=this.node=t,t.raphael=!0,this.id=n._oid++,t.raphaelid=this.id,this.matrix=n.matrix(),this.realPath=null,this.paper=e,this.attrs=this.attrs||{},this._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1},!e.bottom&&(e.bottom=this),this.prev=e.top,e.top&&(e.top.next=this),e.top=this,this.next=null},k=n.el;E.prototype=k,k.constructor=E,n._engine.path=function(t,e){var n=m("path");e.canvas&&e.canvas.appendChild(n);var r=new E(n,e);return r.type="path",_(r,{fill:"none",stroke:"#000",path:t}),r},k.rotate=function(t,n,i){if(this.removed)return this;if(t=e(t).split(c),t.length-1&&(n=r(t[1]),i=r(t[2])),t=r(t[0]),null==i&&(n=i),null==n||null==i){var a=this.getBBox(1);n=a.x+a.width/2,i=a.y+a.height/2}return this.transform(this._.transform.concat([["r",t,n,i]])),this},k.scale=function(t,n,i,a){if(this.removed)return this;if(t=e(t).split(c),t.length-1&&(n=r(t[1]),i=r(t[2]),a=r(t[3])),t=r(t[0]),null==n&&(n=t),null==a&&(i=a),null==i||null==a)var o=this.getBBox(1);return i=null==i?o.x+o.width/2:i,a=null==a?o.y+o.height/2:a,this.transform(this._.transform.concat([["s",t,n,i,a]])),this},k.translate=function(t,n){return this.removed?this:(t=e(t).split(c),t.length-1&&(n=r(t[1])),t=r(t[0])||0,n=+n||0,this.transform(this._.transform.concat([["t",t,n]])),this)},k.transform=function(e){var r=this._;if(null==e)return r.transform;if(n._extractTransform(this,e),this.clip&&m(this.clip,{transform:this.matrix.invert()}),this.pattern&&y(this),this.node&&m(this.node,{transform:this.matrix}),1!=r.sx||1!=r.sy){var i=this.attrs[t]("stroke-width")?this.attrs["stroke-width"]:1;this.attr({"stroke-width":i})}return this},k.hide=function(){return!this.removed&&this.paper.safari(this.node.style.display="none"),this},k.show=function(){return!this.removed&&this.paper.safari(this.node.style.display=""),this},k.remove=function(){if(!this.removed&&this.node.parentNode){var t=this.paper;t.__set__&&t.__set__.exclude(this),u.unbind("raphael.*.*."+this.id),this.gradient&&t.defs.removeChild(this.gradient),n._tear(this,t),"a"==this.node.parentNode.tagName.toLowerCase()?this.node.parentNode.parentNode.removeChild(this.node.parentNode):this.node.parentNode.removeChild(this.node);for(var e in this)this[e]="function"==typeof this[e]?n._removeLine truncated
this.trace(t)},parse:function(t){function e(){var t;return t=n.lexer.lex()||f,"number"!=typeof t&&(t=n.symbols_[t]||t),t}var n=this,r=[0],i=[null],a=[],o=this.table,s="",l=0,c=0,u=0,h=2,f=1;this.lexer.setInput(t),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var d=this.lexer.yylloc;a.push(d);var p=this.lexer.options&&this.lexer.options.ranges;this.parseError="function"==typeof this.yy.parseError?this.yy.parseError:Object.getPrototypeOf(this).parseError;for(var g,m,v,y,x,b,w,_,S,C={};;){if(v=r[r.length-1],this.defaultActions[v]?y=this.defaultActions[v]:((null===g||"undefined"==typeof g)&&(g=e()),y=o[v]&&o[v][g]),"undefined"==typeof y||!y.length||!y[0]){var E="";S=[];for(b in o[v])this.terminals_[b]&&b>h&&S.push("'"+this.terminals_[b]+"'");E=this.lexer.showPosition?"Parse error on line "+(l+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[g]||g)+"'":"Parse error on line "+(l+1)+": Unexpected "+(g==f?"end of input":"'"+(this.terminals_[g]||g)+"'"),this.parseError(E,{text:this.lexer.match,token:this.terminals_[g]||g,line:this.lexer.yylineno,loc:d,expected:S})}if(y[0]instanceof Array&&y.length>1)throw new Error("Parse Error: multiple actions possible at state: "+v+", token: "+g);switch(y[0]){case 1:r.push(g),i.push(this.lexer.yytext),a.push(this.lexer.yylloc),r.push(y[1]),g=null,m?(g=m,m=null):(c=this.lexer.yyleng,s=this.lexer.yytext,l=this.lexer.yylineno,d=this.lexer.yylloc,u>0&&u--);break;case 2:if(w=this.productions_[y[1]][1],C.$=i[i.length-w],C._$={first_line:a[a.length-(w||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(w||1)].first_column,last_column:a[a.length-1].last_column},p&&(C._$.range=[a[a.length-(w||1)].range[0],a[a.length-1].range[1]]),x=this.performAction.call(C,s,c,l,this.yy,y[1],i,a),"undefined"!=typeof x)return x;w&&(r=r.slice(0,-1*w*2),i=i.slice(0,-1*w),a=a.slice(0,-1*w)),r.push(this.productions_[y[1]][0]),i.push(C.$),a.push(C._$),_=o[r[r.length-2]][r[r.length-1]],r.push(_);break;case 3:return!0}}return!0}},r=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t){return this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e-1),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),r=t[0].match(/(?:\r\n?|\n).*/g),r&&(this.yylinLine truncated
else a=this.leftEnd&&x?r(this.chart,c,[{x:c.x,y:c.y+S/2},{x:c.x+(c.x-d.x)/2,y:c.y+S/2},{x:c.x+(c.x-d.x)/2,y:d.y-S/2},{x:d.x,y:d.y-S/2},{x:d.x,y:d.y}],e):r(this.chart,c,[{x:c.x,y:d.y-S/2},{x:d.x,y:d.y-S/2},{x:d.x,y:d.y}],e),this.bottomStart=!0,t.topEnd=!0,_=c.x+(c.x-d.x)/2;else a=r(this.chart,l,[{x:l.x+S/2,y:l.y},{x:l.x+S/2,y:d.y-S/2},{x:d.x,y:d.y-S/2},{x:d.x,y:d.y}],e),this.rightStart=!0,t.topEnd=!0,_=l.x+S/2;else a=r(this.chart,l,[{x:l.x+S/2,y:l.y},{x:l.x+S/2,y:d.y-S/2},{x:d.x,y:d.y-S/2},{x:d.x,y:d.y}],e),this.rightStart=!0,t.topEnd=!0,_=l.x+S/2;else a=r(this.chart,u,p,e),this.leftStart=!0,t.rightEnd=!0,_=p.x;else a=r(this.chart,l,g,e),this.rightStart=!0,t.leftEnd=!0,_=g.x;else a=r(this.chart,c,d,e),this.bottomStart=!0,t.topEnd=!0,_=c.x;if(a){for(var k=0,T=this.chart.lines.length;T>k;k++)for(var I,N=this.chart.lines[k],R=N.attr("path"),A=a.attr("path"),M=0,L=R.length-1;L>M;M++){var O=[];O.push(["M",R[M][1],R[M][2]]),O.push(["L",R[M+1][1],R[M+1][2]]);for(var D=O[0][1],F=O[0][2],P=O[1][1],B=O[1][2],j=0,$=A.length-1;$>j;j++){var H=[];H.push(["M",A[j][1],A[j][2]]),H.push(["L",A[j+1][1],A[j+1][2]]);var U=H[0][1],q=H[0][2],G=H[1][1],z=H[1][2],W=i(D,F,P,B,U,q,G,z);if(W.onLine1&&W.onLine2){var X;q===z?U>G?(X=["L",W.x+2*C,q],A.splice(j+1,0,X),X=["C",W.x+2*C,q,W.x,q-4*C,W.x-2*C,q],A.splice(j+2,0,X),a.attr("path",A)):(X=["L",W.x-2*C,q],A.splice(j+1,0,X),X=["C",W.x-2*C,q,W.x,q-4*C,W.x+2*C,q],A.splice(j+2,0,X),a.attr("path",A)):q>z?(X=["L",U,W.y+2*C],A.splice(j+1,0,X),X=["C",U,W.y+2*C,U+4*C,W.y,U,W.y-2*C],A.splice(j+2,0,X),a.attr("path",A)):(X=["L",U,W.y-2*C],A.splice(j+1,0,X),X=["C",U,W.y-2*C,U+4*C,W.y,U,W.y+2*C],A.splice(j+2,0,X),a.attr("path",A)),j+=2,I+=2}}}this.chart.lines.push(a)}(!this.chart.maxXFromLine||this.chart.maxXFromLine&&_>this.chart.maxXFromLine)&&(this.chart.maxXFromLine=_)},m.inherits(s,o),m.inherits(l,o),m.inherits(c,o),m.inherits(u,o),m.inherits(h,o),h.prototype.getLeft=function(){var t=this.getY()+this.group.getBBox().height/2,e=this.getX()+this.textMargin;return{x:e,y:t}},h.prototype.getRight=function(){var t=this.getY()+this.group.getBBox().height/2,e=this.getX()+this.group.getBBox().width-this.textMargin;return{x:e,y:t}},m.inherits(f,o),f.prototype.render=function(){this.yes_direction&&(this[this.yes_direction+"_symbol"]=this.yes_symbol),this.no_direction&&(this[this.no_direction+"_symbol"]=this.no_symbol);var t=this.getAttr("line-length");if(this.bottom_symbol){var e=this.getBottom();this.bottom_symbol.getTop(),this.bottom_symbol.isPositioned||(this.bottom_symbol.shiftY(this.getY()+this.height+t),this.bottom_symbol.setX(e.x-this.bottom_symbol.width/2),this.bottom_symbol.isPositioned=!0,this.bottom_symbol.render())}if(this.right_symbol){var n=this.getRight();if(this.right_symbol.getLeft(),!this.right_symbol.isPositioned){this.right_symbol.setY(n.y-this.right_symbol.height/2),this.right_symbol.shiftX(this.group.getBBox().x+this.width+t);var r=this;!function i(){for(var e,n=!1,a=0,o=r.chart.symbols.length;o>a;a++){e=r.chart.symbols[a];var s=Math.abs(e.getCenter().x-r.right_symbol.getCenter().x);if(e.getCenter().y>r.right_symbol.getCenter().y&&s<=r.right_symbol.width/2){n=!0;break}}n&&(r.right_symbol.setX(e.getX()+e.width+t),i())}(),this.right_symbol.isPositioned=!0,this.right_symbol.render()}}},f.prototype.renderLines=function(){this.yes_symbol&&this.drawLineTo(this.yes_symbol,this.getAttr("yes-text"),this.yes_direction),this.no_symbol&&this.drawLineTo(this.no_symbol,this.getAttr("no-text"),this.no_direction)},p.parse=d,p}),define("extensions/umlDiagrams",["underscore","utils","logger","classes/Extension","text!html/umlDiagramsSettingsBlock.html","crel","Diagram","flow-chart"],function(t,e,n,r,i,a,o,s){var l=new r("umlDiagrams","UML Diagrams",!0);return l.settingsBlock=i,l.defaultConfig={flowchartOptions:["{",' "line-width": 2,',' "font-family": "sans-serif",',' "font-weight": "normal"',"}"].join("\n")},l.onLoadSettings=function(){e.setInputValue("#textarea-umldiagram-flowchart-options",l.config.flowchartOptions)},l.onSaveSettings=function(t,n){t.flowchartOptions=e.getInputJSONValue("#textarea-umldiagram-flowchart-options",n)},l.onPagedownConfigure=function(e){var n=document.getElementById("preview-contents");e.hooks.chain("onPreviewRefresh",function(){t.each(n.querySelectorAll(".prettyprint > .language-sequence"),function(t){try{var e=o.parse(t.textContent),n=t.parentNode,r=a("div",{"class":"sequence-diagram"});n.parentNode.replaceChild(r,n),e.drawSVG(r,{theme:"simple"})}catch(i){}}),t.each(n.querySelectorAll(".prettyprint > .language-flow"),function(t){try{var e=s.parse(t.textContent),n=t.parentNode,r=a("div",{"class":"flow-chart"});n.parentNode.replaceChild(r,n),e.drawSVG(r,JSON.parse(l.config.flowchartOptions))}catch(i){}})})},l}),define("text!html/tocSettingsBlock.html",[],function(){return'<p>Generates a table of contents when a [TOC] marker is found.</p>\n<div class="form-horizontal">\n <div class="form-group">\n <label class="col-sm-4 control-label" for="input-toc-marker">Marker\nLine truncated
},h.postMessage(JSON.stringify({language:u.language,code:u.code}))}else u.highlightedCode=e.highlight(u.code,u.grammar,u.language),e.hooks.run("before-insert",u),u.element.innerHTML=u.highlightedCode,a&&a.call(r),e.hooks.run("after-highlight",u)}}},highlight:function(t,r,i){return n.stringify(e.tokenize(t,r),i)},tokenize:function(t,n){var r=e.Token,i=[t],a=n.rest;if(a){for(var o in a)n[o]=a[o];delete n.rest}t:for(var o in n)if(n.hasOwnProperty(o)&&n[o]){var s=n[o],l=s.inside,c=!!s.lookbehind,u=0;s=s.pattern||s;for(var h=0;h<i.length;h++){var f=i[h];if(i.length>t.length)break t;if(!(f instanceof r)){s.lastIndex=0;var d=s.exec(f);if(d){c&&(u=d[1].length);var p=d.index-1+u,d=d[0].slice(u),g=d.length,m=p+g,v=f.slice(0,p+1),y=f.slice(m+1),x=[h,1];v&&x.push(v);var b=new r(o,l?e.tokenize(d,l):d);x.push(b),y&&x.push(y),Array.prototype.splice.apply(i,x)}}}}return i},hooks:{all:{},add:function(t,n){var r=e.hooks.all;r[t]=r[t]||[],r[t].push(n)},run:function(t,n){var r=e.hooks.all[t];if(r&&r.length)for(var i,a=0;i=r[a++];)i(n)}}},n=e.Token=function(t,e){this.type=t,this.content=e};if(n.stringify=function(t,r,i){if("string"==typeof t)return t;if("[object Array]"==Object.prototype.toString.call(t))return t.map(function(e){return n.stringify(e,r,t)}).join("");var a={type:t.type,content:n.stringify(t.content,r,i),tag:"span",classes:["token",t.type],attributes:{},language:r,parent:i};"comment"==a.type&&(a.attributes.spellcheck="true"),e.hooks.run("wrap",a);var o="";for(var s in a.attributes)o+=s+'="'+(a.attributes[s]||"")+'"';return"<"+a.tag+' class="'+a.classes.join(" ")+'" '+o+">"+a.content+"</"+a.tag+">"},!self.document)return void self.addEventListener("message",function(t){var n=JSON.parse(t.data),r=n.language,i=n.code;self.postMessage(JSON.stringify(e.tokenize(i,e.languages[r]))),self.close()},!1);var r=document.getElementsByTagName("script");r=r[r.length-1],r&&(e.filename=r.src,document.addEventListener&&!r.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",e.highlightAll))}(),define("prism-core",function(t){return function(){var e;return e||t.Prism}}(this));var DIFF_DELETE=-1,DIFF_INSERT=1,DIFF_EQUAL=0;diff_match_patch.Diff,diff_match_patch.prototype.diff_main=function(t,e,n,r){"undefined"==typeof r&&(r=this.Diff_Timeout<=0?Number.MAX_VALUE:(new Date).getTime()+1e3*this.Diff_Timeout);var i=r;if(null==t||null==e)throw new Error("Null input. (diff_main)");if(t==e)return t?[[DIFF_EQUAL,t]]:[];"undefined"==typeof n&&(n=!0);var a=n,o=this.diff_commonPrefix(t,e),s=t.substring(0,o);t=t.substring(o),e=e.substring(o),o=this.diff_commonSuffix(t,e);var l=t.substring(t.length-o);t=t.substring(0,t.length-o),e=e.substring(0,e.length-o);var c=this.diff_compute_(t,e,a,i);return s&&c.unshift([DIFF_EQUAL,s]),l&&c.push([DIFF_EQUAL,l]),this.diff_cleanupMerge(c),c},diff_match_patch.prototype.diff_compute_=function(t,e,n,r){var i;if(!t)return[[DIFF_INSERT,e]];if(!e)return[[DIFF_DELETE,t]];var a=t.length>e.length?t:e,o=t.length>e.length?e:t,s=a.indexOf(o);if(-1!=s)return i=[[DIFF_INSERT,a.substring(0,s)],[DIFF_EQUAL,o],[DIFF_INSERT,a.substring(s+o.length)]],t.length>e.length&&(i[0][0]=i[2][0]=DIFF_DELETE),i;if(1==o.length)return[[DIFF_DELETE,t],[DIFF_INSERT,e]];var l=this.diff_halfMatch_(t,e);if(l){var c=l[0],u=l[1],h=l[2],f=l[3],d=l[4],p=this.diff_main(c,h,n,r),g=this.diff_main(u,f,n,r);return p.concat([[DIFF_EQUAL,d]],g)}return n&&t.length>100&&e.length>100?this.diff_lineMode_(t,e,r):this.diff_bisect_(t,e,r)},diff_match_patch.prototype.diff_lineMode_=function(t,e,n){var r=this.diff_linesToChars_(t,e);t=r.chars1,e=r.chars2;var i=r.lineArray,a=this.diff_main(t,e,!1,n);this.diff_charsToLines_(a,i),this.diff_cleanupSemantic(a),a.push([DIFF_EQUAL,""]);for(var o=0,s=0,l=0,c="",u="";o<a.length;){switch(a[o][0]){case DIFF_INSERT:l++,u+=a[o][1];break;case DIFF_DELETE:s++,c+=a[o][1];break;case DIFF_EQUAL:if(s>=1&&l>=1){a.splice(o-s-l,s+l),o=o-s-l;for(var r=this.diff_main(c,u,!1,n),h=r.length-1;h>=0;h--)a.splice(o,0,r[h]);o+=r.length}l=0,s=0,c="",u=""}o++}return a.pop(),a},diff_match_patch.prototype.diff_bisect_=function(t,e,n){for(var r=t.length,i=e.length,a=Math.ceil((r+i)/2),o=a,s=2*a,l=new Array(s),c=new Array(s),u=0;s>u;u++)l[u]=-1,c[u]=-1;l[o+1]=0,c[o+1]=0;for(var h=r-i,f=h%2!=0,d=0,p=0,g=0,m=0,v=0;a>v&&!((new Date).getTime()>n);v++){for(var y=-v+d;v-p>=y;y+=2){var x,b=o+y;x=y==-v||y!=v&&l[b-1]<l[b+1]?l[b+1]:l[b-1]+1;for(var w=x-y;r>x&&i>w&&t.charAt(x)==e.charAt(w);)x++,w++;if(l[b]=x,x>r)p+=2;else if(w>i)d+=2;else if(f){var _=o+h-y;if(_>=0&&s>_&&-1!=c[_]){var S=r-c[_];if(x>=S)return this.diff_bisectSplit_(t,e,x,w,n)}}}for(var C=-v+g;v-m>=C;C+=2){var S,_=o+C;S=C==-v||C!=v&&c[_-1]<c[_+1]?c[_+1]:c[_-1]+1;for(var E=S-C;r>S&&i>E&&t.charAt(r-S-1)==e.charAt(i-E-1);)S++,E++;if(c[_]=S,S>r)m+=2;else if(E>i)g+=2;else if(!f){var b=o+h-C;if(b>=0&&s>b&&-1!=l[b]){var x=l[b],w=o+x-b;if(S=r-S,x>=S)return this.diff_bisectSplit_(t,e,x,w,n)}}}}return[[DIFF_DELETE,t],[DIFF_INSERT,e]]},diff_match_patch.prototype.diff_bisectSplit_=function(Line truncated
};r.filterName="dates",n.diffFilter=r},{}],11:[function(t,e,n){var r=function(t,e,n,r){return t[n]===e[r]},i=function(t,e,n,r){var i,a,o=t.length,s=e.length,l=[o+1];for(i=0;o+1>i;i++)for(l[i]=[s+1],a=0;s+1>a;a++)l[i][a]=0;for(l.match=n,i=1;o+1>i;i++)for(a=1;s+1>a;a++)l[i][a]=n(t,e,i-1,a-1,r)?l[i-1][a-1]+1:Math.max(l[i-1][a],l[i][a-1]);return l},a=function(t,e,n,r,i,o){if(0===r||0===i)return{sequence:[],indices1:[],indices2:[]};if(t.match(e,n,r-1,i-1,o)){var s=a(t,e,n,r-1,i-1,o);return s.sequence.push(e[r-1]),s.indices1.push(r-1),s.indices2.push(i-1),s}return t[r][i-1]>t[r-1][i]?a(t,e,n,r,i-1,o):a(t,e,n,r-1,i,o)},o=function(t,e,n,o){o=o||{};var s=i(t,e,n||r,o),l=a(s,t,e,t.length,e.length,o);return"string"==typeof t&&"string"==typeof e&&(l.sequence=l.sequence.join("")),l};n.get=o},{}],12:[function(t,e,n){var r=t("../contexts/diff").DiffContext,i=t("../contexts/patch").PatchContext,a=t("../contexts/reverse").ReverseContext,o=function(t){if(t&&t.children){for(var e,n=t.children.length,r=t.result,i=0;n>i;i++)e=t.children[i],"undefined"!=typeof e.result&&(r=r||{},r[e.childName]=e.result);r&&t.leftIsArray&&(r._t="a"),t.setResult(r).exit()}};o.filterName="collectChildren";var s=function(t){if(!t.leftIsArray&&"object"===t.leftType){var e,n;for(e in t.left)n=new r(t.left[e],t.right[e]),t.push(n,e);for(e in t.right)"undefined"==typeof t.left[e]&&(n=new r(void 0,t.right[e]),t.push(n,e));return t.children&&0!==t.children.length?void t.exit():void t.setResult(void 0).exit()}};s.filterName="objects";var l=function(t){if(t.nested&&!t.delta._t){var e,n;for(e in t.delta)n=new i(t.left[e],t.delta[e]),t.push(n,e);t.exit()}};l.filterName="objects";var c=function(t){if(t&&t.children&&!t.delta._t){for(var e,n=t.children.length,r=0;n>r;r++)e=t.children[r],t.left[e.childName]!==e.result&&(t.left[e.childName]=e.result);t.setResult(t.left).exit()}};c.filterName="collectChildren";var u=function(t){if(t.nested&&!t.delta._t){var e,n;for(e in t.delta)n=new a(t.delta[e]),t.push(n,e);t.exit()}};u.filterName="objects";var h=function(t){if(t&&t.children&&!t.delta._t){for(var e,n=t.children.length,r={},i=0;n>i;i++)e=t.children[i],r[e.childName]!==e.result&&(r[e.childName]=e.result);t.setResult(r).exit()}};h.filterName="collectChildren",n.collectChildrenDiffFilter=o,n.objectsDiffFilter=s,n.patchFilter=l,n.collectChildrenPatchFilter=c,n.reverseFilter=u,n.collectChildrenReverseFilter=h},{"../contexts/diff":3,"../contexts/patch":4,"../contexts/reverse":5}],13:[function(t,e,n){var r=2,i=60,a=null,o=function(){if(!a){var e;if("undefined"!=typeof diff_match_patch)e=new diff_match_patch;else if("function"==typeof t){var n=t("../../external/diff_match_patch_uncompressed");e=new n.diff_match_patch}if(!e){var r=new Error("text diff_match_patch library not found");throw r.diff_match_patch_not_found=!0,r}a={diff:function(t,n){return e.patch_toText(e.patch_make(t,n))},patch:function(t,n){for(var r=e.patch_apply(e.patch_fromText(n),t),i=0;i<r[1].length;i++)if(!r[1][i]){var a=new Error("text patch failed");a.textPatchFailed=!0}return r[0]}}}return a},s=function(t){if("string"===t.leftType){var e=t.options&&t.options.textDiff&&t.options.textDiff.minLength||i;if(t.left.length<e||t.right.length<e)return void t.setResult([t.left,t.right]).exit();var n=o().diff;t.setResult([n(t.left,t.right),0,r]).exit()}};s.filterName="texts";var l=function(t){if(!t.nested&&t.delta[2]===r){var e=o().patch;t.setResult(e(t.left,t.delta[0])).exit()}};l.filterName="texts";var c=function(t){var e,n,r,i,a,o,s,l,c=null,u=/^@@ +\-(\d+),(\d+) +\+(\d+),(\d+) +@@$/;for(r=t.split("\n"),e=0,n=r.length;n>e;e++){i=r[e];var h=i.slice(0,1);"@"===h?(c=u.exec(i),o=e,s=null,l=null,r[o]="@@ -"+c[3]+","+c[4]+" +"+c[1]+","+c[2]+" @@"):"+"===h?(s=e,r[e]="-"+r[e].slice(1),"+"===r[e-1].slice(0,1)&&(a=r[e],r[e]=r[e-1],r[e-1]=a)):"-"===h&&(l=e,r[e]="+"+r[e].slice(1))}return r.join("\n")},u=function(t){t.nested||t.delta[2]===r&&t.setResult([c(t.delta[0]),0,r]).exit()};u.filterName="texts",n.diffFilter=s,n.patchFilter=l,n.reverseFilter=u},{}],14:[function(t,e,n){var r="function"==typeof Array.isArray?Array.isArray:function(t){return t instanceof Array},i=function(t){if(t.left===t.right)return void t.setResult(void 0).exit();if("undefined"==typeof t.left){if("function"==typeof t.right)throw new Error("functions are not supported");return void t.setResult([t.right]).exit()}if("undefined"==typeof t.right)return void t.setResult([t.left,0,0]).exit();if("function"==typeof t.left||"function"==typeof t.right)throw new Error("functions are not supported");return t.leftType=null===t.left?"null":typeof t.left,t.rightType=null===t.right?"null":typeof t.right,t.leftType!==t.rightType?void t.setResult([t.left,t.right]).exit():"boolean"===t.leftType||"number"===t.leftType?void t.setResult([t.left,t.right]).exit():("object"===t.leftType&&(t.leftIsArray=r(t.left)),"object"===t.rightType&&(t.rightIsArray=r(t.right)),t.leftIsArray!==t.rightIsArray?void t.setResult([t.left,t.right]).exit():void 0)};i.filterName="trivial";var Line truncated
R.blur(function(){e[0].setSelectionRange(0,0),e.blur()})}T.focus=y,T.adjustCursorPosition=h,Object.defineProperty(T,"value",{get:function(){return X},set:f}),Object.defineProperty(T,"selectionStart",{get:function(){return Math.min(W.selectionStart,W.selectionEnd)},set:function(t){W.setSelectionStartEnd(t),W.updateSelectionRange(),W.updateCursorCoordinates()},enumerable:!0,configurable:!0}),Object.defineProperty(T,"selectionEnd",{get:function(){return Math.max(W.selectionStart,W.selectionEnd)},set:function(t){W.setSelectionStartEnd(void 0,t),W.updateSelectionRange(),W.updateCursorCoordinates()},enumerable:!0,configurable:!0});var r=!1;R.on("keydown",function(t){if(17!==t.which&&91!==t.which&&18!==t.which&&16!==t.which){W.saveSelectionState(),h();var e=t.metaKey||t.ctrlKey;switch(t.which){case 9:e||(i("indent",{inverse:t.shiftKey}),t.preventDefault());break;case 13:i("newline"),t.preventDefault()}13!==t.which&&(r=!1)}}).on("compositionstart",function(){j++}).on("compositionend",function(){setTimeout(function(){j--},0)}).on("mouseup",t.bind(W.saveSelectionState,W,!0,!1)).on("paste",function(t){Y.currentMode="paste",t.preventDefault();var e,n=(t.originalEvent||t).clipboardData;n?e=n.getData("text/plain"):(n=window.clipboardData,e=n&&n.getData("Text")),e&&(d(W.selectionStart,W.selectionEnd,e),h())}).on("cut",function(){Y.currentMode="cut",h()}).on("focus",function(){W.hasFocus=!0}).on("blur",function(){W.hasFocus=!1});var i=function(t,e){var n=v(),r=Math.min(W.selectionStart,W.selectionEnd),i=Math.max(W.selectionStart,W.selectionEnd),a={selectionStart:r,selectionEnd:i,before:n.slice(0,r),after:n.slice(i),selection:n.slice(r,i)};o[t](a,e||{}),f(a.before+a.selection+a.after),W.setSelectionStartEnd(a.selectionStart,a.selectionEnd),W.updateSelectionRange()},a=/^ {0,3}>[ ]*|^[ \t]*(?:[*+\-]|(\d+)\.)[ \t]|^\s+/,o={indent:function(t,e){function n(t,e,n,r){return n=+n||0,r=r||"",t.slice(0,e)+r+t.slice(e+n)}var r=t.before.lastIndexOf("\n")+1;if(e.inverse)/\s/.test(t.before.charAt(r))&&(t.before=n(t.before,r,1),t.selectionStart--,t.selectionEnd--),t.selection=t.selection.replace(/^[ \t]/gm,"");else{var i=t.before.slice(r);if(!t.selection&&!i.match(a))return t.before+=" ",t.selectionStart++,void t.selectionEnd++;t.before=n(t.before,r,0," "),t.selection=t.selection.replace(/\r?\n(?=[\s\S])/g,"\n "),t.selectionStart++,t.selectionEnd++}t.selectionEnd=t.selectionStart+t.selection.length},newline:function(t){var e=t.before.lastIndexOf("\n")+1;if(r)return t.before=t.before.substring(0,e),t.selection="",t.selectionStart=e,t.selectionEnd=e,void(r=!1);r=!1;var n=t.before.slice(e),i=n.match(a),o=(i||[""])[0];if(i&&i[1]){var s=parseInt(i[1],10);o=o.replace(/\d+/,s+1)}o.length&&(r=!0),Y.currentMode="newlines",t.before+="\n"+o,t.selection="",t.selectionStart+=o.length+1,t.selectionEnd=t.selectionStart}};V!==!1&&F.setContent(V)};var Q,K=[],Z=[],te=[],ee=function(){var t={"&":"&amp;","<":"&lt;"," ":" "};return function(e){return e.replace(/[&<\u00a0]/g,function(e){return t[e]})}}();return r.onEditorCreated(F),F}),function(){function t(){}function e(t){this.buttonBar=h.getElementById("wmd-button-bar"+t),this.preview=h.getElementById("wmd-preview"+t),this.input=h.getElementById("wmd-input"+t)}function n(t,e){var n,i,a,o=this,s=[],c=0,u="none",h=function(t,e){u!=t&&(u=t,e||d()),g.isIE&&"moving"==u?a=null:i=setTimeout(f,1)},f=function(t){a=new r(e,t),i=void 0};this.setCommandMode=function(){u="command",d(),i=setTimeout(f,0)},this.canUndo=function(){return c>1},this.canRedo=function(){return s[c+1]?!0:!1},this.undo=function(){o.canUndo()&&(n?(n.restore(),n=null):(s[c]=new r(e),s[--c].restore(),t&&t())),u="none",e.input.focus(),f()},this.redo=function(){o.canRedo()&&(s[++c].restore(),t&&t()),u="none",e.input.focus(),f()};var d=function(){var i=a||new r(e);return i?"moving"==u?void(n||(n=i)):(n&&(s[c-1].text!=n.text&&(s[c++]=n),n=null),s[c++]=i,s[c+1]=null,void(t&&t())):!1},p=function(t){if(!t.ctrlKey&&!t.metaKey){var e=t.keyCode;e>=33&&40>=e||e>=63232&&63235>=e?h("moving"):8==e||46==e||127==e?h("deleting"):13==e?h("newlines"):27==e?h("escape"):(16>e||e>20)&&91!=e&&h("typing")}},m=function(){l.addEvent(e.input,"keypress",function(t){!t.ctrlKey&&!t.metaKey||t.altKey||89!=t.keyCode&&90!=t.keyCode||t.preventDefault()});var t=function(){(g.isIE||a&&a.text!=e.input.value)&&void 0==i&&(u="paste",d(),f())};l.addEvent(e.input,"keydown",p),l.addEvent(e.input,"mousedown",function(){h("moving")}),e.input.onpaste=t,e.input.ondrop=t},v=function(){m(),f(!0)};this.reinit=function(t,e,r,o){s=[],c=0,u="none",n=void 0,i=void 0,f(),a.text=t,a.start=e,a.end=r,a.scrollTop=o,a.setInputAreaSelection(),d()},this.setMode=h,v()}function r(e){var n=this,r=e.input;this.init=function(){l.isVisible(r)&&(this.setInputAreaSelectionStartEnd(),this.scrollTop=r.scrollTop,(!this.text&&r.selectionStart||0===r.selectionStart)&&(this.text=r.value))},this.setInputAreaSelection=function(){l.isVisible(r)&&(r.focus(),r.selectionStart=n.start,r.selectionEnd=n.end)},this.setInputAreaSelLine truncated
for(var n,r,i,a=0,o=t.attributes.length;o>a;++a)if(n=t.attributes[a],i=n.name,"class"!=i){if(r=e.attributes.getNamedItem(i),n.specified!=r.specified)return!1;if(n.specified&&n.nodeValue!==r.nodeValue)return!1}return!0}function f(t,e){for(var n,r=0,i=t.attributes.length;i>r;++r)if(n=t.attributes[r].name,(!e||!k.arrayContains(e,n))&&t.attributes[r].specified&&"class"!=n)return!0;return!1}function d(t,e){for(var n in e)if(e.hasOwnProperty(n)&&t[n]!==e[n])return!1;return!0}function p(t){var e;return t&&1==t.nodeType&&((e=t.parentNode)&&9==e.nodeType&&"on"==e.designMode||N(t)&&!N(t.parentNode))}function g(t){return(N(t)||1!=t.nodeType&&N(t.parentNode))&&!p(t)}function m(t){return t&&1==t.nodeType&&!R.test(E(t,"display"))}function v(t){if(0==t.data.length)return!0;if(A.test(t.data))return!1;var e=E(t.parentNode,"whiteSpace");switch(e){case"pre":case"pre-wrap":case"-moz-pre-wrap":return!1;case"pre-line":if(/[\r\n]/.test(t.data))return!1}return m(t.previousSibling)||m(t.nextSibling)}function y(t,e){return k.isCharacterDataNode(t)?0==e?!!t.previousSibling:e==t.length?!!t.nextSibling:!0:e>0&&e<t.childNodes.length}function x(t,n,r,i){var a,o=0==r;if(k.isAncestorOf(n,t))return t;if(k.isCharacterDataNode(n))if(0==r)r=k.getNodeIndex(n),n=n.parentNode;else{if(r!=n.length)throw e.createError("splitNodeAt should not be called with offset in the middle of a data node ("+r+" in "+n.data);r=k.getNodeIndex(n)+1,n=n.parentNode}if(y(n,r)){if(!a){a=n.cloneNode(!1),a.id&&a.removeAttribute("id");for(var s;s=n.childNodes[r];)a.appendChild(s);k.insertAfter(a,n)}return n==t?a:x(t,a.parentNode,k.getNodeIndex(a),i)}if(t!=n){a=n.parentNode;var l=k.getNodeIndex(n);return o||l++,x(t,a,l,i)}return t}function b(t,e){return t.tagName==e.tagName&&s(t,e)&&h(t,e)}function w(t){var e=t?"nextSibling":"previousSibling";return function(n,r){var i=n.parentNode,a=n[e];if(a){if(a&&3==a.nodeType)return a}else if(r&&(a=i[e],a&&1==a.nodeType&&b(i,a)))return a[t?"firstChild":"lastChild"];return null}}function _(t){this.isElementMerge=1==t.nodeType,this.firstTextNode=this.isElementMerge?t.lastChild:t,this.textNodes=[this.firstTextNode]}function S(t,e,r){this.cssClass=t;var i,o,s,l,c=null;if("object"==typeof e&&null!==e){for(r=e.tagNames,c=e.elementProperties,o=0;l=O[o++];)e.hasOwnProperty(l)&&(this[l]=e[l]);i=e.normalize}else i=e;this.normalize="undefined"==typeof i?!0:i,this.attrExceptions=[];var u=document.createElement(this.elementTagName);this.elementProperties={};for(var h in c)c.hasOwnProperty(h)&&(D.hasOwnProperty(h)&&(h=D[h]),u[h]=c[h],this.elementProperties[h]=u[h],this.attrExceptions.push(h));this.elementSortedClassName=this.elementProperties.hasOwnProperty("className")?a(this.elementProperties.className+" "+t):t,this.applyToAnyTagName=!1;var f=typeof r;if("string"==f)"*"==r?this.applyToAnyTagName=!0:this.tagNames=n(r.toLowerCase()).split(/\s*,\s*/);else if("object"==f&&"number"==typeof r.length)for(this.tagNames=[],o=0,s=r.length;s>o;++o)"*"==r[o]?this.applyToAnyTagName=!0:this.tagNames.push(r[o].toLowerCase());else this.tagNames=[this.elementTagName]}function C(t,e,n){return new S(t,e,n)}t.requireModules(["WrappedSelection","WrappedRange"]);var E,k=t.dom,T="span",I=function(){function t(t,e,n){return e&&n?" ":""}return function(e,n){e.className&&(e.className=e.className.replace(new RegExp("(?:^|\\s)"+n+"(?:\\s|$)"),t))}}();"undefined"!=typeof window.getComputedStyle?E=function(t,e){return k.getWindow(t).getComputedStyle(t,null)[e]}:"undefined"!=typeof document.documentElement.currentStyle?E=function(t,e){return t.currentStyle[e]}:e.fail("No means of obtaining computed style properties found");var N;!function(){var t=document.createElement("div");N="boolean"==typeof t.isContentEditable?function(t){return t&&1==t.nodeType&&t.isContentEditable}:function(t){return t&&1==t.nodeType&&"false"!=t.contentEditable?"true"==t.contentEditable||N(t.parentNode):!1}}();var R=/^inline(-block|-table)?$/i,A=/[^\r\n\t\f \u200B]/,M=w(!1),L=w(!0);_.prototype={doMerge:function(){for(var t,e,n,r=[],i=0,a=this.textNodes.length;a>i;++i)t=this.textNodes[i],e=t.parentNode,r[i]=t.data,i&&(e.removeChild(t),e.hasChildNodes()||e.parentNode.removeChild(e));return this.firstTextNode.data=n=r.join(""),n},getLength:function(){for(var t=this.textNodes.length,e=0;t--;)e+=this.textNodes[t].length;return e},toString:function(){for(var t=[],e=0,n=this.textNodes.length;n>e;++e)t[e]="'"+this.textNodes[e].data+"'";return"[Merge("+t.join(",")+")]"}};var O=["elementTagName","ignoreWhiteSpace","applyToEditableOnly"],D={"class":"className"};S.prototype={elementTagName:T,elementProperties:{},ignoreWhiteSpace:!0,applyToEditableOnly:!1,hasClass:function(t){return 1==t.nodeType&&k.arrayContains(this.tagNames,t.tagName.toLowerCase())&&r(t,this.cssClass)},getSelfOrAncestorWithClass:function(t){for(;t;){if(this.hasClass(t,this.cssClass))return t;t=t.parentNode}return null},isModifiable:function(t){return!this.applyToEditableOnly||g(t)},isIgnorableWhiteSpaceNode:function(t){return this.ignoreWhiteSpaLine truncated
+1 -1
View File
@@ -1152,7 +1152,7 @@ a.input-group-addon {
line-height: 1.65;
letter-spacing: normal;
border-radius: 0;
color: #5a5a5a;
color: #000;
-webkit-box-shadow: none;
box-shadow: none;
resize: none;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 673 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

+2 -1
View File
@@ -1,2 +1,3 @@
(function(factory){factory(jQuery)})(function($){var pluses=/\+/g;function encode(s){return config.raw?s:encodeURIComponent(s)}function decode(s){return config.raw?s:decodeURIComponent(s)}function stringifyCookieValue(value){return encode(config.json?JSON.stringify(value):String(value))}function parseCookieValue(s){if(s.indexOf('"')===0){s=s.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\")}try{s=decodeURIComponent(s.replace(pluses," "));return config.json?JSON.parse(s):s}catch(e){}}function read(s,converter){var value=config.raw?s:parseCookieValue(s);return $.isFunction(converter)?converter(value):value}var config=$.cookie=function(key,value,options){if(value!==undefined&&!$.isFunction(value)){options=$.extend({},config.defaults,options);if(typeof options.expires==="number"){var days=options.expires,t=options.expires=new Date;t.setTime(+t+days*864e5)}return document.cookie=[encode(key),"=",stringifyCookieValue(value),options.expires?"; expires="+options.expires.toUTCString():"",options.path?"; path="+options.path:"",options.domain?"; domain="+options.domain:"",options.secure?"; secure":""].join("")}var result=key?undefined:{};var cookies=document.cookie?document.cookie.split("; "):[];for(var i=0,l=cookies.length;i<l;i++){var parts=cookies[i].split("=");var name=decode(parts.shift());var cookie=parts.join("=");if(key&&key===name){result=read(cookie,value);break}if(!key&&(cookie=read(cookie))!==undefined){result[name]=cookie}}return result};config.defaults={};$.removeCookie=function(key,options){if($.cookie(key)===undefined){return false}$.cookie(key,"",$.extend({},options,{expires:-1}));return!$.cookie(key)}});if(typeof jQuery==="undefined"){throw new Error("Bootstrap requires jQuery")}+function($){"use strict";function transitionEnd(){var el=document.createElement("bootstrap");var transEndEventNames={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var name in transEndEventNames){if(el.style[name]!==undefined){return{end:transEndEventNames[name]}}}}$.fn.emulateTransitionEnd=function(duration){var called=false,$el=this;$(this).one($.support.transition.end,function(){called=true});var callback=function(){if(!called)$($el).trigger($.support.transition.end)};setTimeout(callback,duration);return this};$(function(){$.support.transition=transitionEnd()})}(jQuery);+function($){"use strict";var dismiss='[data-dismiss="alert"]';var Alert=function(el){$(el).on("click",dismiss,this.close)};Alert.prototype.close=function(e){var $this=$(this);var selector=$this.attr("data-target");if(!selector){selector=$this.attr("href");selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,"")}var $parent=$(selector);if(e)e.preventDefault();if(!$parent.length){$parent=$this.hasClass("alert")?$this:$this.parent()}$parent.trigger(e=$.Event("close.bs.alert"));if(e.isDefaultPrevented())return;$parent.removeClass("in");function removeElement(){$parent.trigger("closed.bs.alert").remove()}$.support.transition&&$parent.hasClass("fade")?$parent.one($.support.transition.end,removeElement).emulateTransitionEnd(150):removeElement()};var old=$.fn.alert;$.fn.alert=function(option){return this.each(function(){var $this=$(this);var data=$this.data("bs.alert");if(!data)$this.data("bs.alert",data=new Alert(this));if(typeof option=="string")data[option].call($this)})};$.fn.alert.Constructor=Alert;$.fn.alert.noConflict=function(){$.fn.alert=old;return this};$(document).on("click.bs.alert.data-api",dismiss,Alert.prototype.close)}(jQuery);+function($){"use strict";var Button=function(element,options){this.$element=$(element);this.options=$.extend({},Button.DEFAULTS,options)};Button.DEFAULTS={loadingText:"loading..."};Button.prototype.setState=function(state){var d="disabled";var $el=this.$element;var val=$el.is("input")?"val":"html";var data=$el.data();state=state+"Text";if(!data.resetText)$el.data("resetText",$el[val]());$el[val](data[state]||this.options[state]);setTimeout(function(){state=="loadingText"?$el.addClass(d).attr(d,d):$el.removeClass(d).removeAttr(d)},0)};Button.prototype.toggle=function(){var $parent=this.$element.closest('[data-toggle="buttons"]');if($parent.length){var $input=this.$element.find("input").prop("checked",!this.$element.hasClass("active")).trigger("change");if($input.prop("type")==="radio")$parent.find(".active").removeClass("active")}this.$element.toggleClass("active")};var old=$.fn.button;$.fn.button=function(option){return this.each(function(){var $this=$(this);var data=$this.data("bs.button");var options=typeof option=="object"&&option;if(!data)$this.data("bs.button",data=new Button(this,options));if(option=="toggle")data.toggle();else if(option)data.setState(option)})};$.fn.button.Constructor=Button;$.fn.button.noConflict=function(){$.fn.button=old;return this};$(document).on("click.bs.button.data-api","[data-toggle^=button]",function(e){var $btn=$(e.target);if(!$btn.hasClass("btn"))$btn=$btn.closest(".btn");$btn.button("toLine truncated
})};$.fn.tab.Constructor=Tab;$.fn.tab.noConflict=function(){$.fn.tab=old;return this};$(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(e){e.preventDefault();$(this).tab("show")})}(jQuery);+function($){"use strict";var Affix=function(element,options){this.options=$.extend({},Affix.DEFAULTS,options);this.$window=$(window).on("scroll.bs.affix.data-api",$.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",$.proxy(this.checkPositionWithEventLoop,this));this.$element=$(element);this.affixed=this.unpin=null;this.checkPosition()};Affix.RESET="affix affix-top affix-bottom";Affix.DEFAULTS={offset:0};Affix.prototype.checkPositionWithEventLoop=function(){setTimeout($.proxy(this.checkPosition,this),1)};Affix.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var scrollHeight=$(document).height();var scrollTop=this.$window.scrollTop();var position=this.$element.offset();var offset=this.options.offset;var offsetTop=offset.top;var offsetBottom=offset.bottom;if(typeof offset!="object")offsetBottom=offsetTop=offset;if(typeof offsetTop=="function")offsetTop=offset.top();if(typeof offsetBottom=="function")offsetBottom=offset.bottom();var affix=this.unpin!=null&&scrollTop+this.unpin<=position.top?false:offsetBottom!=null&&position.top+this.$element.height()>=scrollHeight-offsetBottom?"bottom":offsetTop!=null&&scrollTop<=offsetTop?"top":false;if(this.affixed===affix)return;if(this.unpin)this.$element.css("top","");this.affixed=affix;this.unpin=affix=="bottom"?position.top-scrollTop:null;this.$element.removeClass(Affix.RESET).addClass("affix"+(affix?"-"+affix:""));if(affix=="bottom"){this.$element.offset({top:document.body.offsetHeight-offsetBottom-this.$element.height()})}};var old=$.fn.affix;$.fn.affix=function(option){return this.each(function(){var $this=$(this);var data=$this.data("bs.affix");var options=typeof option=="object"&&option;if(!data)$this.data("bs.affix",data=new Affix(this,options));if(typeof option=="string")data[option]()})};$.fn.affix.Constructor=Affix;$.fn.affix.noConflict=function(){$.fn.affix=old;return this};$(window).on("load",function(){$('[data-spy="affix"]').each(function(){var $spy=$(this);var data=$spy.data();data.offset=data.offset||{};if(data.offsetBottom)data.offset.bottom=data.offsetBottom;if(data.offsetTop)data.offset.top=data.offsetTop;$spy.affix(data)})})}(jQuery);var LEA={};var Notebook={cache:{}};var Note={cache:{}};var Tag={};var Notebook={};var Share={};var Mobile={};var LeaAce={};var Converter;var MarkdownEditor;var ScrollLink;var MD;function trimLeft(str,substr){if(!substr||substr==" "){return $.trim(str)}while(str.indexOf(substr)==0){str=str.substring(substr.length)}return str}function json(str){return eval("("+str+")")}function t(){var args=arguments;if(args.length<=1){return args[0]}var text=args[0];if(!text){return text}var pattern="LEAAEL";text=text.replace(/\?/g,pattern);for(var i=1;i<=args.length;++i){text=text.replace(pattern,args[i])}return text}var tt=t;function arrayEqual(a,b){a=a||[];b=b||[];return a.join(",")==b.join(",")}function isArray(obj){return Object.prototype.toString.call(obj)==="[object Array]"}function isEmpty(obj){if(!obj){return true}if(isArray(obj)){if(obj.length==0){return true}}return false}function getFormJsonData(formId){var data=formArrDataToJson($("#"+formId).serializeArray());return data}function formArrDataToJson(arrData){var datas={};var arrObj={};for(var i in arrData){var attr=arrData[i].name;var value=arrData[i].value;if(attr.substring(attr.length-2,attr.length)=="[]"){attr=attr.substring(0,attr.length-2);if(arrObj[attr]==undefined){arrObj[attr]=[value]}else{arrObj[attr].push(value)}continue}datas[attr]=value}return $.extend(datas,arrObj)}function formSerializeDataToJson(formSerializeData){var arr=formSerializeData.split("&");var datas={};var arrObj={};for(var i=0;i<arr.length;++i){var each=arr[i].split("=");var attr=decodeURI(each[0]);var value=decodeURI(each[1]);if(attr.substring(attr.length-2,attr.length)=="[]"){attr=attr.substring(0,attr.length-2);if(arrObj[attr]==undefined){arrObj[attr]=[value]}else{arrObj[attr].push(value)}continue}datas[attr]=value}return $.extend(datas,arrObj)}function _ajaxCallback(ret,successFunc,failureFunc){if(ret===true||ret=="true"||typeof ret=="object"){if(ret&&typeof ret=="object"){if(ret.Msg=="NOTLOGIN"){alert("你还没有登录, 请先登录!");return}}if(typeof successFunc=="function"){successFunc(ret)}}else{if(typeof failureFunc=="function"){failureFunc(ret)}else{alert("error!")}}}function _ajax(type,url,param,successFunc,failureFunc,async){log("-------------------ajax:");log(url);log(param);if(typeof async=="undefined"){async=true}else{async=false}return $.ajax({type:type,url:url,data:param,async:async,success:function(ret){_ajaxCallback(ret,successFunc,failureFunc)},error:function(ret){_ajaxCallback(ret,successFunc,failureFunc)}})}function ajaxGet(url,param,successFunc,failureFunc,async){return _ajax("GET",url,param,successFunc,failuLine truncated
})};$.fn.tab.Constructor=Tab;$.fn.tab.noConflict=function(){$.fn.tab=old;return this};$(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(e){e.preventDefault();$(this).tab("show")})}(jQuery);+function($){"use strict";var Affix=function(element,options){this.options=$.extend({},Affix.DEFAULTS,options);this.$window=$(window).on("scroll.bs.affix.data-api",$.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",$.proxy(this.checkPositionWithEventLoop,this));this.$element=$(element);this.affixed=this.unpin=null;this.checkPosition()};Affix.RESET="affix affix-top affix-bottom";Affix.DEFAULTS={offset:0};Affix.prototype.checkPositionWithEventLoop=function(){setTimeout($.proxy(this.checkPosition,this),1)};Affix.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var scrollHeight=$(document).height();var scrollTop=this.$window.scrollTop();var position=this.$element.offset();var offset=this.options.offset;var offsetTop=offset.top;var offsetBottom=offset.bottom;if(typeof offset!="object")offsetBottom=offsetTop=offset;if(typeof offsetTop=="function")offsetTop=offset.top();if(typeof offsetBottom=="function")offsetBottom=offset.bottom();var affix=this.unpin!=null&&scrollTop+this.unpin<=position.top?false:offsetBottom!=null&&position.top+this.$element.height()>=scrollHeight-offsetBottom?"bottom":offsetTop!=null&&scrollTop<=offsetTop?"top":false;if(this.affixed===affix)return;if(this.unpin)this.$element.css("top","");this.affixed=affix;this.unpin=affix=="bottom"?position.top-scrollTop:null;this.$element.removeClass(Affix.RESET).addClass("affix"+(affix?"-"+affix:""));if(affix=="bottom"){this.$element.offset({top:document.body.offsetHeight-offsetBottom-this.$element.height()})}};var old=$.fn.affix;$.fn.affix=function(option){return this.each(function(){var $this=$(this);var data=$this.data("bs.affix");var options=typeof option=="object"&&option;if(!data)$this.data("bs.affix",data=new Affix(this,options));if(typeof option=="string")data[option]()})};$.fn.affix.Constructor=Affix;$.fn.affix.noConflict=function(){$.fn.affix=old;return this};$(window).on("load",function(){$('[data-spy="affix"]').each(function(){var $spy=$(this);var data=$spy.data();data.offset=data.offset||{};if(data.offsetBottom)data.offset.bottom=data.offsetBottom;if(data.offsetTop)data.offset.top=data.offsetTop;$spy.affix(data)})})}(jQuery);var LEA={};var Notebook={cache:{}};var Note={cache:{}};var Tag={};var Notebook={};var Share={};var Mobile={};var LeaAce={};var Converter;var MarkdownEditor;var ScrollLink;var MD;function trimLeft(str,substr){if(!substr||substr==" "){return $.trim(str)}while(str.indexOf(substr)==0){str=str.substring(substr.length)}return str}function json(str){return eval("("+str+")")}function t(){var args=arguments;if(args.length<=1){return args[0]}var text=args[0];if(!text){return text}var pattern="LEAAEL";text=text.replace(/\?/g,pattern);for(var i=1;i<=args.length;++i){text=text.replace(pattern,args[i])}return text}var tt=t;function arrayEqual(a,b){a=a||[];b=b||[];return a.join(",")==b.join(",")}function isArray(obj){return Object.prototype.toString.call(obj)==="[object Array]"}function isEmpty(obj){if(!obj){return true}if(isArray(obj)){if(obj.length==0){return true}}return false}function getFormJsonData(formId){var data=formArrDataToJson($("#"+formId).serializeArray());return data}function formArrDataToJson(arrData){var datas={};var arrObj={};for(var i in arrData){var attr=arrData[i].name;var value=arrData[i].value;if(attr.substring(attr.length-2,attr.length)=="[]"){attr=attr.substring(0,attr.length-2);if(arrObj[attr]==undefined){arrObj[attr]=[value]}else{arrObj[attr].push(value)}continue}datas[attr]=value}return $.extend(datas,arrObj)}function formSerializeDataToJson(formSerializeData){var arr=formSerializeData.split("&");var datas={};var arrObj={};for(var i=0;i<arr.length;++i){var each=arr[i].split("=");var attr=decodeURI(each[0]);var value=decodeURI(each[1]);if(attr.substring(attr.length-2,attr.length)=="[]"){attr=attr.substring(0,attr.length-2);if(arrObj[attr]==undefined){arrObj[attr]=[value]}else{arrObj[attr].push(value)}continue}datas[attr]=value}return $.extend(datas,arrObj)}function _ajaxCallback(ret,successFunc,failureFunc){if(ret===true||ret=="true"||typeof ret=="object"){if(ret&&typeof ret=="object"){if(ret.Msg=="NOTLOGIN"){alert("你还没有登录, 请先登录!");return}}if(typeof successFunc=="function"){successFunc(ret)}}else{if(typeof failureFunc=="function"){failureFunc(ret)}else{alert("error!")}}}function _ajax(type,url,param,successFunc,failureFunc,async){log("-------------------ajax:");log(url);log(param);if(typeof async=="undefined"){async=true}else{async=false}return $.ajax({type:type,url:url,data:param,async:async,success:function(ret){_ajaxCallback(ret,successFunc,failureFunc)},error:function(ret){_ajaxCallback(ret,successFunc,failureFunc)}})}function ajaxGet(url,param,successFunc,failureFunc,async){return _ajax("GET",url,param,successFunc,failuLine truncated
Note.newNote(notebookId,false,"",true)});$("#notebookNavForNewNote").on("click","li div",function(){var notebookId=$(this).attr("notebookId");if($(this).hasClass("new-note-right")){Note.newNote(notebookId,false,"",true)}else{Note.newNote(notebookId)}});$("#searchNotebookForAdd").click(function(e){e.stopPropagation()});$("#searchNotebookForAdd").keyup(function(){var key=$(this).val();Notebook.searchNotebookForAddNote(key)});$("#searchNotebookForList").keyup(function(){var key=$(this).val();Notebook.searchNotebookForList(key)});$("#searchNoteInput").on("keydown",function(e){var theEvent=e;if(theEvent.keyCode==13||theEvent.keyCode==108){theEvent.preventDefault();Note.searchNote();return false}});$("#contentHistory").click(function(){Note.listNoteContentHistories()});$("#saveBtn").click(function(){Note.curChangedSaveIt(true)});$("#noteItemList").on("click",".item-blog",function(e){e.preventDefault();e.stopPropagation();var noteId=$(this).parent().attr("noteId");window.open("/blog/view/"+noteId)});$("#noteItemList").on("click",".item-my .item-setting",function(e){e.preventDefault();e.stopPropagation();var $p=$(this).parent();Note.contextmenu.showMenu(e,$p)});$(".toolbar-update").click(function(){Note.toggleWriteable()})});Note.startInterval();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 tags=[];Tag.t.children().each(function(){var text=$(this).data("tag");text=Tag.mapCn2En[text]||text;tags.push(text)});return tags};Tag.clearTags=function(){Tag.t.html("")};Tag.renderTags=function(tags){Tag.t.html("");if(isEmpty(tags)){return}for(var i=0;i<tags.length;++i){var tag=tags[i];Tag.appendTag(tag)}};function revertTagStatus(){$("#addTagTrigger").show();$("#addTagInput").hide()}function hideTagList(event){$("#tagDropdown").removeClass("open");if(event){event.stopPropagation()}}function showTagList(event){$("#tagDropdown").addClass("open");if(event){event.stopPropagation()}}Tag.renderReadOnlyTags=function(tags){$("#noteReadTags").html("");if(isEmpty(tags)||tags.length==1&&tags[0]==""){$("#noteReadTags").html(getMsg("noTag"))}var i=true;function getNextDefaultClasses(){if(i){return"label label-default";i=false}else{i=true;return"label label-info"}}for(var i in tags){var text=tags[i];text=Tag.mapEn2Cn[text]||text;var classes=Tag.classes[text];if(!classes){classes=getNextDefaultClasses()}tag=tt('<span class="?">?</span>',classes,text);$("#noteReadTags").append(tag)}};Tag.appendTag=function(tag,save){var isColor=false;var classes,text;if(typeof tag=="object"){classes=tag.classes;text=tag.text;if(!text){return}}else{tag=$.trim(tag);text=tag;if(!text){return}var classes=Tag.classes[text];if(classes){isColor=true}else{classes="label label-default"}}var rawText=text;if(LEA.locale=="zh"){text=Tag.mapEn2Cn[text]||text;rawText=Tag.mapCn2En[rawText]||rawText}tag=tt('<span class="?" data-tag="?">?<i title="'+getMsg("delete")+'">X</i></span>',classes,text,text);var isExists=false;$("#tags").children().each(function(){if(isColor){var tagHtml=$("<div></div>").append($(this).clone()).html();if(tagHtml==tag){$(this).remove();isExists=true}}else if(text+"X"==$(this).text()){$(this).remove();isExists=true}});$("#tags").append(tag);hideTagList();if(!isColor){reRenderTags()}if(save){Note.curNoteIsDirtied();if(!isExists){Note.curChangedSaveIt(true,function(){ajaxPost("/tag/updateTag",{tag:rawText},function(ret){if(reIsOk(ret)){Tag.addTagNav(ret.Item)}})})}}};function reRenderTags(){var defautClasses=["label label-default","label label-info"];var i=0;$("#tags").children().each(function(){var thisClasses=$(this).attr("class");if(thisClasses=="label label-default"||thisClasses=="label label-info"){$(this).removeClass(thisClasses).addClass(defautClasses[i%2]);i++}})}Tag.removeTag=function($target){var tag=$target.data("tag");$target.remove();reRenderTags();if(LEA.locale=="zh"){tag=Tag.mapCn2En[tag]||tag}Note.curChangedSaveIt(true,function(){ajaxPost("/tag/updateTag",{tag:tag},function(ret){if(reIsOk(ret)){Tag.addTagNav(ret.Item)}})})};Tag.tags=[];Tag.renderTagNav=function(tags){var me=this;tags=tags||[];Tag.tags=tags;$("#tagNav").html("");for(var i in tags){var noteTag=tags[i];var tag=noteTag.Tag;var text=tag;if(LEA.locale=="zh"){var text=Tag.mapEn2Cn[tag]||text}var classes=Tag.classes[tag]||"label label-default";$("#tagNav").append(tt('<li data-tag="?"><a> <span class="?">?</span> <span class="tag-delete">X</span></li>',tag,classes,text))}};Tag.addTagNav=function(newTag){var me=this;for(var i in me.tags){var noteTag=me.tags[i];if(noteTag.Tag==newTag.Tag){me.tags.splice(i,1);break}}me.tags.unshift(newTag);me.renderTagNav(me.tags)};$(function(){$("#addTagTrigger").click(functLine truncated
+2 -1
View File
@@ -1 +1,2 @@
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 ?" 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" 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 ?" fromUserId="?" noteId="?">';Note.newItemTpl+=Note.itemIsBlog+'<div class="item-desc" style="right: 0px;"><p class="item-title">?</p><p class="item-text"><i class="fa fa-book"></i> <span class="note-notebook">?</span> <i class="fa fa-clock-o"></i> <span class="updated-time">?</span><br /><span class="desc">?</span></p></div></li>';Note.noteItemListO=$("#noteItemList");Note.cacheByNotebookId={all:{}};Note.notebookIds={};Note.isReadOnly=false;Note.intervalTime=6e5;Note.startInterval=function(){Note.interval=setInterval(function(){log("自动保存开始...");changedNote=Note.curChangedSaveIt(false)},Note.intervalTime)};Note.stopInterval=function(){clearInterval(Note.interval);setTimeout(function(){Note.startInterval()},Note.intervalTime)};Note.addNoteCache=function(note){Note.cache[note.NoteId]=note;Note.clearCacheByNotebookId(note.NotebookId)};Note.setNoteCache=function(content,clear){if(!Note.cache[content.NoteId]){Note.cache[content.NoteId]=content}else{$.extend(Note.cache[content.NoteId],content)}if(clear==undefined){clear=true}if(clear){Note.clearCacheByNotebookId(content.NotebookId)}};Note.getCurNote=function(){var self=this;if(self.curNoteId==""){return null}return self.cache[self.curNoteId]};Note.getNote=function(noteId){var self=this;return self.cache[noteId]};Note.clearCacheByNotebookId=function(notebookId){if(notebookId){Note.cacheByNotebookId[notebookId]={};Note.cacheByNotebookId["all"]={};Note.notebookIds[notebookId]=true}};Note.notebookHasNotes=function(notebookId){var notes=Note.getNotesByNotebookId(notebookId);return!isEmpty(notes)};Note.getNotesByNotebookId=function(notebookId,sortBy,isAsc){if(!sortBy){sortBy="UpdatedTime"}if(isAsc=="undefined"){isAsc=false}if(!notebookId){notebookId="all"}if(!Note.cacheByNotebookId[notebookId]){return[]}if(Note.cacheByNotebookId[notebookId][sortBy]){return Note.cacheByNotebookId[notebookId][sortBy]}else{}var notes=[];var sortBys=[];for(var i in Note.cache){if(!i){continue}var note=Note.cache[i];if(note.IsTrash||note.IsShared){continue}if(notebookId=="all"||note.NotebookId==notebookId){notes.push(note)}}notes.sort(function(a,b){var t1=a[sortBy];var t2=b[sortBy];if(isAsc){if(t1<t2){return-1}else if(t1>t2){return 1}}else{if(t1<t2){return 1}else if(t1>t2){return-1}}return 0});Note.cacheByNotebookId[notebookId][sortBy]=notes;return notes};Note.curNoteIsDirtied=function(){var me=this;var note=me.getCurNote();if(note){note.isDirty=true}};Note.renderNotesAndFirstOneContent=function(ret){if(!isArray(ret)){return}Note.renderNotes(ret);if(!isEmpty(ret[0])){Note.changeNoteForPjax(ret[0].NoteId,true,false)}else{}};Note.curHasChanged=function(force){if(force==undefined){force=true}var cacheNote=Note.cache[Note.curNoteId]||{};var title=$("#noteTitle").val();var tags=Tag.getTags();var contents=getEditorContent(cacheNote.IsMarkdown);var content,preview;var contentText;if(isArray(contents)){content=contents[0];preview=contents[1];contentText=content;if(content&&previewIsEmpty(preview)&&Converter){preview=Converter.makeHtml(content)}if(!content){preview=""}cacheNote.Preview=preview}else{content=contents;try{contentText=$(content).text()}catch(e){}}var hasChanged={hasChanged:false,IsNew:cacheNote.IsNew,IsMarkdown:cacheNote.IsMarkdown,FromUserId:cacheNote.FromUserId,NoteId:cacheNote.NoteId,NotebookId:cacheNote.NotebookId};if(hasChanged.IsNew){$.extend(hasChanged,cacheNote)}else{if(!cacheNote.isDirty){log("no dirty");hasChanged.hasChanged=false;return hasChanged}}if(cacheNote.Title!=title){hasChanged.hasChanged=true;hasChanged.Title=title;if(!hasChanged.Title){}}if(!arrayEqual(cacheNote.Tags,tags)){hasChanged.hasChanged=true;hasChanged.Tags=tags.join(",")}if(force&&cacheNote.Content!=content||!force&&(!cacheNote.IsMarkdown&&$(cacheNote.Content).text()!=contentText||cacheNote.IsMarkdown&&cacheNote.Content!=contentText)){hasChanged.hasChanged=true;hasChanged.Content=content;var c=preview||content;if(!cacheNote.HasSelfDefined||!cacheNote.IsBlog){hasChanged.Desc=Note.genDesc(c);hasChanged.ImgSrc=Note.getImgSrc(c);hasChaLine 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 ?" 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" 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 ?" fromUserId="?" noteId="?">';Note.newItemTpl+=Note.itemIsBlog+'<div class="item-desc" style="right: 0px;"><p class="item-title">?</p><p class="item-text"><i class="fa fa-book"></i> <span class="note-notebook">?</span> <i class="fa fa-clock-o"></i> <span class="updated-time">?</span><br /><span class="desc">?</span></p></div></li>';Note.noteItemListO=$("#noteItemList");Note.cacheByNotebookId={all:{}};Note.notebookIds={};Note.isReadOnly=false;Note.intervalTime=6e5;Note.startInterval=function(){Note.interval=setInterval(function(){log("自动保存开始...");changedNote=Note.curChangedSaveIt(false)},Note.intervalTime)};Note.stopInterval=function(){clearInterval(Note.interval);setTimeout(function(){Note.startInterval()},Note.intervalTime)};Note.addNoteCache=function(note){Note.cache[note.NoteId]=note;Note.clearCacheByNotebookId(note.NotebookId)};Note.setNoteCache=function(content,clear){if(!Note.cache[content.NoteId]){Note.cache[content.NoteId]=content}else{$.extend(Note.cache[content.NoteId],content)}if(clear==undefined){clear=true}if(clear){Note.clearCacheByNotebookId(content.NotebookId)}};Note.getCurNote=function(){var self=this;if(self.curNoteId==""){return null}return self.cache[self.curNoteId]};Note.getNote=function(noteId){var self=this;return self.cache[noteId]};Note.clearCacheByNotebookId=function(notebookId){if(notebookId){Note.cacheByNotebookId[notebookId]={};Note.cacheByNotebookId["all"]={};Note.notebookIds[notebookId]=true}};Note.notebookHasNotes=function(notebookId){var notes=Note.getNotesByNotebookId(notebookId);return!isEmpty(notes)};Note.getNotesByNotebookId=function(notebookId,sortBy,isAsc){if(!sortBy){sortBy="UpdatedTime"}if(isAsc=="undefined"){isAsc=false}if(!notebookId){notebookId="all"}if(!Note.cacheByNotebookId[notebookId]){return[]}if(Note.cacheByNotebookId[notebookId][sortBy]){return Note.cacheByNotebookId[notebookId][sortBy]}else{}var notes=[];var sortBys=[];for(var i in Note.cache){if(!i){continue}var note=Note.cache[i];if(note.IsTrash||note.IsShared){continue}if(notebookId=="all"||note.NotebookId==notebookId){notes.push(note)}}notes.sort(function(a,b){var t1=a[sortBy];var t2=b[sortBy];if(isAsc){if(t1<t2){return-1}else if(t1>t2){return 1}}else{if(t1<t2){return 1}else if(t1>t2){return-1}}return 0});Note.cacheByNotebookId[notebookId][sortBy]=notes;return notes};Note.curNoteIsDirtied=function(){var me=this;var note=me.getCurNote();if(note){note.isDirty=true}};Note.renderNotesAndFirstOneContent=function(ret){if(!isArray(ret)){return}Note.renderNotes(ret);if(!isEmpty(ret[0])){Note.changeNoteForPjax(ret[0].NoteId,true,false)}else{}};Note.curHasChanged=function(force){if(force==undefined){force=true}var cacheNote=Note.cache[Note.curNoteId]||{};var title=$("#noteTitle").val();var tags=Tag.getTags();var contents=getEditorContent(cacheNote.IsMarkdown);var content,preview;var contentText;if(isArray(contents)){content=contents[0];preview=contents[1];contentText=content;if(content&&previewIsEmpty(preview)&&Converter){preview=Converter.makeHtml(content)}if(!content){preview=""}cacheNote.Preview=preview}else{content=contents;try{contentText=$(content).text()}catch(e){}}var hasChanged={hasChanged:false,IsNew:cacheNote.IsNew,IsMarkdown:cacheNote.IsMarkdown,FromUserId:cacheNote.FromUserId,NoteId:cacheNote.NoteId,NotebookId:cacheNote.NotebookId,Version:cacheNote.Version||0};if(hasChanged.IsNew){$.extend(hasChanged,cacheNote)}else{if(!cacheNote.isDirty){log("no dirty");hasChanged.hasChanged=false;return hasChanged}}if(cacheNote.Title!=title){hasChanged.hasChanged=true;hasChanged.Title=title;if(!hasChanged.Title){}}if(!arrayEqual(cacheNote.Tags,tags)){hasChanged.hasChanged=true;hasChanged.Tags=tags.join(",")}if(force&&cacheNote.Content!=content||!force&&(!cacheNote.IsMarkdown&&$(cacheNote.Content).text()!=contentText||cacheNote.IsMarkdown&&cacheNote.Content!=contentText)){hasChanged.hasChanged=true;hasChanged.Content=content;var c=preview||content;if(!cacheNote.HasSelfDefined||!cacheNote.IsBlog){hasChanged.Desc=Note.genDesc(c);hasChanged.ImLine truncated
Note.newNote(notebookId,false,"",true)});$("#notebookNavForNewNote").on("click","li div",function(){var notebookId=$(this).attr("notebookId");if($(this).hasClass("new-note-right")){Note.newNote(notebookId,false,"",true)}else{Note.newNote(notebookId)}});$("#searchNotebookForAdd").click(function(e){e.stopPropagation()});$("#searchNotebookForAdd").keyup(function(){var key=$(this).val();Notebook.searchNotebookForAddNote(key)});$("#searchNotebookForList").keyup(function(){var key=$(this).val();Notebook.searchNotebookForList(key)});$("#searchNoteInput").on("keydown",function(e){var theEvent=e;if(theEvent.keyCode==13||theEvent.keyCode==108){theEvent.preventDefault();Note.searchNote();return false}});$("#contentHistory").click(function(){Note.listNoteContentHistories()});$("#saveBtn").click(function(){Note.curChangedSaveIt(true)});$("#noteItemList").on("click",".item-blog",function(e){e.preventDefault();e.stopPropagation();var noteId=$(this).parent().attr("noteId");window.open("/blog/view/"+noteId)});$("#noteItemList").on("click",".item-my .item-setting",function(e){e.preventDefault();e.stopPropagation();var $p=$(this).parent();Note.contextmenu.showMenu(e,$p)});$(".toolbar-update").click(function(){Note.toggleWriteable()})});Note.startInterval();
+149 -29
View File
@@ -235,7 +235,8 @@ Note.curHasChanged = function(force) {
IsMarkdown: cacheNote.IsMarkdown, // 是否是markdown笔记
FromUserId: cacheNote.FromUserId, // 是否是共享新建的
NoteId: cacheNote.NoteId,
NotebookId: cacheNote.NotebookId
NotebookId: cacheNote.NotebookId,
Version: cacheNote.Version || 0, // 版本控制
};
if(hasChanged.IsNew) {
@@ -401,7 +402,6 @@ Note.curChangedSaveIt = function(force, callback) {
var hasChanged = Note.curHasChanged(force);
// 把已改变的渲染到左边 item-list
if(hasChanged.hasChanged || hasChanged.IsNew) {
// 把已改变的渲染到左边 item-list
Note.renderChangedNote(hasChanged);
@@ -409,7 +409,6 @@ Note.curChangedSaveIt = function(force, callback) {
// 表示有未完成的保存
/*
if(me.saveInProcess[hasChanged.NoteId]) {
log("in process");
me.savePool[hasChanged.NoteId] = hasChanged;
@@ -615,13 +614,13 @@ Note.changeNote = function(selectNoteId, isShare, needSaveChanged, callback) {
if(hasPerm) {
Note.hideReadOnly();
Note.renderNote(cacheNote);
// 这里要切换编辑器
switchEditor(cacheNote.IsMarkdown)
} else {
Note.renderNoteReadOnly(cacheNote);
}
// 这里要切换编辑器
switchEditor(cacheNote.IsMarkdown)
Attach.renderNoteAttachNum(selectNoteId, true);
Note.contentAjaxSeq++;
@@ -634,11 +633,15 @@ Note.changeNote = function(selectNoteId, isShare, needSaveChanged, callback) {
Note.setNoteCache(ret, false);
// 把其它信息也带上
ret = Note.cache[selectNoteId]
Note.renderNoteContent(ret);
/* 都用editable的render
if(hasPerm) {
Note.renderNoteContent(ret);
} else {
Note.renderNoteContentReadOnly(ret);
}
*/
self.hideContentLoading();
callback && callback(ret);
@@ -676,7 +679,7 @@ Note.renderChangedNote = function(changedNote) {
// 找到左侧相应的note
var $leftNoteNav = $(tt('[noteId="?"]', changedNote.NoteId));
if(changedNote.Title) {
$leftNoteNav.find(".item-title").text(changedNote.Title);
$leftNoteNav.find(".item-title").html(changedNote.Title);
}
if(changedNote.Desc) {
$leftNoteNav.find(".desc").html(changedNote.Desc);
@@ -728,8 +731,6 @@ Note.clearAll = function() {
Note.clearNoteList();
}
// render到编辑器
// render note
Note.renderNote = function(note) {
if(!note) {
return;
@@ -747,7 +748,10 @@ Note.renderNote = function(note) {
// render content
Note.renderNoteContent = function(content) {
setEditorContent(content.Content, content.IsMarkdown, content.Preview);
setEditorContent(content.Content, content.IsMarkdown, content.Preview, function() {
Note.curNoteId = content.NoteId;
Note.toggleReadOnly();
});
// 只有在renderNoteContent时才设置curNoteId
Note.curNoteId = content.NoteId;
}
@@ -844,7 +848,6 @@ Note.renderNotes = function(notes, forNewNote, isShared) {
})(i), i*2000);
}
}
Note._renderNotes = function(notes, forNewNote, isShared, tang) { // 第几趟
var baseClasses = "item-my";
if(isShared) {
@@ -861,9 +864,9 @@ Note._renderNotes = function(notes, forNewNote, isShared, tang) { // 第几趟
var tmp;
note.Title = trimTitle(note.Title);
if(note.ImgSrc) {
tmp = tt(Note.itemTpl, classes, note.NoteId, note.ImgSrc, toHtmlEntity(note.Title), Notebook.getNotebookTitle(note.NotebookId), goNowToDatetime(note.UpdatedTime), note.Desc);
tmp = tt(Note.itemTpl, classes, note.NoteId, note.ImgSrc, note.Title, Notebook.getNotebookTitle(note.NotebookId), goNowToDatetime(note.UpdatedTime), note.Desc);
} else {
tmp = tt(Note.itemTplNoImg, classes, note.NoteId, toHtmlEntity(note.Title), Notebook.getNotebookTitle(note.NotebookId), goNowToDatetime(note.UpdatedTime), note.Desc);
tmp = tt(Note.itemTplNoImg, classes, note.NoteId, note.Title, Notebook.getNotebookTitle(note.NotebookId), goNowToDatetime(note.UpdatedTime), note.Desc);
}
if(!note.IsBlog) {
tmp = $(tmp);
@@ -921,12 +924,12 @@ Note.newNote = function(notebookId, isShare, fromUserId, isMarkdown) {
}
var notebook = Notebook.getNotebook(notebookId);
var notebookTitle = notebook ? toHtmlEntity(notebook.Title) : "";
var notebookTitle = notebook ? notebook.Title : "";
var curDate = getCurDate();
if(isShare) {
newItem = tt(Note.newItemTpl, baseClasses, fromUserId, note.NoteId, toHtmlEntity(note.Title), notebookTitle, curDate, "");
newItem = tt(Note.newItemTpl, baseClasses, fromUserId, note.NoteId, note.Title, notebookTitle, curDate, "");
} else {
newItem = tt(Note.newItemTpl, baseClasses, "", note.NoteId, toHtmlEntity(note.Title), notebookTitle, curDate, "");
newItem = tt(Note.newItemTpl, baseClasses, "", note.NoteId, note.Title, notebookTitle, curDate, "");
}
// notebook是否是Blog
@@ -965,6 +968,9 @@ Note.newNote = function(notebookId, isShare, fromUserId, isMarkdown) {
// 更新数量
Notebook.incrNotebookNumberNotes(notebookId)
// 切换到写模式
Note.toggleWriteable();
}
// 保存note ctrl + s
@@ -1093,7 +1099,8 @@ Note.listNoteContentHistories = function() {
for (i in re) {
var content = re[i]
content.Ab = Note.genAbstract(content.Content, 200);
str += tt('<tr><td seq="?">#?<? class="each-content">?</?> <div class="btns">' + getMsg("datetime") + ': <span class="label label-default">?</span> <button class="btn btn-default all">' + getMsg("unfold") + '</button> <button class="btn btn-primary back">' + getMsg('restoreFromThisVersion') + '</button></div></td></tr>', i, (+i+1), s, content.Ab, s, goNowToDatetime(content.UpdatedTime))
// 为什么不用tt(), 因为content可能含??
str += '<tr><td seq="' + i + '">#' + (i+1) +'<' + s + ' class="each-content">' + content.Ab + '</' + s + '> <div class="btns">' + getMsg("datetime") + ': <span class="label label-default">' + goNowToDatetime(content.UpdatedTime) + '</span> <button class="btn btn-default all">' + getMsg("unfold") + '</button> <button class="btn btn-primary back">' + getMsg('restoreFromThisVersion') + '</button></div></td></tr>';
}
str += "</table></div>";
$content.html(str);
@@ -1134,8 +1141,28 @@ Note.listNoteContentHistories = function() {
// 导出成PDF
Note.exportPDF = function(target) {
var noteId = $(target).attr("noteId");
ajaxGet("/note/exportPdf", {noteId: noteId}, function(ret) {
/*
{
"Ok": true,
"Code": 0,
"Msg": "",
"Id": "upload/5368c1aa99c37b029d000001/images/weibo/我靠, 这是什么??.pdf",
"List": null,
"Item": null
}
*/
$('<form target="mdImageManager" action="/note/exportPdf" method="GET"><input name="noteId" value="' + noteId + '"/></form>').appendTo('body').submit().remove();
// $.get("/note/exportPdf?noteId=" + noteId);
// window.open("/note/exportPdf?noteId=" + noteId);
/*
ajaxGet(", {noteId: noteId}, function(ret) {
if(reIsOk(ret)) {
window.open(UrlPrefix + '/pubic/' + ret.Id);
} else {
alert('error!');
}
});
*/
};
// 长微博
@@ -1181,16 +1208,19 @@ Note.html2Image = function(target) {
Note.showReadOnly = function() {
Note.isReadOnly = true;
$("#noteRead").show();
// $("#noteRead").show();
$('#note').addClass('read-only');
}
Note.hideReadOnly = function() {
Note.isReadOnly = false;
$('#note').removeClass('read-only');
$("#noteRead").hide();
}
// read only
Note.renderNoteReadOnly = function(note) {
Note.showReadOnly();
$("#noteReadTitle").text(note.Title);
$("#noteReadTitle").html(note.Title || getMsg("unTitled"));
Tag.renderReadOnlyTags(note.Tags);
@@ -1198,11 +1228,6 @@ Note.renderNoteReadOnly = function(note) {
$("#noteReadUpdatedTime").html(goNowToDatetime(note.UpdatedTime));
}
Note.renderNoteContentReadOnly = function(note) {
if(note.IsMarkdown) {
$("#noteReadContent").html('<pre id="readOnlyMarkdown">' + note.Content + "</pre>");
} else {
$("#noteReadContent").html(note.Content);
}
}
//---------------------------
@@ -1436,6 +1461,91 @@ Note.deleteNoteTag = function(item, tag) {
}
};
// readonly
Note.readOnly = true;
// 切换只读模式
Note.toggleReadOnly = function() {
if(LEA.em && LEA.em.isWriting()) {
return Note.toggleWriteable();
}
var me = this;
var note = me.getCurNote();
// console.log('(((((((((((((((((((((((');
// tinymce
var $editor = $('#editor');
$editor.addClass('read-only').removeClass('all-tool'); // 不要全部的
// 不可写
$('#editorContent').attr('contenteditable', false);
// markdown
$('#mdEditor').addClass('read-only');
if(!note) {
return;
}
if(note.IsMarkdown) {
$('#mdInfoToolbar .created-time').html(goNowToDatetime(note.CreatedTime));
$('#mdInfoToolbar .updated-time').html(goNowToDatetime(note.UpdatedTime));
}
else {
$('#infoToolbar .created-time').html(goNowToDatetime(note.CreatedTime));
$('#infoToolbar .updated-time').html(goNowToDatetime(note.UpdatedTime));
}
if(note.readOnly) {
return;
}
if(!note.IsMarkdown) {
// 里面的pre也设为不可写
$('#editorContent pre').each(function() {
LeaAce.setAceReadOnly($(this), true);
});
}
note.readOnly = true;
Note.readOnly = true;
};
// 切换到编辑模式
Note.toggleWriteable = function() {
var me = this;
// $('#infoToolbar').hide();
$('#editor').removeClass('read-only');
$('#editorContent').attr('contenteditable', true);
// markdown
$('#mdEditor').removeClass('read-only');
var note = me.getCurNote();
if(!note) {
return;
}
if(!note.readOnly) {
return;
}
if(!note.IsMarkdown) {
// 里面的pre也设为不可写
$('#editorContent pre').each(function() {
LeaAce.setAceReadOnly($(this), false);
});
}
else {
if(MD) {
MD.onResize();
}
}
note.readOnly = false;
Note.readOnly = false;
};
// 这里速度不慢, 很快
Note.getContextNotebooks = function(notebooks) {
var moves = [];
@@ -1490,9 +1600,9 @@ Note.initContextmenu = function() {
{ type: "splitLine" },
{ text: getMsg("publicAsBlog"), alias: 'set2Blog', faIcon: "fa-bold", action: Note.setNote2Blog },
{ text: getMsg("cancelPublic"), alias: 'unset2Blog', faIcon: "fa-undo", action: Note.setNote2Blog },
// { type: "splitLine" },
{ type: "splitLine" },
// { text: "分享到社区", alias: 'html2Image', icon: "", action: Note.html2Image},
// { text: "导出PDF", alias: 'exportPDF', icon: "", action: Note.exportPDF},
{ text: getMsg("exportPdf"), alias: 'exportPDF', icon: "", action: Note.exportPDF},
{ type: "splitLine" },
{ text: getMsg("delete"), icon: "", faIcon: "fa-trash-o", action: Note.deleteNote },
{ text: getMsg("move"), alias: "move", faIcon: "fa-arrow-right",
@@ -1575,6 +1685,7 @@ var Attach = {
var self = this;
// 显示attachs
$("#showAttach").click(function() {
// self._bookmark = tinymce.activeEditor.selection.getBookmark();
self.renderAttachs(Note.curNoteId);
});
// 防止点击隐藏
@@ -1620,6 +1731,7 @@ var Attach = {
if(LEA.isMarkdownEditor() && MD) {
MD.insertLink(src, attach.Title);
} else {
// tinymce.activeEditor.selection.moveToBookmark(self._bookmark);
tinymce.activeEditor.insertContent('<a target="_blank" href="' + src + '">' + attach.Title + '</a>');
}
});
@@ -1686,7 +1798,7 @@ var Attach = {
for(var i = 0; i < attachNum; ++i) {
var each = attachs[i];
html += '<li class="clearfix" data-id="' + each.AttachId + '">' +
'<div class="attach-title">' + toHtmlEntity(each.Title) + '</div>' +
'<div class="attach-title">' + each.Title + '</div>' +
'<div class="attach-process"> ' +
' <button class="btn btn-sm btn-warning delete-attach" data-loading-text="..."><i class="fa fa-trash-o"></i></button> ' +
' <button type="button" class="btn btn-sm btn-primary download-attach"><i class="fa fa-download"></i></button> ' +
@@ -1707,8 +1819,10 @@ var Attach = {
// 渲染noteId的附件
// 当点击"附件"时加载,
// TODO 判断是否已loaded
_bookmark: null,
renderAttachs: function(noteId) {
var self = this;
if(self.loadedNoteAttachs[noteId]) {
self._renderAttachs(self.loadedNoteAttachs[noteId]);
return;
@@ -1794,7 +1908,7 @@ $(function() {
});
// 当前笔记可以已修改
$('#editorContent, #wmd-input, #noteTitle').keyup(function() {
$('#editorContent, #wmd-input, #noteTitle').on('keyup input', function() {
Note.curNoteIsDirtied();
});
/*
@@ -1880,6 +1994,12 @@ $(function() {
var $p = $(this).parent();
Note.contextmenu.showMenu(e, $p);
});
// readony
// 修改
$('.toolbar-update').click(function() {
Note.toggleWriteable();
});
});
// 定时器启动
+1 -1
View File
@@ -1 +1 @@
Notebook.curNotebookId="";Notebook.cache={};Notebook.notebooks=[];Notebook.notebookNavForListNote="";Notebook.notebookNavForNewNote="";Notebook.setCache=function(notebook){var notebookId=notebook.NotebookId;if(!notebookId){return}if(!Notebook.cache[notebookId]){Notebook.cache[notebookId]={}}$.extend(Notebook.cache[notebookId],notebook)};Notebook.getCurNotebookId=function(){return Notebook.curNotebookId};Notebook.getCurNotebook=function(){return Notebook.cache[Notebook.curNotebookId]};Notebook._updateNotebookNumberNotes=function(notebookId,n){var self=this;var notebook=self.getNotebook(notebookId);if(!notebook){return}notebook.NumberNotes+=n;if(notebook.NumberNotes<0){notebook.NumberNotes=0}$("#numberNotes_"+notebookId).html(notebook.NumberNotes)};Notebook.incrNotebookNumberNotes=function(notebookId){var self=this;self._updateNotebookNumberNotes(notebookId,1)};Notebook.minusNotebookNumberNotes=function(notebookId){var self=this;self._updateNotebookNumberNotes(notebookId,-1)};Notebook.getNotebook=function(notebookId){return Notebook.cache[notebookId]};Notebook.getNotebookTitle=function(notebookId){var notebook=Notebook.cache[notebookId];if(notebook){return toHtmlEntity(notebook.Title)}else{return"未知"}};Notebook.getTreeSetting=function(isSearch,isShare){var noSearch=!isSearch;var self=this;function addDiyDom(treeId,treeNode){var spaceWidth=5;var switchObj=$("#"+treeId+" #"+treeNode.tId+"_switch"),icoObj=$("#"+treeId+" #"+treeNode.tId+"_ico");switchObj.remove();icoObj.before(switchObj);if(!isShare){if(!Notebook.isAllNotebookId(treeNode.NotebookId)&&!Notebook.isTrashNotebookId(treeNode.NotebookId)){icoObj.after($('<span class="notebook-number-notes" id="numberNotes_'+treeNode.NotebookId+'">'+(treeNode.NumberNotes||0)+"</span>"));icoObj.after($('<span class="fa notebook-setting" title="setting"></span>'))}}else{if(!Share.isDefaultNotebookId(treeNode.NotebookId)){icoObj.after($('<span class="fa notebook-setting" title="setting"></span>'))}}if(treeNode.level>1){var spaceStr="<span style='display: inline-block;width:"+spaceWidth*treeNode.level+"px'></span>";switchObj.before(spaceStr)}}function beforeDrag(treeId,treeNodes){for(var i=0,l=treeNodes.length;i<l;i++){if(treeNodes[i].drag===false){return false}}return true}function beforeDrop(treeId,treeNodes,targetNode,moveType){return targetNode?targetNode.drop!==false:true}function onDrop(e,treeId,treeNodes,targetNode,moveType){var treeNode=treeNodes[0];if(!targetNode){return}var parentNode;var treeObj=self.tree;var ajaxData={curNotebookId:treeNode.NotebookId};if(moveType=="inner"){parentNode=targetNode}else{parentNode=targetNode.getParentNode()}if(!parentNode){var nodes=treeObj.getNodes()}else{ajaxData.parentNotebookId=parentNode.NotebookId;var nextLevel=parentNode.level+1;function filter(node){return node.level==nextLevel}var nodes=treeObj.getNodesByFilter(filter,false,parentNode)}ajaxData.siblings=[];for(var i in nodes){var notebookId=nodes[i].NotebookId;if(!Notebook.isAllNotebookId(notebookId)&&!Notebook.isTrashNotebookId(notebookId)){ajaxData.siblings.push(notebookId)}}ajaxPost("/notebook/dragNotebooks",{data:JSON.stringify(ajaxData)});setTimeout(function(){Notebook.changeNav()},100)}if(!isShare){var onClick=function(e,treeId,treeNode){var notebookId=treeNode.NotebookId;Notebook.changeNotebook(notebookId)};var onDblClick=function(e){var notebookId=$(e.target).attr("notebookId");if(!Notebook.isAllNotebookId(notebookId)&&!Notebook.isTrashNotebookId(notebookId)){self.updateNotebookTitle(e.target)}}}else{var onClick=function(e,treeId,treeNode){var notebookId=treeNode.NotebookId;var fromUserId=$(e.target).closest(".friend-notebooks").attr("fromUserId");Share.changeNotebook(fromUserId,notebookId)};var onDblClick=null}var setting={view:{showLine:false,showIcon:false,selectedMulti:false,dblClickExpand:false,addDiyDom:addDiyDom},data:{key:{name:"Title",children:"Subs"}},edit:{enable:true,showRemoveBtn:false,showRenameBtn:false,drag:{isMove:noSearch,prev:noSearch,inner:noSearch,next:noSearch}},callback:{beforeDrag:beforeDrag,beforeDrop:beforeDrop,onDrop:onDrop,onClick:onClick,onDblClick:onDblClick,beforeRename:function(treeId,treeNode,newName,isCancel){if(newName==""){if(treeNode.IsNew){self.tree.removeNode(treeNode);return true}return false}if(treeNode.Title==newName){return true}if(treeNode.IsNew){var parentNode=treeNode.getParentNode();var parentNotebookId=parentNode?parentNode.NotebookId:"";self.doAddNotebook(treeNode.NotebookId,newName,parentNotebookId)}else{self.doUpdateNotebookTitle(treeNode.NotebookId,newName)}return true}}};if(isSearch){}return setting};Notebook.allNotebookId="0";Notebook.trashNotebookId="-1";Notebook.curNotebookIsTrashOrAll=function(){return Notebook.curNotebookId==Notebook.trashNotebookId||Notebook.curNotebookId==Notebook.allNotebookId};Notebook.renderNotebooks=function(notebooks){var self=this;if(!notebooks||typeof notebooks!="object"||notebooks.length<0){notebooks=[]}for(var i=0,len=notebooks.length;i<len;++i){var notebook=notebooks[i];noteLine truncated
Notebook.curNotebookId="";Notebook.cache={};Notebook.notebooks=[];Notebook.notebookNavForListNote="";Notebook.notebookNavForNewNote="";Notebook.setCache=function(notebook){var notebookId=notebook.NotebookId;if(!notebookId){return}if(!Notebook.cache[notebookId]){Notebook.cache[notebookId]={}}$.extend(Notebook.cache[notebookId],notebook)};Notebook.getCurNotebookId=function(){return Notebook.curNotebookId};Notebook.getCurNotebook=function(){return Notebook.cache[Notebook.curNotebookId]};Notebook._updateNotebookNumberNotes=function(notebookId,n){var self=this;var notebook=self.getNotebook(notebookId);if(!notebook){return}notebook.NumberNotes+=n;if(notebook.NumberNotes<0){notebook.NumberNotes=0}$("#numberNotes_"+notebookId).html(notebook.NumberNotes)};Notebook.incrNotebookNumberNotes=function(notebookId){var self=this;self._updateNotebookNumberNotes(notebookId,1)};Notebook.minusNotebookNumberNotes=function(notebookId){var self=this;self._updateNotebookNumberNotes(notebookId,-1)};Notebook.getNotebook=function(notebookId){return Notebook.cache[notebookId]};Notebook.getNotebookTitle=function(notebookId){var notebook=Notebook.cache[notebookId];if(notebook){return notebook.Title}else{return"未知"}};Notebook.getTreeSetting=function(isSearch,isShare){var noSearch=!isSearch;var self=this;function addDiyDom(treeId,treeNode){var spaceWidth=5;var switchObj=$("#"+treeId+" #"+treeNode.tId+"_switch"),icoObj=$("#"+treeId+" #"+treeNode.tId+"_ico");switchObj.remove();icoObj.before(switchObj);if(!isShare){if(!Notebook.isAllNotebookId(treeNode.NotebookId)&&!Notebook.isTrashNotebookId(treeNode.NotebookId)){icoObj.after($('<span class="notebook-number-notes" id="numberNotes_'+treeNode.NotebookId+'">'+(treeNode.NumberNotes||0)+"</span>"));icoObj.after($('<span class="fa notebook-setting" title="setting"></span>'))}}else{if(!Share.isDefaultNotebookId(treeNode.NotebookId)){icoObj.after($('<span class="fa notebook-setting" title="setting"></span>'))}}if(treeNode.level>1){var spaceStr="<span style='display: inline-block;width:"+spaceWidth*treeNode.level+"px'></span>";switchObj.before(spaceStr)}}function beforeDrag(treeId,treeNodes){for(var i=0,l=treeNodes.length;i<l;i++){if(treeNodes[i].drag===false){return false}}return true}function beforeDrop(treeId,treeNodes,targetNode,moveType){return targetNode?targetNode.drop!==false:true}function onDrop(e,treeId,treeNodes,targetNode,moveType){var treeNode=treeNodes[0];if(!targetNode){return}var parentNode;var treeObj=self.tree;var ajaxData={curNotebookId:treeNode.NotebookId};if(moveType=="inner"){parentNode=targetNode}else{parentNode=targetNode.getParentNode()}if(!parentNode){var nodes=treeObj.getNodes()}else{ajaxData.parentNotebookId=parentNode.NotebookId;var nextLevel=parentNode.level+1;function filter(node){return node.level==nextLevel}var nodes=treeObj.getNodesByFilter(filter,false,parentNode)}ajaxData.siblings=[];for(var i in nodes){var notebookId=nodes[i].NotebookId;if(!Notebook.isAllNotebookId(notebookId)&&!Notebook.isTrashNotebookId(notebookId)){ajaxData.siblings.push(notebookId)}}ajaxPost("/notebook/dragNotebooks",{data:JSON.stringify(ajaxData)});setTimeout(function(){Notebook.changeNav()},100)}if(!isShare){var onClick=function(e,treeId,treeNode){var notebookId=treeNode.NotebookId;Notebook.changeNotebook(notebookId)};var onDblClick=function(e){var notebookId=$(e.target).attr("notebookId");if(!Notebook.isAllNotebookId(notebookId)&&!Notebook.isTrashNotebookId(notebookId)){self.updateNotebookTitle(e.target)}}}else{var onClick=function(e,treeId,treeNode){var notebookId=treeNode.NotebookId;var fromUserId=$(e.target).closest(".friend-notebooks").attr("fromUserId");Share.changeNotebook(fromUserId,notebookId)};var onDblClick=null}var setting={view:{showLine:false,showIcon:false,selectedMulti:false,dblClickExpand:false,addDiyDom:addDiyDom},data:{key:{name:"Title",children:"Subs"}},edit:{enable:true,showRemoveBtn:false,showRenameBtn:false,drag:{isMove:noSearch,prev:noSearch,inner:noSearch,next:noSearch}},callback:{beforeDrag:beforeDrag,beforeDrop:beforeDrop,onDrop:onDrop,onClick:onClick,onDblClick:onDblClick,beforeRename:function(treeId,treeNode,newName,isCancel){if(newName==""){if(treeNode.IsNew){self.tree.removeNode(treeNode);return true}return false}if(treeNode.Title==newName){return true}if(treeNode.IsNew){var parentNode=treeNode.getParentNode();var parentNotebookId=parentNode?parentNode.NotebookId:"";self.doAddNotebook(treeNode.NotebookId,newName,parentNotebookId)}else{self.doUpdateNotebookTitle(treeNode.NotebookId,newName)}return true}}};if(isSearch){}return setting};Notebook.allNotebookId="0";Notebook.trashNotebookId="-1";Notebook.curNotebookIsTrashOrAll=function(){return Notebook.curNotebookId==Notebook.trashNotebookId||Notebook.curNotebookId==Notebook.allNotebookId};Notebook.renderNotebooks=function(notebooks){var self=this;if(!notebooks||typeof notebooks!="object"||notebooks.length<0){notebooks=[]}for(var i=0,len=notebooks.length;i<len;++i){var notebook=notebooks[i];notebook.Title=triLine truncated
+6 -7
View File
@@ -58,7 +58,7 @@ Notebook.getNotebook = function(notebookId) {
Notebook.getNotebookTitle = function(notebookId) {
var notebook = Notebook.cache[notebookId];
if(notebook) {
return toHtmlEntity(notebook.Title);
return notebook.Title;
} else {
return "未知";
}
@@ -409,7 +409,7 @@ Notebook.getChangedNotebooks = function(notebooks) {
if(!isEmpty(notebook.Subs)) {
classes = "dropdown-submenu";
}
var eachForNew = tt('<li role="presentation" class="clearfix ?"><div class="new-note-left pull-left" title="为该笔记本新建笔记" href="#" notebookId="?">?</div><div title="为该笔记本新建markdown笔记" class="new-note-right pull-left" notebookId="?">M</div>', classes, notebook.NotebookId, toHtmlEntity(notebook.Title), notebook.NotebookId);
var eachForNew = tt('<li role="presentation" class="clearfix ?"><div class="new-note-left pull-left" title="为该笔记本新建笔记" href="#" notebookId="?">?</div><div title="为该笔记本新建markdown笔记" class="new-note-right pull-left" notebookId="?">M</div>', classes, notebook.NotebookId, notebook.Title, notebook.NotebookId);
if(!isEmpty(notebook.Subs)) {
eachForNew += "<ul class='dropdown-menu'>";
@@ -487,12 +487,12 @@ Notebook.renderShareNotebooks = function(sharedUserInfos, shareNotebooks) {
userNotebooks.ShareNotebooks = [{NotebookId: "-2", Title: "默认共享"}].concat(userNotebooks.ShareNotebooks)
var username = toHtmlEntity(userInfo.Username || userInfo.Email);
var username = userInfo.Username || userInfo.Email;
var header = tt('<div class="folderNote closed"><div class="folderHeader"><a><h1 title="? 的共享"><i class="fa fa-angle-right"></i>?</h1></a></div>', username, username);
var body = '<ul class="folderBody">';
for(var j in userNotebooks.ShareNotebooks) {
var notebook = userNotebooks.ShareNotebooks[j];
body += tt('<li><a notebookId="?">?</a></li>', notebook.NotebookId, toHtmlEntity(notebook.Title))
body += tt('<li><a notebookId="?">?</a></li>', notebook.NotebookId, notebook.Title)
}
body += "</ul>";
@@ -521,7 +521,7 @@ Notebook.changeNotebookNavForNewNote = function(notebookId, title) {
}
if(!Notebook.isAllNotebookId(notebookId) && !Notebook.isTrashNotebookId(notebookId)) {
$("#curNotebookForNewNote").text(title).attr("notebookId", notebookId);
$("#curNotebookForNewNote").html(title).attr("notebookId", notebookId);
} else if(!$("#curNotebookForNewNote").attr("notebookId")) {
// 但又没有一个笔记, 默认选第一个吧
// 这里很可能会死循环, 万一用户没有其它笔记呢?
@@ -565,7 +565,7 @@ Notebook.changeNotebookNav = function(notebookId) {
}
// 2
$("#curNotebookForListNote").text(notebook.Title);
$("#curNotebookForListNote").html(notebook.Title);
// 3
Notebook.changeNotebookNavForNewNote(notebookId, notebook.Title);
@@ -644,7 +644,6 @@ Notebook.changeNotebook = function(notebookId, callback) {
// 这里可以缓存起来, note按notebookId缓存
// 这里可能点击过快导致前面点击的后来才返回
me.showNoteAndEditorLoading();
me.changeNotebookSeq++;
(function(seq) {
ajaxGet(url, param, function(cacheNotes) {
+1 -1
View File
@@ -1 +1 @@
function editorMode(){this.writingHash="writing";this.normalHash="normal";this.isWritingMode=location.hash.indexOf(this.writingHash)>=0;this.toggleA=null}editorMode.prototype.toggleAText=function(isWriting){var self=this;setTimeout(function(){var toggleA=$(".toggle-editor-mode a");var toggleSpan=$(".toggle-editor-mode span");if(isWriting){toggleA.attr("href","#"+self.normalHash);toggleSpan.text(getMsg("normalMode"))}else{toggleA.attr("href","#"+self.writingHash);toggleSpan.text(getMsg("writingMode"))}},0)};editorMode.prototype.isWriting=function(hash){return hash.indexOf(this.writingHash)>=0};editorMode.prototype.init=function(){this.changeMode(this.isWritingMode);var self=this;$(".toggle-editor-mode").click(function(e){e.preventDefault();saveBookmark();var $a=$(this).find("a");var isWriting=self.isWriting($a.attr("href"));self.changeMode(isWriting);if(isWriting){setHash("m",self.writingHash)}else{setHash("m",self.normalHash)}restoreBookmark()})};editorMode.prototype.changeMode=function(isWritingMode){this.toggleAText(isWritingMode);if(isWritingMode){this.writtingMode()}else{this.normalMode()}$("#moreBtn i").removeClass("fa-angle-up").addClass("fa-angle-down")};editorMode.prototype.resizeEditor=function(){setTimeout(function(){resizeEditor()},10);setTimeout(function(){resizeEditor()},20);setTimeout(function(){resizeEditor()},500)};editorMode.prototype.normalMode=function(){var $c=$("#editorContent_ifr").contents();$c.contents().find("#writtingMode").remove();$c.contents().find('link[href$="editor-writting-mode.css"]').remove();$("#noteItemListWrap, #notesAndSort").show();$("#noteList").unbind("mouseenter").unbind("mouseleave");var theme=UserInfo.Theme||"default";theme+=".css";$("#themeLink").attr("href","/css/theme/"+theme);$("#mceToolbar").css("height","30px");this.resizeEditor();$("#noteList").width(UserInfo.NoteListWidth);$("#note").css("left",UserInfo.NoteListWidth)};editorMode.prototype.writtingMode=function(){$("#themeLink").attr("href","/css/theme/writting-overwrite.css");setTimeout(function(){var $c=$("#editorContent_ifr").contents();$c.contents().find("head").append('<link type="text/css" rel="stylesheet" href="/css/editor/editor-writting-mode.css" id="writtingMode">')},0);$("#noteItemListWrap, #notesAndSort").fadeOut();$("#noteList").hover(function(){$("#noteItemListWrap, #notesAndSort").fadeIn()},function(){$("#noteItemListWrap, #notesAndSort").fadeOut()});$("#mceToolbar").css("height","40px");this.resizeEditor();$("#noteList").width(250);$("#note").css("left",0)};editorMode.prototype.getWritingCss=function(){if(this.isWritingMode){return["/css/editor/editor-writting-mode.css"]}return[]};var em=new editorMode;var Resize={lineMove:false,mdLineMove:false,target:null,leftNotebook:$("#leftNotebook"),notebookSplitter:$("#notebookSplitter"),noteList:$("#noteList"),noteAndEditor:$("#noteAndEditor"),noteSplitter:$("#noteSplitter"),note:$("#note"),body:$("body"),leftColumn:$("#left-column"),rightColumn:$("#right-column"),mdSplitter:$("#mdSplitter2"),init:function(){var self=this;self.initEvent()},initEvent:function(){var self=this;$(".noteSplit").bind("mousedown",function(event){event.preventDefault();self.lineMove=true;$(this).css("background-color","#ccc");self.target=$(this).attr("id");$("#noteMask").css("z-index",99999)});self.mdSplitter.bind("mousedown",function(event){event.preventDefault();if($(this).hasClass("open")){self.mdLineMove=true}});self.body.bind("mousemove",function(event){if(self.lineMove){event.preventDefault();self.resize3Columns(event)}else if(self.mdLineMove){event.preventDefault();self.resizeMdColumns(event)}});self.body.bind("mouseup",function(event){self.stopResize();$("#noteMask").css("z-index",-1)});var everLeftWidth;$(".layout-toggler-preview").click(function(){var $t=$(this);var $p=self.leftColumn.parent();if($t.hasClass("open")){var totalWidth=$p.width();var minRightWidth=22;var leftWidth=totalWidth-minRightWidth;everLeftWidth=self.leftColumn.width();self.leftColumn.width(leftWidth);self.rightColumn.css("left","auto").width(minRightWidth);$t.removeClass("open");self.rightColumn.find(".layout-resizer").removeClass("open");$(".preview-container").hide()}else{$t.addClass("open");self.rightColumn.find(".layout-resizer").addClass("open");self.leftColumn.width(everLeftWidth);$(".preview-container").show();self.rightColumn.css("left",everLeftWidth).width("auto");if(MD){MD.onResize()}}})},stopResize:function(){var self=this;if(self.lineMove||self.mdLineMove){ajaxGet("/user/updateColumnWidth",{mdEditorWidth:UserInfo.MdEditorWidth,notebookWidth:UserInfo.NotebookWidth,noteListWidth:UserInfo.NoteListWidth},function(){})}self.lineMove=false;self.mdLineMove=false;$(".noteSplit").css("background","none");self.mdSplitter.css("background","none")},set3ColumnsWidth:function(notebookWidth,noteListWidth){var self=this;if(notebookWidth<150||noteListWidth<100){return}var noteWidth=self.body.width()-notebookWidth-noteListWidth;if(noteWidth<400){return}self.leftNotebook.width(notebookWidth);self.nLine truncated
function editorMode(){this.writingHash="writing";this.normalHash="normal";this.isWritingMode=location.hash.indexOf(this.writingHash)>=0;this.toggleA=null}editorMode.prototype.toggleAText=function(isWriting){var self=this;setTimeout(function(){var toggleA=$(".toggle-editor-mode a");var toggleSpan=$(".toggle-editor-mode span");if(isWriting){toggleA.attr("href","#"+self.normalHash);toggleSpan.text(getMsg("normalMode"))}else{toggleA.attr("href","#"+self.writingHash);toggleSpan.text(getMsg("writingMode"))}},0)};editorMode.prototype.isWriting=function(hash){if(!hash){hash=location.hash}return hash.indexOf(this.writingHash)>=0};editorMode.prototype.init=function(){this.$themeLink=$("#themeLink");this.changeMode(this.isWritingMode);var self=this;$(".toggle-editor-mode").click(function(e){e.preventDefault();saveBookmark();var $a=$(this).find("a");var isWriting=self.isWriting($a.attr("href"));self.changeMode(isWriting);if(isWriting){setHash("m",self.writingHash)}else{setHash("m",self.normalHash)}restoreBookmark()})};editorMode.prototype.changeMode=function(isWritingMode){this.toggleAText(isWritingMode);if(isWritingMode){this.writtingMode()}else{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 theme=UserInfo.Theme||"default";theme+=".css";var $themeLink=$("#themeLink");if(this.$themeLink.attr("href").indexOf("writting-overwrite.css")!=-1){this.$themeLink.attr("href","/css/theme/"+theme)}$("#noteList").width(UserInfo.NoteListWidth);$("#note").css("left",UserInfo.NoteListWidth)};editorMode.prototype.writtingMode=function(){if(this.$themeLink.attr("href").indexOf("writting-overwrite.css")==-1){this.$themeLink.attr("href","/css/theme/writting-overwrite.css")}$("#noteItemListWrap, #notesAndSort").fadeOut();$("#noteList").hover(function(){$("#noteItemListWrap, #notesAndSort").fadeIn()},function(){$("#noteItemListWrap, #notesAndSort").fadeOut()});this.resizeEditor();$("#noteList").width(250);$("#note").css("left",0);Note.toggleWriteable()};editorMode.prototype.getWritingCss=function(){if(this.isWritingMode){return["/css/editor/editor-writting-mode.css"]}return[]};var em=new editorMode;LEA.em=em;var Resize={lineMove:false,mdLineMove:false,target:null,leftNotebook:$("#leftNotebook"),notebookSplitter:$("#notebookSplitter"),noteList:$("#noteList"),noteAndEditor:$("#noteAndEditor"),noteSplitter:$("#noteSplitter"),note:$("#note"),body:$("body"),leftColumn:$("#left-column"),rightColumn:$("#right-column"),mdSplitter:$("#mdSplitter2"),init:function(){var self=this;self.initEvent()},initEvent:function(){var self=this;$(".noteSplit").bind("mousedown",function(event){event.preventDefault();self.lineMove=true;$(this).css("background-color","#ccc");self.target=$(this).attr("id");$("#noteMask").css("z-index",99999)});self.mdSplitter.bind("mousedown",function(event){event.preventDefault();if($(this).hasClass("open")){self.mdLineMove=true}});self.body.bind("mousemove",function(event){if(self.lineMove){event.preventDefault();self.resize3Columns(event)}else if(self.mdLineMove){event.preventDefault();self.resizeMdColumns(event)}});self.body.bind("mouseup",function(event){self.stopResize();$("#noteMask").css("z-index",-1)});var everLeftWidth;$(".layout-toggler-preview").click(function(){var $t=$(this);var $p=self.leftColumn.parent();if($t.hasClass("open")){var totalWidth=$p.width();var minRightWidth=22;var leftWidth=totalWidth-minRightWidth;everLeftWidth=self.leftColumn.width();self.leftColumn.width(leftWidth);self.rightColumn.css("left","auto").width(minRightWidth);$t.removeClass("open");self.rightColumn.find(".layout-resizer").removeClass("open");$(".preview-container").hide()}else{$t.addClass("open");self.rightColumn.find(".layout-resizer").addClass("open");self.leftColumn.width(everLeftWidth);$(".preview-container").show();self.rightColumn.css("left",everLeftWidth).width("auto");if(MD){MD.onResize()}}})},stopResize:function(){var self=this;if(self.lineMove||self.mdLineMove){ajaxGet("/user/updateColumnWidth",{mdEditorWidth:UserInfo.MdEditorWidth,notebookWidth:UserInfo.NotebookWidth,noteListWidth:UserInfo.NoteListWidth},function(){})}self.lineMove=false;self.mdLineMove=false;$(".noteSplit").css("background","none");self.mdSplitter.css("background","none")},set3ColumnsWidth:function(notebookWidth,noteListWidth){var self=this;if(notebookWidth<150||noteListWidth<100){return}var noteWidth=self.body.width()-notebookWidth-noteListWidth;if(noteWidth<400){return}self.leftNotebook.width(notebookWidth);self.notebookSplitter.css("left",notebookWidth);self.noteAndEditor.css("left",notebookWidth);self.noteList.width(noteListWidth);self.noteSplitter.css("left",noteListWidth);self.note.css("left",noteListWidth);UserInfo.NotebookWidth=notebookWidth;UserInfo.NoteListWidthLine truncated
+71 -38
View File
@@ -25,9 +25,13 @@ editorMode.prototype.toggleAText = function(isWriting) {
}, 0);
}
editorMode.prototype.isWriting = function(hash) {
if(!hash) {
hash = location.hash;
}
return hash.indexOf(this.writingHash) >= 0
}
editorMode.prototype.init = function() {
this.$themeLink = $("#themeLink");
this.changeMode(this.isWritingMode);
var self = this;
$(".toggle-editor-mode").click(function(e) {
@@ -54,8 +58,6 @@ editorMode.prototype.changeMode = function(isWritingMode) {
} else {
this.normalMode();
}
$("#moreBtn i").removeClass("fa-angle-up").addClass("fa-angle-down");
}
editorMode.prototype.resizeEditor = function() {
@@ -71,42 +73,39 @@ editorMode.prototype.resizeEditor = function() {
}, 500);
}
editorMode.prototype.normalMode = function() {
// 最开始的时候就调用?
/*
var w = $(document).width();
var h = $(document).height();
$("#lock").css({right:0, bottom:0});
*/
var $c = $("#editorContent_ifr").contents();
$c.contents().find("#writtingMode").remove();
$c.contents().find('link[href$="editor-writting-mode.css"]').remove();
*/
$("#noteItemListWrap, #notesAndSort").show();
$("#noteList").unbind("mouseenter").unbind("mouseleave");
var theme = UserInfo.Theme || "default";
theme += ".css";
$("#themeLink").attr("href", "/css/theme/" + theme);
$("#mceToolbar").css("height", "30px");
// $("#lock").animate({right:w},1000);
this.resizeEditor();
var $themeLink = $("#themeLink");
// 如果之前不是normal才换
if(this.$themeLink.attr('href').indexOf('writting-overwrite.css') != -1) {
this.$themeLink.attr("href", "/css/theme/" + theme);
}
$("#noteList").width(UserInfo.NoteListWidth);
$("#note").css("left", UserInfo.NoteListWidth);
}
editorMode.prototype.writtingMode = function() {
// $("#pageInner").removeClass("animated fadeInUp");
$("#themeLink").attr("href", "/css/theme/writting-overwrite.css");
if(this.$themeLink.attr('href').indexOf('writting-overwrite.css') == -1) {
this.$themeLink.attr("href", "/css/theme/writting-overwrite.css");
}
/*
setTimeout(function() {
var $c = $("#editorContent_ifr").contents();
$c.contents().find("head").append('<link type="text/css" rel="stylesheet" href="/css/editor/editor-writting-mode.css" id="writtingMode">');
}, 0);
*/
$("#noteItemListWrap, #notesAndSort").fadeOut();
$("#noteList").hover(function() {
@@ -116,7 +115,7 @@ editorMode.prototype.writtingMode = function() {
});
// 点击扩展会使html的height生成, 切换后会覆盖css文件的
$("#mceToolbar").css("height", "40px");
// $("#mceToolbar").css("height", "40px");
//$("#pageInner").addClass("animated fadeInUp");
@@ -124,6 +123,9 @@ editorMode.prototype.writtingMode = function() {
$("#noteList").width(250);
$("#note").css("left", 0);
// 切换到写模式
Note.toggleWriteable();
}
editorMode.prototype.getWritingCss = function() {
@@ -133,6 +135,7 @@ editorMode.prototype.getWritingCss = function() {
return [];
}
var em = new editorMode();
LEA.em = em;
//----------------
// 拖拉改变变宽度
@@ -444,28 +447,20 @@ function initEditor() {
var mceToobarEverHeight = 0;
$("#moreBtn").click(function() {
saveBookmark();
var height = $("#mceToolbar").height();
// 现在是折叠的
if (height < $("#popularToolbar").height()) {
$("#mceToolbar").height($("#popularToolbar").height());
$(this).find("i").removeClass("fa-angle-down").addClass("fa-angle-up");
mceToobarEverHeight = height;
var $editor = $('#editor');
if($editor.hasClass('all-tool')) {
$editor.removeClass('all-tool');
} else {
$("#mceToolbar").height(mceToobarEverHeight);
$(this).find("i").removeClass("fa-angle-up").addClass("fa-angle-down");
$editor.addClass('all-tool');
}
resizeEditor();
restoreBookmark();
});
// 初始化编辑器
tinymce.init({
inline: true,
// theme: 'leanote',
theme: 'leanote',
valid_children: "+pre[div|#text|p|span|textarea|i|b|strong]", // ace
/*
protect: [
@@ -477,7 +472,16 @@ function initEditor() {
],
*/
setup: function(ed) {
ed.on('keydown', Note.saveNote);
ed.on('keydown', function(e) {
// 如果是readony, 则不能做任何操作
var num = e.which ? e.which : e.keyCode;
// 如果是readony, 则不能做任何操作, 除了复制
if(Note.readOnly && !((e.ctrlKey || e.metaKey) && num == 67)) {
e.preventDefault();
return;
}
Note.saveNote(e);
});
// 为了把下拉菜单关闭
ed.on("click", function(e) {
@@ -496,7 +500,7 @@ function initEditor() {
// height: 100,//这个应该是文档的高度, 而其上层的高度是$("#content").height(),
// parentHeight: $("#content").height(),
// content_css : ["/css/bootstrap.css", "/css/editor/editor.css"].concat(em.getWritingCss()),
content_css : ["/css/editor/editor.css"].concat(em.getWritingCss()),
content_css : ["/css/editor/editor.css"], // .concat(em.getWritingCss()),
skin : "custom",
language: LEA.locale, // 语言
plugins : [
@@ -983,9 +987,11 @@ LeaAce = {
me.disableAddHistory();
// 本身就有格式的, 防止之前有格式的显示为<span>(ace下)
if($pre.attr('style') || $pre.html().indexOf('style') != -1) {
var classes = $pre.attr('class') || '';
var isHtml = classes.indexOf('brush:html') != -1;
if($pre.attr('style') ||
(!isHtml && $pre.html().indexOf('style') != -1)) { // 如果是html就不用考虑了, 因为html格式的支持有style
$pre.html($pre.text());
// return;
}
$pre.find('.toggle-raw').remove();
var preHtml = $pre.html();
@@ -1018,6 +1024,9 @@ LeaAce = {
aceEditor.setShowInvisibles(false); // OK 不显示空格
aceEditor.setOption("wrap", "free");
aceEditor.setShowInvisibles(false);
aceEditor.setReadOnly(Note.readOnly);
aceEditor.setAutoScrollEditorIntoView(true);
aceEditor.setOption("maxLines", 10000);
aceEditor.commands.addCommand({
@@ -1077,10 +1086,17 @@ LeaAce = {
var pres = content.find('pre');
for(var i = 0 ; i < pres.length; ++i) {
var pre = pres.eq(i);
// 如果不是ace
if(me.isInAce(pre)) {
var aceAndNode = me.isInAce(pre);
if(aceAndNode) {
if(isAceError(aceAndNode[0].getValue())) {
console.error('之前有些没有destroy掉');
}
else {
break;
}
}
setTimeout((function(pre) {
return function() {
pre.find('.toggle-raw').remove();
@@ -1183,6 +1199,19 @@ LeaAce = {
}
return this._aceEditors[id];
},
setAceReadOnly: function(pre, readOnly) {
var me = this;
if(typeof pre == 'object') {
var id = pre.attr('id');
}
else {
var id = pre;
}
var ace = me.getAce(id);
if(ace) {
ace.setReadOnly(readOnly);
}
},
// 当前焦点是否在aceEditor中
nowIsInAce: function () {
if(!this.canAce()) {
@@ -1275,6 +1304,10 @@ LeaAce = {
var aceEditor = aceEditorAndPre[0];
var $pre = aceEditorAndPre[1];
var value = aceEditor.getValue();
// 表示有错
if(isAceError(value)) {
value = $pre.html();
}
value = value.replace(/</g, '&lt').replace(/>/g, '&gt');
// var id = getAceId();
var replacePre = $('<pre class="' + $pre.attr('class') + ' ace-to-pre">' + value + "</pre>");
+1 -1
View File
@@ -1 +1 @@
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 tags=[];Tag.t.children().each(function(){var text=$(this).data("tag");text=Tag.mapCn2En[text]||text;tags.push(text)});return tags};Tag.clearTags=function(){Tag.t.html("")};Tag.renderTags=function(tags){Tag.t.html("");if(isEmpty(tags)){return}for(var i=0;i<tags.length;++i){var tag=tags[i];Tag.appendTag(tag)}};function revertTagStatus(){$("#addTagTrigger").show();$("#addTagInput").hide()}function hideTagList(event){$("#tagDropdown").removeClass("open");if(event){event.stopPropagation()}}function showTagList(event){$("#tagDropdown").addClass("open");if(event){event.stopPropagation()}}Tag.renderReadOnlyTags=function(tags){$("#noteReadTags").html("");if(isEmpty(tags)){$("#noteReadTags").html(getMsg("noTag"))}var i=true;function getNextDefaultClasses(){if(i){return"label label-default";i=false}else{i=true;return"label label-info"}}for(var i in tags){var text=tags[i];text=Tag.mapEn2Cn[text]||text;text=text.replace(/[\r\n]/g,"");var classes=Tag.classes[text];if(!classes){classes=getNextDefaultClasses()}tag=tt('<span class="?">?</span>',classes,toHtmlEntity(text));$("#noteReadTags").append(tag)}};Tag.appendTag=function(tag,save){var isColor=false;var classes,text;if(typeof tag=="object"){classes=tag.classes;text=tag.text;if(!text){return}}else{tag=$.trim(tag);text=tag;if(!text){return}var classes=Tag.classes[text];if(classes){isColor=true}else{classes="label label-default"}}var rawText=text;if(LEA.locale=="zh"){text=Tag.mapEn2Cn[text]||text;rawText=Tag.mapCn2En[rawText]||rawText}text=text.replace(/[\r\n]/g,"");tag=tt('<span class="?" data-tag="?">?<i title="'+getMsg("delete")+'">X</i></span>',classes,text,toHtmlEntity(text));var isExists=false;$("#tags").children().each(function(){if(isColor){var tagHtml=$("<div></div>").append($(this).clone()).html();if(tagHtml==tag){$(this).remove();isExists=true}}else if(text+"X"==$(this).text()){$(this).remove();isExists=true}});$("#tags").append(tag);hideTagList();if(!isColor){reRenderTags()}if(save){Note.curNoteIsDirtied();if(!isExists){Note.curChangedSaveIt(true,function(){ajaxPost("/tag/updateTag",{tag:rawText},function(ret){if(reIsOk(ret)){Tag.addTagNav(ret.Item)}})})}}};function reRenderTags(){var defautClasses=["label label-default","label label-info"];var i=0;$("#tags").children().each(function(){var thisClasses=$(this).attr("class");if(thisClasses=="label label-default"||thisClasses=="label label-info"){$(this).removeClass(thisClasses).addClass(defautClasses[i%2]);i++}})}Tag.removeTag=function($target){var tag=$target.data("tag");$target.remove();reRenderTags();if(LEA.locale=="zh"){tag=Tag.mapCn2En[tag]||tag}Note.curChangedSaveIt(true,function(){ajaxPost("/tag/updateTag",{tag:tag},function(ret){if(reIsOk(ret)){Tag.addTagNav(ret.Item)}})})};Tag.tags=[];Tag.renderTagNav=function(tags){var me=this;tags=tags||[];Tag.tags=tags;$("#tagNav").html("");for(var i in tags){var noteTag=tags[i];var tag=noteTag.Tag;var text=tag;if(LEA.locale=="zh"){var text=Tag.mapEn2Cn[tag]||text}text=text.replace(/[\r\n]/g,"");var classes=Tag.classes[tag]||"label label-default";$("#tagNav").append(tt('<li data-tag="?"><a> <span class="?">?</span> <span class="tag-delete">X</span></li>',tag,classes,toHtmlEntity(text)))}};Tag.addTagNav=function(newTag){var me=this;for(var i in me.tags){var noteTag=me.tags[i];if(noteTag.Tag==newTag.Tag){me.tags.splice(i,1);break}}me.tags.unshift(newTag);me.renderTagNav(me.tags)};$(function(){$("#addTagTrigger").click(function(){$(this).hide();$("#addTagInput").show().focus().val("")});$("#addTagInput").click(function(event){showTagList(event)});$("#addTagInput").blur(function(){var val=$(this).val();if(val){Tag.appendTag(val,true)}return;$("#addTagTrigger").show();$("#addTagInput").hide()});$("#addTagInput").keydown(function(e){if(e.keyCode==13){hideTagList();if($("#addTagInput").val()){$(this).trigger("blur");$("#addTagTrigger").trigger("click")}else{$(this).trigger("blur")}}});$("#tagColor li").click(function(event){var a;if($(this).attr("role")){a=$(this).find("span")}else{a=$(this)}Tag.appendTag({classes:a.attr("class"),text:a.text()},true)});$("#tags").on("click","i",function(){Tag.removeTag($(this).parent())});function deleteTag(){$li=$(this).closest("li");var tag=$.trim($li.data("tag"));if(confirm("Are you sure ?")){ajaxPost("/tag/deleteTag",{tag:tag},function(re){if(reIsOk(re)){var item=re.Item;Note.deleteNoteTag(item,tag);$li.remove()}})}}function searchTag(){var $li=$(this).closest("li");var tag=$.trim($li.data("tag"));Note.curChangedSaveIt();Note.clearAll();$("#tagSearch").html($li.html()).show();$("#tagSearch .tag-delete").remove();showLLine truncated
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 tags=[];Tag.t.children().each(function(){var text=$(this).data("tag");text=Tag.mapCn2En[text]||text;tags.push(text)});return tags};Tag.clearTags=function(){Tag.t.html("")};Tag.renderTags=function(tags){Tag.t.html("");if(isEmpty(tags)){return}for(var i=0;i<tags.length;++i){var tag=tags[i];Tag.appendTag(tag)}};function revertTagStatus(){$("#addTagTrigger").show();$("#addTagInput").hide()}function hideTagList(event){$("#tagDropdown").removeClass("open");if(event){event.stopPropagation()}}function showTagList(event){$("#tagDropdown").addClass("open");if(event){event.stopPropagation()}}Tag.renderReadOnlyTags=function(tags){$("#noteReadTags").html("");if(isEmpty(tags)||tags.length==1&&tags[0]==""){$("#noteReadTags").html(getMsg("noTag"))}var i=true;function getNextDefaultClasses(){if(i){return"label label-default";i=false}else{i=true;return"label label-info"}}for(var i in tags){var text=tags[i];text=Tag.mapEn2Cn[text]||text;var classes=Tag.classes[text];if(!classes){classes=getNextDefaultClasses()}tag=tt('<span class="?">?</span>',classes,text);$("#noteReadTags").append(tag)}};Tag.appendTag=function(tag,save){var isColor=false;var classes,text;if(typeof tag=="object"){classes=tag.classes;text=tag.text;if(!text){return}}else{tag=$.trim(tag);text=tag;if(!text){return}var classes=Tag.classes[text];if(classes){isColor=true}else{classes="label label-default"}}var rawText=text;if(LEA.locale=="zh"){text=Tag.mapEn2Cn[text]||text;rawText=Tag.mapCn2En[rawText]||rawText}tag=tt('<span class="?" data-tag="?">?<i title="'+getMsg("delete")+'">X</i></span>',classes,text,text);var isExists=false;$("#tags").children().each(function(){if(isColor){var tagHtml=$("<div></div>").append($(this).clone()).html();if(tagHtml==tag){$(this).remove();isExists=true}}else if(text+"X"==$(this).text()){$(this).remove();isExists=true}});$("#tags").append(tag);hideTagList();if(!isColor){reRenderTags()}if(save){Note.curNoteIsDirtied();if(!isExists){Note.curChangedSaveIt(true,function(){ajaxPost("/tag/updateTag",{tag:rawText},function(ret){if(reIsOk(ret)){Tag.addTagNav(ret.Item)}})})}}};function reRenderTags(){var defautClasses=["label label-default","label label-info"];var i=0;$("#tags").children().each(function(){var thisClasses=$(this).attr("class");if(thisClasses=="label label-default"||thisClasses=="label label-info"){$(this).removeClass(thisClasses).addClass(defautClasses[i%2]);i++}})}Tag.removeTag=function($target){var tag=$target.data("tag");$target.remove();reRenderTags();if(LEA.locale=="zh"){tag=Tag.mapCn2En[tag]||tag}Note.curChangedSaveIt(true,function(){ajaxPost("/tag/updateTag",{tag:tag},function(ret){if(reIsOk(ret)){Tag.addTagNav(ret.Item)}})})};Tag.tags=[];Tag.renderTagNav=function(tags){var me=this;tags=tags||[];Tag.tags=tags;$("#tagNav").html("");for(var i in tags){var noteTag=tags[i];var tag=noteTag.Tag;var text=tag;if(LEA.locale=="zh"){var text=Tag.mapEn2Cn[tag]||text}var classes=Tag.classes[tag]||"label label-default";$("#tagNav").append(tt('<li data-tag="?"><a> <span class="?">?</span> <span class="tag-delete">X</span></li>',tag,classes,text))}};Tag.addTagNav=function(newTag){var me=this;for(var i in me.tags){var noteTag=me.tags[i];if(noteTag.Tag==newTag.Tag){me.tags.splice(i,1);break}}me.tags.unshift(newTag);me.renderTagNav(me.tags)};$(function(){$("#addTagTrigger").click(function(){$(this).hide();$("#addTagInput").show().focus().val("")});$("#addTagInput").click(function(event){showTagList(event)});$("#addTagInput").blur(function(){var val=$(this).val();if(val){Tag.appendTag(val,true)}return;$("#addTagTrigger").show();$("#addTagInput").hide()});$("#addTagInput").keydown(function(e){if(e.keyCode==13){hideTagList();if($("#addTagInput").val()){$(this).trigger("blur");$("#addTagTrigger").trigger("click")}else{$(this).trigger("blur")}}});$("#tagColor li").click(function(event){var a;if($(this).attr("role")){a=$(this).find("span")}else{a=$(this)}Tag.appendTag({classes:a.attr("class"),text:a.text()},true)});$("#tags").on("click","i",function(){Tag.removeTag($(this).parent())});function deleteTag(){$li=$(this).closest("li");var tag=$.trim($li.data("tag"));if(confirm("Are you sure ?")){ajaxPost("/tag/deleteTag",{tag:tag},function(re){if(reIsOk(re)){var item=re.Item;Note.deleteNoteTag(item,tag);$li.remove()}})}}function searchTag(){var $li=$(this).closest("li");var tag=$.trim($li.data("tag"));Note.curChangedSaveIt();Note.clearAll();$("#tagSearch").html($li.html()).show();$("#tagSearch .tag-delete").remove();showLoading();ajaxGet("/note/searchNoteByTags",{tags:[tag]},function(notes){hideLoading();if(notes){Note.renderNotLine truncated
+4 -9
View File
@@ -86,7 +86,7 @@ function showTagList(event) {
Tag.renderReadOnlyTags = function(tags) {
// 先清空
$("#noteReadTags").html("");
if(isEmpty(tags)) {
if(isEmpty(tags) || (tags.length == 1 && tags[0] == "")) {
$("#noteReadTags").html(getMsg("noTag"));
}
@@ -104,13 +104,11 @@ Tag.renderReadOnlyTags = function(tags) {
for(var i in tags) {
var text = tags[i];
text = Tag.mapEn2Cn[text] || text;
text = text.replace(/[\r\n]/g, '');
var classes = Tag.classes[text];
if(!classes) {
classes = getNextDefaultClasses();
}
tag = tt('<span class="?">?</span>', classes, toHtmlEntity(text));
tag = tt('<span class="?">?</span>', classes, text);
$("#noteReadTags").append(tag);
}
@@ -147,9 +145,7 @@ Tag.appendTag = function(tag, save) {
text = Tag.mapEn2Cn[text] || text;
rawText = Tag.mapCn2En[rawText] || rawText;
}
text = text.replace(/[\r\n]/g, '');
tag = tt('<span class="?" data-tag="?">?<i title="' + getMsg("delete") + '">X</i></span>', classes, text, toHtmlEntity(text));
tag = tt('<span class="?" data-tag="?">?<i title="' + getMsg("delete") + '">X</i></span>', classes, text, text);
// 避免重复
var isExists = false;
@@ -239,9 +235,8 @@ Tag.renderTagNav = function(tags) {
if(LEA.locale == "zh") {
var text = Tag.mapEn2Cn[tag] || text;
}
text = text.replace(/[\r\n]/g, '');
var classes = Tag.classes[tag] || "label label-default";
$("#tagNav").append(tt('<li data-tag="?"><a> <span class="?">?</span> <span class="tag-delete">X</span></li>', tag, classes, toHtmlEntity(text)));
$("#tagNav").append(tt('<li data-tag="?"><a> <span class="?">?</span> <span class="tag-delete">X</span></li>', tag, classes, text));
}
};
-4
View File
@@ -1,4 +0,0 @@
= modal =
bootstrap.js modal 缓存修改, 不缓存remote的数据
添加postShow
+1 -1
View File
@@ -1 +1 @@
var LEA={};var Notebook={cache:{}};var Note={cache:{}};var Tag={};var Notebook={};var Share={};var Mobile={};var LeaAce={};var Converter;var MarkdownEditor;var ScrollLink;var MD;function trimLeft(str,substr){if(!substr||substr==" "){return $.trim(str)}while(str.indexOf(substr)==0){str=str.substring(substr.length)}return str}function json(str){return eval("("+str+")")}function t(){var args=arguments;if(args.length<=1){return args[0]}var text=args[0];if(!text){return text}var pattern="LEAAEL";text=text.replace(/\?/g,pattern);for(var i=1;i<=args.length;++i){text=text.replace(pattern,args[i])}return text}var tt=t;function arrayEqual(a,b){a=a||[];b=b||[];return a.join(",")==b.join(",")}function isArray(obj){return Object.prototype.toString.call(obj)==="[object Array]"}function isEmpty(obj){if(!obj){return true}if(isArray(obj)){if(obj.length==0){return true}}return false}function getFormJsonData(formId){var data=formArrDataToJson($("#"+formId).serializeArray());return data}function formArrDataToJson(arrData){var datas={};var arrObj={};for(var i in arrData){var attr=arrData[i].name;var value=arrData[i].value;if(attr.substring(attr.length-2,attr.length)=="[]"){attr=attr.substring(0,attr.length-2);if(arrObj[attr]==undefined){arrObj[attr]=[value]}else{arrObj[attr].push(value)}continue}datas[attr]=value}return $.extend(datas,arrObj)}function formSerializeDataToJson(formSerializeData){var arr=formSerializeData.split("&");var datas={};var arrObj={};for(var i=0;i<arr.length;++i){var each=arr[i].split("=");var attr=decodeURI(each[0]);var value=decodeURI(each[1]);if(attr.substring(attr.length-2,attr.length)=="[]"){attr=attr.substring(0,attr.length-2);if(arrObj[attr]==undefined){arrObj[attr]=[value]}else{arrObj[attr].push(value)}continue}datas[attr]=value}return $.extend(datas,arrObj)}function _ajaxCallback(ret,successFunc,failureFunc){if(ret===true||ret=="true"||typeof ret=="object"){if(ret&&typeof ret=="object"){if(ret.Msg=="NOTLOGIN"){alert("你还没有登录, 请先登录!");return}}if(typeof successFunc=="function"){successFunc(ret)}}else{if(typeof failureFunc=="function"){failureFunc(ret)}else{alert("error!")}}}function _ajax(type,url,param,successFunc,failureFunc,async){log("-------------------ajax:");log(url);log(param);if(typeof async=="undefined"){async=true}else{async=false}return $.ajax({type:type,url:url,data:param,async:async,success:function(ret){_ajaxCallback(ret,successFunc,failureFunc)},error:function(ret){_ajaxCallback(ret,successFunc,failureFunc)}})}function ajaxGet(url,param,successFunc,failureFunc,async){return _ajax("GET",url,param,successFunc,failureFunc,async)}function ajaxPost(url,param,successFunc,failureFunc,async){_ajax("POST",url,param,successFunc,failureFunc,async)}function ajaxPostJson(url,param,successFunc,failureFunc,async){log("-------------------ajaxPostJson:");log(url);log(param);if(typeof async=="undefined"){async=true}else{async=false}$.ajax({url:url,type:"POST",contentType:"application/json; charset=utf-8",datatype:"json",async:async,data:JSON.stringify(param),success:function(ret,stats){_ajaxCallback(ret,successFunc,failureFunc)},error:function(ret){_ajaxCallback(ret,successFunc,failureFunc)}})}function findParents(target,selector){if($(target).is(selector)){return $(target)}var parents=$(target).parents();for(var i=0;i<parents.length;++i){log(parents.eq(i));if(parents.eq(i).is(selector)){return parents.seq(i)}}return null}function getVendorPrefix(){var body=document.body||document.documentElement,style=body.style,vendor=["webkit","khtml","moz","ms","o"],i=0;while(i<vendor.length){if(typeof style[vendor[i]+"Transition"]==="string"){return vendor[i]}i++}}function editorIframeTabindex(index){var $i=$("#editorContent");$i.attr("tabindex",index);setTimeout(function(){$i.attr("tabindex",index)},500);setTimeout(function(){$i.attr("tabindex",index)},1e3)}LEA.isM=false;LEA.isMarkdownEditor=function(){return LEA.isM};function switchEditor(isMarkdown){LEA.isM=isMarkdown;if(!isMarkdown){$("#editor").show();$("#mdEditor").css("z-index",1).hide();editorIframeTabindex(2);$("#wmd-input").attr("tabindex",3);$("#leanoteNav").show()}else{$("#mdEditor").css("z-index",3).show();editorIframeTabindex(3);$("#wmd-input").attr("tabindex",2);$("#leanoteNav").hide()}}var previewToken="<div style='display: none'>FORTOKEN</div>";var clearIntervalForSetContent;function setEditorContent(content,isMarkdown,preview){if(!content){content=""}if(clearIntervalForSetContent){clearInterval(clearIntervalForSetContent)}if(!isMarkdown){$("#editorContent").html(content);if(typeof tinymce!="undefined"&&tinymce.activeEditor){var editor=tinymce.activeEditor;editor.setContent(content);editor.undoManager.clear()}else{clearIntervalForSetContent=setTimeout(function(){setEditorContent(content,false)},100)}}else{if(MD){MD.setContent(content)}else{clearIntervalForSetContent=setTimeout(function(){setEditorContent(content,true)},100)}}}function previewIsEmpty(preview){if(!preview||preview.substr(0,previewToken.length)==previewToken){reLine truncated
var LEA={};var Notebook={cache:{}};var Note={cache:{}};var Tag={};var Notebook={};var Share={};var Mobile={};var LeaAce={};var Converter;var MarkdownEditor;var ScrollLink;var MD;function trimLeft(str,substr){if(!substr||substr==" "){return $.trim(str)}while(str.indexOf(substr)==0){str=str.substring(substr.length)}return str}function json(str){return eval("("+str+")")}function t(){var args=arguments;if(args.length<=1){return args[0]}var text=args[0];if(!text){return text}var pattern="LEAAEL";text=text.replace(/\?/g,pattern);for(var i=1;i<=args.length;++i){text=text.replace(pattern,args[i])}return text}var tt=t;function arrayEqual(a,b){a=a||[];b=b||[];return a.join(",")==b.join(",")}function isArray(obj){return Object.prototype.toString.call(obj)==="[object Array]"}function isEmpty(obj){if(!obj){return true}if(isArray(obj)){if(obj.length==0){return true}}return false}function getFormJsonData(formId){var data=formArrDataToJson($("#"+formId).serializeArray());return data}function formArrDataToJson(arrData){var datas={};var arrObj={};for(var i in arrData){var attr=arrData[i].name;var value=arrData[i].value;if(attr.substring(attr.length-2,attr.length)=="[]"){attr=attr.substring(0,attr.length-2);if(arrObj[attr]==undefined){arrObj[attr]=[value]}else{arrObj[attr].push(value)}continue}datas[attr]=value}return $.extend(datas,arrObj)}function formSerializeDataToJson(formSerializeData){var arr=formSerializeData.split("&");var datas={};var arrObj={};for(var i=0;i<arr.length;++i){var each=arr[i].split("=");var attr=decodeURI(each[0]);var value=decodeURI(each[1]);if(attr.substring(attr.length-2,attr.length)=="[]"){attr=attr.substring(0,attr.length-2);if(arrObj[attr]==undefined){arrObj[attr]=[value]}else{arrObj[attr].push(value)}continue}datas[attr]=value}return $.extend(datas,arrObj)}function _ajaxCallback(ret,successFunc,failureFunc){if(ret===true||ret=="true"||typeof ret=="object"){if(ret&&typeof ret=="object"){if(ret.Msg=="NOTLOGIN"){alert("你还没有登录, 请先登录!");return}}if(typeof successFunc=="function"){successFunc(ret)}}else{if(typeof failureFunc=="function"){failureFunc(ret)}else{alert("error!")}}}function _ajax(type,url,param,successFunc,failureFunc,async){log("-------------------ajax:");log(url);log(param);if(typeof async=="undefined"){async=true}else{async=false}return $.ajax({type:type,url:url,data:param,async:async,success:function(ret){_ajaxCallback(ret,successFunc,failureFunc)},error:function(ret){_ajaxCallback(ret,successFunc,failureFunc)}})}function ajaxGet(url,param,successFunc,failureFunc,async){return _ajax("GET",url,param,successFunc,failureFunc,async)}function ajaxPost(url,param,successFunc,failureFunc,async){_ajax("POST",url,param,successFunc,failureFunc,async)}function ajaxPostJson(url,param,successFunc,failureFunc,async){log("-------------------ajaxPostJson:");log(url);log(param);if(typeof async=="undefined"){async=true}else{async=false}$.ajax({url:url,type:"POST",contentType:"application/json; charset=utf-8",datatype:"json",async:async,data:JSON.stringify(param),success:function(ret,stats){_ajaxCallback(ret,successFunc,failureFunc)},error:function(ret){_ajaxCallback(ret,successFunc,failureFunc)}})}function findParents(target,selector){if($(target).is(selector)){return $(target)}var parents=$(target).parents();for(var i=0;i<parents.length;++i){log(parents.eq(i));if(parents.eq(i).is(selector)){return parents.seq(i)}}return null}function getVendorPrefix(){var body=document.body||document.documentElement,style=body.style,vendor=["webkit","khtml","moz","ms","o"],i=0;while(i<vendor.length){if(typeof style[vendor[i]+"Transition"]==="string"){return vendor[i]}i++}}function editorIframeTabindex(index){var $i=$("#editorContent");$i.attr("tabindex",index);setTimeout(function(){$i.attr("tabindex",index)},500);setTimeout(function(){$i.attr("tabindex",index)},1e3)}LEA.isM=false;LEA.isMarkdownEditor=function(){return LEA.isM};function switchEditor(isMarkdown){LEA.isM=isMarkdown;if(!isMarkdown){$("#editor").show();$("#mdEditor").css("z-index",1).hide();editorIframeTabindex(2);$("#wmd-input").attr("tabindex",3);$("#leanoteNav").show()}else{$("#mdEditor").css("z-index",3).show();editorIframeTabindex(3);$("#wmd-input").attr("tabindex",2);$("#leanoteNav").hide()}}var previewToken="<div style='display: none'>FORTOKEN</div>";var clearIntervalForSetContent;function setEditorContent(content,isMarkdown,preview,callback){if(!content){content=""}if(clearIntervalForSetContent){clearInterval(clearIntervalForSetContent)}if(!isMarkdown){$("#editorContent").html(content);if(typeof tinymce!="undefined"&&tinymce.activeEditor){var editor=tinymce.activeEditor;editor.setContent(content);callback&&callback();editor.undoManager.clear()}else{clearIntervalForSetContent=setTimeout(function(){setEditorContent(content,false,false,callback)},100)}}else{if(MD){MD.setContent(content);callback&&callback()}else{clearIntervalForSetContent=setTimeout(function(){setEditorContent(content,true,false,callback)},100)}}}function previewIsEmLine truncated
+24 -15
View File
@@ -343,7 +343,7 @@ function switchEditor(isMarkdown) {
// 可能是tinymce还没有渲染成功
var previewToken = "<div style='display: none'>FORTOKEN</div>"
var clearIntervalForSetContent;
function setEditorContent(content, isMarkdown, preview) {
function setEditorContent(content, isMarkdown, preview, callback) {
if(!content) {
content = "";
}
@@ -366,6 +366,7 @@ function setEditorContent(content, isMarkdown, preview) {
if(typeof tinymce != "undefined" && tinymce.activeEditor) {
var editor = tinymce.activeEditor;
editor.setContent(content);
callback && callback();
/*
if(LeaAce.canAce() && LeaAce.isAce) {
try {
@@ -382,7 +383,7 @@ function setEditorContent(content, isMarkdown, preview) {
} else {
// 等下再设置
clearIntervalForSetContent = setTimeout(function() {
setEditorContent(content, false);
setEditorContent(content, false, false, callback);
}, 100);
}
} else {
@@ -409,9 +410,10 @@ function setEditorContent(content, isMarkdown, preview) {
*/
if(MD) {
MD.setContent(content);
callback && callback();
} else {
clearIntervalForSetContent = setTimeout(function() {
setEditorContent(content, true);
setEditorContent(content, true, false, callback);
}, 100);
}
}
@@ -425,6 +427,14 @@ function previewIsEmpty(preview) {
return false;
}
// ace的值有误?
function isAceError(val) {
if(!val) {
return false;
}
return val.indexOf('XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') != -1;
}
// 有tinymce得到的content有<html>包围
function getEditorContent(isMarkdown) {
if(!isMarkdown) {
@@ -434,6 +444,8 @@ function getEditorContent(isMarkdown) {
// 删除toggle raw
content.find('.toggle-raw').remove();
// single页面没有LeaAce
if(window.LeaAce && LeaAce.getAce) {
// 替换掉ace editor
var pres = content.find('pre');
for(var i = 0 ; i < pres.length; ++i) {
@@ -442,11 +454,16 @@ function getEditorContent(isMarkdown) {
var aceEditor = LeaAce.getAce(id);
if(aceEditor) {
var val = aceEditor.getValue();
// 表示有错
if(isAceError(val)) {
val = pre.html();
}
val = val.replace(/</g, '&lt').replace(/>/g, '&gt');
pre.removeAttr('style', '').removeAttr('contenteditable').removeClass('ace_editor');
pre.html(val);
}
}
}
// 去掉恶心的花瓣注入
// <pinit></pinit>
@@ -674,6 +691,8 @@ function getObjectId() {
//-----------------------------------------
function resizeEditor(second) {
return;
var ifrParent = $("#editorContent_ifr").parent();
ifrParent.css("overflow", "auto");
var height = $("#editorContent").height();
@@ -683,7 +702,7 @@ function resizeEditor(second) {
// life 12.9
// inline editor
$("#editorContent").css("top", $("#mceToolbar").height());
// $("#editorContent").css("top", $("#mceToolbar").height());
/*
// 第一次时可能会被改变
@@ -1278,16 +1297,6 @@ function setHash(key, value) {
location.href = "#" + str;
}
// 防止js注入
function trimTitle(title) {
if(!title) {
return '';
}
var trimTitle = function(title) {
return title.replace(/<.*?script.*?>/g, '');
};
function toHtmlEntity(html) {
if(!html) {
return '';
}
return (html + '').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
};
-822
View File
@@ -1,822 +0,0 @@
/**
* @preserve FastClick: polyfill to remove click delays on browsers with touch UIs.
*
* @version 1.0.3
* @codingstandard ftlabs-jsv2
* @copyright The Financial Times Limited [All Rights Reserved]
* @license MIT License (see LICENSE.txt)
*/
/*jslint browser:true, node:true*/
/*global define, Event, Node*/
/**
* Instantiate fast-clicking listeners on the specified layer.
*
* @constructor
* @param {Element} layer The layer to listen on
* @param {Object} options The options to override the defaults
*/
function FastClick(layer, options) {
'use strict';
var oldOnClick;
options = options || {};
/**
* Whether a click is currently being tracked.
*
* @type boolean
*/
this.trackingClick = false;
/**
* Timestamp for when click tracking started.
*
* @type number
*/
this.trackingClickStart = 0;
/**
* The element being tracked for a click.
*
* @type EventTarget
*/
this.targetElement = null;
/**
* X-coordinate of touch start event.
*
* @type number
*/
this.touchStartX = 0;
/**
* Y-coordinate of touch start event.
*
* @type number
*/
this.touchStartY = 0;
/**
* ID of the last touch, retrieved from Touch.identifier.
*
* @type number
*/
this.lastTouchIdentifier = 0;
/**
* Touchmove boundary, beyond which a click will be cancelled.
*
* @type number
*/
this.touchBoundary = options.touchBoundary || 10;
/**
* The FastClick layer.
*
* @type Element
*/
this.layer = layer;
/**
* The minimum time between tap(touchstart and touchend) events
*
* @type number
*/
this.tapDelay = options.tapDelay || 200;
if (FastClick.notNeeded(layer)) {
return;
}
// Some old versions of Android don't have Function.prototype.bind
function bind(method, context) {
return function() { return method.apply(context, arguments); };
}
var methods = ['onMouse', 'onClick', 'onTouchStart', 'onTouchMove', 'onTouchEnd', 'onTouchCancel'];
var context = this;
for (var i = 0, l = methods.length; i < l; i++) {
context[methods[i]] = bind(context[methods[i]], context);
}
// Set up event handlers as required
if (deviceIsAndroid) {
layer.addEventListener('mouseover', this.onMouse, true);
layer.addEventListener('mousedown', this.onMouse, true);
layer.addEventListener('mouseup', this.onMouse, true);
}
layer.addEventListener('click', this.onClick, true);
layer.addEventListener('touchstart', this.onTouchStart, false);
layer.addEventListener('touchmove', this.onTouchMove, false);
layer.addEventListener('touchend', this.onTouchEnd, false);
layer.addEventListener('touchcancel', this.onTouchCancel, false);
// Hack is required for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2)
// which is how FastClick normally stops click events bubbling to callbacks registered on the FastClick
// layer when they are cancelled.
if (!Event.prototype.stopImmediatePropagation) {
layer.removeEventListener = function(type, callback, capture) {
var rmv = Node.prototype.removeEventListener;
if (type === 'click') {
rmv.call(layer, type, callback.hijacked || callback, capture);
} else {
rmv.call(layer, type, callback, capture);
}
};
layer.addEventListener = function(type, callback, capture) {
var adv = Node.prototype.addEventListener;
if (type === 'click') {
adv.call(layer, type, callback.hijacked || (callback.hijacked = function(event) {
if (!event.propagationStopped) {
callback(event);
}
}), capture);
} else {
adv.call(layer, type, callback, capture);
}
};
}
// If a handler is already declared in the element's onclick attribute, it will be fired before
// FastClick's onClick handler. Fix this by pulling out the user-defined handler function and
// adding it as listener.
if (typeof layer.onclick === 'function') {
// Android browser on at least 3.2 requires a new reference to the function in layer.onclick
// - the old one won't work if passed to addEventListener directly.
oldOnClick = layer.onclick;
layer.addEventListener('click', function(event) {
oldOnClick(event);
}, false);
layer.onclick = null;
}
}
/**
* Android requires exceptions.
*
* @type boolean
*/
var deviceIsAndroid = navigator.userAgent.indexOf('Android') > 0;
/**
* iOS requires exceptions.
*
* @type boolean
*/
var deviceIsIOS = /iP(ad|hone|od)/.test(navigator.userAgent);
/**
* iOS 4 requires an exception for select elements.
*
* @type boolean
*/
var deviceIsIOS4 = deviceIsIOS && (/OS 4_\d(_\d)?/).test(navigator.userAgent);
/**
* iOS 6.0(+?) requires the target element to be manually derived
*
* @type boolean
*/
var deviceIsIOSWithBadTarget = deviceIsIOS && (/OS ([6-9]|\d{2})_\d/).test(navigator.userAgent);
/**
* BlackBerry requires exceptions.
*
* @type boolean
*/
var deviceIsBlackBerry10 = navigator.userAgent.indexOf('BB10') > 0;
/**
* Determine whether a given element requires a native click.
*
* @param {EventTarget|Element} target Target DOM element
* @returns {boolean} Returns true if the element needs a native click
*/
FastClick.prototype.needsClick = function(target) {
'use strict';
switch (target.nodeName.toLowerCase()) {
// Don't send a synthetic click to disabled inputs (issue #62)
case 'button':
case 'select':
case 'textarea':
if (target.disabled) {
return true;
}
break;
case 'input':
// File inputs need real clicks on iOS 6 due to a browser bug (issue #68)
if ((deviceIsIOS && target.type === 'file') || target.disabled) {
return true;
}
break;
case 'label':
case 'video':
return true;
}
return (/\bneedsclick\b/).test(target.className);
};
/**
* Determine whether a given element requires a call to focus to simulate click into element.
*
* @param {EventTarget|Element} target Target DOM element
* @returns {boolean} Returns true if the element requires a call to focus to simulate native click.
*/
FastClick.prototype.needsFocus = function(target) {
'use strict';
switch (target.nodeName.toLowerCase()) {
case 'textarea':
return true;
case 'select':
return !deviceIsAndroid;
case 'input':
switch (target.type) {
case 'button':
case 'checkbox':
case 'file':
case 'image':
case 'radio':
case 'submit':
return false;
}
// No point in attempting to focus disabled inputs
return !target.disabled && !target.readOnly;
default:
return (/\bneedsfocus\b/).test(target.className);
}
};
/**
* Send a click event to the specified element.
*
* @param {EventTarget|Element} targetElement
* @param {Event} event
*/
FastClick.prototype.sendClick = function(targetElement, event) {
'use strict';
var clickEvent, touch;
// On some Android devices activeElement needs to be blurred otherwise the synthetic click will have no effect (#24)
if (document.activeElement && document.activeElement !== targetElement) {
document.activeElement.blur();
// $("#editorContent_ifr").blur();
}
touch = event.changedTouches[0];
// Synthesise a click event, with an extra attribute so it can be tracked
clickEvent = document.createEvent('MouseEvents');
clickEvent.initMouseEvent(this.determineEventType(targetElement), true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null);
clickEvent.forwardedTouchEvent = true;
targetElement.dispatchEvent(clickEvent);
};
FastClick.prototype.determineEventType = function(targetElement) {
'use strict';
//Issue #159: Android Chrome Select Box does not open with a synthetic click event
if (deviceIsAndroid && targetElement.tagName.toLowerCase() === 'select') {
return 'mousedown';
}
return 'click';
};
/**
* @param {EventTarget|Element} targetElement
*/
FastClick.prototype.focus = function(targetElement) {
'use strict';
var length;
// Issue #160: on iOS 7, some input elements (e.g. date datetime) throw a vague TypeError on setSelectionRange. These elements don't have an integer value for the selectionStart and selectionEnd properties, but unfortunately that can't be used for detection because accessing the properties also throws a TypeError. Just check the type instead. Filed as Apple bug #15122724.
if (deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf('date') !== 0 && targetElement.type !== 'time') {
length = targetElement.value.length;
targetElement.setSelectionRange(length, length);
} else {
targetElement.focus();
}
};
/**
* Check whether the given target element is a child of a scrollable layer and if so, set a flag on it.
*
* @param {EventTarget|Element} targetElement
*/
FastClick.prototype.updateScrollParent = function(targetElement) {
'use strict';
var scrollParent, parentElement;
scrollParent = targetElement.fastClickScrollParent;
// Attempt to discover whether the target element is contained within a scrollable layer. Re-check if the
// target element was moved to another parent.
if (!scrollParent || !scrollParent.contains(targetElement)) {
parentElement = targetElement;
do {
if (parentElement.scrollHeight > parentElement.offsetHeight) {
scrollParent = parentElement;
targetElement.fastClickScrollParent = parentElement;
break;
}
parentElement = parentElement.parentElement;
} while (parentElement);
}
// Always update the scroll top tracker if possible.
if (scrollParent) {
scrollParent.fastClickLastScrollTop = scrollParent.scrollTop;
}
};
/**
* @param {EventTarget} targetElement
* @returns {Element|EventTarget}
*/
FastClick.prototype.getTargetElementFromEventTarget = function(eventTarget) {
'use strict';
// On some older browsers (notably Safari on iOS 4.1 - see issue #56) the event target may be a text node.
if (eventTarget.nodeType === Node.TEXT_NODE) {
return eventTarget.parentNode;
}
return eventTarget;
};
/**
* On touch start, record the position and scroll offset.
*
* @param {Event} event
* @returns {boolean}
*/
FastClick.prototype.onTouchStart = function(event) {
'use strict';
var targetElement, touch, selection;
// Ignore multiple touches, otherwise pinch-to-zoom is prevented if both fingers are on the FastClick element (issue #111).
if (event.targetTouches.length > 1) {
return true;
}
targetElement = this.getTargetElementFromEventTarget(event.target);
touch = event.targetTouches[0];
if (deviceIsIOS) {
// Only trusted events will deselect text on iOS (issue #49)
selection = window.getSelection();
if (selection.rangeCount && !selection.isCollapsed) {
return true;
}
if (!deviceIsIOS4) {
// Weird things happen on iOS when an alert or confirm dialog is opened from a click event callback (issue #23):
// when the user next taps anywhere else on the page, new touchstart and touchend events are dispatched
// with the same identifier as the touch event that previously triggered the click that triggered the alert.
// Sadly, there is an issue on iOS 4 that causes some normal touch events to have the same identifier as an
// immediately preceeding touch event (issue #52), so this fix is unavailable on that platform.
// Issue 120: touch.identifier is 0 when Chrome dev tools 'Emulate touch events' is set with an iOS device UA string,
// which causes all touch events to be ignored. As this block only applies to iOS, and iOS identifiers are always long,
// random integers, it's safe to to continue if the identifier is 0 here.
if (touch.identifier && touch.identifier === this.lastTouchIdentifier) {
event.preventDefault();
return false;
}
this.lastTouchIdentifier = touch.identifier;
// If the target element is a child of a scrollable layer (using -webkit-overflow-scrolling: touch) and:
// 1) the user does a fling scroll on the scrollable layer
// 2) the user stops the fling scroll with another tap
// then the event.target of the last 'touchend' event will be the element that was under the user's finger
// when the fling scroll was started, causing FastClick to send a click event to that layer - unless a check
// is made to ensure that a parent layer was not scrolled before sending a synthetic click (issue #42).
this.updateScrollParent(targetElement);
}
}
this.trackingClick = true;
this.trackingClickStart = event.timeStamp;
this.targetElement = targetElement;
this.touchStartX = touch.pageX;
this.touchStartY = touch.pageY;
// Prevent phantom clicks on fast double-tap (issue #36)
if ((event.timeStamp - this.lastClickTime) < this.tapDelay) {
event.preventDefault();
}
return true;
};
/**
* Based on a touchmove event object, check whether the touch has moved past a boundary since it started.
*
* @param {Event} event
* @returns {boolean}
*/
FastClick.prototype.touchHasMoved = function(event) {
'use strict';
var touch = event.changedTouches[0], boundary = this.touchBoundary;
if (Math.abs(touch.pageX - this.touchStartX) > boundary || Math.abs(touch.pageY - this.touchStartY) > boundary) {
return true;
}
return false;
};
/**
* Update the last position.
*
* @param {Event} event
* @returns {boolean}
*/
FastClick.prototype.onTouchMove = function(event) {
'use strict';
if (!this.trackingClick) {
return true;
}
// If the touch has moved, cancel the click tracking
if (this.targetElement !== this.getTargetElementFromEventTarget(event.target) || this.touchHasMoved(event)) {
this.trackingClick = false;
this.targetElement = null;
}
return true;
};
/**
* Attempt to find the labelled control for the given label element.
*
* @param {EventTarget|HTMLLabelElement} labelElement
* @returns {Element|null}
*/
FastClick.prototype.findControl = function(labelElement) {
'use strict';
// Fast path for newer browsers supporting the HTML5 control attribute
if (labelElement.control !== undefined) {
return labelElement.control;
}
// All browsers under test that support touch events also support the HTML5 htmlFor attribute
if (labelElement.htmlFor) {
return document.getElementById(labelElement.htmlFor);
}
// If no for attribute exists, attempt to retrieve the first labellable descendant element
// the list of which is defined here: http://www.w3.org/TR/html5/forms.html#category-label
return labelElement.querySelector('button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea');
};
/**
* On touch end, determine whether to send a click event at once.
*
* @param {Event} event
* @returns {boolean}
*/
FastClick.prototype.onTouchEnd = function(event) {
'use strict';
var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement;
if (!this.trackingClick) {
return true;
}
// Prevent phantom clicks on fast double-tap (issue #36)
if ((event.timeStamp - this.lastClickTime) < this.tapDelay) {
this.cancelNextClick = true;
return true;
}
// Reset to prevent wrong click cancel on input (issue #156).
this.cancelNextClick = false;
this.lastClickTime = event.timeStamp;
trackingClickStart = this.trackingClickStart;
this.trackingClick = false;
this.trackingClickStart = 0;
// On some iOS devices, the targetElement supplied with the event is invalid if the layer
// is performing a transition or scroll, and has to be re-detected manually. Note that
// for this to function correctly, it must be called *after* the event target is checked!
// See issue #57; also filed as rdar://13048589 .
if (deviceIsIOSWithBadTarget) {
touch = event.changedTouches[0];
// In certain cases arguments of elementFromPoint can be negative, so prevent setting targetElement to null
targetElement = document.elementFromPoint(touch.pageX - window.pageXOffset, touch.pageY - window.pageYOffset) || targetElement;
targetElement.fastClickScrollParent = this.targetElement.fastClickScrollParent;
}
targetTagName = targetElement.tagName.toLowerCase();
if (targetTagName === 'label') {
forElement = this.findControl(targetElement);
if (forElement) {
this.focus(targetElement);
if (deviceIsAndroid) {
return false;
}
targetElement = forElement;
}
} else if (this.needsFocus(targetElement)) {
// Case 1: If the touch started a while ago (best guess is 100ms based on tests for issue #36) then focus will be triggered anyway. Return early and unset the target element reference so that the subsequent click will be allowed through.
// Case 2: Without this exception for input elements tapped when the document is contained in an iframe, then any inputted text won't be visible even though the value attribute is updated as the user types (issue #37).
if ((event.timeStamp - trackingClickStart) > 100 || (deviceIsIOS && window.top !== window && targetTagName === 'input')) {
this.targetElement = null;
return false;
}
this.focus(targetElement);
this.sendClick(targetElement, event);
// Select elements need the event to go through on iOS 4, otherwise the selector menu won't open.
// Also this breaks opening selects when VoiceOver is active on iOS6, iOS7 (and possibly others)
if (!deviceIsIOS || targetTagName !== 'select') {
this.targetElement = null;
event.preventDefault();
}
return false;
}
if (deviceIsIOS && !deviceIsIOS4) {
// Don't send a synthetic click event if the target element is contained within a parent layer that was scrolled
// and this tap is being used to stop the scrolling (usually initiated by a fling - issue #42).
scrollParent = targetElement.fastClickScrollParent;
if (scrollParent && scrollParent.fastClickLastScrollTop !== scrollParent.scrollTop) {
return true;
}
}
// Prevent the actual click from going though - unless the target node is marked as requiring
// real clicks or if it is in the whitelist in which case only non-programmatic clicks are permitted.
if (!this.needsClick(targetElement)) {
event.preventDefault();
this.sendClick(targetElement, event);
}
return false;
};
/**
* On touch cancel, stop tracking the click.
*
* @returns {void}
*/
FastClick.prototype.onTouchCancel = function() {
'use strict';
this.trackingClick = false;
this.targetElement = null;
};
/**
* Determine mouse events which should be permitted.
*
* @param {Event} event
* @returns {boolean}
*/
FastClick.prototype.onMouse = function(event) {
'use strict';
// If a target element was never set (because a touch event was never fired) allow the event
if (!this.targetElement) {
return true;
}
if (event.forwardedTouchEvent) {
return true;
}
// Programmatically generated events targeting a specific element should be permitted
if (!event.cancelable) {
return true;
}
// Derive and check the target element to see whether the mouse event needs to be permitted;
// unless explicitly enabled, prevent non-touch click events from triggering actions,
// to prevent ghost/doubleclicks.
if (!this.needsClick(this.targetElement) || this.cancelNextClick) {
// Prevent any user-added listeners declared on FastClick element from being fired.
if (event.stopImmediatePropagation) {
event.stopImmediatePropagation();
} else {
// Part of the hack for browsers that don't support Event#stopImmediatePropagation (e.g. Android 2)
event.propagationStopped = true;
}
// Cancel the event
event.stopPropagation();
event.preventDefault();
return false;
}
// If the mouse event is permitted, return true for the action to go through.
return true;
};
/**
* On actual clicks, determine whether this is a touch-generated click, a click action occurring
* naturally after a delay after a touch (which needs to be cancelled to avoid duplication), or
* an actual click which should be permitted.
*
* @param {Event} event
* @returns {boolean}
*/
FastClick.prototype.onClick = function(event) {
'use strict';
var permitted;
// It's possible for another FastClick-like library delivered with third-party code to fire a click event before FastClick does (issue #44). In that case, set the click-tracking flag back to false and return early. This will cause onTouchEnd to return early.
if (this.trackingClick) {
this.targetElement = null;
this.trackingClick = false;
return true;
}
// Very odd behaviour on iOS (issue #18): if a submit element is present inside a form and the user hits enter in the iOS simulator or clicks the Go button on the pop-up OS keyboard the a kind of 'fake' click event will be triggered with the submit-type input element as the target.
if (event.target.type === 'submit' && event.detail === 0) {
return true;
}
permitted = this.onMouse(event);
// Only unset targetElement if the click is not permitted. This will ensure that the check for !targetElement in onMouse fails and the browser's click doesn't go through.
if (!permitted) {
this.targetElement = null;
}
// If clicks are permitted, return true for the action to go through.
return permitted;
};
/**
* Remove all FastClick's event listeners.
*
* @returns {void}
*/
FastClick.prototype.destroy = function() {
'use strict';
var layer = this.layer;
if (deviceIsAndroid) {
layer.removeEventListener('mouseover', this.onMouse, true);
layer.removeEventListener('mousedown', this.onMouse, true);
layer.removeEventListener('mouseup', this.onMouse, true);
}
layer.removeEventListener('click', this.onClick, true);
layer.removeEventListener('touchstart', this.onTouchStart, false);
layer.removeEventListener('touchmove', this.onTouchMove, false);
layer.removeEventListener('touchend', this.onTouchEnd, false);
layer.removeEventListener('touchcancel', this.onTouchCancel, false);
};
/**
* Check whether FastClick is needed.
*
* @param {Element} layer The layer to listen on
*/
FastClick.notNeeded = function(layer) {
'use strict';
var metaViewport;
var chromeVersion;
var blackberryVersion;
// Devices that don't support touch don't need FastClick
if (typeof window.ontouchstart === 'undefined') {
return true;
}
// Chrome version - zero for other browsers
chromeVersion = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [,0])[1];
if (chromeVersion) {
if (deviceIsAndroid) {
metaViewport = document.querySelector('meta[name=viewport]');
if (metaViewport) {
// Chrome on Android with user-scalable="no" doesn't need FastClick (issue #89)
if (metaViewport.content.indexOf('user-scalable=no') !== -1) {
return true;
}
// Chrome 32 and above with width=device-width or less don't need FastClick
if (chromeVersion > 31 && document.documentElement.scrollWidth <= window.outerWidth) {
return true;
}
}
// Chrome desktop doesn't need FastClick (issue #15)
} else {
return true;
}
}
if (deviceIsBlackBerry10) {
blackberryVersion = navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/);
// BlackBerry 10.3+ does not require Fastclick library.
// https://github.com/ftlabs/fastclick/issues/251
if (blackberryVersion[1] >= 10 && blackberryVersion[2] >= 3) {
metaViewport = document.querySelector('meta[name=viewport]');
if (metaViewport) {
// user-scalable=no eliminates click delay.
if (metaViewport.content.indexOf('user-scalable=no') !== -1) {
return true;
}
// width=device-width (or less than device-width) eliminates click delay.
if (document.documentElement.scrollWidth <= window.outerWidth) {
return true;
}
}
}
}
// IE10 with -ms-touch-action: none, which disables double-tap-to-zoom (issue #97)
if (layer.style.msTouchAction === 'none') {
return true;
}
return false;
};
/**
* Factory method for creating a FastClick object
*
* @param {Element} layer The layer to listen on
* @param {Object} options The options to override the defaults
*/
FastClick.attach = function(layer, options) {
'use strict';
return new FastClick(layer, options);
};
if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
// AMD. Register as an anonymous module.
define(function() {
'use strict';
return FastClick;
});
} else if (typeof module !== 'undefined' && module.exports) {
module.exports = FastClick.attach;
module.exports.FastClick = FastClick;
} else {
window.FastClick = FastClick;
}
+1 -1
View File
@@ -1,4 +1,4 @@
var MSG = {"a":"a","aboutMe":"About me","author":"Author","baseInfoSet":"Base info","blog":"Blog","blogClass":"Classification","blogDesc":"Description","blogLogo":"Logo","blogLogoTips":"Upload image to replace blog title","blogName":"Title","blogNav":"Blog nav","blogNavs":"Navs","blogSet":"Set blog","cancel":"Cancel","chooseReason":"请选择举报理由","comment":"Comment","commentSet":"Comment","commentSys":"leanote use \u003ca href=\"http://disqus.com\" target=\"_blank\"\u003eDisqus\u003c/a\u003e as comment system","comments":"Comments","community":"Community","confirm":"Confirm","confirmDeleteComment":"Are you sure?","createdTime":"Created at","daysAgo":"days ago","delete":"Delete","disqusHelp":"Please input your Disqus Id or use \"leanote\"","elegant":"Elegant","error":"Error","fullBlog":"Full blog","home":"Home","hoursAgo":"hours ago","justNow":"Just now","latestPosts":"Latest posts","like":"Like","minutesAgo":"minutes ago","monthsAgo":"months ago","moreShare":"More","navFixed":"Nav fixed at left side","needHelp":"Need help?","noBlog":"No blog","noTag":"No tag","none":"None","openComment":"Open comment?","other":"Other","qqZone":"QQ Zone","quickLinks":"Quick links","renren":"Renren","reply":"Reply","report":"Report","reportBlog?":"举报该博客?","reportComment?":"举报该评论?","reportReason":"Reason","reportReason1":"不友善内容","reportReason2":"广告等垃圾信息","reportReason3":"违法违规内容","reportReason4":"不宜公开讨论的政治内容","reportSuccess":"举报成功, 我们处理后会通知作者, 感谢您的监督","saveSuccess":"Save success","scanQRCode":"Open weichat and scan the QR code","signIn":"Sign In","signUp":"Sign Up","sinaWeibo":"Weibo","submitComment":"Submit","tencentWeibo":"Tencent Weibo","theme":"Theme","themeSet":"Theme","unlike":"Unlike","updatedTime":"Updated at","viewers":"Viewers","weeksAgo":"weeks ago","weixin":"Weichat"};
var MSG = {"a":"a","aboutMe":"About Me","author":"Author","baseInfoSet":"Base info","blogClass":"Category","blogDesc":"Description","blogLogo":"Logo","blogLogoTips":"Upload image to replace blog title","blogName":"Title","blogNav":"Blog nav","blogNavs":"Navs","blogSet":"Blog configuration","cancel":"Cancel","chooseComment":"Comment System","chooseReason":"请选择举报理由","comment":"Comment","commentSet":"Comment","comments":"Comments","community":"Community","confirm":"Confirm","confirmDeleteComment":"Are you sure?","createdTime":"Created at","daysAgo":"days ago","delete":"Delete","disqusHelp":"Please input your Disqus Id","domain":"Custom domain","domainSet":"Domain","elegant":"Elegant","error":"Error","fullBlog":"Full blog","home":"Home","hoursAgo":"hours ago","justNow":"Just now","latestPosts":"Latest posts","like":"Like","minutesAgo":"minutes ago","monthsAgo":"months ago","more":"More...","moreShare":"More","navFixed":"Nav fixed at left side","needHelp":"Need help?","next":"Next","noBlog":"No blog","noTag":"No tag","none":"None","openComment":"Open comment?","other":"Other","previous":"Previous","qqZone":"QQ Zone","quickLinks":"Quick links","renren":"Renren","reply":"Reply","report":"Report","reportBlog?":"举报该博客?","reportComment?":"举报该评论?","reportReason":"Reason","reportReason1":"不友善内容","reportReason2":"广告等垃圾信息","reportReason3":"违法违规内容","reportReason4":"不宜公开讨论的政治内容","reportSuccess":"举报成功, 我们处理后会通知作者, 感谢您的监督","saveSuccess":"Save success","scanQRCode":"Open weichat and scan the QR code","signIn":"Sign In","signUp":"Sign Up","sinaWeibo":"Weibo","subDomain":"Sub domain","submitComment":"Submit","tencentWeibo":"Tencent Weibo","theme":"Theme","themeSet":"Theme","unlike":"Unlike","updatedTime":"Updated at","viewers":"Viewers","weeksAgo":"weeks ago","weixin":"Weichat"};
function getMsg(key, data) {
var msg = MSG[key]
if(msg) {
+1 -1
View File
@@ -1,4 +1,4 @@
var MSG = {"a":"a","aboutMe":"关于我","author":"作者","baseInfoSet":"基本设置","blog":"博客","blogClass":"分类","blogDesc":"博客描述","blogLogo":"博客Logo","blogLogoTips":"上传logo将显示logo(替代博客标题)","blogName":"博客标题","blogNav":"导航","blogNavs":"导航","blogSet":"博客设置","cancel":"取消","chooseReason":"请选择举报理由","comment":"评论","commentSet":"评论设置","commentSys":"leanote 使用 \u003ca href=\"http://disqus.com\" target=\"_blank\"\u003eDisqus\u003c/a\u003e 作为评论系统","comments":"条评论","community":"社区","confirm":"确认","confirmDeleteComment":"确定删除该评论?","createdTime":"创建","daysAgo":"天前","delete":"删除","disqusHelp":"请填写您申请的Disqus唯一url前缀. 建议您申请Disqus帐号, 这样可以自己管理评论. 或使用leanote的默认Disqus Id. ","elegant":"大气","error":"错误","fullBlog":"全文","home":"主页","hoursAgo":"个小时前","justNow":"刚刚","latestPosts":"最近发表","like":"赞","minutesAgo":"分钟前","monthsAgo":"个月前","moreShare":"更多分享","navFixed":"导航左侧固定","needHelp":"需要帮助?","noBlog":"无博客","noTag":"无","none":"无","openComment":"开启评论?","other":"其它","qqZone":"QQ空间","quickLinks":"快速链接","renren":"人人网","reply":"回复","report":"举报","reportBlog?":"举报该博客?","reportComment?":"举报该评论?","reportReason":"举报理由","reportReason1":"不友善内容","reportReason2":"广告等垃圾信息","reportReason3":"违法违规内容","reportReason4":"不宜公开讨论的政治内容","reportSuccess":"举报成功, 我们处理后会通知作者, 感谢您的监督","saveSuccess":"保存成功","scanQRCode":"打开微信扫一扫二维码","signIn":"登录","signUp":"注册","sinaWeibo":"新浪微博","submitComment":"发表评论","tencentWeibo":"腾讯微博","theme":"主题","themeSet":"主题设置","unlike":"取消赞","updatedTime":"更新","viewers":"人读过","weeksAgo":"周前","weixin":"微信"};
var MSG = {"a":"a","aboutMe":"关于我","author":"作者","baseInfoSet":"基本设置","blog":"博客","blogClass":"分类","blogDesc":"博客描述","blogLogo":"博客Logo","blogLogoTips":"上传logo将显示logo(替代博客标题)","blogName":"博客标题","blogNav":"导航","blogNavs":"导航","blogSet":"博客设置","cancel":"取消","chooseComment":"选择评论系统","chooseReason":"请选择举报理由","comment":"评论","commentSet":"评论设置","comments":"条评论","community":"社区","confirm":"确认","confirmDeleteComment":"确定删除该评论?","createdTime":"创建","daysAgo":"天前","delete":"删除","disqusHelp":"请填写您申请的Disqus唯一url前缀. 建议您申请Disqus帐号, 这样可以自己管理评论. 或使用leanote的默认Disqus Id. ","domain":"自定义域名","domainSet":"域名设置","elegant":"大气","error":"错误","fullBlog":"全文","home":"主页","hoursAgo":"个小时前","justNow":"刚刚","latestPosts":"最近发表","like":"赞","minutesAgo":"分钟前","monthsAgo":"个月前","more":"更多...","moreShare":"更多分享","navFixed":"导航左侧固定","needHelp":"需要帮助?","next":"下一页","noBlog":"无博客","noTag":"无","none":"无","openComment":"开启评论?","other":"其它","previous":"上一页","qqZone":"QQ空间","quickLinks":"快速链接","renren":"人人网","reply":"回复","report":"举报","reportBlog?":"举报该博客?","reportComment?":"举报该评论?","reportReason":"举报理由","reportReason1":"不友善内容","reportReason2":"广告等垃圾信息","reportReason3":"违法违规内容","reportReason4":"不宜公开讨论的政治内容","reportSuccess":"举报成功, 我们处理后会通知作者, 感谢您的监督","saveSuccess":"保存成功","scanQRCode":"打开微信扫一扫二维码","signIn":"登录","signUp":"注册","sinaWeibo":"新浪微博","subDomain":"博客子域名","submitComment":"发表评论","tencentWeibo":"腾讯微博","theme":"主题","themeSet":"主题设置","unlike":"取消赞","updatedTime":"更新","viewers":"人读过","weeksAgo":"周前","weixin":"微信"};
function getMsg(key, data) {
var msg = MSG[key]
if(msg) {
Loaded 100 of 1452 files, more files were not shown because too many files have changed in this diff. Show more