Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
000dfea92d | ||
|
|
a53398ebb4 | ||
|
|
b23592229a | ||
|
|
584bde247e | ||
|
|
6774392807 | ||
|
|
964cf1a750 | ||
|
|
52128e6453 | ||
|
|
032470c3df | ||
|
|
a8dd578624 | ||
|
|
f49624d3eb |
No files matched your search
@@ -18,8 +18,6 @@ script:
|
||||
- mongo --version
|
||||
- mongorestore -h localhost -d leanote --directoryperdb ./mongodb_backup/leanote_install_data/
|
||||
|
||||
- go test github.com/leanote/leanote/app/tests
|
||||
|
||||
# gen tmp/main.go, routes/routes.go
|
||||
- go run app/cmd/main.go
|
||||
# build
|
||||
|
||||
@@ -184,6 +184,6 @@ Leanote还有很多问题, 如果你喜欢它, 欢迎加入我们一起完善Lea
|
||||
## 联系&加入我们
|
||||
* Email: leanote@leanote.com
|
||||
* [Leanote 社区](http://bbs.leanote.com)
|
||||
* QQ群: 326073529, 256076853, 158716820
|
||||
* [QQ群](http://leanote.leanote.com/post/Leanote-groups)
|
||||
* [Leanote Google Group](https://groups.google.com/forum/#!forum/leanote)
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
# Leanote
|
||||
|
||||
[](https://gitter.im/leanote/leanote?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
||||
[](https://travis-ci.org/leanote/leanote)
|
||||
## 1. 介绍
|
||||
|
||||
Leanote, 不只是笔记!
|
||||

|
||||
|
||||
**特性**
|
||||
|
||||
* 知识管理: 通过leanote来管理知识, leanote有易操作的界面, 包含两款编辑器tinymce和markdown. 在leanote, 你可以尽情享受写作.
|
||||
* 分享: 你也可以通过分享知识给好友, 让好友拥有你的知识.
|
||||
* 协作: 在分享的同时也可以与好友一起协作知识.
|
||||
* 博客: leanote也可以作为你的博客, 将知识公开成博客, 让leanote把你的知识传播的更远!
|
||||
|
||||
## 2. 为什么我们要创建leanote?
|
||||
说实话, 我们曾是evernote的忠实粉丝, 但是我们也发现evernote的不足:
|
||||
* evernote的编辑器不能满足我们的需求, 不能贴代码(格式会乱掉, 作为程序员, 代码是我们的基本需求啊), 图片不能缩放.
|
||||
* 我们是markdown的爱好者, 可是evernote竟然没有.
|
||||
* 我们也想将知识公开, 所以我们有自己的博客, 如wordpress, 但为什么这两者不能合二为一呢?
|
||||
* 还有...
|
||||
|
||||
## 3.安装leanote
|
||||
leanote是一款私有云笔记, 你可以下载它安装在自己的服务器上, 当然也可以在 http://leanote.com 上注册.
|
||||
|
||||
这里详细整理了leanote二进版和leanote开发版的安装教程, 请移步至:
|
||||
|
||||
* [leanote二进制详细安装教程](https://github.com/leanote/leanote/wiki/leanote%E4%BA%8C%E8%BF%9B%E5%88%B6%E7%89%88%E8%AF%A6%E7%BB%86%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B)
|
||||
* [leanote开发版详细安装教程](https://github.com/leanote/leanote/wiki/leanote%E5%BC%80%E5%8F%91%E7%89%88%E8%AF%A6%E7%BB%86%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B)
|
||||
|
||||
## 4. 如何对leanote进行二次开发
|
||||
|
||||
请查看 [How-to-develop-leanote](https://github.com/leanote/leanote/wiki/How-to-develop-leanote-%E5%A6%82%E4%BD%95%E5%BC%80%E5%8F%91leanote)
|
||||
|
||||
## 5 相关文档
|
||||
* [leanote二进制版详细安装教程](https://github.com/leanote/leanote/wiki/leanote%E4%BA%8C%E8%BF%9B%E5%88%B6%E7%89%88%E8%AF%A6%E7%BB%86%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B)
|
||||
* [leanote开发版详细安装教程](https://github.com/leanote/leanote/wiki/leanote%E5%BC%80%E5%8F%91%E7%89%88%E8%AF%A6%E7%BB%86%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B)
|
||||
* [Leanote source leanote源码导读](https://github.com/leanote/leanote/wiki/Leanote-source-leanote源码导读)
|
||||
* [leanote blog theme api(中文版)](https://github.com/leanote/leanote/wiki/leanote-blog-theme-api)
|
||||
* [How to develop leanote 如何开发leanote](https://github.com/leanote/leanote/wiki/How-to-develop-leanote-如何开发leanote)
|
||||
|
||||
更多文档请查看 [wiki](https://github.com/leanote/leanote/wiki).
|
||||
|
||||
## 6. 贡献者
|
||||
多谢 [贡献者](https://github.com/leanote/leanote/graphs/contributors) 的贡献, leanote因有你们而更完美!
|
||||
|
||||
## 7. 加入我们
|
||||
|
||||
欢迎提交[pull requests](https://github.com/leanote/leanote/pulls) 到leanote.
|
||||
|
||||
有任何问题或建议, 欢迎提交[issue](https://github.com/leanote/leanote/issues).
|
||||
|
||||
Leanote还有很多问题, 如果你喜欢它, 欢迎加入我们一起完善leanote.
|
||||
|
||||
## 8. 捐赠
|
||||
支持我们, [捐赠Leanote](http://leanote.org/#donate). 感谢[捐赠者](http://leanote.leanote.com/post/leanote-donation-list), 谢谢你们的鼓励, Leanote会一直坚持!
|
||||
|
||||
## 9. 其它相关项目
|
||||
* [Leanote Desktop App](https://github.com/leanote/desktop-app), [下载地址](http://app.leanote.com)
|
||||
* [Leanote IOS](https://github.com/leanote/leanote-ios), [从App Store下载](https://itunes.apple.com/zn/app/leanote/id1022302858?mt=8)
|
||||
* [Leanote Android](https://github.com/Dminter/leanote-android-client), 开发阶段
|
||||
|
||||
欢迎加入我们!
|
||||
|
||||
## 联系&加入我们
|
||||
* Email: leanote@leanote.com
|
||||
* [leanote 社区](http://bbs.leanote.com)
|
||||
* QQ群: 158716820, 256076853
|
||||
* [Leanote Google Group](https://groups.google.com/forum/#!forum/leanote)
|
||||
|
||||
----------------------------------------------------------------
|
||||
[English](README.md)
|
||||
@@ -338,6 +338,8 @@ func (c Note) ToPdf(noteId, appKey string) revel.Result {
|
||||
siteUrlPattern = strings.Replace(siteUrlPattern, "http", "https*", 1)
|
||||
}
|
||||
|
||||
siteUrlPattern = "(?:" + siteUrlPattern + ")*"
|
||||
|
||||
regImage, _ := regexp.Compile(`<img .*?(src=('|")` + siteUrlPattern + `/(file/outputImage|api/file/getImage)\?fileId=([a-z0-9A-Z]{24})("|'))`)
|
||||
|
||||
findsImage := regImage.FindAllStringSubmatch(contentStr, -1) // 查找所有的
|
||||
|
||||
@@ -74,12 +74,13 @@ func (c AdminEmail) DoToImage(toImageBinPath string) revel.Result {
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
func (c AdminEmail) Set(emailHost, emailPort, emailUsername, emailPassword string) revel.Result {
|
||||
func (c AdminEmail) Set(emailHost, emailPort, emailUsername, emailPassword, emailSSL string) revel.Result {
|
||||
re := info.NewRe()
|
||||
re.Ok = configService.UpdateGlobalStringConfig(c.GetUserId(), "emailHost", emailHost)
|
||||
re.Ok = configService.UpdateGlobalStringConfig(c.GetUserId(), "emailPort", emailPort)
|
||||
re.Ok = configService.UpdateGlobalStringConfig(c.GetUserId(), "emailUsername", emailUsername)
|
||||
re.Ok = configService.UpdateGlobalStringConfig(c.GetUserId(), "emailPassword", emailPassword)
|
||||
re.Ok = configService.UpdateGlobalStringConfig(c.GetUserId(), "emailSSL", emailSSL)
|
||||
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
@@ -8,8 +8,9 @@ import (
|
||||
"gopkg.in/mgo.v2/bson"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
// "strings"
|
||||
"time"
|
||||
"regexp"
|
||||
// "github.com/leanote/leanote/app/types"
|
||||
// "io/ioutil"
|
||||
// "fmt"
|
||||
@@ -158,11 +159,33 @@ func (c ApiNote) fixPostNotecontent(noteOrContent *info.ApiNote) {
|
||||
if noteOrContent.Content == "" {
|
||||
return
|
||||
}
|
||||
|
||||
files := noteOrContent.Files
|
||||
if files != nil && len(files) > 0 {
|
||||
for _, file := range files {
|
||||
if file.LocalFileId != "" {
|
||||
noteOrContent.Content = strings.Replace(noteOrContent.Content, "fileId="+file.LocalFileId, "fileId="+file.FileId, -1)
|
||||
LogJ(file)
|
||||
if !file.IsAttach {
|
||||
// <img src="https://"
|
||||
// 
|
||||
reg, _ := regexp.Compile(`https*://[^/]*?/api/file/getImage\?fileId=`+file.LocalFileId)
|
||||
// Log(reg)
|
||||
noteOrContent.Content = reg.ReplaceAllString(noteOrContent.Content, `/api/file/getImage?fileId=`+file.FileId)
|
||||
|
||||
// // "http://a.com/api/file/getImage?fileId=localId" => /api/file/getImage?fileId=serverId
|
||||
// noteOrContent.Content = strings.Replace(noteOrContent.Content,
|
||||
// baseUrl + "/api/file/getImage?fileId="+file.LocalFileId,
|
||||
// "/api/file/getImage?fileId="+file.FileId, -1)
|
||||
} else {
|
||||
reg, _ := regexp.Compile(`https*://[^/]*?/api/file/getAttach\?fileId=`+file.LocalFileId)
|
||||
Log(reg)
|
||||
noteOrContent.Content = reg.ReplaceAllString(noteOrContent.Content, `/api/file/getAttach?fileId=`+file.FileId)
|
||||
/*
|
||||
noteOrContent.Content = strings.Replace(noteOrContent.Content,
|
||||
baseUrl + "/api/file/getAttach?fileId="+file.LocalFileId,
|
||||
"/api/file/getAttach?fileId="+file.FileId, -1)
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -352,6 +375,7 @@ func (c ApiNote) UpdateNote(noteOrContent info.ApiNote) revel.Result {
|
||||
Log("conflict")
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
Log("没有冲突")
|
||||
|
||||
// 如果传了files
|
||||
// TODO 测试
|
||||
|
||||
@@ -119,6 +119,7 @@ func (this *AttachService) DeleteAllAttachs(noteId, userId string) bool {
|
||||
}
|
||||
|
||||
// delete attach
|
||||
// 删除附件为什么要incrNoteUsn ? 因为可能没有内容要修改的
|
||||
func (this *AttachService) DeleteAttach(attachId, userId string) (bool, string) {
|
||||
attach := info.Attach{}
|
||||
db.Get(db.Attachs, attachId, &attach)
|
||||
|
||||
@@ -49,7 +49,8 @@ func (this *ConfigService) InitGlobalConfigs() bool {
|
||||
this.adminUserId = userInfo.UserId.Hex()
|
||||
|
||||
configs := []info.Config{}
|
||||
db.ListByQ(db.Configs, bson.M{"UserId": userInfo.UserId}, &configs)
|
||||
// db.ListByQ(db.Configs, bson.M{"UserId": userInfo.UserId}, &configs)
|
||||
db.ListByQ(db.Configs, bson.M{}, &configs)
|
||||
|
||||
for _, config := range configs {
|
||||
if config.IsArr {
|
||||
@@ -96,7 +97,7 @@ func (this *ConfigService) updateGlobalConfig(userId, key string, value interfac
|
||||
if _, ok := this.GlobalAllConfigs[key]; !ok {
|
||||
// 需要添加
|
||||
config := info.Config{ConfigId: bson.NewObjectId(),
|
||||
UserId: bson.ObjectIdHex(userId),
|
||||
UserId: bson.ObjectIdHex(userId), // 没用
|
||||
Key: key,
|
||||
IsArr: isArr,
|
||||
IsMap: isMap,
|
||||
@@ -141,7 +142,8 @@ func (this *ConfigService) updateGlobalConfig(userId, key string, value interfac
|
||||
i["ValueStr"] = v
|
||||
this.GlobalStringConfigs[key] = v
|
||||
}
|
||||
return db.UpdateByQMap(db.Configs, bson.M{"UserId": bson.ObjectIdHex(userId), "Key": key}, i)
|
||||
// return db.UpdateByQMap(db.Configs, bson.M{"UserId": bson.ObjectIdHex(userId), "Key": key}, i)
|
||||
return db.UpdateByQMap(db.Configs, bson.M{"Key": key}, i)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -604,5 +606,5 @@ func (this *ConfigService) HomePageIsAdminsBlog() bool {
|
||||
}
|
||||
|
||||
func (this *ConfigService) GetVersion() string {
|
||||
return "2.0"
|
||||
return "2.2.2"
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"net"
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/leanote/leanote/app/db"
|
||||
@@ -29,12 +31,74 @@ var host = ""
|
||||
var emailPort = ""
|
||||
var username = ""
|
||||
var password = ""
|
||||
var ssl = false
|
||||
|
||||
func InitEmailFromDb() {
|
||||
host = configService.GetGlobalStringConfig("emailHost")
|
||||
emailPort = configService.GetGlobalStringConfig("emailPort")
|
||||
username = configService.GetGlobalStringConfig("emailUsername")
|
||||
password = configService.GetGlobalStringConfig("emailPassword")
|
||||
if configService.GetGlobalStringConfig("emailSSL") == "1" {
|
||||
ssl = true
|
||||
}
|
||||
}
|
||||
|
||||
//return a smtp client
|
||||
func dial(addr string) (*smtp.Client, error) {
|
||||
conn, err := tls.Dial("tcp", addr, nil)
|
||||
if err != nil {
|
||||
LogW("Dialing Error:", err)
|
||||
return nil, err
|
||||
}
|
||||
//分解主机端口字符串
|
||||
host, _, _ := net.SplitHostPort(addr)
|
||||
return smtp.NewClient(conn, host)
|
||||
}
|
||||
|
||||
func SendEmailWithSSL (auth smtp.Auth, to []string, msg []byte) (err error) {
|
||||
//create smtp client
|
||||
c, err := dial(host + ":" + emailPort)
|
||||
if err != nil {
|
||||
LogW("Create smpt client error:", err)
|
||||
return err
|
||||
}
|
||||
defer c.Close()
|
||||
|
||||
if auth != nil {
|
||||
if ok, _ := c.Extension("AUTH"); ok {
|
||||
if err = c.Auth(auth); err != nil {
|
||||
LogW("Error during AUTH", err)
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if err = c.Mail(username); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, addr := range to {
|
||||
if err = c.Rcpt(addr); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
w, err := c.Data()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = w.Write(msg)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
err = w.Close()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return c.Quit()
|
||||
}
|
||||
|
||||
func (this *EmailService) SendEmail(to, subject, body string) (ok bool, e string) {
|
||||
@@ -57,7 +121,14 @@ func (this *EmailService) SendEmail(to, subject, body string) (ok bool, e string
|
||||
|
||||
msg := []byte("To: " + to + "\r\nFrom: " + username + "<" + username + ">\r\nSubject: " + subject + "\r\n" + content_type + "\r\n\r\n" + body)
|
||||
send_to := strings.Split(to, ";")
|
||||
err := smtp.SendMail(host+":"+emailPort, auth, username, send_to, msg)
|
||||
|
||||
var err error
|
||||
if ssl {
|
||||
err = SendEmailWithSSL(auth, send_to, msg)
|
||||
} else {
|
||||
Log("no ssl")
|
||||
err = smtp.SendMail(host + ":" + emailPort, auth, username, send_to, msg)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
e = fmt.Sprint(err)
|
||||
|
||||
@@ -415,9 +415,15 @@ func (this *NoteService) UpdateNote(updatedUserId, noteId string, needUpdate bso
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
// 这里不再判断, 因为controller已经判断了, 删除附件会新增, 所以不用判断
|
||||
if usn > 0 && note.Usn != usn {
|
||||
Log("有冲突!!")
|
||||
Log(note.Usn)
|
||||
Log(usn)
|
||||
return false, "conflict", 0
|
||||
}
|
||||
*/
|
||||
|
||||
// 是否已自定义
|
||||
if note.IsBlog && note.HasSelfDefined {
|
||||
@@ -857,7 +863,13 @@ func (this *NoteService) searchNoteFromContent(notes []info.Note, userId, key st
|
||||
notes2 := this.ListNotesByNoteIds(noteIds2)
|
||||
|
||||
// 合并之
|
||||
notes = append(notes, notes2...)
|
||||
// 不能是删除的
|
||||
for _, n := range notes2 {
|
||||
if !n.IsDeleted && !n.IsTrash {
|
||||
// notes = append(notes, notes2...)
|
||||
notes = append(notes, n)
|
||||
}
|
||||
}
|
||||
return notes
|
||||
}
|
||||
|
||||
@@ -1017,6 +1029,8 @@ func (this *NoteService) FixContentBad(content string, isMarkdown bool) string {
|
||||
return content
|
||||
}
|
||||
|
||||
// 得到笔记的内容, 此时将笔记内的链接转成标准的Leanote Url
|
||||
// 将笔记的图片, 附件链接转换成 site.url/file/getImage?fileId=xxx, site.url/file/getAttach?fileId=xxxx
|
||||
// 性能更好, 5倍的差距
|
||||
func (this *NoteService) FixContent(content string, isMarkdown bool) string {
|
||||
baseUrl := configService.GetSiteUrl()
|
||||
@@ -1029,12 +1043,19 @@ func (this *NoteService) FixContent(content string, isMarkdown bool) string {
|
||||
} else {
|
||||
baseUrlPattern = strings.Replace(baseUrl, "http://", "https*://", 1)
|
||||
}
|
||||
baseUrlPattern = "(?:" + baseUrlPattern + ")*"
|
||||
|
||||
Log(baseUrlPattern)
|
||||
|
||||
patterns := []map[string]string{
|
||||
map[string]string{"src": "src", "middle": "/api/file/getImage", "param": "fileId", "to": "getImage?fileId="},
|
||||
map[string]string{"src": "src", "middle": "/file/outputImage", "param": "fileId", "to": "getImage?fileId="},
|
||||
|
||||
map[string]string{"src": "href", "middle": "/attach/download", "param": "attachId", "to": "getAttach?fileId="},
|
||||
map[string]string{"src": "href", "middle": "/api/file/getAtach", "param": "fileId", "to": "getAttach?fileId="},
|
||||
|
||||
// 该链接已失效, 不再支持
|
||||
map[string]string{"src": "href", "middle": "/attach/downloadAll", "param": "noteId", "to": "getAllAttachs?noteId="},
|
||||
// map[string]string{"src": "href", "middle": "/attach/downloadAll", "param": "noteId", "to": "getAllAttachs?noteId="},
|
||||
}
|
||||
|
||||
for _, eachPattern := range patterns {
|
||||
@@ -1056,6 +1077,8 @@ func (this *NoteService) FixContent(content string, isMarkdown bool) string {
|
||||
reg2, _ = regexp.Compile("<a(?:[^>]+?)(" + eachPattern["src"] + `=['"]*` + baseUrlPattern + eachPattern["middle"] + `\?` + eachPattern["param"] + `=([a-z0-9A-Z]{24})["']*)[^>]*>`)
|
||||
}
|
||||
|
||||
Log(reg2)
|
||||
|
||||
content = reg.ReplaceAllStringFunc(content, func(str string) string {
|
||||
// str=这样的
|
||||
// <img src="http://localhost:9000/file/outputImage?fileId=563d706e99c37b48e0000001" alt="" data-mce-src="http://localhost:9000/file/outputImage?fileId=563d706e99c37b48e0000002">
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package tests
|
||||
|
||||
import (
|
||||
"github.com/revel/revel"
|
||||
"github.com/leanote/leanote/app/db"
|
||||
"testing"
|
||||
// . "github.com/leanote/leanote/app/lea"
|
||||
"github.com/leanote/leanote/app/service"
|
||||
// "gopkg.in/mgo.v2"
|
||||
// "fmt"
|
||||
)
|
||||
|
||||
func init() {
|
||||
revel.Init("dev", "github.com/leanote/leanote", "/Users/life/Documents/Go/package_base/src")
|
||||
db.Init("mongodb://localhost:27017/leanote", "leanote")
|
||||
service.InitService()
|
||||
service.ConfigS.InitGlobalConfigs()
|
||||
}
|
||||
|
||||
// 测试登录
|
||||
func TestSendMail(t *testing.T) {
|
||||
ok, err := service.EmailS.SendEmail("life@leanote.com", "你好", "你好吗")
|
||||
t.Log(ok)
|
||||
t.Log(err)
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package tests
|
||||
|
||||
import (
|
||||
"github.com/leanote/leanote/app/db"
|
||||
"github.com/revel/revel"
|
||||
"testing"
|
||||
// . "github.com/leanote/leanote/app/lea"
|
||||
"github.com/leanote/leanote/app/service"
|
||||
// "regexp"
|
||||
// "gopkg.in/mgo.v2"
|
||||
// "fmt"
|
||||
// "strings"
|
||||
)
|
||||
|
||||
|
||||
// 可在server端调试
|
||||
|
||||
func init() {
|
||||
revel.Init("dev", "github.com/leanote/leanote", "/Users/life/Documents/Go/package_base/src")
|
||||
db.Init("mongodb://localhost:27017/leanote", "leanote")
|
||||
service.InitService()
|
||||
service.ConfigS.InitGlobalConfigs()
|
||||
}
|
||||
|
||||
func TestApiFixNoteContent2(t *testing.T) {
|
||||
note2 := service.NoteS.GetNote("585df83771c1b17e8a000000", "585df81199c37b6176000004")
|
||||
note := service.NoteS.GetNoteContent("585df83771c1b17e8a000000", "585df81199c37b6176000004")
|
||||
contentFixed := service.NoteS.FixContent(note.Content, false)
|
||||
t.Log(note2.Title)
|
||||
t.Log(note.Content)
|
||||
t.Log(contentFixed)
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package tests
|
||||
|
||||
import (
|
||||
// "github.com/leanote/leanote/app/db"
|
||||
"testing"
|
||||
// . "github.com/leanote/leanote/app/lea"
|
||||
// "github.com/leanote/leanote/app/service"
|
||||
// "gopkg.in/mgo.v2"
|
||||
// "fmt"
|
||||
"regexp"
|
||||
)
|
||||
|
||||
|
||||
// 测试登录
|
||||
func TestReg(t *testing.T) {
|
||||
a := `<a href="http://localhost:9000/api/file/getAttach?fileId=585e0e9c270a35609300000c" target="_blank" data-mce-href="http://localhost:9000/api/file/getAttach?fileId=585e0e9c270a35609300000c">proxy.go</a>`
|
||||
reg, _ := regexp.Compile(`"https*://[^/]*?/api/file/getAttach\?fileId=585e0e9c270a35609300000c`)
|
||||
|
||||
a2 := reg.ReplaceAllString(a, `"`)
|
||||
t.Log(a2)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -24,6 +24,10 @@
|
||||
<label>Password</label>
|
||||
<input type="text" class="form-control" name="emailPassword" value="{{.str.emailPassword}}" placeholder="">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>SSL ?</label>
|
||||
<input type="checkbox" class="form-control" name="emailSSL" {{if .str.emailSSL}}checked="checked"{{end}} value="1">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer class="panel-footer text-right bg-light lter">
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
</h4>
|
||||
<ul class="list-group" id="eventsList"></ul>
|
||||
</section>
|
||||
|
||||
|
||||
<!--
|
||||
<section class="panel panel-default">
|
||||
<form>
|
||||
@@ -56,7 +56,7 @@
|
||||
</footer>
|
||||
</section>
|
||||
-->
|
||||
|
||||
|
||||
{{template "admin/footer.html" .}}
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
@@ -225,6 +225,7 @@
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<!--
|
||||
<li>
|
||||
<a href="#">
|
||||
<i class="fa fa-space-shuttle icon">
|
||||
@@ -259,5 +260,6 @@
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
-->
|
||||
</ul>
|
||||
</nav>
|
||||
@@ -29,18 +29,8 @@
|
||||
|
||||
<ul class="nav navbar-nav navbar-right m-n hidden-xs nav-user">
|
||||
<li class="hidden-xs">
|
||||
<a href="http://leanote.com" class="dk" target="_blank">
|
||||
Leanote Home
|
||||
</a>
|
||||
</li>
|
||||
<li class="hidden-xs">
|
||||
<a href="https://github.com/leanote/leanote" class="dk" target="_blank">
|
||||
Leanote Github
|
||||
</a>
|
||||
</li>
|
||||
<li class="hidden-xs">
|
||||
<a href="http://lea.leanote.com" class="dk" target="_blank">
|
||||
Leanote Explore
|
||||
<a href="/" class="dk">
|
||||
Home
|
||||
</a>
|
||||
</li>
|
||||
<li class="hidden-xs">
|
||||
@@ -87,7 +77,7 @@
|
||||
</section>
|
||||
<footer class="footer lt hidden-xs b-t b-light" style="min-height: initial;
|
||||
padding: 10px 15px;text-align:center;">
|
||||
<a href="http://leanote.com" target="_blank">leanote</a> © 2015
|
||||
© <a href="https://leanote.com" target="_blank">Leanote</a>
|
||||
<!--
|
||||
<a href="#nav" data-toggle="class:nav-xs" class="pull-right btn btn-sm btn-default btn-icon">
|
||||
<i class="fa fa-angle-left text">
|
||||
|
||||
@@ -161,6 +161,6 @@ var UrlPrefix = '{{.siteUrl}}';
|
||||
<script src="/public/album/js/main.js"></script>
|
||||
-->
|
||||
|
||||
<script src="/public/album/js/main.all.js"></script>
|
||||
<script src="/public/album/js/main.all.js?i=2"></script>
|
||||
|
||||
</html>
|
||||
@@ -26,7 +26,7 @@
|
||||
</section>
|
||||
<div id="boxFooter">
|
||||
<p>
|
||||
<a href="/index">leanote</a> © 2015
|
||||
© <a href="/index">Leanote</a>
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
</section>
|
||||
<div id="boxFooter">
|
||||
<p>
|
||||
<a href="/index">leanote</a> © 2015
|
||||
© <a href="/index">Leanote</a>
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<a href="/index">{{msg . "home"}}</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="https://leanote.com">Leanote</a> © 2014-2016
|
||||
© <a href="https://leanote.com">Leanote</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<a href="/index">{{msg . "home"}}</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="https://leanote.com">Leanote</a> © 2014-2016
|
||||
© <a href="https://leanote.com">Leanote</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<a href="/index">{{msg . "home"}}</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="https://leanote.com">Leanote</a> © 2014-2016
|
||||
© <a href="https://leanote.com">Leanote</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -4,22 +4,21 @@
|
||||
<div class="col-md-6">
|
||||
<i class="fa fa-envelope-o fa-3x icon-muted"></i>
|
||||
<h2>Contact</h2>
|
||||
<a href="http://weibo.com/leanotecom" target="_blank"><i class="fa fa-weibo"></i></a>
|
||||
<a href="http://weibo.com/leanotecom" target="_blank"><i class="fa fa-weibo"></i></a> / leanote@leanote.com
|
||||
<br />
|
||||
leanote@leanote.com
|
||||
<br />
|
||||
Copyright © 2014-2016 <a href="https://leanote.com">Leanote</a>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<i class="fa fa-globe fa-3x icon-muted"></i>
|
||||
<h2>Join Us</h2>
|
||||
<a href="https://github.com/leanote/leanote">Github Leanote</a>
|
||||
<br />
|
||||
QQ Group: <span id="qqGrup">326073529, 256076853, 158716820</span>
|
||||
<a href="https://github.com/leanote/leanote">Github</a> / <a href="http://leanote.leanote.com/post/Leanote-groups">QQ Group</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="footer-leanote">Proudly powered by <a href="https://leanote.com">Leanote</a></div>
|
||||
<div class="footer-leanote">
|
||||
Copyright © <a href="https://leanote.com">Leanote</a>
|
||||
<br/>
|
||||
Proudly powered by <a href="https://leanote.com">Leanote</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -64,7 +64,7 @@
|
||||
<a href="/">{{msg . "home"}}</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="https://leanote.com">Leanote</a> © 2014-2016
|
||||
© <a href="https://leanote.com">Leanote</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<a href="/index">{{msg . "home"}}</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="https://leanote.com">Leanote</a> © 2014-2016
|
||||
© <a href="https://leanote.com">Leanote</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
</section>
|
||||
<footer class="footer lt hidden-xs b-t b-light" style="min-height: initial;
|
||||
padding: 10px 15px;text-align:center;">
|
||||
<a href="http://leanote.com" target="_blank">leanote</a> © 2015
|
||||
© <a href="https://leanote.com" target="_blank">Leanote</a>
|
||||
<!--
|
||||
<a href="#nav" data-toggle="class:nav-xs" class="pull-right btn btn-sm btn-default btn-icon">
|
||||
<i class="fa fa-angle-left text">
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ SP=$(cd "$(dirname "$0")"; pwd)
|
||||
tmp="/Users/life/Desktop/leanote_release"
|
||||
|
||||
# version
|
||||
V="v2.0"
|
||||
V="v2.2.1"
|
||||
|
||||
##=================================
|
||||
# 1. 先build 成 3个平台, 2种bit = 6种
|
||||
|
||||
@@ -4,4 +4,4 @@ return c(e,"previousSibling")},nextAll:function(e){return se.dir(e,"nextSibling"
|
||||
if("undefined"==typeof jQuery)throw new Error("Bootstrap requires jQuery");+function(t){"use strict";function e(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(void 0!==t.style[i])return{end:e[i]}}t.fn.emulateTransitionEnd=function(e){var i=!1,o=this;t(this).one(t.support.transition.end,function(){i=!0});var n=function(){i||t(o).trigger(t.support.transition.end)};return setTimeout(n,e),this},t(function(){t.support.transition=e()})}(jQuery),+function(t){"use strict";var e='[data-dismiss="alert"]',i=function(i){t(i).on("click",e,this.close)};i.prototype.close=function(e){function i(){s.trigger("closed.bs.alert").remove()}var o=t(this),n=o.attr("data-target");n||(n=o.attr("href"),n=n&&n.replace(/.*(?=#[^\s]*$)/,""));var s=t(n);e&&e.preventDefault(),s.length||(s=o.hasClass("alert")?o:o.parent()),s.trigger(e=t.Event("close.bs.alert")),e.isDefaultPrevented()||(s.removeClass("in"),t.support.transition&&s.hasClass("fade")?s.one(t.support.transition.end,i).emulateTransitionEnd(150):i())};var o=t.fn.alert;t.fn.alert=function(e){return this.each(function(){var o=t(this),n=o.data("bs.alert");n||o.data("bs.alert",n=new i(this)),"string"==typeof e&&n[e].call(o)})},t.fn.alert.Constructor=i,t.fn.alert.noConflict=function(){return t.fn.alert=o,this},t(document).on("click.bs.alert.data-api",e,i.prototype.close)}(jQuery),+function(t){"use strict";var e=function(i,o){this.$element=t(i),this.options=t.extend({},e.DEFAULTS,o)};e.DEFAULTS={loadingText:"loading..."},e.prototype.setState=function(t){var e="disabled",i=this.$element,o=i.is("input")?"val":"html",n=i.data();t+="Text",n.resetText||i.data("resetText",i[o]()),i[o](n[t]||this.options[t]),setTimeout(function(){"loadingText"==t?i.addClass(e).attr(e,e):i.removeClass(e).removeAttr(e)},0)},e.prototype.toggle=function(){var t=this.$element.closest('[data-toggle="buttons"]');if(t.length){var e=this.$element.find("input").prop("checked",!this.$element.hasClass("active")).trigger("change");"radio"===e.prop("type")&&t.find(".active").removeClass("active")}this.$element.toggleClass("active")};var i=t.fn.button;t.fn.button=function(i){return this.each(function(){var o=t(this),n=o.data("bs.button"),s="object"==typeof i&&i;n||o.data("bs.button",n=new e(this,s)),"toggle"==i?n.toggle():i&&n.setState(i)})},t.fn.button.Constructor=e,t.fn.button.noConflict=function(){return t.fn.button=i,this},t(document).on("click.bs.button.data-api","[data-toggle^=button]",function(e){var i=t(e.target);i.hasClass("btn")||(i=i.closest(".btn")),i.button("toggle"),e.preventDefault()})}(jQuery),+function(t){"use strict";var e=function(e,i){this.$element=t(e),this.$indicators=this.$element.find(".carousel-indicators"),this.options=i,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",t.proxy(this.pause,this)).on("mouseleave",t.proxy(this.cycle,this))};e.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},e.prototype.cycle=function(e){return e||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(t.proxy(this.next,this),this.options.interval)),this},e.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},e.prototype.to=function(e){var i=this,o=this.getActiveIndex();return e>this.$items.length-1||0>e?void 0:this.sliding?this.$element.one("slid",function(){i.to(e)}):o==e?this.pause().cycle():this.slide(e>o?"next":"prev",t(this.$items[e]))},e.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&t.support.transition.end&&(this.$element.trigger(t.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},e.prototype.next=function(){return this.sliding?void 0:this.slide("next")},e.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},e.prototype.slide=function(e,i){var o=this.$element.find(".item.active"),n=i||o[e](),s=this.interval,a="next"==e?"left":"right",r="next"==e?"first":"last",l=this;if(!n.length){if(!this.options.wrap)return;n=this.$element.find(".item")[r]()}this.sliding=!0,s&&this.pause();var h=t.Event("slide.bs.carousel",{relatedTarget:n[0],direction:a});if(!n.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var e=t(l.$indicators.children()[l.getActiveIndex()]);e&&e.addClass("active")})),t.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(h),h.isDefaultPrevented())return;n.addClass(e),n[0].offsetWidth,o.addClass(a),n.addClass(a),o.one(t.support.transition.end,function(){n.removeClass([e,a].join(" ")).addClass("active"),o.removeClass(["active",a].join(" ")),l.sliding=!1,setTimeout(functioLine truncated
|
||||
!function(e){"use strict";e(window.jQuery)}(function(e){"use strict";var t=0;e.ajaxTransport("iframe",function(i){if(i.async){var n,r,o;return{send:function(s,a){n=e('<form style="display:none;"></form>'),n.attr("accept-charset",i.formAcceptCharset),o=/\?/.test(i.url)?"&":"?","DELETE"===i.type?(i.url=i.url+o+"_method=DELETE",i.type="POST"):"PUT"===i.type?(i.url=i.url+o+"_method=PUT",i.type="POST"):"PATCH"===i.type&&(i.url=i.url+o+"_method=PATCH",i.type="POST"),r=e('<iframe src="javascript:false;" name="iframe-transport-'+(t+=1)+'"></iframe>').bind("load",function(){var t,o=e.isArray(i.paramName)?i.paramName:[i.paramName];r.unbind("load").bind("load",function(){var t;try{if(t=r.contents(),!t.length||!t[0].firstChild)throw new Error}catch(i){t=void 0}a(200,"success",{iframe:t}),e('<iframe src="javascript:false;"></iframe>').appendTo(n),n.remove()}),n.prop("target",r.prop("name")).prop("action",i.url).prop("method",i.type),i.formData&&e.each(i.formData,function(t,i){e('<input type="hidden"/>').prop("name",i.name).val(i.value).appendTo(n)}),i.fileInput&&i.fileInput.length&&"POST"===i.type&&(t=i.fileInput.clone(),i.fileInput.after(function(e){return t[e]}),i.paramName&&i.fileInput.each(function(t){e(this).prop("name",o[t]||i.paramName)}),n.append(i.fileInput).prop("enctype","multipart/form-data").prop("encoding","multipart/form-data")),n.submit(),t&&t.length&&i.fileInput.each(function(i,n){var r=e(t[i]);e(n).prop("name",r.prop("name")),r.replaceWith(n)})}),n.append(r).appendTo(document.body)},abort:function(){r&&r.unbind("load").prop("src","javascript".concat(":false;")),n&&n.remove()}}}}),e.ajaxSetup({converters:{"iframe text":function(t){return t&&e(t[0].body).text()},"iframe json":function(t){return t&&e.parseJSON(e(t[0].body).text())},"iframe html":function(t){return t&&e(t[0].body).html()},"iframe script":function(t){return t&&e.globalEval(e(t[0].body).text())}}})}),!function(e){e(jQuery)}(function(e,t){var i=0,n=Array.prototype.slice,r=e.cleanData;e.cleanData=function(t){for(var i,n=0;null!=(i=t[n]);n++)try{e(i).triggerHandler("remove")}catch(o){}r(t)},e.widget=function(t,i,n){var r,o,s,a,l={},p=t.split(".")[0];t=t.split(".")[1],r=p+"-"+t,n||(n=i,i=e.Widget),e.expr[":"][r.toLowerCase()]=function(t){return!!e.data(t,r)},e[p]=e[p]||{},o=e[p][t],s=e[p][t]=function(e,t){return this._createWidget?void(arguments.length&&this._createWidget(e,t)):new s(e,t)},e.extend(s,o,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),a=new i,a.options=e.widget.extend({},a.options),e.each(n,function(t,n){return e.isFunction(n)?void(l[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},r=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,o=this._superApply;return this._super=e,this._superApply=r,t=n.apply(this,arguments),this._super=i,this._superApply=o,t}}()):void(l[t]=n)}),s.prototype=e.widget.extend(a,{widgetEventPrefix:o?a.widgetEventPrefix:t},l,{constructor:s,namespace:p,widgetName:t,widgetFullName:r}),o?(e.each(o._childConstructors,function(t,i){var n=i.prototype;e.widget(n.namespace+"."+n.widgetName,s,i._proto)}),delete o._childConstructors):i._childConstructors.push(s),e.widget.bridge(t,s)},e.widget.extend=function(i){for(var r,o,s=n.call(arguments,1),a=0,l=s.length;l>a;a++)for(r in s[a])o=s[a][r],s[a].hasOwnProperty(r)&&o!==t&&(e.isPlainObject(o)?i[r]=e.isPlainObject(i[r])?e.widget.extend({},i[r],o):e.widget.extend({},o):i[r]=o);return i},e.widget.bridge=function(i,r){var o=r.prototype.widgetFullName||i;e.fn[i]=function(s){var a="string"==typeof s,l=n.call(arguments,1),p=this;return s=!a&&l.length?e.widget.extend.apply(null,[s].concat(l)):s,a?this.each(function(){var n,r=e.data(this,o);return r?e.isFunction(r[s])&&"_"!==s.charAt(0)?(n=r[s].apply(r,l),n!==r&&n!==t?(p=n&&n.jquery?p.pushStack(n.get()):n,!1):void 0):e.error("no such method '"+s+"' for "+i+" widget instance"):e.error("cannot call methods on "+i+" prior to initialization; attempted to call method '"+s+"'")}):this.each(function(){var t=e.data(this,o);t?t.option(s||{})._init():e.data(this,o,new r(s,this))}),p}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,n){n=e(n||this.defaultElement||this)[0],this.element=e(n),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),n!==this&&(e.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===n&&this.destroy()}}),this.document=e(n.style?n.ownerDocument:n.document||n),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._deLine truncated
|
||||
jQuery.fn.pagination=function(e,t){return t=jQuery.extend({items_per_page:10,num_display_entries:10,current_page:0,num_edge_entries:2,link_to:"#",prev_text:"Prev",next_text:"Next",ellipse_text:"...",prev_show_always:!0,next_show_always:!0,callback:function(){return!1}},t||{}),this.each(function(){function n(){return Math.ceil(e/t.items_per_page)}function a(){var e=Math.ceil(t.num_display_entries/2),a=n(),r=a-t.num_display_entries,s=i>e?Math.max(Math.min(i-e,r),0):0,_=i>e?Math.min(i+e,a):Math.min(t.num_display_entries,a);return[s,_]}function r(e,n){n.preventDefault(),i=e,s();var a=t.callback(e,_);return a||(n.stopPropagation?n.stopPropagation():n.cancelBubble=!0),a}function s(){_.empty();var e=a(),s=n(),p=function(e){return function(t){return r(e,t)}},l=function(e,n){e=0>e?0:s>e?e:s-1,n=jQuery.extend({text:e+1,classes:""},n||{});var a="";if(e==i){var r=jQuery("<span class='current'>"+n.text+"</span>");n.text!=t.prev_text&&n.text!=t.next_text&&(a='class="active"')}else var r=jQuery("<a>"+n.text+"</a>").bind("click",p(e)).attr("href",t.link_to.replace(/__id__/,e));n.classes&&r.addClass(n.classes);var l=$("<li "+a+"></li>").append(r);_.append(l)};if(t.prev_text&&(i>0||t.prev_show_always)&&l(i-1,{text:t.prev_text,classes:"prev"}),e[0]>0&&t.num_edge_entries>0){for(var u=Math.min(t.num_edge_entries,e[0]),c=0;u>c;c++)l(c);t.num_edge_entries<e[0]&&t.ellipse_text&&jQuery("<li><span>"+t.ellipse_text+"</span></li>").appendTo(_)}for(var c=e[0];c<e[1];c++)l(c);if(e[1]<s&&t.num_edge_entries>0){s-t.num_edge_entries>e[1]&&t.ellipse_text&&jQuery("<li><span>"+t.ellipse_text+"</span></li>").appendTo(_);for(var x=Math.max(s-t.num_edge_entries,e[1]),c=x;s>c;c++)l(c)}t.next_text&&(s-1>i||t.next_show_always)&&l(i+1,{text:t.next_text,classes:"next"})}var i=t.current_page;e=!e||0>e?1:e,t.items_per_page=!t.items_per_page||t.items_per_page<0?1:t.items_per_page;var _=jQuery(this);this.selectPage=function(e){r(e)},this.prevPage=function(){return i>0?(r(i-1),!0):!1},this.nextPage=function(){return i<n()-1?(r(i+1),!0):!1},s()})};
|
||||
function log(e){}function retIsOk(e){return e&&"object"==typeof e&&1==e.Ok?!0:!1}function getImageSize(e,t){function a(e,a){i.parentNode.removeChild(i),t({width:e,height:a})}var i=document.createElement("img");i.onload=function(){a(i.clientWidth,i.clientHeight)},i.onerror=function(){a()},i.src=e;var s=i.style;s.visibility="hidden",s.position="fixed",s.bottom=s.left=0,s.width=s.height="auto",document.body.appendChild(i)}function mdGetImgSrc(){return o.selectedImages&&o.selectedImages.length?o.selectedImages[0]:""}var urlPrefix=UrlPrefix,getMsg=parent.getMsg;getMsg||(getMsg=function(e){return e});var o={maxSelected:G.maxSelected,selectedZoneO:$("#preview"),previewO:$("#preview"),selectedImages:[],imageAttrs:{},pageNum:1,pagination:function(e){var t=this;$(".pagination").pagination(e,{items_per_page:G.perPageItems,prev_text:getMsg("Prev"),next_text:getMsg("Next"),callback:function(e){t.pageNum=e+1,t.renderImages($("#albumsForList").val(),t.pageNum,!1)}})},showMsg:function(e){$("#msg").html(e).css("display","inline"),setTimeout(function(){$("#msg").fadeOut()},2e3)},pageAddAlbum:function(e){var t='<option value="'+e.AlbumId+'">'+e.Name+"</option>";$("#albumsForUpload").append(t).val(e.AlbumId),$("#albumsForList").append(t)},pageUpdateAlbum:function(e,t){$('option[value="'+e+'"]').html(t)},processAlbum:function(){function e(){$("#addOrUpdateAlbumForm").is(":hidden")?($("#addOrUpdateAlbumForm").show(),$("#albumSelect").hide()):($("#addOrUpdateAlbumForm").hide(),$("#albumSelect").show())}var t=this,a=!0,i="";$("#renameAlbumBtn").click(function(){return(i=$("#albumsForUpload").val())?(e(),$("#addOrUpdateAlbumBtn").html(getMsg("Rename Album")),$("#albumName").val($("#albumsForUpload option:selected").html()).focus(),void(a=!1)):void alert(getMsg("Cannot rename default album"))}),$("#addAlbumBtn").click(function(){e(),$("#addOrUpdateAlbumBtn").html(getMsg("Add Album")),$("#albumName").val("").focus(),a=!0}),$("#cancelAlbumBtn").click(function(){e()}),$("#addOrUpdateAlbumBtn").click(function(){var s=$("#albumName").val();return s?void(a?$.get("/album/addAlbum",{name:s},function(a){"object"==typeof a&&""!=a.AlbumId?($("#albumName").val(""),t.showMsg(getMsg("Add Success!")),t.pageAddAlbum(a),setTimeout(function(){e()},200)):alert(getMsg("error"))}):$.get("/album/updateAlbum",{albumId:i,name:s},function(a){"boolean"==typeof a&&a?($("#albumName").val(""),t.showMsg(getMsg("Rename Success!")),t.pageUpdateAlbum(i,s),setTimeout(function(){e()},200)):alert(getMsg("error!"))})):void $("#albumName").focus()}),$("#deleteAlbumBtn").click(function(){var e=$("#albumsForUpload").val();return e?void $.get("/album/deleteAlbum",{albumId:e},function(a){"object"==typeof a&&1==a.Ok?(t.showMsg(getMsg("Delete Success!")),$("#albumsForUpload option[value='"+e+"']").remove(),$("#albumsForList").val()==e&&(t.needRefresh=!0),$("#albumsForList option[value='"+e+"']").remove()):alert(getMsg("This album has images, please delete it's images at first."))}):void alert(getMsg("Cannot delete default album"))})},renderAlbums:function(){var e=this;$.get("/album/getAlbums",function(t){if(t){var a="";for(var i in t){var s=t[i],r='<option value="'+s.AlbumId+'">'+s.Name+"</option>";a+=r}$("#albumsForUpload").append(a),$("#albumsForList").append(a);var l=$("#albumsForList").val();e.renderImages(l,1,!0)}})},imageMaskO:$("#imageMask"),noImagesO:$("#noImages"),loadingO:$("#loading"),loadingStart:function(){this.imageMaskO.is(":hidden")&&this.imageMaskO.css("opacity",.8).show(),this.noImagesO.hide(),this.loadingO.show()},loadingEnd:function(){this.imageMaskO.hide()},noImages:function(){this.imageMaskO.show().css("opacity",1),this.noImagesO.show(),this.loadingO.hide()},search:function(){var e=this,t=1;$("#key").on("keyup",function(){var a=++t,i=$(this).val(),s=$("#albumsForList").val();e.renderImages(s,1,!0,i,function(){return t==a})})},renderImages:function(e,t,a,i,s){var r=this;t||(t=1),r.loadingStart(),$.get("/file/getImages",{albumId:e,page:t,key:i},function(e){if(!e||!e.Count)return void r.noImages();r.loadingEnd();var t=e.List,i={};for(var s in r.selectedImages){var l=r.selectedImages[s];i[l]=!0}var n="";for(var s in t){var o=t[s],d="";if(""!=o.Path&&"/"==o.Path[0]&&(o.Path=o.Path.substr(1)),""!=o.Path&&"upload/"==o.Path.substr(0,7))var l=urlPrefix+"/"+o.Path;else var l=urlPrefix+"/api/file/getImage?fileId="+o.FileId;i[l]&&(d='class="selected"'),n+="<li "+d+">",n+='<a title="" href="javascript:;" class="a-img"><img alt="" src="'+l+'" data-original="'+l+'" ></a>',n+='<div class="tools clearfix" data-id="'+o.FileId+'"><div class="file-title pull-left">'+o.Title+'</div><div class="pull-right"><a href="javascript:;" class="del" data-id="'+o.FileId+'"><span class="fa fa-trash"></span></a></div></div>',n+="</li>"}$("#imageList").html(n),a&&r.pagination(e.Count)})},initSelectedZones:function(){var e=this;num=this.maxSelected,e.previewO.html("");for(var t=1;t<=num;++t)e.previewO.append("<li>?</li>")},reRenderSelectedImages:function(e,t){for(var a=this,i=this.selectLine truncated
|
||||
function log(e){}function retIsOk(e){return e&&"object"==typeof e&&1==e.Ok?!0:!1}function getImageSize(e,t){function a(e,a){i.parentNode.removeChild(i),t({width:e,height:a})}var i=document.createElement("img");i.onload=function(){a(i.clientWidth,i.clientHeight)},i.onerror=function(){a()},i.src=e;var s=i.style;s.visibility="hidden",s.position="fixed",s.bottom=s.left=0,s.width=s.height="auto",document.body.appendChild(i)}function mdGetImgSrc(){return o.selectedImages&&o.selectedImages.length?o.selectedImages[0]:""}var urlPrefix="",getMsg=parent.getMsg;getMsg||(getMsg=function(e){return e});var o={maxSelected:G.maxSelected,selectedZoneO:$("#preview"),previewO:$("#preview"),selectedImages:[],imageAttrs:{},pageNum:1,pagination:function(e){var t=this;$(".pagination").pagination(e,{items_per_page:G.perPageItems,prev_text:getMsg("Prev"),next_text:getMsg("Next"),callback:function(e){t.pageNum=e+1,t.renderImages($("#albumsForList").val(),t.pageNum,!1)}})},showMsg:function(e){$("#msg").html(e).css("display","inline"),setTimeout(function(){$("#msg").fadeOut()},2e3)},pageAddAlbum:function(e){var t='<option value="'+e.AlbumId+'">'+e.Name+"</option>";$("#albumsForUpload").append(t).val(e.AlbumId),$("#albumsForList").append(t)},pageUpdateAlbum:function(e,t){$('option[value="'+e+'"]').html(t)},processAlbum:function(){function e(){$("#addOrUpdateAlbumForm").is(":hidden")?($("#addOrUpdateAlbumForm").show(),$("#albumSelect").hide()):($("#addOrUpdateAlbumForm").hide(),$("#albumSelect").show())}var t=this,a=!0,i="";$("#renameAlbumBtn").click(function(){return(i=$("#albumsForUpload").val())?(e(),$("#addOrUpdateAlbumBtn").html(getMsg("Rename Album")),$("#albumName").val($("#albumsForUpload option:selected").html()).focus(),void(a=!1)):void alert(getMsg("Cannot rename default album"))}),$("#addAlbumBtn").click(function(){e(),$("#addOrUpdateAlbumBtn").html(getMsg("Add Album")),$("#albumName").val("").focus(),a=!0}),$("#cancelAlbumBtn").click(function(){e()}),$("#addOrUpdateAlbumBtn").click(function(){var s=$("#albumName").val();return s?void(a?$.get("/album/addAlbum",{name:s},function(a){"object"==typeof a&&""!=a.AlbumId?($("#albumName").val(""),t.showMsg(getMsg("Add Success!")),t.pageAddAlbum(a),setTimeout(function(){e()},200)):alert(getMsg("error"))}):$.get("/album/updateAlbum",{albumId:i,name:s},function(a){"boolean"==typeof a&&a?($("#albumName").val(""),t.showMsg(getMsg("Rename Success!")),t.pageUpdateAlbum(i,s),setTimeout(function(){e()},200)):alert(getMsg("error!"))})):void $("#albumName").focus()}),$("#deleteAlbumBtn").click(function(){var e=$("#albumsForUpload").val();return e?void $.get("/album/deleteAlbum",{albumId:e},function(a){"object"==typeof a&&1==a.Ok?(t.showMsg(getMsg("Delete Success!")),$("#albumsForUpload option[value='"+e+"']").remove(),$("#albumsForList").val()==e&&(t.needRefresh=!0),$("#albumsForList option[value='"+e+"']").remove()):alert(getMsg("This album has images, please delete it's images at first."))}):void alert(getMsg("Cannot delete default album"))})},renderAlbums:function(){var e=this;$.get("/album/getAlbums",function(t){if(t){var a="";for(var i in t){var s=t[i],r='<option value="'+s.AlbumId+'">'+s.Name+"</option>";a+=r}$("#albumsForUpload").append(a),$("#albumsForList").append(a);var l=$("#albumsForList").val();e.renderImages(l,1,!0)}})},imageMaskO:$("#imageMask"),noImagesO:$("#noImages"),loadingO:$("#loading"),loadingStart:function(){this.imageMaskO.is(":hidden")&&this.imageMaskO.css("opacity",.8).show(),this.noImagesO.hide(),this.loadingO.show()},loadingEnd:function(){this.imageMaskO.hide()},noImages:function(){this.imageMaskO.show().css("opacity",1),this.noImagesO.show(),this.loadingO.hide()},search:function(){var e=this,t=1;$("#key").on("keyup",function(){var a=++t,i=$(this).val(),s=$("#albumsForList").val();e.renderImages(s,1,!0,i,function(){return t==a})})},renderImages:function(e,t,a,i,s){var r=this;t||(t=1),r.loadingStart(),$.get("/file/getImages",{albumId:e,page:t,key:i},function(e){if(!e||!e.Count)return void r.noImages();r.loadingEnd();var t=e.List,i={};for(var s in r.selectedImages){var l=r.selectedImages[s];i[l]=!0}var n="";for(var s in t){var o=t[s],d="";if(""!=o.Path&&"/"==o.Path[0]&&(o.Path=o.Path.substr(1)),""!=o.Path&&"upload/"==o.Path.substr(0,7))var l=urlPrefix+"/"+o.Path;else var l=urlPrefix+"/api/file/getImage?fileId="+o.FileId;i[l]&&(d='class="selected"'),n+="<li "+d+">",n+='<a title="" href="javascript:;" class="a-img"><img alt="" src="'+l+'" data-original="'+l+'" ></a>',n+='<div class="tools clearfix" data-id="'+o.FileId+'"><div class="file-title pull-left">'+o.Title+'</div><div class="pull-right"><a href="javascript:;" class="del" data-id="'+o.FileId+'"><span class="fa fa-trash"></span></a></div></div>',n+="</li>"}$("#imageList").html(n),a&&r.pagination(e.Count)})},initSelectedZones:function(){var e=this;num=this.maxSelected,e.previewO.html("");for(var t=1;t<=num;++t)e.previewO.append("<li>?</li>")},reRenderSelectedImages:function(e,t){for(var a=this,i=this.selectedZoneOLine truncated
|
||||
@@ -8,7 +8,7 @@ function retIsOk(ret) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var urlPrefix = UrlPrefix;
|
||||
var urlPrefix = '';
|
||||
var getMsg = parent.getMsg;
|
||||
if (!getMsg) {
|
||||
getMsg = function(msg) {
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
function trimLeft(t,e){if(!e||" "==e)return $.trim(t);for(;0==t.indexOf(e);)t=t.substring(e.length);return t}function json(str){return eval("("+str+")")}function t(){var t=arguments;if(t.length<=1)return t[0];var e=t[0];if(!e)return e;var n="LEAAEL";e=e.replace(/\?/g,n);for(var o=1;o<=t.length;++o)e=e.replace(n,t[o]);return e}function arrayEqual(t,e){return t=t||[],e=e||[],t.join(",")==e.join(",")}function isArray(t){return"[object Array]"===Object.prototype.toString.call(t)}function isEmpty(t){return t?isArray(t)&&0==t.length?!0:!1:!0}function getFormJsonData(t){var e=formArrDataToJson($("#"+t).serializeArray());return e}function formArrDataToJson(t){var e={},n={};for(var o in t){var r=t[o].name,i=t[o].value;"[]"!=r.substring(r.length-2,r.length)?e[r]=i:(r=r.substring(0,r.length-2),void 0==n[r]?n[r]=[i]:n[r].push(i))}return $.extend(e,n)}function formSerializeDataToJson(t){for(var e=t.split("&"),n={},o={},r=0;r<e.length;++r){var i=e[r].split("="),a=decodeURI(i[0]),s=decodeURI(i[1]);"[]"!=a.substring(a.length-2,a.length)?n[a]=s:(a=a.substring(0,a.length-2),void 0==o[a]?o[a]=[s]:o[a].push(s))}return $.extend(n,o)}function _ajaxCallback(t,e,n){if(t===!0||"true"==t||"object"==typeof t){if(t&&"object"==typeof t&&"NOTLOGIN"==t.Msg)return void alert(getMsg("Please sign in firstly!"));"function"==typeof e&&e(t)}else"function"==typeof n?n(t):alert("error!")}function _ajax(t,e,n,o,r,i){return i="undefined"==typeof i?!0:!1,$.ajax({type:t,url:e,data:n,async:i,success:function(t){_ajaxCallback(t,o,r)},error:function(t){_ajaxCallback(t,o,r)}})}function ajaxGet(t,e,n,o,r){return _ajax("GET",t,e,n,o,r)}function ajaxPost(t,e,n,o,r){_ajax("POST",t,e,n,o,r)}function ajaxPostJson(t,e,n,o,r){r="undefined"==typeof r?!0:!1,$.ajax({url:t,type:"POST",contentType:"application/json; charset=utf-8",datatype:"json",async:r,data:JSON.stringify(e),success:function(t,e){_ajaxCallback(t,n,o)},error:function(t){_ajaxCallback(t,n,o)}})}function findParents(t,e){if($(t).is(e))return $(t);for(var n=$(t).parents(),o=0;o<n.length;++o)if(log(n.eq(o)),n.eq(o).is(e))return n.seq(o);return null}function getVendorPrefix(){for(var t=document.body||document.documentElement,e=t.style,n=["webkit","khtml","moz","ms","o"],o=0;o<n.length;){if("string"==typeof e[n[o]+"Transition"])return n[o];o++}}function switchEditor(t){LEA.isM=t,t?($("#mdEditor").css("z-index",3).show(),$("#leanoteNav").hide()):($("#editor").show(),$("#mdEditor").css("z-index",1).hide(),$("#leanoteNav").show())}function setEditorContent(t,e,n,o){if(t||(t=""),clearIntervalForSetContent&&clearInterval(clearIntervalForSetContent),e)MD?(MD.setContent(t),MD.clearUndo&&MD.clearUndo(),o&&o()):clearIntervalForSetContent=setTimeout(function(){setEditorContent(t,!0,!1,o)},100);else if("undefined"!=typeof tinymce&&tinymce.activeEditor){var r=tinymce.activeEditor;r.setContent(t),o&&o(),r.undoManager.clear()}else clearIntervalForSetContent=setTimeout(function(){setEditorContent(t,!1,!1,o)},100)}function previewIsEmpty(t){return t&&t.substr(0,previewToken.length)!=previewToken?!1:!0}function isAceError(t){return t?-1!=t.indexOf("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"):!1}function getEditorContent(t){var e=_getEditorContent(t);return'<p><br data-mce-bogus="1"></p>'===e?"<p><br></p>":e}function _getEditorContent(t){if(t)return[MD.getContent(),"<div>"+$("#preview-contents").html()+"</div>"];var e=tinymce.activeEditor;if(e){var n=$(e.getBody()).clone();if(n.find(".toggle-raw").remove(),window.LeaAce&&LeaAce.getAce)for(var o=n.find("pre"),r=0;r<o.length;++r){var i=o.eq(r),a=i.attr("id"),s=LeaAce.getAce(a);if(s){var l=s.getValue();isAceError(l)&&(l=i.html()),l=l.replace(/</g,"<").replace(/>/g,">"),i.removeAttr("style","").removeAttr("contenteditable").removeClass("ace_editor"),i.html(l)}}if(n.find("pinit").remove(),n.find(".thunderpin").remove(),n.find(".pin").parent().remove(),n=$(n).html())for(;;){var c=n.lastIndexOf("</script>");if(-1==c)return n;var u=n.length;if(u-9!=c)return n;var f=n.lastIndexOf("<script ");if(-1==f&&(f=n.lastIndexOf("<script>")),-1==f)return n;n=n.substring(0,f)}return n}}function disableEditor(){var t=tinymce.activeEditor;t&&(t.hide(),LEA.editorStatus=!1,$("#mceTollbarMark").show().css("z-index",1e3))}function enableEditor(){if(!LEA.editorStatus){$("#mceTollbarMark").css("z-index",-1).hide();var t=tinymce.activeEditor;t&&t.show()}}function showDialog(t,e){$("#leanoteDialog #modalTitle").html(e.title),$("#leanoteDialog .modal-body").html($("#"+t+" .modal-body").html()),$("#leanoteDialog .modal-footer").html($("#"+t+" .modal-footer").html()),delete e.title,e.show=!0,$("#leanoteDialog").modal(e)}function hideDialog(t){t||(t=0),setTimeout(function(){$("#leanoteDialog").modal("hide")},t)}function closeDialog(){$(".modal").modal("hide")}function showDialog2(t,e){e=e||{},e.show=!0,$(t).modal(e)}function hideDialog2(t,e){e||(e=0),setTimeout(function(){$(t).modal("hide")},e)}function showDialogRemote(t,e){e=e||{},t+="?";for(var n in e)t+=n+"="+e[n]+"&";$("#leanoteDialogRemLine truncated
|
||||
Note.curNoteId="",Note.interval="",Note.itemIsBlog='<div class="item-blog"><i class="fa fa-bold" title="blog"></i></div><div class="item-setting"><i class="fa fa-cog" title="setting"></i></div>',Note.itemTplNoImg='<li href="#" class="item ?" data-seq="?" noteId="?">',Note.itemTplNoImg+=Note.itemIsBlog+'<div class="item-desc"><p class="item-title">?</p><p class="item-info"><i class="fa fa-book"></i> <span class="note-notebook">?</span> <i class="fa fa-clock-o"></i> <span class="updated-time">?</span></p><p class="desc">?</p></div></li>',Note.itemTpl='<li href="#" class="item ? item-image" data-seq="?" noteId="?"><div class="item-thumb" style=""><img src="?"/></div>',Note.itemTpl+=Note.itemIsBlog+'<div class="item-desc" style=""><p class="item-title">?</p><p class="item-info"><i class="fa fa-book"></i> <span class="note-notebook">?</span> <i class="fa fa-clock-o"></i> <span class="updated-time">?</span></p><p class="desc">?</p></div></li>',Note.newItemTpl='<li href="#" class="item item-active ?" data-seq="?" fromUserId="?" noteId="?">',Note.newItemTpl+=Note.itemIsBlog+'<div class="item-desc" style="right: 0px;"><p class="item-title">?</p><p class="item-info"><i class="fa fa-book"></i> <span class="note-notebook">?</span> <i class="fa fa-clock-o"></i> <span class="updated-time">?</span></p><p class="desc">?</p></div></li>',Note.noteItemListO=$("#noteItemList"),Note.cacheByNotebookId={all:{}},Note.notebookIds={},Note.isReadOnly=!1,Note.intervalTime=0,Note.intervalTime=1e4,Note.startInterval=function(){clearInterval(Note.interval),Note.interval=setInterval(function(){log("自动保存开始..."),Note.curChangedSaveIt()},Note.intervalTime)},Note.stopInterval=function(){clearInterval(Note.interval),setTimeout(function(){Note.startInterval()},Note.intervalTime)},Note.addNoteCache=function(t){Note.cache[t.NoteId]=t,Note.clearCacheByNotebookId(t.NotebookId)},Note.setNoteCache=function(t,e){Note.cache[t.NoteId]?$.extend(Note.cache[t.NoteId],t):Note.cache[t.NoteId]=t,void 0==e&&(e=!0),e&&Note.clearCacheByNotebookId(t.NotebookId)},Note.setCurNoteId=function(t){this.curNoteId=t},Note.clearCurNoteId=function(){this.curNoteId=null},Note.getCurNote=function(){var t=this;return""==t.curNoteId?null:t.cache[t.curNoteId]},Note.getNote=function(t){var e=this;return e.cache[t]},Note.clearCacheByNotebookId=function(t){t&&(Note.cacheByNotebookId[t]={},Note.cacheByNotebookId.all={},Note.notebookIds[t]=!0)},Note.notebookHasNotes=function(t){var e=Note.getNotesByNotebookId(t);return!isEmpty(e)},Note.getNotesByNotebookId=function(t,e,o){if(e||(e="UpdatedTime"),"undefined"==o&&(o=!1),t||(t="all"),!Note.cacheByNotebookId[t])return[];if(Note.cacheByNotebookId[t][e])return Note.cacheByNotebookId[t][e];var a=[];for(var n in Note.cache)if(n){var i=Note.cache[n];i.IsTrash||i.IsShared||("all"==t||i.NotebookId==t)&&a.push(i)}return a.sort(function(t,a){var n=t[e],i=a[e];if(o){if(i>n)return-1;if(n>i)return 1}else{if(i>n)return 1;if(n>i)return-1}return 0}),Note.cacheByNotebookId[t][e]=a,a},Note.renderNotesAndFirstOneContent=function(t){isArray(t)&&(Note.renderNotes(t),isEmpty(t[0])||Note.changeNoteForPjax(t[0].NoteId,!0,!1))},Note.curHasChanged=function(t){var e=Note.getCurNote();if(!e)return!1;var o=$("#noteTitle").val(),a=Tag.getTags(),n={hasChanged:!1,IsNew:e.IsNew,IsMarkdown:e.IsMarkdown,FromUserId:e.FromUserId,NoteId:e.NoteId,NotebookId:e.NotebookId};e.IsNew&&(n.hasChanged=!0),e.Title!=o&&(n.hasChanged=!0,n.Title=o),arrayEqual(e.Tags,a)||(n.hasChanged=!0,n.Tags=a.join(","));var i=!1;if((e.IsNew||t||!Note.readOnly)&&(i=!0),!n.hasChanged&&!i)return!1;if(!i)return n;var r,s,c=getEditorContent(e.IsMarkdown);if(isArray(c)?(r=c[0],s=c[1],r&&previewIsEmpty(s)&&Converter&&(s=Converter.makeHtml(r)),r||(s=""),e.Preview=s):r=c,e.Content!=r){n.hasChanged=!0,n.Content=r;var l=s||r;e.HasSelfDefined&&e.IsBlog||(n.Desc=Note.genDesc(l),n.ImgSrc=Note.getImgSrc(l),n.Abstract=Note.genAbstract(l))}else log("text相同");return n.hasChanged?n:!1},Note.genDesc=function(t){return t?(t=t.replace(/<br \/>/g," "),t=t.replace(/<\/p>/g," "),t=t.replace(/<\/div>/g," "),t=t.replace(/<\/?[^>]+(>|$)/g,""),t=$.trim(t),t=t.replace(/</g,"<"),t=t.replace(/>/g,">"),t.length<300?t:t.substring(0,300)):""},Note.genAbstract=function(t,e){if(!t)return"";if(void 0==e&&(e=1e3),t.length<e)return t;for(var o=!1,a=!1,n=0,i="",r=e,s=0;s<t.length;++s){var c=t[s];if("<"==c?o=!0:"&"==c?a=!0:">"==c&&o?(n-=1,o=!1):";"==c&&a&&(a=!1),o||a||(n+=1),i+=c,n>=r)break}var l=document.createElement("div");return l.innerHTML=i,l.innerHTML},Note.getImgSrc=function(t){if(!t)return"";var e=$(t).find("img");for(var o in e){var a=e.eq(o).attr("src");if(a)return a}return""},Note.saveInProcess={},Note.savePool={},Note.curChangedSaveIt=function(t,e){var o=this;if(Note.curNoteId&&!Note.isReadOnly){var a;try{a=Note.curHasChanged(t)}catch(n){return void(e&&e(!1))}return a&&a.hasChanged?(log("需要保存..."),Note.renderChangedNote(a),delete a.hasChanged,showMsg(getMsg("saving")),o.saveInProcess[a.NoteId]=!0,Line truncated
|
||||
function editorMode(){this.writingHash="writing",this.normalHash="normal",this.isWritingMode=location.hash.indexOf(this.writingHash)>=0,this.toggleA=null}function initSlimScroll(){Mobile.isMobile()||($("#notebook").slimScroll({height:"100%"}),$("#noteItemList").slimScroll({height:"100%"}),$("#wmd-panel-preview").slimScroll({height:"100%"}),$("#wmd-panel-preview").css("width","100%"))}function initEditor(){$("#moreBtn").click(function(){saveBookmark();var e=$("#editor");e.hasClass("all-tool")?e.removeClass("all-tool"):e.addClass("all-tool"),restoreBookmark()}),tinymce.init({inline:!0,theme:"leanote",valid_children:"+pre[div|#text|p|span|textarea|i|b|strong]",setup:function(e){e.on("keydown",function(e){var t=e.which?e.which:e.keyCode;return!Note.readOnly||(e.ctrlKey||e.metaKey)&&67==t?void LeaAce.removeCurToggleRaw():void e.preventDefault()}),e.on("cut",function(e){return $(e.target).hasClass("ace_text-input")?void e.preventDefault():void 0})},convert_urls:!0,relative_urls:!1,remove_script_host:!1,selector:"#editorContent",skin:"custom",language:LEA.locale,plugins:["autolink link leaui_image lists hr","paste","searchreplace leanote_nav leanote_code tabfocus","table textcolor"],toolbar1:"formatselect | forecolor backcolor | bold italic underline strikethrough | leaui_image | leanote_code leanote_inline_code | bullist numlist | alignleft aligncenter alignright alignjustify",toolbar2:"outdent indent blockquote | link unlink | table | hr removeformat | subscript superscript |searchreplace | pastetext | leanote_ace_pre | fontselect fontsizeselect",menubar:!1,toolbar_items_size:"small",statusbar:!1,url_converter:!1,font_formats:"Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Times New Roman=times new roman,times;Courier New=courier new,courier;Tahoma=tahoma,arial,helvetica,sans-serif;Verdana=verdana,geneva;宋体=SimSun;新宋体=NSimSun;黑体=SimHei;微软雅黑=Microsoft YaHei",block_formats:"Header 1=h1;Header 2=h2;Header 3=h3;Header 4=h4;Paragraph=p",paste_data_images:!0}),window.onbeforeunload=function(e){LEA.isLogout||Note.curChangedSaveIt(!0)},$("body").on("keydown",function(e){var t=e.which?e.which:e.keyCode,o=e.ctrlKey||e.metaKey;if(o){if(83==t)return Note.curChangedSaveIt(),e.preventDefault(),!1;if(69==t)return Note.toggleWriteableAndReadOnly(),e.preventDefault(),!1}})}function scrollTo(e,t,o){var i=$("#editorContent"),n=i.find(t+":contains("+o+")");random++;for(var r=$('#leanoteNavContent [data-a="'+t+"-"+encodeURI(o)+'"]'),s=r.size(),a=0;s>a&&r[a]!=e;++a);if(n.size()>=a+1){n=n.eq(a);var l=i.scrollTop()-i.offset().top+n.offset().top;return void i.animate({scrollTop:l},300)}}function updateLeftIsMin(e){ajaxGet("/user/updateLeftIsMin",{leftIsMin:e})}function minLeft(e){$page.addClass("mini-left"),e&&updateLeftIsMin(!0)}function maxLeft(e){$page.removeClass("mini-left"),$("#noteAndEditor").css("left",UserInfo.NotebookWidth),$("#leftNotebook").width(UserInfo.NotebookWidth),e&&updateLeftIsMin(!1)}function getMaxDropdownHeight(e){var t=$(e).offset(),o=$(document).height()-t.top;o-=70,0>o&&(o=0);var i=$(e).find("ul").height();return o>i?i:o}function initPage(){if(Notebook.renderNotebooks(notebooks),Share.renderShareNotebooks(sharedUserInfos,shareNotebooks),curSharedNoteNotebookId?Share.firstRenderShareNote(curSharedUserId,curSharedNoteNotebookId,curNoteId):(Note.setNoteCache(noteContentJson),Note.renderNotes(notes),curNoteId&&(setTimeout(function(){Note.changeNoteForPjax(curNoteId,!0,curNotebookId)}),curNotebookId||Notebook.selectNotebook($(tt('#notebook [notebookId="?"]',Notebook.allNotebookId))))),latestNotes.length>0)for(var e=0;e<latestNotes.length;++e)Note.addNoteCache(latestNotes[e]);Tag.renderTagNav(tagsJson),initSlimScroll(),LeaAce.handleEvent()}editorMode.prototype.toggleAText=function(e){var t=this;setTimeout(function(){var o=$(".toggle-editor-mode a"),i=$(".toggle-editor-mode span");e?(o.attr("href","#"+t.normalHash),i.text(getMsg("normalMode"))):(o.attr("href","#"+t.writingHash),i.text(getMsg("writingMode")))},0)},editorMode.prototype.isWriting=function(e){return e||(e=location.hash),e.indexOf(this.writingHash)>=0},editorMode.prototype.init=function(){this.$themeLink=$("#themeLink"),this.changeMode(this.isWritingMode);var e=this;$(".toggle-editor-mode").click(function(t){t.preventDefault(),saveBookmark();var o=$(this).find("a"),i=e.isWriting(o.attr("href"));e.changeMode(i),i?setHash("m",e.writingHash):setHash("m",e.normalHash),restoreBookmark()})},editorMode.prototype.changeMode=function(e){this.toggleAText(e),e?this.writtingMode():this.normalMode()},editorMode.prototype.resizeEditor=function(){setTimeout(function(){resizeEditor()},10),setTimeout(function(){resizeEditor()},20),setTimeout(function(){resizeEditor()},500)},editorMode.prototype.normalMode=function(){$("#noteItemListWrap, #notesAndSort").show(),$("#noteList").unbind("mouseenter").unbind("mouseleave");var e=UserInfo.Theme||"default";e+=".css";$("#themeLink");-1!=this.$themeLink.attr("href").indexOf("writting-overwLine truncated
|
||||
function editorMode(){this.writingHash="writing",this.normalHash="normal",this.isWritingMode=location.hash.indexOf(this.writingHash)>=0,this.toggleA=null}function initSlimScroll(){Mobile.isMobile()||($("#notebook").slimScroll({height:"100%"}),$("#noteItemList").slimScroll({height:"100%"}),$("#wmd-panel-preview").slimScroll({height:"100%"}),$("#wmd-panel-preview").css("width","100%"))}function initEditor(){$("#moreBtn").click(function(){saveBookmark();var e=$("#editor");e.hasClass("all-tool")?e.removeClass("all-tool"):e.addClass("all-tool"),restoreBookmark()}),tinymce.init({inline:!0,theme:"leanote",valid_children:"+pre[div|#text|p|span|textarea|i|b|strong]",setup:function(e){e.on("keydown",function(e){var t=e.which?e.which:e.keyCode;return!Note.readOnly||(e.ctrlKey||e.metaKey)&&67==t?void LeaAce.removeCurToggleRaw():void e.preventDefault()}),e.on("cut",function(e){return $(e.target).hasClass("ace_text-input")?void e.preventDefault():void 0})},convert_urls:!1,relative_urls:!0,remove_script_host:!1,selector:"#editorContent",skin:"custom",language:LEA.locale,plugins:["autolink link leaui_image lists hr","paste","searchreplace leanote_nav leanote_code tabfocus","table textcolor"],toolbar1:"formatselect | forecolor backcolor | bold italic underline strikethrough | leaui_image | leanote_code leanote_inline_code | bullist numlist | alignleft aligncenter alignright alignjustify",toolbar2:"outdent indent blockquote | link unlink | table | hr removeformat | subscript superscript |searchreplace | pastetext | leanote_ace_pre | fontselect fontsizeselect",menubar:!1,toolbar_items_size:"small",statusbar:!1,url_converter:!1,font_formats:"Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Times New Roman=times new roman,times;Courier New=courier new,courier;Tahoma=tahoma,arial,helvetica,sans-serif;Verdana=verdana,geneva;宋体=SimSun;新宋体=NSimSun;黑体=SimHei;微软雅黑=Microsoft YaHei",block_formats:"Header 1=h1;Header 2=h2;Header 3=h3;Header 4=h4;Paragraph=p",paste_data_images:!0}),window.onbeforeunload=function(e){LEA.isLogout||Note.curChangedSaveIt(!0)},$("body").on("keydown",function(e){var t=e.which?e.which:e.keyCode,o=e.ctrlKey||e.metaKey;if(o){if(83==t)return Note.curChangedSaveIt(),e.preventDefault(),!1;if(69==t)return Note.toggleWriteableAndReadOnly(),e.preventDefault(),!1}})}function scrollTo(e,t,o){var i=$("#editorContent"),n=i.find(t+":contains("+o+")");random++;for(var r=$('#leanoteNavContent [data-a="'+t+"-"+encodeURI(o)+'"]'),s=r.size(),a=0;s>a&&r[a]!=e;++a);if(n.size()>=a+1){n=n.eq(a);var l=i.scrollTop()-i.offset().top+n.offset().top;return void i.animate({scrollTop:l},300)}}function updateLeftIsMin(e){ajaxGet("/user/updateLeftIsMin",{leftIsMin:e})}function minLeft(e){$page.addClass("mini-left"),e&&updateLeftIsMin(!0)}function maxLeft(e){$page.removeClass("mini-left"),$("#noteAndEditor").css("left",UserInfo.NotebookWidth),$("#leftNotebook").width(UserInfo.NotebookWidth),e&&updateLeftIsMin(!1)}function getMaxDropdownHeight(e){var t=$(e).offset(),o=$(document).height()-t.top;o-=70,0>o&&(o=0);var i=$(e).find("ul").height();return o>i?i:o}function initPage(){if(Notebook.renderNotebooks(notebooks),Share.renderShareNotebooks(sharedUserInfos,shareNotebooks),curSharedNoteNotebookId?Share.firstRenderShareNote(curSharedUserId,curSharedNoteNotebookId,curNoteId):(Note.setNoteCache(noteContentJson),Note.renderNotes(notes),curNoteId&&(setTimeout(function(){Note.changeNoteForPjax(curNoteId,!0,curNotebookId)}),curNotebookId||Notebook.selectNotebook($(tt('#notebook [notebookId="?"]',Notebook.allNotebookId))))),latestNotes.length>0)for(var e=0;e<latestNotes.length;++e)Note.addNoteCache(latestNotes[e]);Tag.renderTagNav(tagsJson),initSlimScroll(),LeaAce.handleEvent()}editorMode.prototype.toggleAText=function(e){var t=this;setTimeout(function(){var o=$(".toggle-editor-mode a"),i=$(".toggle-editor-mode span");e?(o.attr("href","#"+t.normalHash),i.text(getMsg("normalMode"))):(o.attr("href","#"+t.writingHash),i.text(getMsg("writingMode")))},0)},editorMode.prototype.isWriting=function(e){return e||(e=location.hash),e.indexOf(this.writingHash)>=0},editorMode.prototype.init=function(){this.$themeLink=$("#themeLink"),this.changeMode(this.isWritingMode);var e=this;$(".toggle-editor-mode").click(function(t){t.preventDefault(),saveBookmark();var o=$(this).find("a"),i=e.isWriting(o.attr("href"));e.changeMode(i),i?setHash("m",e.writingHash):setHash("m",e.normalHash),restoreBookmark()})},editorMode.prototype.changeMode=function(e){this.toggleAText(e),e?this.writtingMode():this.normalMode()},editorMode.prototype.resizeEditor=function(){setTimeout(function(){resizeEditor()},10),setTimeout(function(){resizeEditor()},20),setTimeout(function(){resizeEditor()},500)},editorMode.prototype.normalMode=function(){$("#noteItemListWrap, #notesAndSort").show(),$("#noteList").unbind("mouseenter").unbind("mouseleave");var e=UserInfo.Theme||"default";e+=".css";$("#themeLink");-1!=this.$themeLink.attr("href").indexOf("writting-overwLine truncated
|
||||
function revertTagStatus(){$("#addTagTrigger").show(),$("#addTagInput").hide()}function hideTagList(a){$("#tagDropdown").removeClass("open"),a&&a.stopPropagation()}function showTagList(a){$("#tagDropdown").addClass("open"),a&&a.stopPropagation()}function reRenderTags(){var a=["label label-default","label label-info"],e=0;$("#tags").children().each(function(){var t=$(this).attr("class");("label label-default"==t||"label label-info"==t)&&($(this).removeClass(t).addClass(a[e%2]),e++)})}Tag.classes={"蓝色":"label label-blue","红色":"label label-red","绿色":"label label-green","黄色":"label label-yellow",blue:"label label-blue",red:"label label-red",green:"label label-green",yellow:"label label-yellow"},Tag.mapCn2En={"蓝色":"blue","红色":"red","绿色":"green","黄色":"yellow"},Tag.mapEn2Cn={blue:"蓝色",red:"红色",green:"绿色",yellow:"黄色"},Tag.t=$("#tags"),Tag.getTags=function(){var a=[];return Tag.t.children().each(function(){var e=$(this).data("tag");e=Tag.mapCn2En[e]||e,a.push(e)}),a},Tag.clearTags=function(){Tag.t.html("")},Tag.renderTags=function(a){if(Tag.t.html(""),!isEmpty(a))for(var e=0;e<a.length;++e){var t=a[e];Tag.appendTag(t)}},Tag.renderReadOnlyTags=function(a){function e(){return t?"label label-default":(t=!0,"label label-info")}$("#noteReadTags").html(""),(isEmpty(a)||1==a.length&&""==a[0])&&$("#noteReadTags").html(getMsg("noTag"));var t=!0;for(var t in a){var l=a[t];l=Tag.mapEn2Cn[l]||l;var n=Tag.classes[l];n||(n=e()),tag=tt('<span class="?">?</span>',n,trimTitle(l)),$("#noteReadTags").append(tag)}},Tag.appendTag=function(a,e){var t,l,n=!1;if("object"==typeof a){if(t=a.classes,l=a.text,!l)return}else{if(a=$.trim(a),l=a,!l)return;var t=Tag.classes[l];t?n=!0:t="label label-default"}var g=l;"zh"==LEA.locale&&(l=Tag.mapEn2Cn[l]||l,g=Tag.mapCn2En[g]||g),a=tt('<span class="?" data-tag="?">?<i title="'+getMsg("delete")+'">X</i></span>',t,l,l);var r=!1;$("#tags").children().each(function(){if(n){var e=$("<div></div>").append($(this).clone()).html();e==a&&($(this).remove(),r=!0)}else l+"X"==$(this).text()&&($(this).remove(),r=!0)}),$("#tags").append(a),hideTagList(),n||reRenderTags(),e&&(r||Note.curChangedSaveIt(!0,function(){ajaxPost("/tag/updateTag",{tag:g},function(a){reIsOk(a)&&Tag.addTagNav(a.Item)})}))},Tag.removeTag=function(a){var e=a.data("tag");a.remove(),reRenderTags(),"zh"==LEA.locale&&(e=Tag.mapCn2En[e]||e),Note.curChangedSaveIt(!0,function(){ajaxPost("/tag/updateTag",{tag:e},function(a){reIsOk(a)&&Tag.addTagNav(a.Item)})})},Tag.tags=[],Tag.renderTagNav=function(a){a=a||[],Tag.tags=a,$("#tagNav").html("");for(var e in a){var t=a[e],l=t.Tag,n=l;if("zh"==LEA.locale)var n=Tag.mapEn2Cn[l]||n;n=trimTitle(n);var g=Tag.classes[l]||"label label-default";$("#tagNav").append(tt('<li data-tag="?"><a> <span class="?">?</span> <span class="tag-delete">X</span></li>',l,g,n))}},Tag.addTagNav=function(a){var e=this;for(var t in e.tags){var l=e.tags[t];if(l.Tag==a.Tag){e.tags.splice(t,1);break}}e.tags.unshift(a),e.renderTagNav(e.tags)},$(function(){function a(){$li=$(this).closest("li");var a=$.trim($li.data("tag"));confirm("Are you sure ?")&&ajaxPost("/tag/deleteTag",{tag:a},function(e){if(reIsOk(e)){var t=e.Item;Note.deleteNoteTag(t,a),$li.remove()}})}function e(){var a=$(this).closest("li"),e=$.trim(a.data("tag"));Note.curChangedSaveIt(),Note.clearAll(),$("#tagSearch").html(a.html()).show(),$("#tagSearch .tag-delete").remove(),showLoading(),ajaxGet("/note/searchNoteByTags",{tags:[e]},function(a){hideLoading(),a&&(Note.renderNotes(a),isEmpty(a)||Note.changeNote(a[0].NoteId))})}$("#addTagTrigger").click(function(){$(this).hide(),$("#addTagInput").show().focus().val("")}),$("#addTagInput").click(function(a){showTagList(a)}),$("#addTagInput").blur(function(){var a=$(this).val();a&&Tag.appendTag(a,!0)}),$("#addTagInput").keydown(function(a){13==a.keyCode&&(hideTagList(),$("#addTagInput").val()?($(this).trigger("blur"),$("#addTagTrigger").trigger("click")):$(this).trigger("blur"))}),$("#tagColor li").click(function(a){var e;e=$(this).attr("role")?$(this).find("span"):$(this),Tag.appendTag({classes:e.attr("class"),text:e.text()},!0)}),$("#tags").on("click","i",function(){Tag.removeTag($(this).parent())}),$("#myTag .folderBody").on("click","li .label",e),$("#myTag .folderBody").on("click","li .tag-delete",a)});
|
||||
Notebook.curNotebookId="",Notebook.cache={},Notebook.notebooks=[],Notebook.notebookNavForListNote="",Notebook.notebookNavForNewNote="",Notebook.setCache=function(o){var e=o.NotebookId;e&&(Notebook.cache[e]||(Notebook.cache[e]={}),$.extend(Notebook.cache[e],o))},Notebook.getCurNotebookId=function(){return Notebook.curNotebookId},Notebook.getCurNotebook=function(){return Notebook.cache[Notebook.curNotebookId]},Notebook._updateNotebookNumberNotes=function(o,e){var t=this,N=t.getNotebook(o);N&&(N.NumberNotes+=e,N.NumberNotes<0&&(N.NumberNotes=0),$("#numberNotes_"+o).html(N.NumberNotes))},Notebook.incrNotebookNumberNotes=function(o){var e=this;e._updateNotebookNumberNotes(o,1)},Notebook.minusNotebookNumberNotes=function(o){var e=this;e._updateNotebookNumberNotes(o,-1)},Notebook.getNotebook=function(o){return Notebook.cache[o]},Notebook.getNotebookTitle=function(o){var e=Notebook.cache[o];return e?e.Title:"未知"},Notebook.getTreeSetting=function(o,e){function t(o,t){var N=5,n=$("#"+o+" #"+t.tId+"_switch"),a=$("#"+o+" #"+t.tId+"_ico");if(n.remove(),a.before(n),e?Share.isDefaultNotebookId(t.NotebookId)||a.after($('<span class="fa notebook-setting" title="setting"></span>')):Notebook.isAllNotebookId(t.NotebookId)||Notebook.isTrashNotebookId(t.NotebookId)||(a.after($('<span class="notebook-number-notes" id="numberNotes_'+t.NotebookId+'">'+(t.NumberNotes||0)+"</span>")),a.after($('<span class="fa notebook-setting" title="setting"></span>'))),t.level>1){var r="<span style='display: inline-block;width:"+N*t.level+"px'></span>";n.before(r)}}function N(o,e){for(var t=0,N=e.length;N>t;t++)if(e[t].drag===!1)return!1;return!0}function n(o,e,t,N){return t?t.drop!==!1:!0}function a(o,e,t,N,n){function a(o){return o.level==d}var r=t[0];if(N){var i,k=b.tree,s={curNotebookId:r.NotebookId};if(i="inner"==n?N:N.getParentNode()){s.parentNotebookId=i.NotebookId;var d=i.level+1,c=k.getNodesByFilter(a,!1,i)}else var c=k.getNodes();s.siblings=[];for(var l in c){var h=c[l].NotebookId;Notebook.isAllNotebookId(h)||Notebook.isTrashNotebookId(h)||s.siblings.push(h)}ajaxPost("/notebook/dragNotebooks",{data:JSON.stringify(s)}),setTimeout(function(){Notebook.changeNav()},100)}}var r=!o,b=this;if(e)var i=function(o,e,t){var N=t.NotebookId,n=$(o.target).closest(".friend-notebooks").attr("fromUserId");Share.changeNotebook(n,N)},k=null;else var i=function(o,e,t){var N=t.NotebookId;Notebook.changeNotebook(N)},k=function(o){var e=$(o.target).attr("notebookId");Notebook.isAllNotebookId(e)||Notebook.isTrashNotebookId(e)||b.updateNotebookTitle(o.target)};var s={view:{showLine:!1,showIcon:!1,selectedMulti:!1,dblClickExpand:!1,addDiyDom:t},data:{key:{name:"Title",children:"Subs"}},edit:{enable:!0,showRemoveBtn:!1,showRenameBtn:!1,drag:{isMove:r,prev:r,inner:r,next:r}},callback:{beforeDrag:N,beforeDrop:n,onDrop:a,onClick:i,onDblClick:k,beforeRename:function(o,e,t,N){if(""==t)return e.IsNew?(b.tree.removeNode(e),!0):!1;if(e.Title==t)return!0;if(e.IsNew){var n=e.getParentNode(),a=n?n.NotebookId:"";b.doAddNotebook(e.NotebookId,t,a)}else b.doUpdateNotebookTitle(e.NotebookId,t);return!0}}};return s},Notebook.allNotebookId="0",Notebook.trashNotebookId="-1",Notebook.curNotebookIsTrashOrAll=function(){return Notebook.curNotebookId==Notebook.trashNotebookId||Notebook.curNotebookId==Notebook.allNotebookId},Notebook.renderNotebooks=function(o){var e=this;(!o||"object"!=typeof o||o.length<0)&&(o=[]);for(var t=0,N=o.length;N>t;++t){var n=o[t];n.Title=trimTitle(n.Title)}o=[{NotebookId:Notebook.allNotebookId,Title:getMsg("all"),drop:!1,drag:!1}].concat(o),o.push({NotebookId:Notebook.trashNotebookId,Title:getMsg("trash"),drop:!1,drag:!1}),Notebook.notebooks=o,e.tree=$.fn.zTree.init($("#notebookList"),e.getTreeSetting(),o);var a=$("#notebookList");a.hover(function(){$(this).hasClass("showIcon")||$(this).addClass("showIcon")},function(){$(this).removeClass("showIcon")}),isEmpty(o)||(Notebook.curNotebookId=o[0].NotebookId,e.cacheAllNotebooks(o)),Notebook.renderNav(),Notebook.changeNotebookNavForNewNote(o[0].NotebookId)},Notebook.cacheAllNotebooks=function(o){var e=this;for(var t in o){var N=o[t];Notebook.cache[N.NotebookId]=N,isEmpty(N.Subs)||e.cacheAllNotebooks(N.Subs)}},Notebook.expandNotebookTo=function(o,e){var t=this,N=!1,n=t.tree;if(e&&(n=Share.trees[e]),n){var a=n.getNodeByTId(o);if(a)for(;;){var r=a.getParentNode();if(!r){N||Notebook.changeNotebookNav(o);break}n.expandNode(r,!0),N||(Notebook.changeNotebookNav(o),N=!0),a=r}}},Notebook.renderNav=function(o){var e=this;e.changeNav()},Notebook.searchNotebookForAddNote=function(o){var e=this;if(o){var t=e.tree.getNodesByParamFuzzy("Title",o);t=t||[];var N=[];for(var n in t){var a=t[n].NotebookId;e.isAllNotebookId(a)||e.isTrashNotebookId(a)||N.push(t[n])}isEmpty(N)?$("#notebookNavForNewNote").html(""):$("#notebookNavForNewNote").html(e.getChangedNotebooks(N))}else $("#notebookNavForNewNote").html(e.everNavForNewNote)},Notebook.searchNotebookForList=function(o){var e=this,t=$("#notebookListForSearch"),N=$("#notebookList")Line truncated
|
||||
function addShareNoteOrNotebook(e){var t="#tr"+e,o=Share.dialogNoteOrNotebookId,r=isEmailFromInput(t+" #friendsEmail","#shareMsg",getMsg("inputFriendEmail"));if(r){var a=$(t+' input[name="perm'+e+'"]:checked').val()||0,n=a,s="/share/addShareNote",i={noteId:o,emails:[r],perm:a};Share.dialogIsNote||(s="/share/addShareNotebook",i={notebookId:o,emails:[r],perm:a}),hideAlert("#shareMsg"),post(s,i,function(e){var e=e[r];if(e)if(e.Ok){var a=tt("<td>?</td>","#");a+=tt("<td>?</td>",r),a+=tt('<td><a href="#" noteOrNotebookId="?" perm="?" toUserId="?" title="'+getMsg("clickToChangePermission")+'" class="btn btn-default change-perm">?</a></td>',o,n,e.Id,n&&"0"!=n?getMsg("writable"):getMsg("readOnly")),a+=tt('<td><a href="#" noteOrNotebookId="?" toUserId="?" class="btn btn-warning delete-share">'+getMsg("delete")+"</a></td>",o,e.Id),$(t).html(a)}else{var s=UrlPrefix+"/register?iu="+UserInfo.Username;showAlert("#shareMsg",getMsg("friendNotExits",[getMsg("app"),'<input style="background: none;border: 1px solid #ccc;width: 300px;padding: 3px;border-radius: 3px;outline: none;" onclick="$(this).focus().select()" type="text" value="'+s+'" />'])+"</a> <br /> "+getMsg("sendInviteEmailToYourFriend")+', <a href="#" onclick="sendRegisterEmail(\''+r+"')\">"+getMsg("send"),"warning")}},t+" .btn-success")}}function sendRegisterEmail(e){showDialog2("#sendRegisterEmailDialog",{postShow:function(){$("#emailContent").val(getMsg("inviteEmailBody",[UserInfo.Username,getMsg("app")])),setTimeout(function(){$("#emailContent").focus()},500),$("#toEmail").val(e)}})}function deleteShareNoteOrNotebook(e){$("#tr"+e).remove()}Share.defaultNotebookId="share0",Share.defaultNotebookTitle=getMsg("defaultShare"),Share.sharedUserInfos={},Share.userNavs={},Share.notebookCache={},Share.cache={},Share.dialogIsNote=!0,Share.setCache=function(e){e&&e.NoteId&&(Share.cache[e.NoteId]=e)},Share.getNotebooksForNew=function(e,t){for(var o=this,r="",a=t.length,n=0;a>n;++n){var s=t[n];s.IsShared=!0,s.UserId=e,o.notebookCache[s.NotebookId]=s,Notebook.cache[s.NotebookId]=s;var i="",d=!1;if(!isEmpty(s.Subs)){log(11),log(s.Subs);var d=o.getNotebooksForNew(e,s.Subs);d&&(i="dropdown-submenu")}var h="";if(s.Perm){var h=tt('<li role="presentation" class="clearfix ?" userId="?" notebookId="?"><div class="new-note-left pull-left" title="为该笔记本新建笔记" href="#">?</div><div title="为该笔记本新建markdown笔记" class="new-note-right pull-left">M</div>',i,e,s.NotebookId,s.Title);d&&(h+="<ul class='dropdown-menu'>",h+=d,h+="</ul>"),h+="</li>"}r+=h}return r},Share.trees={},Share.renderShareNotebooks=function(e,t){function o(e){}function r(){var e=$(this).attr("notebookId");return!Share.isDefaultNotebookId(e)}var a=Share;if(!isEmpty(e)){(!t||"object"!=typeof t||t.length<0)&&(t={});var n=$("#shareNotebooks");for(var s in e){var i=e[s],d=t[i.UserId]||[];userNotebooks=[{NotebookId:a.defaultNotebookId,Title:Share.defaultNotebookTitle}].concat(d),a.notebookCache[a.defaultNotebookId]=userNotebooks[0];var h=i.Username||i.Email;i.Username=h,Share.sharedUserInfos[i.UserId]=i;var l=i.UserId,c=tt('<li class="each-user"><div class="friend-header" fromUserId="?"><i class="fa fa-angle-down"></i><span>?</span> <span class="fa notebook-setting" title="setting"></span> </div>',i.UserId,h),N="friendContainer_"+l,u='<ul class="friend-notebooks ztree" id="'+N+'" fromUserId="'+l+'"></ul>';n.append(c+u+"</li>"),a.trees[l]=$.fn.zTree.init($("#"+N),Notebook.getTreeSetting(!0,!0),userNotebooks),a.userNavs[l]={forNew:a.getNotebooksForNew(l,d)},log(a.userNavs)}$(".friend-notebooks").hover(function(){$(this).hasClass("showIcon")||$(this).addClass("showIcon")},function(){$(this).removeClass("showIcon")}),$(".friend-header i").click(function(){var e=$(this),t=$(this).parent().next();t.is(":hidden")?(t.slideDown("fast"),e.removeClass("fa-angle-right fa-angle-down").addClass("fa-angle-down")):(t.slideUp("fast"),e.removeClass("fa-angle-right fa-angle-down").addClass("fa-angle-right"))});var f={width:180,items:[{text:getMsg("deleteSharedNotebook"),icon:"",faIcon:"fa-trash-o",action:Share.deleteShareNotebook}],onShow:o,onContextMenu:r,parent:"#shareNotebooks",children:".notebook-item"},b=$("#shareNotebooks").contextmenu(f),k={width:180,items:[{text:getMsg("deleteAllShared"),icon:"",faIcon:"fa-trash-o",action:Share.deleteUserShareNoteAndNotebook}],parent:"#shareNotebooks",children:".friend-header"},g=$("#shareNotebooks").contextmenu(k);$(".friend-header").on("click",".notebook-setting",function(e){e.preventDefault(),e.stopPropagation();var t=$(this).parent();g.showMenu(e,t)}),$("#shareNotebooks .notebook-item").on("click",".notebook-setting",function(e){e.preventDefault(),e.stopPropagation();var t=$(this).parent();b.showMenu(e,t)})}},Share.isDefaultNotebookId=function(e){return Share.defaultNotebookId==e},Share.toggleToSharedNav=function(e,t){$("#curNotebookForListNote").html(Share.notebookCache[t].Title+"("+Share.sharedUserInfos[e].Username+")");var o=Share.userNavs[e].forNew;if(o){$("#notebookNaLine truncated
|
||||
@@ -523,8 +523,8 @@ function initEditor() {
|
||||
|
||||
// fix TinyMCE Removes site base url
|
||||
// http://stackoverflow.com/questions/3360084/tinymce-removes-site-base-urls
|
||||
convert_urls:true,
|
||||
relative_urls:false,
|
||||
convert_urls: false, // true会将url变成../api/
|
||||
relative_urls: true,
|
||||
remove_script_host:false,
|
||||
|
||||
selector : "#editorContent",
|
||||
|
||||
@@ -1 +1 @@
|
||||
var MSG={"noTag":"Keine Tags","saveSuccess":"Speichern erfolgreich","none":"Keine","like":"Gefällt mir","unlike":"Gefällt mir nicht mehr","delete":"Löschen","cancel":"Abbrechen","confirm":"Bestätigen","chooseReason":"Grund angeben","reportSuccess":"Erfolg","error":"Fehler","reportComment?":"Kommentar?","reportBlog?":"Blog?","confirmDeleteComment":"Wirklich löschen?","scanQRCode":"weichat öffnen und QR Code scannen","justNow":"Jetzt","minutesAgo":"Minuten","hoursAgo":"Stunden","daysAgo":"Tage","weeksAgo":"Wochen","monthsAgo":"Monate"};function getMsg(key, data) {var msg = MSG[key];if(msg) {if(data) {if(!isArray(data)) {data = [data];}for(var i = 0; i < data.length; ++i) {msg = msg.replace("%s", data[i]);}}return msg;}return key;}
|
||||
var MSG={"noTag":"Keine Tags","saveSuccess":"Speichern erfolgreich","none":"Keine","like":"Gefällt mir","unlike":"Gefällt mir nicht mehr","delete":"Löschen","cancel":"Abbrechen","confirm":"Bestätigen","chooseReason":"请选择举报理由","reportSuccess":"举报成功, 我们处理后会通知作者, 感谢您的监督","error":"Error","reportComment?":"举报该评论?","reportBlog?":"举报该博客?","confirmDeleteComment":"Sind Sie sicher?","scanQRCode":"Öffnen Sie weichat und scannen den QR Code","justNow":"Jetz","minutesAgo":"Minuten","hoursAgo":"Stunden","daysAgo":"Tage","weeksAgo":"Wochen","monthsAgo":"Monate"};function getMsg(key, data) {var msg = MSG[key];if(msg) {if(data) {if(!isArray(data)) {data = [data];}for(var i = 0; i < data.length; ++i) {msg = msg.replace("%s", data[i]);}}return msg;}return key;}
|
||||
@@ -1 +1 @@
|
||||
var MSG={"noTag":"No tag","saveSuccess":"Save success","none":"None","like":"Like","unlike":"Unlike","delete":"Delete","cancel":"Cancel","confirm":"Confirm","chooseReason":"请选择举报理由","reportSuccess":"举报成功, 我们处理后会通知作者, 感谢您的监督","error":"Error","reportComment?":"举报该评论?","reportBlog?":"举报该博客?","confirmDeleteComment":"Are you sure?","scanQRCode":"Open weichat and scan the QR code","justNow":"Just now","minutesAgo":"minutes ago","hoursAgo":"hours ago","daysAgo":"days ago","weeksAgo":"weeks ago","monthsAgo":"months ago"};function getMsg(key, data) {var msg = MSG[key];if(msg) {if(data) {if(!isArray(data)) {data = [data];}for(var i = 0; i < data.length; ++i) {msg = msg.replace("%s", data[i]);}}return msg;}return key;}
|
||||
var MSG={"noTag":"No tag","saveSuccess":"Save success","none":"None","like":"Like","unlike":"Unlike","delete":"Delete","cancel":"Cancel","confirm":"Confirm","chooseReason":"Select report reason","reportSuccess":"Reporting success, we will notify the author, thank you for your monitor","error":"Error","reportComment?":"Report this comment?","reportBlog?":"Report this blog?","confirmDeleteComment":"Are you sure?","scanQRCode":"Open weichat and scan the QR code","justNow":"Just now","minutesAgo":"minutes ago","hoursAgo":"hours ago","daysAgo":"days ago","weeksAgo":"weeks ago","monthsAgo":"months ago"};function getMsg(key, data) {var msg = MSG[key];if(msg) {if(data) {if(!isArray(data)) {data = [data];}for(var i = 0; i < data.length; ++i) {msg = msg.replace("%s", data[i]);}}return msg;}return key;}
|
||||
@@ -1 +1 @@
|
||||
var MSG={"app":"Leanote","share":"Teilen","noTag":"Keine Tags","inputUsername":"Benutzernamen eingeben","inputEmail":"E-Mail ist erforderlich","inputPassword":"Passwort ist erforderlich","inputPassword2":"Bitte Passwort erneut eingeben","confirmPassword":"Bitte Passwort bestätigen","history":"Verlauf","editorTips":"Tips","editorTipsInfo":"<h4>1. Kurzbefehle</h4>ctrl+shift+c Ansicht ändern<h4>2. shift+enter Den aktuellen Block verlassen</h4> Beispiel: <img src=\"/images/outofcode.png\" style=\"width: 90px\"/> in dieser Situation nutze shift+enter um den derzeitigen Block zu verlassen.","all":"Neuste","trash":"Papierkorb","delete":"Löschen","unTitled":"Ohne Titel","defaultShare":"Standard Freigabe","writingMode":"Schreibmodus","normalMode":"Normaler Modus","saving":"Speichern","saveSuccess":"Speichern erfolgreich","update":"Aktualisieren","close":"Schliessen","cancel":"Abbrechen","send":"Senden","shareToFriends":"Mit Anderen teilen","publicAsBlog":"Blog veröffentlichen","cancelPublic":"Blog zurückziehen","move":"Verschieben","copy":"Kopieren","rename":"Umbenennen","exportPdf":"Export als PDF","addChildNotebook":"Neue Unter-Notizbuch","deleteAllShared":"Lösche gemeinsame Nutzer","deleteSharedNotebook":"Entfernen des freigegebenen Notizbuchs","copyToMyNotebook":"Zu meinen Notizbüchern kopieren","checkEmail":"E-Mail abrufen","sendVerifiedEmail":"Schicke Bestätigungsmail","defaulthhare":"Voreinstellung","friendEmail":"Friend E-Mail","readOnly":"Nur-Lesen","writable":"Schreibrechte","inputFriendEmail":"Bitte geben Sie Ihre Freunde E-Mail ein","clickToChangePermission":"Klicken Sie auf Berechtigungen ändern","sendInviteEmailToYourFriend":"Senden Sie die Einladung per E-Mail an Freunde","friendNotExits":"Der Benutzer hat %s's nicht registriert, Einladungs-Link:%s","emailBodyRequired":"E-Mail kann nicht leer sein","sendSuccess":"erfolgreich","inviteEmailBody":"Hallo, ich bin %s, %s ist grossartig, schau es dir an!","historiesNum":"Wir haben deine letzten <b>10</b> Einträge gespeichert.","noHistories":"Kein Verlauf","datetime":"Datum und Zeit","restoreFromThisVersion":"Wiederherstellen von dieser Version","confirmBackup":"Sind Sie sicher das die ausgewählte Version wiederhergestellt werden soll? Die aktuelle Notiz wird zuvor gesichert.","createAccountSuccess":"Konto-Erstellung erfolgreich","createAccountFailed":"Fehler beim Erstellen des Kontos","updateUsernameSuccess":"Aktualisierung des Nutzernamens war erfolgreich","usernameIsExisted":"Nutzername existiert bereits","noSpecialChars":"Nutzername darf keine Sonderzeichen enthalten","minLength":"Die Länge muss mindestens %s Zeichen betragen","errorEmail":"Bitte füge die richtige E-Mail ein","verifiedEmaiHasSent":"Die Verifizierungs-E-Mail wurde verschickt, bitte checke deine E-Mail.","emailSendFailed":"E-Mail-Verifizierung fehlgeschlagen","inputNewPassword":"Neues Passwort ist erforderlich","errorPassword":"Die länge des Passwortes sollte mindestenns 6 Zeichen und so komplex wie möglich sein","updatePasswordSuccess":"Aktualiseren des Passwortes erfolgreich","Please save note firstly!":"Bitte die Notiz zuerst speichen!","Please sign in firstly!":"Bitte zuerst anmelden!","Are you sure ?":"Sind Sie sicher ?","Are you sure to install it ?":"Wollen Sie das wirklich installieren ?","Are you sure to delete":"Wirklich Löschen","Success":"Erfolgreich","Error":"Fehler","File exists":"Datei existiert bereits","Delete file":"Datei löschen","No images":"Keine Bilder","Filename":"Dateiname","Group Title":"Gruppenname","Hyperlink":"Hyperlink","Please provide the link URL and an optional title":"Bitte URL und einen optionalen Titel angeben","optional title":"Optionaler Titel","Cancel":"Abbrechen","Strong":"Fett","strong text":"Text in Fettschrift","Emphasis":"Kursiv","emphasized text":"Kursiver Text","Blockquote":"Blockzitat","Code Sample":"Code Schnipsel","enter code here":"Code hier eingeben","Image":"Bild","Heading":"Überschrift","Numbered List":"Nummerierte Liste","Bulleted List":"Aufzählungsliste","List item":"Listenelement","Horizontal Rule":"Horizontaler Trennstrich","Markdown syntax":"Markdown Syntax","Undo":"Rückgängig","Redo":"Wiederholen","enter image description here":"Bildbeschreibung hier eingeben","enter link description here":"Link Beschreibung hier eingeben","Edit mode":"Bearbeiten Modus","Vim mode":"Vim Modus","Emacs mode":"Emacs Modus","Normal mode":"Normaler Modus","Normal":"Normal","Light":"Light","Light editor":"Light Editor","Add Album":"Album hinzufügen","Cannot delete default album":"Das Standard Album kann nicht gelöscht werden","Cannot rename default album":"Das Standard Album kann nicht umbenannt werden","Rename Album":"Album umbenennen","Add Success!":"Hinzufügen erfolgreich!","Rename Success!":"Umbenennen erfolgreich!","Delete Success!":"Löschen erfolgreich!","Are you sure to delete this image ?":"Soll dieses Bild wirklich gelöscht werden ?","click to remove this image":"Klicken um dieses Bild zu löschen","error":"Fehler","PrevLine truncated
|
||||
var MSG={"app":"Leanote","share":"Teilen","noTag":"Keine Tags","inputUsername":"Füge Nutzernamen ein","inputEmail":"E-Mail ist erforderlich","inputPassword":"Passwort ist erforderlich","inputPassword2":"Bitte füge dein neues Passwort ein","confirmPassword":"Passwort stimmt nicht überein","history":"Verlauf","editorTips":"Tipps","editorTipsInfo":"<h4>1. Kurzbefehle</h4>ctrl+shift+c Ansicht ändern<h4>2. shift+enter Den aktuellen Block verlassen</h4> eg. <img src=\"/images/outofcode.png\" style=\"width: 90px\"/> in dieser Situation nutze shift+enter um den derzeitigen Block zu verlassen.","all":"Neueste","trash":"Papierkorb","delete":"Löschen","unTitled":"Ohne Titel","defaultShare":"Standard Freigabe","writingMode":"Schreibmodus","normalMode":"Normaler Modus","saving":"Speichern","saveSuccess":"Speichern erfolgreich","update":"Aktualisierung","close":"Schliessen","cancel":"Abbrechen","send":"Absenden","shareToFriends":"Teile mit Anderen","publicAsBlog":"Veröffentlichen als Blog","cancelPublic":"Veröffentlichung zurückziehen","move":"Verschieben","copy":"Kopieren","rename":"Umbenennen","exportPdf":"Export als PDF","addChildNotebook":"Erstelle Unter-Notizbuch","deleteAllShared":"Lösche gemeinsame Nutzer","deleteSharedNotebook":"Lösche gemeinsame Notiz","copyToMyNotebook":"Kopiere zu meinen Notizen","checkEmail":"Überprüfe E-Mail","sendVerifiedEmail":"Schicke Bestätigungsmail","defaulthhare":"Voreinstellung","friendEmail":"E-Mail des Freundes","readOnly":"Nur lesen","writable":"Schreibrechte","inputFriendEmail":"E-Mail-Adresse deines Freundes wird benötigt","clickToChangePermission":"Klicke, um Erlaubniss zu ändern","sendInviteEmailToYourFriend":"Schicke deinem Freund eine E-Mail-Benachrichtigung","friendNotExits":"Dein Freund besitzt kein %s's Konto, Einladungs-Benachrichtigung verschicken: %s","emailBodyRequired":"E-Mail-Inhalt ist notwendig","sendSuccess":"Erfolgreich","inviteEmailBody":"Hallo, ich bin %s, %s ist grossartig, schau es dir an!","historiesNum":"Wir haben deine letzten <b>10</b> Einträge gespeichert.","noHistories":"Kein Verlauf","fold":"Einklappen","unfold":"Ausklappen","datetime":"Datum und Zeit","restoreFromThisVersion":"Wiederherstellen von dieser Version","confirmBackup":"Bist du sicher, dass du von dieser Version wiederherstellen willst? Wir werden die aktuelle Version speichern.","createAccountSuccess":"Konto-Erstellung erfolgreich","createAccountFailed":"Fehler beim Erstellen des Kontos","updateUsernameSuccess":"Aktualisierung des Nutzernamens war erfolgreich","usernameIsExisted":"Nutzername existiert bereits","noSpecialChars":"Nutzername darf keine Sonderzeichen enthalten","minLength":"Die Länge muss mindestens %s Zeichen betragen","errorEmail":"Bitte füge die richtige E-Mail ein","verifiedEmaiHasSent":"Die Verifizierungs-E-Mail wurde verschickt, bitte checke deine E-Mail.","emailSendFailed":"E-Mail-Verifizierung fehlgeschlagen","inputNewPassword":"Neues Passwort ist erforderlich","errorPassword":"Die länge des Passwortes sollte mindestenns 6 Zeichen und so komplex wie möglich sein","updatePasswordSuccess":"Aktualiseren des Passwortes erfolgreich","Please save note firstly!":"Bitte die Notiz zuerst speichen!","Please sign in firstly!":"Bitte zuerst anmelden!","Are you sure ?":"Sind Sie sicher ?","Are you sure to install it ?":"Soll das wirklich installiert werden ?","Are you sure to delete":"Wirklich löschen","Success":"Erfolgreich","Error":"Fehler","File exists":"Datei bereits vorhanden","Delete file":"Datei löschen","No images":"Keine Bilder","Filename":"Dateiname","Group Title":"Gruppenname","Hyperlink":"Hyperlink","Please provide the link URL and an optional title":"Bitte Link URL und einen optionalen Titel angeben","optional title":"Optionaler Titel","Cancel":"Abbrechen","Strong":"Fett","strong text":"Text in Fettschrift","Emphasis":"Kursiv","emphasized text":"Kursiver Text","Blockquote":"Blockzitat","Code Sample":"Code-Schnipsel","enter code here":"Code hier eingeben","Image":"Bild","Heading":"Überschrift","Numbered List":"Nummerierte Liste","Bulleted List":"Aufzählungsliste","List item":"Listenelement","Horizontal Rule":"Horizontale Trennlinie","Markdown syntax":"Markdown Syntax","Undo":"Rückgängig","Redo":"Wiederholen","enter image description here":"Beschreibung des Bildes hier eingeben","enter link description here":"Beschreibung des Links hier eingeben","Edit mode":"Bearbeiten Modus","Vim mode":"Vim Modus","Emacs mode":"Emacs Modus","Normal mode":"Normaler Modus","Normal":"Normal","Light":"Light","Light editor":"Light Editor","Add Album":"Album hinzufügen","Cannot delete default album":"Standard Album kann nicht gelöscht werden","Cannot rename default album":"Standard Album kann nicht umbenannt werden","Rename Album":"Album umbenennen","Add Success!":"Hinzufügen erfolgreich!","Rename Success!":"Umbenennen erfolgreich!","Delete Success!":"Löschen erfolgreich!","Are you sure to delete this image ?":"Soll dieses Bild wirklich gelöscht werden ?","cliLine truncated
|
||||
@@ -1 +1 @@
|
||||
var MSG={"app":"Leanote","share":"Partager","noTag":"Pas d'étiquettes","inputUsername":"Entrer le nom d'utilisateur","inputEmail":"L'adresse courriel est requis","inputPassword":"Mot de passe requis","inputPassword2":"Veuillez rentrer le nouveau mot de passe à nouveau.","confirmPassword":"Le mot de passe ne correspond pas.","history":"Historique","editorTips":"Astuces","editorTipsInfo":"<h4>1. Raccourcis</h4>ctrl+maj+c Active/désactive le code<h4>2. maj+entrée Sortir du bloc courant</h4> ex. <img src=\"/images/outofcode.png\" style=\"width: 90px\"/> dans cette situation vous pouvez utiliser maj+entrée pour sortir du bloc de code courant.","all":"Le plus récent","trash":"Corbeille","delete":"Effacer","unTitled":"Sans titre","defaultShare":"Partage par défaut","writingMode":"Mode écriture","normalMode":"Mode normal","saving":"Sauvegarde","saveSuccess":"Sauvegarde réussie","update":"Mettre à jour","close":"Fermer","cancel":"Annuler","send":"Envoyer","shareToFriends":"Partage avec ses amis","publicAsBlog":"Publier en tant que blog","cancelPublic":"Annuler la publication","move":"Déplacer","copy":"Copier","rename":"Renommer","addChildNotebook":"Ajouer un bloc-note enfant","deleteAllShared":"Effacer l'utilisateur partagé","deleteSharedNotebook":"Effacer le bloc-notes partagé","copyToMyNotebook":"Copier vers mon bloc-notes","checkEmail":"Vérifier courriel","sendVerifiedEmail":"Envoyer le courriel de confirmation","defaulthhare":"Par défaut","friendEmail":"Courriel de l'ami","readOnly":"Lecture seule","writable":"Editable","inputFriendEmail":"Le courriel de votre ami est requis/","clickToChangePermission":"Cliquez pour changer l'autorisation.","sendInviteEmailToYourFriend":"Envoyer un courriel d'invitation à votre ami.","friendNotExits":"Votre ami n'a pas de compte %s, lien d'invitation à s'enregistrer: %s","emailBodyRequired":"Corps du message requis","sendSuccess":"succès","inviteEmailBody":"Coucou, je suis %s, %s est génial, viens!","historiesNum":"Nous avons enregistré au maximum <b>10</b> historiques récents de chaque note.","noHistories":"Pas d'historique.","fold":"Plier","unfold":"Déplier","datetime":"Date & Heure","restoreFromThisVersion":"Restaurer depuis cette version","confirmBackup":"Êtes-vous sûr de vouloir restaurer depuis cette version? Nous allons réaliser une copie de sauvegarde de la note actuelle.","createAccountSuccess":"Compte créé avec succès","createAccountFailed":"Echec de la création du compte","updateUsernameSuccess":"Mise à jour du nom d'utilisateur réussie","usernameIsExisted":"Le nom d'utilisateur existe déjà.","noSpecialChars":"le nom d'utilisateur ne peut pas contenir de caractères spéciaux","minLength":"La longueur doit être d'au moins %s","errorEmail":"Veuillez renseigner le courriel correct","verifiedEmaiHasSent":"Le courriel de confirmation a été envoyé, veuillez surveiller votre boite de réception.","emailSendFailed":"Envoi du courriel échoué.","inputNewPassword":"Le nouveau mot de passe est requis.","errorPassword":"La taille du mot de passe est d'au moins 6 caractères et aussi complexe que possible.","updatePasswordSuccess":"Mises à jour du mot de passe réussie.","Please save note firstly!":"Veuillez d'abord enregistrer votre note!","Please sign in firstly!":"Veuillez d'abord vous enregistrer!","Are you sure ?":"Are you sure ?","Are you sure to install it ?":"Are you sure to install it ?","Are you sure to delete":"Are you sure to delete","Success":"Success","Error":"Error","File exists":"File exists","Delete file":"Delete file","No images":"No images","Filename":"Filename","Group Title":"Group Title","Hyperlink":"Hyperlink","Please provide the link URL and an optional title":"Please provide the link URL and an optional title","optional title":"optional title","Cancel":"Cancel","Strong":"Strong","strong text":"strong text","Emphasis":"Emphasis","emphasized text":"emphasized text","Blockquote":"Blockquote","Code Sample":"Code Sample","enter code here":"enter code here","Image":"Image","Heading":"Heading","Numbered List":"Numbered List","Bulleted List":"Bulleted List","List item":"List item","Horizontal Rule":"Horizontal Rule","Markdown syntax":"Markdown syntax","Undo":"Undo","Redo":"Redo","enter image description here":"enter image description here","enter link description here":"enter link description here","Edit mode":"Edit mode","Vim mode":"Vim mode","Emacs mode":"Emacs mode","Normal mode":"Normal mode","Normal":"Normal","Light":"Light","Light editor":"Light editor","Add Album":"Add Album","Cannot delete default album":"Cannot delete default album","Cannot rename default album":"Cannot rename default album","Rename Album":"Rename Album","Add Success!":"Add Success!","Rename Success!":"Rename Success!","Delete Success!":"Delete Success!","Are you sure to delete this image ?":"Are you sure to delete this image ?","click to remove this image":"click to remove this image","error":"error","Prev":"Prev","Next":"Next"};function getMsg(keyLine truncated
|
||||
var MSG={"app":"Leanote","share":"Partager","noTag":"Pas d'étiquettes","inputUsername":"Entrer le nom d'utilisateur","inputEmail":"L'adresse courriel est requis","inputPassword":"Mot de passe requis","inputPassword2":"Veuillez rentrer le nouveau mot de passe à nouveau.","confirmPassword":"Le mot de passe ne correspond pas.","history":"Historique","editorTips":"Astuces","editorTipsInfo":"<h4>1. Raccourcis</h4>ctrl+maj+c Active/désactive le code<h4>2. maj+entrée Sortir du bloc courant</h4> ex. <img src=\"/images/outofcode.png\" style=\"width: 90px\"/> dans cette situation vous pouvez utiliser maj+entrée pour sortir du bloc de code courant.","all":"Le plus récent","trash":"Corbeille","delete":"Effacer","unTitled":"Sans titre","defaultShare":"Partage par défaut","writingMode":"Mode écriture","normalMode":"Mode normal","saving":"Sauvegarde","saveSuccess":"Sauvegarde réussie","update":"Mettre à jour","close":"Fermer","cancel":"Annuler","send":"Envoyer","shareToFriends":"Partage avec ses amis","publicAsBlog":"Publier en tant que blog","cancelPublic":"Annuler la publication","move":"Déplacer","copy":"Copier","rename":"Renommer","addChildNotebook":"Ajouer un bloc-note enfant","deleteAllShared":"Effacer l'utilisateur partagé","deleteSharedNotebook":"Effacer le bloc-notes partagé","copyToMyNotebook":"Copier vers mon bloc-notes","checkEmail":"Vérifier courriel","sendVerifiedEmail":"Envoyer le courriel de confirmation","defaulthhare":"Par défaut","friendEmail":"Courriel de l'ami","readOnly":"Lecture seule","writable":"Editable","inputFriendEmail":"Le courriel de votre ami est requis","clickToChangePermission":"Cliquez pour changer l'autorisation.","sendInviteEmailToYourFriend":"Envoyer un courriel d'invitation à votre ami.","friendNotExits":"Votre ami n'a pas de compte %s, lien d'invitation à s'enregistrer: %s","emailBodyRequired":"Corps du message requis","sendSuccess":"succès","inviteEmailBody":"Coucou, je suis %s, %s est génial, viens!","historiesNum":"Nous avons enregistré au maximum <b>10</b> historiques récents de chaque note.","noHistories":"Pas d'historique.","fold":"Plier","unfold":"Déplier","datetime":"Date & Heure","restoreFromThisVersion":"Restaurer depuis cette version","confirmBackup":"Êtes-vous sûr de vouloir restaurer depuis cette version? Nous allons réaliser une copie de sauvegarde de la note actuelle.","createAccountSuccess":"Compte créé avec succès","createAccountFailed":"Echec de la création du compte","updateUsernameSuccess":"Mise à jour du nom d'utilisateur réussie","usernameIsExisted":"Le nom d'utilisateur existe déjà.","noSpecialChars":"le nom d'utilisateur ne peut pas contenir de caractères spéciaux","minLength":"La longueur doit être d'au moins %s","errorEmail":"Veuillez renseigner le courriel correct","verifiedEmaiHasSent":"Le courriel de confirmation a été envoyé, veuillez surveiller votre boite de réception.","emailSendFailed":"Envoi du courriel échoué.","inputNewPassword":"Le nouveau mot de passe est requis.","errorPassword":"La taille du mot de passe est d'au moins 6 caractères et aussi complexe que possible.","updatePasswordSuccess":"Mises à jour du mot de passe réussie.","Please save note firstly!":"Veuillez d'abord enregistrer votre note!","Please sign in firstly!":"Veuillez d'abord vous enregistrer!","Are you sure ?":"Êtes-vous sûr ?","Are you sure to install it ?":"Voulez-vous vraiment l'installer ?","Are you sure to delete":"Voulez-vous vraiment l'effacer?","Success":"Succès","Error":"Erreur","File exists":"Le fichier exite","Delete file":"Effacer le fichier","No images":"Pas d'images","Filename":"Nom de fichier","Group Title":"Titre du groupe","Hyperlink":"Hyperlien","Please provide the link URL and an optional title":"Veuillez fournir le lien hypertexte et un titre facultatif","optional title":"titre facultatif","Cancel":"Annuler","Strong":"Fort","strong text":"Texte fort","Emphasis":"Emphase","emphasized text":"Texte avec emphase","Blockquote":"Bloc de citation","Code Sample":"Extrait de code","enter code here":"entrer le code ici","Image":"Image","Heading":"Titre","Numbered List":"Liste ordonnée","Bulleted List":"Liste non ordonnée","List item":"Element de liste","Horizontal Rule":"Ligne horizontale","Markdown syntax":"Syntaxe markdown","Undo":"Annuler","Redo":"Reproduire","enter image description here":"entrer la description de l'image ici","enter link description here":"entrer la description du lien ici","Edit mode":"Mode édition","Vim mode":"Mode Vim","Emacs mode":"Mode Emacs","Normal mode":"Mode Normal","Normal":"Normal","Light":"Léger","Light editor":"Editeur léger","Add Album":"Ajouter un album","Cannot delete default album":"Album par défaut impossible à effacer","Cannot rename default album":"Album par défaut impossible à renommer","Rename Album":"Renommer un album","Add Success!":"Ajout effectué avec succès!","Rename Success!":"Renommage effectué avec succès!","Delete Success!":"Effaçage effectué avec succLine truncated
|
||||
@@ -1,6 +1,5 @@
|
||||
// for editor.
|
||||
// drag image to editor
|
||||
var urlPrefix = UrlPrefix; // window.location.protocol + "//" + window.location.host;
|
||||
define('editor_drop_paste', ['fileupload'], function() {
|
||||
|
||||
// 在toggle成pre或ace时
|
||||
@@ -125,8 +124,7 @@ define('editor_drop_paste', ['fileupload'], function() {
|
||||
(function(data) {
|
||||
ajaxPost("/file/copyImage", {userId: UserInfo.UserId, fileId: fileId, toUserId: curNote.UserId}, function(re) {
|
||||
if(reIsOk(re) && re.Id) {
|
||||
var urlPrefix = window.location.protocol + "//" + window.location.host;
|
||||
data.src = urlPrefix + "/api/file/getImage?fileId=" + re.Id;
|
||||
data.src = "/api/file/getImage?fileId=" + re.Id;
|
||||
}
|
||||
renderImage(data);
|
||||
});
|
||||
@@ -180,7 +178,7 @@ define('editor_drop_paste', ['fileupload'], function() {
|
||||
if (data.result.Ok == true) {
|
||||
data.context.remove();
|
||||
// life
|
||||
var data2 = {src: urlPrefix + "/api/file/getImage?fileId=" + data.result.Id}
|
||||
var data2 = {src: "/api/file/getImage?fileId=" + data.result.Id}
|
||||
insertImage(data2);
|
||||
} else {
|
||||
data.context.empty();
|
||||
@@ -339,80 +337,20 @@ define('editor_drop_paste', ['fileupload'], function() {
|
||||
data.process = process;
|
||||
var jqXHR = data.submit();
|
||||
}, 20);
|
||||
|
||||
/*
|
||||
d.id = '__mcenew' + (new Date()).getTime();
|
||||
d.src = "http://leanote.com/images/loading-24.gif"; // 写死了
|
||||
var img = '<img src="' + d.src + '" id="' + d.id + '" />';
|
||||
editor.insertContent(img);
|
||||
var imgElm = $(d.id);
|
||||
data.imgId = d.id;
|
||||
data.context = imgElm;
|
||||
*/
|
||||
|
||||
/*
|
||||
// 上传之
|
||||
var c = new FormData;
|
||||
c.append("from", "pasteImage");
|
||||
// var d;
|
||||
// d = $.ajaxSettings.xhr();
|
||||
// d.withCredentials = i;var d = {};
|
||||
|
||||
// 先显示loading...
|
||||
var editor = tinymce.EditorManager.activeEditor;
|
||||
var dom = editor.dom;
|
||||
var d = {};
|
||||
d.id = '__mcenew';
|
||||
d.src = "http://leanote.com/images/loading-24.gif"; // 写死了
|
||||
editor.insertContent(dom.createHTML('img', d));
|
||||
var imgElm = dom.get('__mcenew');
|
||||
$.ajax({url: "/file/pasteImage", contentType:false, processData:false , data: c, type: "POST"}
|
||||
).done(function(re) {
|
||||
if(!re || typeof re != "object" || !re.Ok) {
|
||||
// 删除
|
||||
dom.remove(imgElm);
|
||||
return;
|
||||
}
|
||||
// 这里, 如果图片宽度过大, 这里设置成500px
|
||||
var urlPrefix = UrlPrefix; // window.location.protocol + "//" + window.location.host;
|
||||
var src = urlPrefix + "/api/file/getImage?fileId=" + re.Id;
|
||||
getImageSize(src, function(wh) {
|
||||
// life 4/25
|
||||
if(wh && wh.width) {
|
||||
if(wh.width > 600) {
|
||||
wh.width = 600;
|
||||
}
|
||||
d.width = wh.width;
|
||||
dom.setAttrib(imgElm, 'width', d.width);
|
||||
}
|
||||
dom.setAttrib(imgElm, 'src', src);
|
||||
});
|
||||
dom.setAttrib(imgElm, 'id', null);
|
||||
});
|
||||
};
|
||||
reader.readAsDataURL(blob);
|
||||
*/
|
||||
},
|
||||
|
||||
done: function(e, data) {
|
||||
if (data.result.Ok == true) {
|
||||
// 这里, 如果图片宽度过大, 这里设置成500px
|
||||
var re = data.result;
|
||||
var urlPrefix = UrlPrefix; // window.location.protocol + "//" + window.location.host;
|
||||
var src = urlPrefix + "/api/file/getImage?fileId=" + re.Id;
|
||||
var src = "/api/file/getImage?fileId=" + re.Id;
|
||||
|
||||
if(curNote && !curNote.IsMarkdown) {
|
||||
data.process.replace(src);
|
||||
} else {
|
||||
MD && MD.insertLink(src, 'title', true);
|
||||
}
|
||||
|
||||
/*
|
||||
getImageSize(src, function() {
|
||||
$img.attr('src', src);
|
||||
$img.removeAttr('id');
|
||||
});
|
||||
*/
|
||||
|
||||
} else {
|
||||
data.process.remove();
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -2,6 +2,6 @@ define("note_info",[],function(){var t=["<table>","<tr><th>"+getMsg("Create Time
|
||||
define("tips",[],function(){var d=['<div class="modal fade bs-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">','<div class="modal-dialog modal-sm">','<div class="modal-content">','<div class="modal-header">','<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>','<h4 class="modal-title" class="modalTitle">'+getMsg("editorTips")+"</h4>","</div>",'<div class="modal-body">'+getMsg("editorTipsInfo")+"</div>",'<div class="modal-footer">','<button type="button" class="btn btn-default" data-dismiss="modal">'+getMsg("close")+"</button>","</div>","</div>","</div>","</div>"].join(""),a=$(d),i={init:function(){$("#tipsBtn").click(function(){a.modal({show:!0})})}};i.init()});
|
||||
define("history",[],function(){var t=['<div class="modal fade history-modal" tabindex="-1" role="dialog" aria-hidden="true">','<div class="modal-dialog modal-lg ">','<div class="modal-content">','<div class="modal-header">','<h4 class="modal-title" class="modalTitle">NaN',"</div>",'<div class="modal-body clearfix">','<div class="history-list-wrap pull-left">','<div class="history-list-header">'+getMsg("history")+' (<span class="history-num"></span>)</div>','<div class="history-list list-group"></div>',"</div>",'<div class="history-content-wrap pull-left">','<div class="history-content-header">','<a class="btn btn-primary back">'+getMsg("restoreFromThisVersion")+"</a>",'<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>',"</div>",'<div class="history-content"></div>',"</div>","</div>",'<div class="modal-footer hide">','<button type="button" class="btn btn-default" data-dismiss="modal">'+getMsg("close")+"</button>","</div>","</div>","</div>","</div>"].join(""),i=$(t),s=i.find(".history-content"),e=i.find(".history-list"),o=i.find(".history-num"),n={note:null,list:[],curIndex:0,renderContent:function(t){var i=this.list[t].Content;this.curIndex=t;var o="<div>",n="</div>";this.note.IsMarkdown&&(o="<pre>",n="</pre>"),s.html(o+i+n);var a=e.find("a");a.removeClass("active"),a.eq(t).addClass("active")},render:function(t){var s="";if(this.list=t,t)for(var n=0;n<t.length;++n){var a=t[n];s+='<a class="list-group-item" data-index="'+n+'"><span class="badge">#'+(n+1)+"</span>"+goNowToDatetime(a.UpdatedTime)+"</a>"}e.html(s),this.renderContent(0),o.html(t.length),i.modal({show:!0})},bind:function(){var t=this;$("#contentHistory").click(function(){t.getHistories()}),e.on("click","a",function(){var i=$(this).data("index");t.renderContent(i)}),i.find(".back").click(function(){confirm(getMsg("confirmBackup"))&&(Note.curChangedSaveIt(!0),note=Note.cache[Note.curNoteId],setEditorContent(t.list[t.curIndex].Content,note.IsMarkdown),i.modal("hide"),Note.curChangedSaveIt(!0))})},getHistories:function(){var t=this,i=Note.getCurNote();t.note=i,ajaxGet("/noteContentHistory/listHistories",{noteId:Note.curNoteId},function(i){return isArray(i)?void t.render(i):void alert(getMsg("noHistories"))})},init:function(){this.bind()}};n.init()});
|
||||
var urlPrefix=UrlPrefix;define("attachment_upload",["fileupload"],function(){function e(e){return"number"!=typeof e?"":e>=1e9?(e/1e9).toFixed(2)+" GB":e>=1e6?(e/1e6).toFixed(2)+" MB":(e/1e3).toFixed(2)+" KB"}function t(e,t){var a=$(e);$(t).bind("dragover",function(e){e.preventDefault();var t=window.dropZoneTimeoutAttach;t&&clearTimeout(t);var o=!1,i=e.target;do{if(i===a[0]){o=!0;break}i=i.parentNode}while(null!=i);o?a.addClass("hover"):a.removeClass("hover"),window.dropZoneTimeoutAttach=setTimeout(function(){window.dropZoneTimeoutAttach=null,a.removeClass("in hover")},100)})}t("#dropAttach","#uploadAttach");var a=function(){$(".dropzone .btn-choose-file").click(function(){$(this).parent().find("input").click()});var t=$("#attachUploadMsg");$("#uploadAttach").fileupload({dataType:"json",pasteZone:"",dropZone:$("#dropAttach"),formData:function(e){return[{name:"noteId",value:Note.curNoteId}]},add:function(a,o){var i=Note.getCurNote();if(!i||i.IsNew)return void alert("This note hasn't saved, please save it firstly!");var r=$('<div class="alert alert-info"><img class="loader" src="/images/ajax-loader.gif"> <a class="close" data-dismiss="alert">×</a></div>');r.append(o.files[0].name+" <small>[<i>"+e(o.files[0].size)+"</i>]</small>"),t.html(r),o.context=t;var n=o.files[0].size,l=+GlobalConfigs.uploadAttachSize||100;if("number"==typeof n&&n>1048576*l)return r.find("img").remove(),r.removeClass("alert-info").addClass("alert-danger"),r.append(" Warning: File size is bigger than "+l+"M"),void setTimeout(function(e){return function(){e.remove()}}(r),3e3);var s;setTimeout(function(){s=o.submit()},10)},done:function(t,a){if(1==a.result.Ok)a.context.html(""),Attach.addAttach(a.result.Item);else{a.result;a.context.html("");var o=$('<div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div>');o.append("<b>Error:</b> "+a.files[0].name+" <small>[<i>"+e(a.files[0].size)+"</i>]</small> "+a.result.Msg),a.context.html(o),setTimeout(function(e){return function(){e.remove()}}(o),3e3)}$("#uploadAttachMsg").scrollTop(1e3)},fail:function(t,a){a.context.html("");var o=$('<div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div>');o.append("<b>Error:</b> "+a.files[0].name+" <small>[<i>"+e(a.files[0].size)+"</i>]</small> "+a.errorThrown),a.context.html(o),setTimeout(function(e){return function(){e.remove()}}(o),3e3),$("#uploadAttachMsg").scrollTop(1e3)}})};a()});
|
||||
var urlPrefix=UrlPrefix;define("editor_drop_paste",["fileupload"],function(){function e(){var e=$("#editorContent").children(),t=e&&e.length>0?e[e.length-1]:null;t&&"P"==t.tagName||$("#editorContent").append('<p><br data-mce-bogus="1"></p>')}function t(t){var i="__mcenew"+(new Date).getTime(),o='<div contenteditable="false" id="'+i+'" class="leanote-image-container"><img class="loader" src="/images/ajax-loader.gif"><div class="progress"><div class="progress-bar progress-bar-success progress-bar-striped" role="progressbar" aria-valuenow="2" aria-valuemin="0" aria-valuemax="100" style="width: 0%;">0%</div></div></div>';this.containerStr=o,t.insertContent(o),e();var a=$("#"+i);this.container=a,this.id=i,this.processBar=a.find(".progress-bar")}function i(e,t){function i(e,i){o.parentNode.removeChild(o),t({width:e,height:i})}var o=document.createElement("img");o.onload=function(){i(o.clientWidth,o.clientHeight)},o.onerror=function(){i()},o.src=e;var a=o.style;a.visibility="hidden",a.position="fixed",a.bottom=a.left=0,a.width=a.height="auto",document.body.appendChild(o)}function o(e){var t=tinymce.activeEditor,o=t.dom,r=function(t){function r(e){o.setAttrib(n,"src",t.src),t.title&&o.setAttrib(n,"title",t.title),o.setAttrib(n,"id",null)}var n,s={};s.id="__mcenew"+a++,s.src="/images/loading-24.gif",n=o.createHTML("img",s),tinymce.activeEditor.insertContent(n),n=o.get(s.id),i(e.src,r)},n="";if(fileIds=e.src.split("fileId="),2==fileIds.length&&fileIds[1].length=="53aecf8a8a039a43c8036282".length&&(n=fileIds[1]),n){var s=Note.getCurNote();s&&s.UserId!=UserInfo.UserId?!function(e){ajaxPost("/file/copyImage",{userId:UserInfo.UserId,fileId:n,toUserId:s.UserId},function(t){if(reIsOk(t)&&t.Id){var i=window.location.protocol+"//"+window.location.host;e.src=i+"/api/file/getImage?fileId="+t.Id}r(e)})}(e):r(e)}else r(e)}t.prototype.update=function(e){var t=this;e=Math.ceil(100*e),e>=100&&(e=99),e+="%",$("#"+t.id+" .progress-bar").html(e).css("width",e)},t.prototype.replace=function(e){var t=this;i(e,function(){$("#"+t.id).replaceWith('<img src="'+e+'" />')})},t.prototype.remove=function(){var e=this;$("#"+e.id).remove()};var a=1,r=function(){function e(e){return"number"!=typeof e?"":e>=1e9?(e/1e9).toFixed(2)+" GB":e>=1e6?(e/1e6).toFixed(2)+" MB":(e/1e3).toFixed(2)+" KB"}function t(){$("#upload").css("z-index",12);var e=+$("#mceToolbar").css("height").slice(0,-2);$("#upload").css("top",e-8),$("#upload").show()}function i(){$("#upload").css("z-index",0).css("top","auto").hide()}var a=$("#upload ul");$("#drop a").click(function(){$(this).parent().find("input").click()}),$("#upload").fileupload({dataType:"json",pasteZone:"",acceptFileTypes:/(\.|\/)(gif|jpg|jpeg|png|jpe)$/i,maxFileSize:21e4,dropZone:$("#drop"),formData:function(e){return[{name:"albumId",value:""}]},add:function(t,i){var o=$('<li><div class="alert alert-info"><img class="loader" src="/images/ajax-loader.gif"> <a class="close" data-dismiss="alert">×</a></div></li>');o.find("div").append(i.files[0].name+" <small>[<i>"+e(i.files[0].size)+"</i>]</small>"),i.context=o.appendTo(a);i.submit()},done:function(t,i){if(1==i.result.Ok){i.context.remove();var a={src:urlPrefix+"/api/file/getImage?fileId="+i.result.Id};o(a)}else{i.context.empty();var r=$('<li><div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div></li>');r.find("div").append("<b>"+getMsg("Error")+":</b> "+i.files[0].name+" <small>[<i>"+e(i.files[0].size)+"</i>]</small> "+i.result.Msg),i.context.append(r),setTimeout(function(e){return function(){e.remove()}}(r),2e3)}$("#uploadMsg").scrollTop(1e3)},fail:function(t,i){i.context.empty();var o=$('<li><div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div></li>');o.find("div").append("<b>"+getMsg("Error")+":</b> "+i.files[0].name+" <small>[<i>"+e(i.files[0].size)+"</i>]</small> "+i.errorThrown),i.context.append(o),setTimeout(function(e){return function(){e.remove()}}(o),2e3),$("#uploadMsg").scrollTop(1e3)}}),$(document).on("drop dragover",function(e){e.preventDefault()}),$(document).bind("dragover",function(e){var o=$("#drop"),a=window.dropZoneTimeout;a?clearTimeout(a):(o.addClass("in"),t());var r=!1,n=e.target;do{if(n===o[0]){r=!0;break}n=n.parentNode}while(null!=n);r?(o.addClass("hover"),LEA.readOnly&&LEA.toggleWriteable()):o.removeClass("hover"),window.dropZoneTimeout=setTimeout(function(){window.dropZoneTimeout=null,o.removeClass("in hover"),i()},500)})},n=0,s=function(){var e,i;$("#editorContent, #left-column").fileupload({dataType:"json",pasteZone:$("#editorContent, #left-column"),dropZone:"",maxFileSize:21e4,url:"/file/pasteImage",paramName:"file",formData:function(e){return[{name:"from",value:"pasteImage"},{name:"noteId",value:Note.curNoteId}]},progress:function(t,i){e&&!e.IsMarkdown&&i.process.update(i.loaded/i.total)},add:function(o,a){var r=(new Date).getTime();if(!(500>r-n)){n=r;var s=Note.getCurNote();e=s,!s||s.IsNew,setTimeout(function(){if(i=tinymce.EditorManager.activeEditor,!s.IsMarkdown)var e=new
Line truncated
|
||||
define("editor_drop_paste",["fileupload"],function(){function e(){var e=$("#editorContent").children(),t=e&&e.length>0?e[e.length-1]:null;t&&"P"==t.tagName||$("#editorContent").append('<p><br data-mce-bogus="1"></p>')}function t(t){var i="__mcenew"+(new Date).getTime(),o='<div contenteditable="false" id="'+i+'" class="leanote-image-container"><img class="loader" src="/images/ajax-loader.gif"><div class="progress"><div class="progress-bar progress-bar-success progress-bar-striped" role="progressbar" aria-valuenow="2" aria-valuemin="0" aria-valuemax="100" style="width: 0%;">0%</div></div></div>';this.containerStr=o,t.insertContent(o),e();var a=$("#"+i);this.container=a,this.id=i,this.processBar=a.find(".progress-bar")}function i(e,t){function i(e,i){o.parentNode.removeChild(o),t({width:e,height:i})}var o=document.createElement("img");o.onload=function(){i(o.clientWidth,o.clientHeight)},o.onerror=function(){i()},o.src=e;var a=o.style;a.visibility="hidden",a.position="fixed",a.bottom=a.left=0,a.width=a.height="auto",document.body.appendChild(o)}function o(e){var t=tinymce.activeEditor,o=t.dom,n=function(t){function n(e){o.setAttrib(r,"src",t.src),t.title&&o.setAttrib(r,"title",t.title),o.setAttrib(r,"id",null)}var r,s={};s.id="__mcenew"+a++,s.src="/images/loading-24.gif",r=o.createHTML("img",s),tinymce.activeEditor.insertContent(r),r=o.get(s.id),i(e.src,n)},r="";if(fileIds=e.src.split("fileId="),2==fileIds.length&&fileIds[1].length=="53aecf8a8a039a43c8036282".length&&(r=fileIds[1]),r){var s=Note.getCurNote();s&&s.UserId!=UserInfo.UserId?!function(e){ajaxPost("/file/copyImage",{userId:UserInfo.UserId,fileId:r,toUserId:s.UserId},function(t){reIsOk(t)&&t.Id&&(e.src="/api/file/getImage?fileId="+t.Id),n(e)})}(e):n(e)}else n(e)}t.prototype.update=function(e){var t=this;e=Math.ceil(100*e),e>=100&&(e=99),e+="%",$("#"+t.id+" .progress-bar").html(e).css("width",e)},t.prototype.replace=function(e){var t=this;i(e,function(){$("#"+t.id).replaceWith('<img src="'+e+'" />')})},t.prototype.remove=function(){var e=this;$("#"+e.id).remove()};var a=1,n=function(){function e(e){return"number"!=typeof e?"":e>=1e9?(e/1e9).toFixed(2)+" GB":e>=1e6?(e/1e6).toFixed(2)+" MB":(e/1e3).toFixed(2)+" KB"}function t(){$("#upload").css("z-index",12);var e=+$("#mceToolbar").css("height").slice(0,-2);$("#upload").css("top",e-8),$("#upload").show()}function i(){$("#upload").css("z-index",0).css("top","auto").hide()}var a=$("#upload ul");$("#drop a").click(function(){$(this).parent().find("input").click()}),$("#upload").fileupload({dataType:"json",pasteZone:"",acceptFileTypes:/(\.|\/)(gif|jpg|jpeg|png|jpe)$/i,maxFileSize:21e4,dropZone:$("#drop"),formData:function(e){return[{name:"albumId",value:""}]},add:function(t,i){var o=$('<li><div class="alert alert-info"><img class="loader" src="/images/ajax-loader.gif"> <a class="close" data-dismiss="alert">×</a></div></li>');o.find("div").append(i.files[0].name+" <small>[<i>"+e(i.files[0].size)+"</i>]</small>"),i.context=o.appendTo(a);i.submit()},done:function(t,i){if(1==i.result.Ok){i.context.remove();var a={src:"/api/file/getImage?fileId="+i.result.Id};o(a)}else{i.context.empty();var n=$('<li><div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div></li>');n.find("div").append("<b>"+getMsg("Error")+":</b> "+i.files[0].name+" <small>[<i>"+e(i.files[0].size)+"</i>]</small> "+i.result.Msg),i.context.append(n),setTimeout(function(e){return function(){e.remove()}}(n),2e3)}$("#uploadMsg").scrollTop(1e3)},fail:function(t,i){i.context.empty();var o=$('<li><div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div></li>');o.find("div").append("<b>"+getMsg("Error")+":</b> "+i.files[0].name+" <small>[<i>"+e(i.files[0].size)+"</i>]</small> "+i.errorThrown),i.context.append(o),setTimeout(function(e){return function(){e.remove()}}(o),2e3),$("#uploadMsg").scrollTop(1e3)}}),$(document).on("drop dragover",function(e){e.preventDefault()}),$(document).bind("dragover",function(e){var o=$("#drop"),a=window.dropZoneTimeout;a?clearTimeout(a):(o.addClass("in"),t());var n=!1,r=e.target;do{if(r===o[0]){n=!0;break}r=r.parentNode}while(null!=r);n?(o.addClass("hover"),LEA.readOnly&&LEA.toggleWriteable()):o.removeClass("hover"),window.dropZoneTimeout=setTimeout(function(){window.dropZoneTimeout=null,o.removeClass("in hover"),i()},500)})},r=0,s=function(){var e,i;$("#editorContent, #left-column").fileupload({dataType:"json",pasteZone:$("#editorContent, #left-column"),dropZone:"",maxFileSize:21e4,url:"/file/pasteImage",paramName:"file",formData:function(e){return[{name:"from",value:"pasteImage"},{name:"noteId",value:Note.curNoteId}]},progress:function(t,i){e&&!e.IsMarkdown&&i.process.update(i.loaded/i.total)},add:function(o,a){var n=(new Date).getTime();if(!(500>n-r)){r=n;var s=Note.getCurNote();e=s,!s||s.IsNew,setTimeout(function(){if(i=tinymce.EditorManager.activeEditor,!s.IsMarkdown)var e=new t(i);a.process=e;a.submit()},20)}},done:function(t,i){if(1==i.result.Ok){var o=i.result,a="/apLine truncated
|
||||
requirejs.config({paths:{editor_drop_paste:"js/plugins/editor_drop_paste",attachment_upload:"js/plugins/attachment_upload",fileupload:"js/plugins/libs-min/fileupload",note_info:"js/plugins/note_info",tips:"js/plugins/tips",history:"js/plugins/history"},shim:{}}),setTimeout(function(){require(["editor_drop_paste","attachment_upload"]),require(["note_info"]),setTimeout(function(){require(["tips"]),require(["history"])},10)});
|
||||
!function(e){"use strict";e(window.jQuery)}(function(e){"use strict";var t=0;e.ajaxTransport("iframe",function(i){if(i.async){var n,r,o;return{send:function(s,a){n=e('<form style="display:none;"></form>'),n.attr("accept-charset",i.formAcceptCharset),o=/\?/.test(i.url)?"&":"?","DELETE"===i.type?(i.url=i.url+o+"_method=DELETE",i.type="POST"):"PUT"===i.type?(i.url=i.url+o+"_method=PUT",i.type="POST"):"PATCH"===i.type&&(i.url=i.url+o+"_method=PATCH",i.type="POST"),r=e('<iframe src="javascript:false;" name="iframe-transport-'+(t+=1)+'"></iframe>').bind("load",function(){var t,o=e.isArray(i.paramName)?i.paramName:[i.paramName];r.unbind("load").bind("load",function(){var t;try{if(t=r.contents(),!t.length||!t[0].firstChild)throw new Error}catch(i){t=void 0}a(200,"success",{iframe:t}),e('<iframe src="javascript:false;"></iframe>').appendTo(n),n.remove()}),n.prop("target",r.prop("name")).prop("action",i.url).prop("method",i.type),i.formData&&e.each(i.formData,function(t,i){e('<input type="hidden"/>').prop("name",i.name).val(i.value).appendTo(n)}),i.fileInput&&i.fileInput.length&&"POST"===i.type&&(t=i.fileInput.clone(),i.fileInput.after(function(e){return t[e]}),i.paramName&&i.fileInput.each(function(t){e(this).prop("name",o[t]||i.paramName)}),n.append(i.fileInput).prop("enctype","multipart/form-data").prop("encoding","multipart/form-data")),n.submit(),t&&t.length&&i.fileInput.each(function(i,n){var r=e(t[i]);e(n).prop("name",r.prop("name")),r.replaceWith(n)})}),n.append(r).appendTo(document.body)},abort:function(){r&&r.unbind("load").prop("src","javascript".concat(":false;")),n&&n.remove()}}}}),e.ajaxSetup({converters:{"iframe text":function(t){return t&&e(t[0].body).text()},"iframe json":function(t){return t&&e.parseJSON(e(t[0].body).text())},"iframe html":function(t){return t&&e(t[0].body).html()},"iframe script":function(t){return t&&e.globalEval(e(t[0].body).text())}}})}),!function(e){e(jQuery)}(function(e,t){var i=0,n=Array.prototype.slice,r=e.cleanData;e.cleanData=function(t){for(var i,n=0;null!=(i=t[n]);n++)try{e(i).triggerHandler("remove")}catch(o){}r(t)},e.widget=function(t,i,n){var r,o,s,a,l={},p=t.split(".")[0];t=t.split(".")[1],r=p+"-"+t,n||(n=i,i=e.Widget),e.expr[":"][r.toLowerCase()]=function(t){return!!e.data(t,r)},e[p]=e[p]||{},o=e[p][t],s=e[p][t]=function(e,t){return this._createWidget?void(arguments.length&&this._createWidget(e,t)):new s(e,t)},e.extend(s,o,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),a=new i,a.options=e.widget.extend({},a.options),e.each(n,function(t,n){return e.isFunction(n)?void(l[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},r=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,o=this._superApply;return this._super=e,this._superApply=r,t=n.apply(this,arguments),this._super=i,this._superApply=o,t}}()):void(l[t]=n)}),s.prototype=e.widget.extend(a,{widgetEventPrefix:o?a.widgetEventPrefix:t},l,{constructor:s,namespace:p,widgetName:t,widgetFullName:r}),o?(e.each(o._childConstructors,function(t,i){var n=i.prototype;e.widget(n.namespace+"."+n.widgetName,s,i._proto)}),delete o._childConstructors):i._childConstructors.push(s),e.widget.bridge(t,s)},e.widget.extend=function(i){for(var r,o,s=n.call(arguments,1),a=0,l=s.length;l>a;a++)for(r in s[a])o=s[a][r],s[a].hasOwnProperty(r)&&o!==t&&(e.isPlainObject(o)?i[r]=e.isPlainObject(i[r])?e.widget.extend({},i[r],o):e.widget.extend({},o):i[r]=o);return i},e.widget.bridge=function(i,r){var o=r.prototype.widgetFullName||i;e.fn[i]=function(s){var a="string"==typeof s,l=n.call(arguments,1),p=this;return s=!a&&l.length?e.widget.extend.apply(null,[s].concat(l)):s,a?this.each(function(){var n,r=e.data(this,o);return r?e.isFunction(r[s])&&"_"!==s.charAt(0)?(n=r[s].apply(r,l),n!==r&&n!==t?(p=n&&n.jquery?p.pushStack(n.get()):n,!1):void 0):e.error("no such method '"+s+"' for "+i+" widget instance"):e.error("cannot call methods on "+i+" prior to initialization; attempted to call method '"+s+"'")}):this.each(function(){var t=e.data(this,o);t?t.option(s||{})._init():e.data(this,o,new r(s,this))}),p}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,n){n=e(n||this.defaultElement||this)[0],this.element=e(n),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),n!==this&&(e.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===n&&this.destroy()}}),this.document=e(n.style?n.ownerDocument:n.document||n),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._deLine truncated
|
||||
@@ -1 +1 @@
|
||||
tinymce.addI18n("de",{Cut:"Ausschneiden","Heading 5":"Überschrift 5","Header 2":"Überschrift 2","Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.":"Ihr Browser unterstützt leider keinen direkten Zugriff auf die Zwischenablage. Bitte benutzen Sie die Strg + X / C / V Tastenkombinationen.","Heading 4":"Überschrift 4",Div:"Textblock","Heading 2":"Überschrift 2",Paste:"Einfügen",Close:"Schließen","Font Family":"Schriftart",Pre:"Vorformatierter Text","Align right":"Rechtsbündig ausrichten","New document":"Neues Dokument",Blockquote:"Zitat","Numbered list":"Nummerierte Liste","Heading 1":"Überschrift 1",Headings:"Überschriften","Increase indent":"Einzug vergrößern",Formats:"Formate",Headers:"Überschriften","Select all":"Alles auswählen","Header 3":"Überschrift 3",Blocks:"Absatzformate",Undo:"Rückgängig",Strikethrough:"Durchgestrichen","Bullet list":"Aufzählung","Header 1":"Überschrift 1",Superscript:"Hochgestellt","Clear formatting":"Formatierung entfernen","Font Sizes":"Schriftgröße",Subscript:"Tiefgestellt","Header 6":"Überschrift 6",Redo:"Wiederholen",Paragraph:"Absatz",Ok:"Ok",Bold:"Fett",Code:"Quelltext",Italic:"Kursiv","Align center":"Zentriert ausrichten","Header 5":"Überschrift 5","Heading 6":"Überschrift 6","Heading 3":"Überschrift 3","Decrease indent":"Einzug verkleinern","Header 4":"Überschrift 4","Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.":"Einfügen ist nun im einfachen Textmodus. Inhalte werden ab jetzt als unformatierter Text eingefügt, bis Sie diese Einstellung wieder ausschalten!",Underline:"Unterstrichen",Cancel:"Abbrechen",Justify:"Blocksatz",Inline:"Zeichenformate",Copy:"Kopieren","Align left":"Linksbündig ausrichten","Visual aids":"Visuelle Hilfen","Lower Greek":"Griechische Kleinbuchstaben",Square:"Quadrat",Default:"Standard","Lower Alpha":"Kleinbuchstaben",Circle:"Kreis",Disc:"Punkt","Upper Alpha":"Großbuchstaben","Upper Roman":"Römische Zahlen (Großbuchstaben)","Lower Roman":"Römische Zahlen (Kleinbuchstaben)",Name:"Name",Anchor:"Textmarke","You have unsaved changes are you sure you want to navigate away?":"Die Änderungen wurden noch nicht gespeichert, sind Sie sicher, dass Sie diese Seite verlassen wollen?","Restore last draft":"Letzten Entwurf wiederherstellen","Special character":"Sonderzeichen","Source code":"Quelltext",B:"B",R:"R",G:"G",Color:"Farbe","Right to left":"Von rechts nach links","Left to right":"Von links nach rechts",Emoticons:"Emoticons",Robots:"Robots","Document properties":"Dokumenteigenschaften",Title:"Titel",Keywords:"Schüsselwörter",Encoding:"Zeichenkodierung",Description:"Beschreibung",Author:"Verfasser",Fullscreen:"Vollbild","Horizontal line":"Horizontale Linie","Horizontal space":"Horizontaler Abstand","Insert/edit image":"Bild einfügen/bearbeiten",General:"Allgemein",Advanced:"Erweitert",Source:"Quelle",Border:"Rahmen","Constrain proportions":"Seitenverhältnis beibehalten","Vertical space":"Vertikaler Abstand","Image description":"Bildbeschreibung",Style:"Stil",Dimensions:"Abmessungen","Insert image":"Bild einfügen","Zoom in":"Ansicht vergrößern",Contrast:"Kontrast",Back:"Zurück",Gamma:"Gamma","Flip horizontally":"Horizontal spiegeln",Resize:"Skalieren",Sharpen:"Schärfen","Zoom out":"Ansicht verkleinern","Image options":"Bildeigenschaften",Apply:"Anwenden",Brightness:"Helligkeit","Rotate clockwise":"Im Uhrzeigersinn drehen","Rotate counterclockwise":"Gegen den Uhrzeigersinn drehen","Edit image":"Bild bearbeiten","Color levels":"Farbwerte",Crop:"Bescheiden",Orientation:"Ausrichtung","Flip vertically":"Vertikal spiegeln",Invert:"Invertieren","Insert date/time":"Datum/Uhrzeit einfügen ","Remove link":"Link entfernen",Url:"URL","Text to display":"Anzuzeigender Text",Anchors:"Textmarken","Insert link":"Link einfügen","New window":"Neues Fenster",None:"Keine","The URL you entered seems to be an external link. Do you want to add the required http:// prefix?":'Diese Adresse scheint ein externer Link zu sein. Möchten Sie das dazu benötigte "http://" voranstellen?',Target:"Ziel","The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?":'Diese Adresse scheint eine E-Mail-Adresse zu sein. Möchten Sie das dazu benötigte "mailto:" voranstellen?',"Insert/edit link":"Link einfügen/bearbeiten","Insert/edit video":"Video einfügen/bearbeiten",Poster:"Poster","Alternative source":"Alternative Quelle","Paste your embed code below:":"Fügen Sie Ihren Einbettungscode hier ein:","Insert video":"Video einfügen",Embed:"Einbetten","Nonbreaking space":"Geschütztes Leerzeichen","Page break":"Seitenumbruch","Paste as text":"Als Text einfügen",Preview:"Vorschau",Print:"Drucken",Save:"Speichern","Could not find the specified string.":"Die Zeichenfolge wurde nicht gefunden.",Replace:"Ersetzen",Next:"Weiter","Whole words":"Nur ganze Wörter","Find and replace":"Suchen undLine truncated
|
||||
tinymce.addI18n("de-de",{"Cut":"Cut","Header 2":"Header 2","Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\\/C\\/V keyboard shortcuts instead.":"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\\/C\\/V keyboard shortcuts instead.","Div":"Div","Paste":"Paste","Close":"Close","Font Family":"Schriftart","Pre":"Pre","Align right":"Align right","New document":"New document","Blockquote":"Blockquote","Numbered list":"Numbered list","Increase indent":"Increase indent","Formats":"Formats","Headers":"Headers","Select all":"Select all","Header 3":"Header 3","Blocks":"Blocks","Undo":"Undo","Strikethrough":"Strike-through","Bullet list":"Bullet list","Header 1":"Header 1","Superscript":"Superscript","Clear formatting":"Clear formatting","Font Sizes":"Font Sizes","Subscript":"Subscript","Header 6":"Header 6","Redo":"Redo","Paragraph":"Paragraph","Ok":"Ok","Bold":"Bold","Code":"Code","Italic":"Italic","Align center":"Align centre","Header 5":"Header 5","Decrease indent":"Decrease indent","Header 4":"Header 4","Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.":"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.","Underline":"Underline","Cancel":"Cancel","Justify":"Justify","Inline":"Inline","Copy":"Copy","Align left":"Align left","Visual aids":"Visual aids","Lower Greek":"Lower Greek","Square":"Square","Default":"Default","Lower Alpha":"Lower Alpha","Circle":"Circle","Disc":"Disc","Upper Alpha":"Upper Alpha","Upper Roman":"Upper Roman","Lower Roman":"Lower Roman","Name":"Name","Anchor":"Anchor","You have unsaved changes are you sure you want to navigate away?":"You have unsaved changes are you sure you want to navigate away?","Restore last draft":"Restore last draft","Special character":"Special character","Source code":"Source code","Right to left":"Right to left","Left to right":"Left to right","Emoticons":"Emoticons","Robots":"Robots","Document properties":"Document properties","Title":"Title","Keywords":"Keywords","Encoding":"Encoding","Description":"Description","Author":"Author","Language":"Language","`ctrl/cmd+shift+c` toggle code":"`ctrl/cmd+shift+c` toggle code","Fullscreen":"Full-screen","Horizontal line":"Horizontal line","Horizontal space":"Horizontal space","Insert\\/edit image":"Insert\\/edit image","General":"General","Advanced":"Advanced","Source":"Source","Border":"Border","Constrain proportions":"Constrain proportions","Vertical space":"Vertical space","Image description":"Image description","Style":"Style","Dimensions":"Dimensions","Insert image":"Insert image","Insert date\\/time":"Insert date\\/time","Remove link":"Remove link","Url":"URL","Text to display":"Text to display","Anchors":"Anchors","Insert link":"Insert link","New window":"New window","None":"None","The URL you entered seems to be an external link. Do you want to add the required http:\\/\\/ prefix?":"The URL you entered seems to be an external link. Do you want to add the required http:\\/\\/ prefix?","Target":"Target","The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?","Insert\\/edit link":"Insert\\/edit link","Insert\\/edit video":"Insert\\/edit video","Poster":"Poster","Alternative source":"Alternative source","Paste your embed code below:":"Paste your embed code below:","Insert video":"Insert video","Embed":"Embed","Nonbreaking space":"Non-breaking space","Page break":"Page break","Paste as text":"Paste as text","Preview":"Preview","Print":"Print","Save":"Save","Could not find the specified string.":"Could not find the specified string.","Replace":"Replace","Next":"Next","Whole words":"Whole words","Find and replace":"Find and replace","Replace with":"Replace with","Find":"Find","Replace all":"Replace all","Match case":"Match case","Prev":"Prev","Spellcheck":"Spell-check","Finish":"Finish","Ignore all":"Ignore all","Ignore":"Ignore","Insert row before":"Insert row before","Rows":"Rows","Height":"Height","Paste row after":"Paste row after","Alignment":"Alignment","Column group":"Column group","Row":"Row","Insert column before":"Insert column before","Split cell":"Split cell","Cell padding":"Cell padding","Cell spacing":"Cell spacing","Row type":"Row type","Insert table":"Insert table","Body":"Body","Caption":"Caption","Footer":"Footer","Delete row":"Delete row","Paste row before":"Paste row before","Scope":"Scope","Delete table":"Delete table","Header cell":"Header cell","Column":"Column","Cell":"Cell","Header":"Header","Cell type":"Cell type","Copy row":"Copy row","Row properties":"Row properties","Table properties":"Table properties","Row group":"Row group","Right":"Right","Insert column after":"Insert column after","Cols":"Cols","Insert row after":"Insert row after","Width":"Width","Cell properties":"Line truncated
|
||||
@@ -1 +1 @@
|
||||
tinymce.addI18n("fr-fr",{"Cut":"Cut","Header 2":"Header 2","Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\\/C\\/V keyboard shortcuts instead.":"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\\/C\\/V keyboard shortcuts instead.","Div":"Div","Paste":"Paste","Close":"Close","Font Family":"Font Family","Pre":"Pre","Align right":"Align right","New document":"New document","Blockquote":"Blockquote","Numbered list":"Numbered list","Increase indent":"Increase indent","Formats":"Formats","Headers":"Headers","Select all":"Select all","Header 3":"Header 3","Blocks":"Blocks","Undo":"Undo","Strikethrough":"Strike-through","Bullet list":"Bullet list","Header 1":"Header 1","Superscript":"Superscript","Clear formatting":"Clear formatting","Font Sizes":"Font Sizes","Subscript":"Subscript","Header 6":"Header 6","Redo":"Redo","Paragraph":"Paragraph","Ok":"Ok","Bold":"Bold","Code":"Code","Italic":"Italic","Align center":"Align centre","Header 5":"Header 5","Decrease indent":"Decrease indent","Header 4":"Header 4","Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.":"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.","Underline":"Underline","Cancel":"Cancel","Justify":"Justify","Inline":"Inline","Copy":"Copy","Align left":"Align left","Visual aids":"Visual aids","Lower Greek":"Lower Greek","Square":"Square","Default":"Default","Lower Alpha":"Lower Alpha","Circle":"Circle","Disc":"Disc","Upper Alpha":"Upper Alpha","Upper Roman":"Upper Roman","Lower Roman":"Lower Roman","Name":"Name","Anchor":"Anchor","You have unsaved changes are you sure you want to navigate away?":"You have unsaved changes are you sure you want to navigate away?","Restore last draft":"Restore last draft","Special character":"Special character","Source code":"Source code","Right to left":"Right to left","Left to right":"Left to right","Emoticons":"Emoticons","Robots":"Robots","Document properties":"Document properties","Title":"Title","Keywords":"Keywords","Encoding":"Encoding","Description":"Description","Author":"Author","Language":"Language","`ctrl/cmd+shift+c` toggle code":"`ctrl/cmd+shift+c` toggle code","Fullscreen":"Full-screen","Horizontal line":"Horizontal line","Horizontal space":"Horizontal space","Insert\\/edit image":"Insert\\/edit image","General":"General","Advanced":"Advanced","Source":"Source","Border":"Border","Constrain proportions":"Constrain proportions","Vertical space":"Vertical space","Image description":"Image description","Style":"Style","Dimensions":"Dimensions","Insert image":"Insert image","Insert date\\/time":"Insert date\\/time","Remove link":"Remove link","Url":"URL","Text to display":"Text to display","Anchors":"Anchors","Insert link":"Insert link","New window":"New window","None":"None","The URL you entered seems to be an external link. Do you want to add the required http:\\/\\/ prefix?":"The URL you entered seems to be an external link. Do you want to add the required http:\\/\\/ prefix?","Target":"Target","The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?":"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?","Insert\\/edit link":"Insert\\/edit link","Insert\\/edit video":"Insert\\/edit video","Poster":"Poster","Alternative source":"Alternative source","Paste your embed code below:":"Paste your embed code below:","Insert video":"Insert video","Embed":"Embed","Nonbreaking space":"Non-breaking space","Page break":"Page break","Paste as text":"Paste as text","Preview":"Preview","Print":"Print","Save":"Save","Could not find the specified string.":"Could not find the specified string.","Replace":"Replace","Next":"Next","Whole words":"Whole words","Find and replace":"Find and replace","Replace with":"Replace with","Find":"Find","Replace all":"Replace all","Match case":"Match case","Prev":"Prev","Spellcheck":"Spell-check","Finish":"Finish","Ignore all":"Ignore all","Ignore":"Ignore","Insert row before":"Insert row before","Rows":"Rows","Height":"Height","Paste row after":"Paste row after","Alignment":"Alignment","Column group":"Column group","Row":"Row","Insert column before":"Insert column before","Split cell":"Split cell","Cell padding":"Cell padding","Cell spacing":"Cell spacing","Row type":"Row type","Insert table":"Insert table","Body":"Body","Caption":"Caption","Footer":"Footer","Delete row":"Delete row","Paste row before":"Paste row before","Scope":"Scope","Delete table":"Delete table","Header cell":"Header cell","Column":"Column","Cell":"Cell","Header":"Header","Cell type":"Cell type","Copy row":"Copy row","Row properties":"Row properties","Table properties":"Table properties","Row group":"Row group","Right":"Right","Insert column after":"Insert column after","Cols":"Cols","Insert row after":"Insert row after","Width":"Width","Cell properties":Line truncated
|
||||
tinymce.addI18n("fr-fr",{"Cut":"Couper","Header 2":"Titre 2","Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\\/C\\/V keyboard shortcuts instead.":"Votre navigateur ne supporte pas l'accès direct au presse-papier. Veuillez utiliser les raccourcis Ctrl+X\\/C\\/V à la place.","Div":"Div","Paste":"Coller","Close":"Fermer","Font Family":"Famille de police","Pre":"Pre","Align right":"Aligné à droite","New document":"Nouveau document","Blockquote":"Bloc de citation","Numbered list":"Liste ordonnée","Increase indent":"Augmenter l'indentation","Formats":"Format","Headers":"En-tête","Select all":"Sélectionner tout","Header 3":"En-tête 3","Blocks":"Blocs","Undo":"Annuler","Strikethrough":"Barrer","Bullet list":"Liste à puces","Header 1":"En-tête 1","Superscript":"Exposant","Clear formatting":"Nettoyer le formatage","Font Sizes":"Taille des Polices","Subscript":"Indice","Header 6":"En-tête 6","Redo":"Reproduire","Paragraph":"Paragraphe","Ok":"Ok","Bold":"Gras","Code":"Code","Italic":"Italique","Align center":"Aligner au centre","Header 5":"En-tête 5","Decrease indent":"Diminuer l'indentation","Header 4":"En-tête 4","Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.":"Coller est en mode texte clair. Les contenus seront collés désormais en clair jusqu'à ce que vous ne désactiviez cette option.","Underline":"Souligner","Cancel":"Annuler","Justify":"Justifier","Inline":"En ligne","Copy":"Copier","Align left":"Aligner à gauche","Visual aids":"Aides visuelles","Lower Greek":"Grec minuscule","Square":"Carré","Default":"Par défaut","Lower Alpha":"Alpha minuscule","Circle":"Cercle","Disc":"Disque","Upper Alpha":"Alpha majuscule","Upper Roman":"Roman majuscule","Lower Roman":"Roman minuscule","Name":"Nom","Anchor":"Ancre","You have unsaved changes are you sure you want to navigate away?":"Des changements n'ont pas été enregistrés, voulez-vous vraiment sortir?","Restore last draft":"Restaurer dernier brouillon","Special character":"Caractère spécial","Source code":"Code Source","Right to left":"De droite à gauche","Left to right":"De gauche à droite","Emoticons":"Emoticones","Robots":"Robots","Document properties":"Propriétés du document","Title":"Titre","Keywords":"Mots-clés","Encoding":"Encodage","Description":"Description","Author":"Auteur","Language":"Langue","`ctrl/cmd+shift+c` toggle code":"inverser le code `ctrl/cmd+shift+c` ","Fullscreen":"Plein écran","Horizontal line":"Ligne horizontal","Horizontal space":"Espace horizontal","Insert\\/edit image":"Insérer\\/éditer image","General":"Général","Advanced":"Avancé","Source":"Source","Border":"Bordure","Constrain proportions":"Conserver proportions","Vertical space":"Espace vertical","Image description":"Description de l'image","Style":"Style","Dimensions":"Dimensions","Insert image":"Insérer image","Insert date\\/time":"Insérer date\\/heure","Remove link":"Enlever le lien","Url":"URL","Text to display":"Texte à afficher","Anchors":"Ancres","Insert link":"Insérer liens","New window":"Nouvelle fenêtre","None":"Aucune","The URL you entered seems to be an external link. Do you want to add the required http:\\/\\/ prefix?":"L'URL que vous avez entré semble être un lien externe. Voulez-vous ajouter le préfixe http:\\/\\/ requis?","Target":"Cible","The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?":"L'URL que vous avez entré semble être une adresse de courriel. Voulez-vous ajouter le préfixe mailto: requis?","Insert\\/edit link":"Insérer\\/éditer le lien","Insert\\/edit video":"Insérer\\/éditer la vidéo","Poster":"Poster","Alternative source":"Source alternative","Paste your embed code below:":"Coller le code intégré ci-dessous:","Insert video":"Insérer video","Embed":"Intégrer","Nonbreaking space":"Espaces insécables","Page break":"Saut de page","Paste as text":"Coller en tant que texte","Preview":"Aperçu","Print":"Imprimer","Save":"Enregistrer","Could not find the specified string.":"Impossible de trouver la chaîne spécifiée.","Replace":"Remplacer","Next":"Suivant","Whole words":"Mots entiers","Find and replace":"Trouver et remplacer","Replace with":"Remplacer par","Find":"Trouver","Replace all":"Tout remplacer","Match case":"Correspondance de la casse","Prev":"Précédent","Spellcheck":"Correcteur d'orthographe","Finish":"Terminer","Ignore all":"Ignorer tout","Ignore":"Ignorer","Insert row before":"Insérer une ligne avant","Rows":"Lignes","Height":"Hauteur","Paste row after":"Coller une ligne après","Alignment":"Alignement","Column group":"Groupe de colonnes","Row":"Ligne","Insert column before":"Insérer une colonne avant","Split cell":"Diviser la cellule","Cell padding":"Marge intérieure de cellule","Cell spacing":"Marge extérieure de cellule","Row type":"Type de ligne","Insert table":"Insérer tableau","Body":"Corps","Caption":"Légende","Footer":"Pied de page","Delete rLine truncated
|
||||
@@ -110,13 +110,8 @@ tinymce.PluginManager.add('leaui_image', function(editor, url) {
|
||||
var data = datas[i];
|
||||
var src = data.src;
|
||||
// the network image
|
||||
var trueSrc;
|
||||
if(src.indexOf("http://") != -1 || src.indexOf("https://") != -1) {
|
||||
trueSrc = src;
|
||||
} else {
|
||||
trueSrc = url + "/" + src;
|
||||
}
|
||||
data.src = trueSrc;
|
||||
var trueSrc = src;
|
||||
data.src = src;
|
||||
|
||||
var renderImage = function(data) {
|
||||
// 这里, 如果图片宽度过大, 这里设置成500px
|
||||
@@ -125,7 +120,7 @@ tinymce.PluginManager.add('leaui_image', function(editor, url) {
|
||||
var imgElm;
|
||||
// 先显示loading...
|
||||
d.id = '__mcenew' + i;
|
||||
d.src = "http://leanote.com/images/loading-24.gif";
|
||||
d.src = "/images/loading-24.gif";
|
||||
imgElm = dom.createHTML('img', d);
|
||||
editor.insertContent(imgElm);
|
||||
imgElm = dom.get(d.id);
|
||||
@@ -164,8 +159,7 @@ tinymce.PluginManager.add('leaui_image', function(editor, url) {
|
||||
(function(data) {
|
||||
ajaxPost("/file/copyImage", {userId: UserInfo.UserId, fileId: fileId, toUserId: curNote.UserId}, function(re) {
|
||||
if(reIsOk(re) && re.Id) {
|
||||
var urlPrefix = UrlPrefix; // window.location.protocol + "//" + window.location.host;
|
||||
data.src = urlPrefix + "/api/file/getImage?fileId=" + re.Id;
|
||||
data.src = "/api/file/getImage?fileId=" + re.Id;
|
||||
}
|
||||
renderImage(data);
|
||||
});
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
var LEAUI_DATAS=[];tinymce.PluginManager.add("leaui_image",function(a,b){function c(a,b){function c(a,c){d.parentNode.removeChild(d),b({width:a,height:c})}var d=document.createElement("img");d.onload=function(){c(d.clientWidth,d.clientHeight)},d.onerror=function(){c()},d.src=a;var e=d.style;e.visibility="hidden",e.position="fixed",e.bottom=e.left=0,e.width=e.height="auto",document.body.appendChild(d)}function d(){function d(){var a='<iframe id="leauiIfr" src="/album/index?'+(new Date).getTime()+'" frameborder="0"></iframe>';return a}var e=a.dom,f=a.selection.getContent(),g=/<img.*?\/>/g,h=f.match(g),i=document.createElement("p"),j=[];for(var k in h){i.innerHTML=h[k];var l=i.firstChild;if(l&&"IMG"==l.nodeName){var m={};m.src=e.getAttrib(l,"data-src")||e.getAttrib(l,"src"),m.width=e.getAttrib(l,"width"),m.height=e.getAttrib(l,"height"),m.title=e.getAttrib(l,"title"),j.push(m)}}LEAUI_DATAS=j;var n=$(document).width()-10;n>805&&(n=805);var o=$(document).height()-100;o>365&&(o=365),win=a.windowManager.open({title:"Image",width:n,height:o,html:d(),buttons:[{text:"Cancel",onclick:function(){this.parent().parent().close()}},{text:"Insert Image",subtype:"primary",onclick:function(d){for(var f=document.getElementById("leauiIfr").contentWindow,g=f.document.getElementById("preview"),h=g.childNodes,i=[],j=0;j<h.length;++j){var d=h[j];if(d.firstChild&&"IMG"==d.firstChild.nodeName){var k=d.firstChild,l={};l.src=k.getAttribute("src"),l.width=k.getAttribute("data-width"),l.height=k.getAttribute("data-height"),l.title=k.getAttribute("data-title"),i.push(l)}}for(var j in i){var m,n=i[j],o=n.src;m=-1!=o.indexOf("http://")||-1!=o.indexOf("https://")?o:b+"/"+o,n.src=m;var p=function(b){var d=function(b,c){var d,f={};return f.id="__mcenew"+c,f.src="http://leanote.com/images/loading-24.gif",d=e.createHTML("img",f),a.insertContent(d),d=e.get(f.id),function(a){a&&a.width&&(a.width>600&&(a.width=600),b.width=a.width),e.setAttrib(d,"src",b.src),e.setAttrib(d,"title",b.title),e.setAttrib(d,"id",null)}}(b,j);c(b.src,d)},q="";if(fileIds=m.split("fileId="),2==fileIds.length&&fileIds[1].length=="53aecf8a8a039a43c8036282".length&&(q=fileIds[1]),q){var r;Note&&Note.getCurNote&&(r=Note.getCurNote()),r&&r.UserId!=UserInfo.UserId?!function(a){ajaxPost("/file/copyImage",{userId:UserInfo.UserId,fileId:q,toUserId:r.UserId},function(b){if(reIsOk(b)&&b.Id){var c=UrlPrefix;a.src=c+"/api/file/getImage?fileId="+b.Id}p(a)})}(n):p(n)}else p(n)}this.parent().parent().close()}}]})}a.addButton("leaui_image",{icon:"image",tooltip:"Insert/edit image",onclick:d,stateSelector:"img:not([data-mind-json])"}),a.addMenuItem("leaui_image",{icon:"image",text:"Insert image",onclick:d,context:"insert",prependToContext:!0});var e=!1;a.on("dragstart",function(a){LEA.readOnly&&(a.preventDefault(),a.stopPropagation()),e=!0}),a.on("dragend",function(a){e=!1}),a.on("dragover",function(a){e&&(a.preventDefault(),a.stopPropagation())})});
|
||||
var LEAUI_DATAS=[];tinymce.PluginManager.add("leaui_image",function(a,b){function c(a,b){function c(a,c){d.parentNode.removeChild(d),b({width:a,height:c})}var d=document.createElement("img");d.onload=function(){c(d.clientWidth,d.clientHeight)},d.onerror=function(){c()},d.src=a;var e=d.style;e.visibility="hidden",e.position="fixed",e.bottom=e.left=0,e.width=e.height="auto",document.body.appendChild(d)}function d(){function b(){var a='<iframe id="leauiIfr" src="/album/index?'+(new Date).getTime()+'" frameborder="0"></iframe>';return a}var d=a.dom,e=a.selection.getContent(),f=/<img.*?\/>/g,g=e.match(f),h=document.createElement("p"),i=[];for(var j in g){h.innerHTML=g[j];var k=h.firstChild;if(k&&"IMG"==k.nodeName){var l={};l.src=d.getAttrib(k,"data-src")||d.getAttrib(k,"src"),l.width=d.getAttrib(k,"width"),l.height=d.getAttrib(k,"height"),l.title=d.getAttrib(k,"title"),i.push(l)}}LEAUI_DATAS=i;var m=$(document).width()-10;m>805&&(m=805);var n=$(document).height()-100;n>365&&(n=365),win=a.windowManager.open({title:"Image",width:m,height:n,html:b(),buttons:[{text:"Cancel",onclick:function(){this.parent().parent().close()}},{text:"Insert Image",subtype:"primary",onclick:function(b){for(var e=document.getElementById("leauiIfr").contentWindow,f=e.document.getElementById("preview"),g=f.childNodes,h=[],i=0;i<g.length;++i){var b=g[i];if(b.firstChild&&"IMG"==b.firstChild.nodeName){var j=b.firstChild,k={};k.src=j.getAttribute("src"),k.width=j.getAttribute("data-width"),k.height=j.getAttribute("data-height"),k.title=j.getAttribute("data-title"),h.push(k)}}for(var i in h){var l=h[i],m=l.src,n=m;l.src=m;var o=function(b){var e=function(b,c){var e,f={};return f.id="__mcenew"+c,f.src="/images/loading-24.gif",e=d.createHTML("img",f),a.insertContent(e),e=d.get(f.id),function(a){a&&a.width&&(a.width>600&&(a.width=600),b.width=a.width),d.setAttrib(e,"src",b.src),d.setAttrib(e,"title",b.title),d.setAttrib(e,"id",null)}}(b,i);c(b.src,e)},p="";if(fileIds=n.split("fileId="),2==fileIds.length&&fileIds[1].length=="53aecf8a8a039a43c8036282".length&&(p=fileIds[1]),p){var q;Note&&Note.getCurNote&&(q=Note.getCurNote()),q&&q.UserId!=UserInfo.UserId?!function(a){ajaxPost("/file/copyImage",{userId:UserInfo.UserId,fileId:p,toUserId:q.UserId},function(b){reIsOk(b)&&b.Id&&(a.src="/api/file/getImage?fileId="+b.Id),o(a)})}(l):o(l)}else o(l)}this.parent().parent().close()}}]})}a.addButton("leaui_image",{icon:"image",tooltip:"Insert/edit image",onclick:d,stateSelector:"img:not([data-mind-json])"}),a.addMenuItem("leaui_image",{icon:"image",text:"Insert image",onclick:d,context:"insert",prependToContext:!0});var e=!1;a.on("dragstart",function(a){LEA.readOnly&&(a.preventDefault(),a.stopPropagation()),e=!0}),a.on("dragend",function(a){e=!1}),a.on("dragover",function(a){e&&(a.preventDefault(),a.stopPropagation())})});
|
||||
@@ -117,4 +117,4 @@
|
||||
writeScripts();
|
||||
})(this);
|
||||
|
||||
// $hash: fb4edcbc9aa7f82a3fc6e0a6a3486fec
|
||||
// $hash: f4f33bf34dc8356762ead5554b3b4576
|
||||
@@ -39899,13 +39899,8 @@ tinymce.PluginManager.add('leaui_image', function(editor, url) {
|
||||
var data = datas[i];
|
||||
var src = data.src;
|
||||
// the network image
|
||||
var trueSrc;
|
||||
if(src.indexOf("http://") != -1 || src.indexOf("https://") != -1) {
|
||||
trueSrc = src;
|
||||
} else {
|
||||
trueSrc = url + "/" + src;
|
||||
}
|
||||
data.src = trueSrc;
|
||||
var trueSrc = src;
|
||||
data.src = src;
|
||||
|
||||
var renderImage = function(data) {
|
||||
// 这里, 如果图片宽度过大, 这里设置成500px
|
||||
@@ -39914,7 +39909,7 @@ tinymce.PluginManager.add('leaui_image', function(editor, url) {
|
||||
var imgElm;
|
||||
// 先显示loading...
|
||||
d.id = '__mcenew' + i;
|
||||
d.src = "http://leanote.com/images/loading-24.gif";
|
||||
d.src = "/images/loading-24.gif";
|
||||
imgElm = dom.createHTML('img', d);
|
||||
editor.insertContent(imgElm);
|
||||
imgElm = dom.get(d.id);
|
||||
@@ -39953,8 +39948,7 @@ tinymce.PluginManager.add('leaui_image', function(editor, url) {
|
||||
(function(data) {
|
||||
ajaxPost("/file/copyImage", {userId: UserInfo.UserId, fileId: fileId, toUserId: curNote.UserId}, function(re) {
|
||||
if(reIsOk(re) && re.Id) {
|
||||
var urlPrefix = UrlPrefix; // window.location.protocol + "//" + window.location.host;
|
||||
data.src = urlPrefix + "/api/file/getImage?fileId=" + re.Id;
|
||||
data.src = "/api/file/getImage?fileId=" + re.Id;
|
||||
}
|
||||
renderImage(data);
|
||||
});
|
||||
|
||||
Vendored
+1
-1
@@ -12,4 +12,4 @@ s=n.offsetHeight,l=r.clientWidth,c=r.clientHeight,"end"==e?(i-=l-a,o-=c-s):"cent
|
||||
if(!u(t)&&t.keyCode==e.BACKSPACE&&(n=Q.getRng(),r=n.startContainer,i=n.startOffset,o=J.getRoot(),a=r,n.collapsed&&0===i)){for(;a&&a.parentNode&&a.parentNode.firstChild==a&&a.parentNode!=o;)a=a.parentNode;"BLOCKQUOTE"===a.tagName&&(s.formatter.toggle("blockquote",null,a),n=J.createRng(),n.setStart(r,0),n.setEnd(r,0),Q.setRng(n))}})}function S(){function e(){s._refreshContentEditable(),l("StyleWithCSS",!1),l("enableInlineTableEditing",!1),Z.object_resizing||l("enableObjectResizing",!1)}Z.readonly||s.on("BeforeExecCommand MouseDown",e)}function T(){function e(){K(J.select("a"),function(e){var t=e.parentNode,n=J.getRoot();if(t.lastChild===e){for(;t&&!J.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}J.add(t,"br",{"data-mce-bogus":1})}})}s.on("SetContent ExecCommand",function(t){("setcontent"==t.type||"mceInsertLink"===t.command)&&e()})}function R(){Z.forced_root_block&&s.on("init",function(){l("DefaultParagraphSeparator",Z.forced_root_block)})}function A(){s.on("Undo Redo SetContent",function(e){e.initial||s.execCommand("mceRepaint")})}function B(){s.on("keydown",function(e){var t;u(e)||e.keyCode!=G||(t=s.getDoc().selection.createRange(),t&&t.item&&(e.preventDefault(),s.undoManager.beforeChange(),J.remove(t.item(0)),s.undoManager.add()))})}function D(){var e;c()>=10&&(e="",K("p div h1 h2 h3 h4 h5 h6".split(" "),function(t,n){e+=(n>0?",":"")+t+":empty"}),s.contentStyles.push(e+"{padding-right: 1px !important}"))}function L(){c()<9&&(ee.addNodeFilter("noscript",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.firstChild,r&&n.attr("data-mce-innertext",r.value)}),te.addNodeFilter("noscript",function(e){for(var t=e.length,n,o,a;t--;)n=e[t],o=e[t].firstChild,o?o.value=i.decode(o.value):(a=n.attributes.map["data-mce-innertext"],a&&(n.attr("data-mce-innertext",null),o=new r("#text",3),o.value=a,o.raw=!0,n.append(o)))}))}function M(){function e(e,t){var n=i.createTextRange();try{n.moveToPoint(e,t)}catch(r){n=null}return n}function t(t){var r;t.button?(r=e(t.x,t.y),r&&(r.compareEndPoints("StartToStart",a)>0?r.setEndPoint("StartToStart",a):r.setEndPoint("EndToEnd",a),r.select())):n()}function n(){var e=r.selection.createRange();a&&!e.item&&0===e.compareEndPoints("StartToEnd",e)&&a.select(),J.unbind(r,"mouseup",n),J.unbind(r,"mousemove",t),a=o=0}var r=J.doc,i=r.body,o,a,s;r.documentElement.unselectable=!0,J.bind(r,"mousedown contextmenu",function(i){if("HTML"===i.target.nodeName){if(o&&n(),s=r.documentElement,s.scrollHeight>s.clientHeight)return;o=1,a=e(i.x,i.y),a&&(J.bind(r,"mouseup",n),J.bind(r,"mousemove",t),J.getRoot().focus(),a.select())}})}function H(){s.on("keyup focusin mouseup",function(t){65==t.keyCode&&e.metaKeyPressed(t)||Q.normalize()},!0)}function P(){s.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function O(){s.inline||s.on("keydown",function(){document.activeElement==document.body&&s.getWin().focus()})}function I(){s.inline||(s.contentStyles.push("body {min-height: 150px}"),s.on("click",function(e){if("HTML"==e.target.nodeName){var t;t=s.selection.getRng(),s.getBody().focus(),s.selection.setRng(t),s.selection.normalize(),s.nodeChanged()}}))}function F(){o.mac&&s.on("keydown",function(t){!e.metaKeyPressed(t)||37!=t.keyCode&&39!=t.keyCode||(t.preventDefault(),s.selection.getSel().modify("move",37==t.keyCode?"backward":"forward","word"))})}function z(){l("AutoUrlDetect",!1)}function W(){s.inline||s.on("focus blur beforegetcontent",function(){var e=s.dom.create("br");s.getBody().appendChild(e),e.parentNode.removeChild(e)},!0)}function V(){s.on("click",function(e){var t=e.target;do if("A"===t.tagName)return void e.preventDefault();while(t=t.parentNode)}),s.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")}function $(){s.on("touchstart",function(e){var t,n,r,i;t=e.target,n=(new Date).getTime(),i=e.changedTouches,!i||i.length>1||(r=i[0],s.once("touchend",function(e){var i=e.changedTouches[0],o;(new Date).getTime()-n>500||Math.abs(r.clientX-i.clientX)>5||Math.abs(r.clientY-i.clientY)>5||(o={target:t},K("pageX pageY clientX clientY screenX screenY".split(" "),function(e){o[e]=i[e]}),o=s.fire("click",o),o.isDefaultPrevented()||(s.selection.placeCaretAt(i.clientX,i.clientY),s.nodeChanged()))}))})}function U(){s.on("init",function(){s.dom.bind(s.getBody(),"submit",function(e){e.preventDefault()})})}function q(){ee.addNodeFilter("br",function(e){for(var t=e.length;t--;)"Apple-interchange-newline"==e[t].attr("class")&&e[t].remove()})}function j(){s.on("dragstart",function(e){d(e)}),s.on("drop",function(e){if(!u(e)){var n=f(e);if(n){e.preventDefault();var r=t.getCaretRangeFromPoint(e.x,e.y,s.getDoc());Q.setRng(r),p(n)}}})}var K=a.each,Y=s.$,G=e.BACKSPACE,X=e.DELETE,J=s.dom,Q=s.selection,Z=s.settings,ee=s.parser,te=s.serializer,ne=o.gecko,re=o.ie,ie=o.webkit,oe="data:text/mce-internal,",ae=re?"Text":"URL";k(),m(),H(),ie&&(h(),v(),C(),R(),U(),_(),q(),$(),o.iOS?(O(),I(),V()):g()),re&&o.ie<11&&(y(),w(),E(),N(),B(),D(),L(),MLine truncated
|
||||
var e,s;if(d.unbind(window,"ready",a),i("onpageload"),t.types)return void p(t.types,function(e){p(d.select(e.selector),function(i){r(n(i),h({},t,e),i)})});if(t.selector)return void p(d.select(t.selector),function(e){r(n(e),t,e)});switch(t.target&&r(n(t.target),t),t.mode){case"exact":e=t.elements||"",e.length>0&&p(f(e),function(e){var n;(n=d.get(e))?r(e,t,n):p(document.forms,function(n){p(n.elements,function(n){n.name===e&&(e="mce_editor_"+m++,d.setAttrib(n,"id",e),r(e,t,n))})})});break;case"textareas":case"specific_textareas":p(d.select("textarea"),function(e){t.editor_deselector&&o(e,t.editor_deselector)||(!t.editor_selector||o(e,t.editor_selector))&&r(n(e),t,e)})}t.oninit&&(e=s=0,p(l,function(t){s++,t.initialized?e++:t.on("init",function(){e++,e==s&&i("oninit")}),e==s&&i("oninit")}))}var s=this,l=[];s.settings=t,d.bind(window,"ready",a)},get:function(e){return arguments.length?e in this.editors?this.editors[e]:null:this.editors},add:function(e){var t=this,n=t.editors;return n[e.id]=e,n.push(e),t.activeEditor=e,t.fire("AddEditor",{editor:e}),g||(g=function(){t.fire("BeforeUnload")},d.bind(window,"beforeunload",g)),e},createEditor:function(t,n){return this.add(new e(t,n,this))},remove:function(e){var t=this,n,r=t.editors,i;{if(e)return"string"==typeof e?(e=e.selector||e,void p(d.select(e),function(e){i=r[e.id],i&&t.remove(i)})):(i=e,r[i.id]?(c(i)&&t.fire("RemoveEditor",{editor:i}),r.length||d.unbind(window,"beforeunload",g),i.remove(),i):null);for(n=r.length-1;n>=0;n--)t.remove(r[n])}},execCommand:function(t,n,r){var i=this,o=i.get(r);switch(t){case"mceAddEditor":return i.get(r)||new e(r,i.settings,i).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(i.execCommand("mceAddEditor",0,r),!0)}return i.activeEditor?i.activeEditor.execCommand(t,n,r):!1},triggerSave:function(){p(this.editors,function(e){e.save()})},addI18n:function(e,t){s.add(e,t)},translate:function(e){return s.translate(e)},setActive:function(e){var t=this.activeEditor;this.activeEditor!=e&&(t&&t.fire("deactivate",{relatedTarget:e}),e.fire("activate",{relatedTarget:t})),this.activeEditor=e}},h(v,a),v.setup(),window.tinymce=window.tinyMCE=v,v}),r(ge,[me,d],function(e,t){var n=t.each,r=t.explode;e.on("AddEditor",function(e){var t=e.editor;t.on("preInit",function(){function e(e,t){n(t,function(t,n){t&&s.setStyle(e,n,t)}),s.rename(e,"span")}function i(e){s=t.dom,l.convert_fonts_to_spans&&n(s.select("font,u,strike",e.node),function(e){o[e.nodeName.toLowerCase()](s,e)})}var o,a,s,l=t.settings;l.inline_styles&&(a=r(l.font_size_legacy_values),o={font:function(t,n){e(n,{backgroundColor:n.style.backgroundColor,color:n.color,fontFamily:n.face,fontSize:a[parseInt(n.size,10)-1]})},u:function(n,r){"html4"===t.settings.schema&&e(r,{textDecoration:"underline"})},strike:function(t,n){e(n,{textDecoration:"line-through"})}},t.on("PreProcess SetContent",i))})})}),r(ve,[ce,d],function(e,t){var n={send:function(e){function t(){!e.async||4==r.readyState||i++>1e4?(e.success&&1e4>i&&200==r.status?e.success.call(e.success_scope,""+r.responseText,r,e):e.error&&e.error.call(e.error_scope,i>1e4?"TIMED_OUT":"GENERAL",r,e),r=null):setTimeout(t,10)}var r,i=0;if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=e.async===!1?!1:!0,e.data=e.data||"",r=new XMLHttpRequest){if(r.overrideMimeType&&r.overrideMimeType(e.content_type),r.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.crossDomain&&(r.withCredentials=!0),e.content_type&&r.setRequestHeader("Content-Type",e.content_type),r.setRequestHeader("X-Requested-With","XMLHttpRequest"),r=n.fire("beforeSend",{xhr:r,settings:e}).xhr,r.send(e.data),!e.async)return t();setTimeout(t,10)}}};return t.extend(n,e),n}),r(ye,[],function(){function e(t,n){var r,i,o,a;if(n=n||'"',null===t)return"null";if(o=typeof t,"string"==o)return i="\bb t\nn\ff\rr\"\"''\\\\",n+t.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=i.indexOf(t),r+1?"\\"+i.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e))})+n;if("object"==o){if(t.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(t)){for(r=0,i="[";r<t.length;r++)i+=(r>0?",":"")+e(t[r],n);return i+"]"}i="{";for(a in t)t.hasOwnProperty(a)&&(i+="function"!=typeof t[a]?(i.length>1?","+n:n)+a+n+":"+e(t[a],n):"");return i+"}"}return""+t}return{serialize:e,parse:function(e){try{return window[String.fromCharCode(101)+"val"]("("+e+")")}catch(t){}}}}),r(be,[ye,ve,d],function(e,t,n){function r(e){this.settings=i({},e),this.count=0}var i=n.extend;return r.sendRPC=function(e){return(new r).send(e)},r.prototype={send:function(n){var r=n.error,o=n.success;n=i(this.settings,n),n.success=function(t,i){t=e.parse(t),"undefined"==typeof t&&(t={error:"JSON Parse error."}),t.error?r.call(n.error_scope||n.scope,t.error,i):o.call(n.success_scope||n.scope,t.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,tLine truncated
|
||||
|
||||
})})},onclick:function(){l(n)}})}),s({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1]})}),s({blockquote:["Blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bullet list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1],onPostRender:function(){var t=this;e.formatter?e.formatter.formatChanged(n,function(e){t.active(e)}):e.on("init",function(){e.formatter.formatChanged(n,function(e){t.active(e)})})}})}),e.addButton("undo",{tooltip:"Undo",onPostRender:o("undo"),cmd:"undo"}),e.addButton("redo",{tooltip:"Redo",onPostRender:o("redo"),cmd:"redo"}),e.addMenuItem("newdocument",{text:"New document",icon:"newdocument",cmd:"mceNewDocument"}),e.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:o("undo"),cmd:"undo"}),e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:o("redo"),cmd:"redo"}),e.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:a,cmd:"mceToggleVisualAid"}),s({cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"],bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic","Meta+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(t,n){e.addMenuItem(n,{text:t[0],icon:n,shortcut:t[2],cmd:t[1]})}),e.on("mousedown",function(){n.hideAll()}),e.addButton("styleselect",{type:"menubutton",text:"Formats",menu:c}),e.addButton("formatselect",function(){var n=[],i=r(e.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre");return s(i,function(t){n.push({text:t[0],value:t[1],textStyle:function(){return e.formatter.getCssText(t[1])}})}),{type:"listbox",text:i[0][0],values:n,fixedWidth:!0,onselect:l,onPostRender:t(n)}}),e.addButton("fontselect",function(){var n="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",i=[],o=r(e.settings.font_formats||n);return s(o,function(e){i.push({text:{raw:e[0]},value:e[1],textStyle:-1==e[1].indexOf("dings")?"font-family:"+e[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:i,fixedWidth:!0,onPostRender:t(i,"fontname"),onselect:function(t){t.control.settings.value&&e.execCommand("FontName",!1,t.control.settings.value)}}}),e.addButton("fontsizeselect",function(){var n=[],r="8pt 10pt 12pt 14pt 18pt 24pt 36pt",i=e.settings.fontsize_formats||r;return s(i.split(" "),function(e){var t=e,r=e,i=e.split("=");i.length>1&&(t=i[0],r=i[1]),n.push({text:t,value:r})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:n,fixedWidth:!0,onPostRender:t(n,"fontsize"),onclick:function(t){t.control.settings.value&&e.execCommand("FontSize",!1,t.control.settings.value)}}}),e.addMenuItem("formats",{text:"Formats",menu:c})}var s=r.each;i.on("AddEditor",function(t){t.editor.rtl&&(e.rtl=!0),a(t.editor)}),e.translate=function(e){return i.translate(e)},t.tooltips=!o.iOS}),r(je,[Ee],function(e){return e.extend({recalc:function(e){var t=e.settings,n,r,i,o,a,s,l,c,u,d,f,p,h,m,g,v,y,b,C,x,w,_,E=[],N=[],k,S,T,R,A,B;t=e.settings,i=e.items().filter(":visible"),o=e.layoutRect(),r=t.columns||Math.ceil(Math.sqrt(i.length)),n=Math.ceil(i.length/r),y=t.spacingH||t.spacing||0,b=t.spacingV||t.spacing||0,C=t.alignH||t.align,x=t.alignV||t.align,g=e._paddingBox,A="reverseRows"in t?t.reverseRows:e.isRtl(),C&&"string"==typeof C&&(C=[C]),x&&"string"==typeof x&&(x=[x]);for(d=0;r>d;d++)E.push(0);for(f=0;n>f;f++)N.push(0);for(f=0;n>f;f++)for(d=0;r>d&&(u=i[f*r+d],u);d++)c=u.layoutRect(),k=c.minW,S=c.minH,E[d]=k>E[d]?k:E[d],N[f]=S>N[f]?S:N[f];for(T=o.innerW-g.left-g.right,w=0,d=0;r>d;d++)w+=E[d]+(d>0?y:0),T-=(d>0?y:0)+E[d];for(R=o.innerH-g.top-g.bottom,_=0,f=0;n>f;fLine truncated
|
||||
})})},onclick:function(){l(n)}})}),s({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1]})}),s({blockquote:["Blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bullet list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1],onPostRender:function(){var t=this;e.formatter?e.formatter.formatChanged(n,function(e){t.active(e)}):e.on("init",function(){e.formatter.formatChanged(n,function(e){t.active(e)})})}})}),e.addButton("undo",{tooltip:"Undo",onPostRender:o("undo"),cmd:"undo"}),e.addButton("redo",{tooltip:"Redo",onPostRender:o("redo"),cmd:"redo"}),e.addMenuItem("newdocument",{text:"New document",icon:"newdocument",cmd:"mceNewDocument"}),e.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Meta+Z",onPostRender:o("undo"),cmd:"undo"}),e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Meta+Y",onPostRender:o("redo"),cmd:"redo"}),e.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:a,cmd:"mceToggleVisualAid"}),s({cut:["Cut","Cut","Meta+X"],copy:["Copy","Copy","Meta+C"],paste:["Paste","Paste","Meta+V"],selectall:["Select all","SelectAll","Meta+A"],bold:["Bold","Bold","Meta+B"],italic:["Italic","Italic","Meta+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(t,n){e.addMenuItem(n,{text:t[0],icon:n,shortcut:t[2],cmd:t[1]})}),e.on("mousedown",function(){n.hideAll()}),e.addButton("styleselect",{type:"menubutton",text:"Formats",menu:c}),e.addButton("formatselect",function(){var n=[],i=r(e.settings.block_formats||"Paragraph=p;Heading 1=h1;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6;Preformatted=pre");return s(i,function(t){n.push({text:t[0],value:t[1],textStyle:function(){return e.formatter.getCssText(t[1])}})}),{type:"listbox",text:i[0][0],values:n,fixedWidth:!0,onselect:l,onPostRender:t(n)}}),e.addButton("fontselect",function(){var n="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",i=[],o=r(e.settings.font_formats||n);return s(o,function(e){i.push({text:{raw:e[0]},value:e[1],textStyle:-1==e[1].indexOf("dings")?"font-family:"+e[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:i,fixedWidth:!0,onPostRender:t(i,"fontname"),onselect:function(t){t.control.settings.value&&e.execCommand("FontName",!1,t.control.settings.value)}}}),e.addButton("fontsizeselect",function(){var n=[],r="8pt 10pt 12pt 14pt 18pt 24pt 36pt",i=e.settings.fontsize_formats||r;return s(i.split(" "),function(e){var t=e,r=e,i=e.split("=");i.length>1&&(t=i[0],r=i[1]),n.push({text:t,value:r})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:n,fixedWidth:!0,onPostRender:t(n,"fontsize"),onclick:function(t){t.control.settings.value&&e.execCommand("FontSize",!1,t.control.settings.value)}}}),e.addMenuItem("formats",{text:"Formats",menu:c})}var s=r.each;i.on("AddEditor",function(t){t.editor.rtl&&(e.rtl=!0),a(t.editor)}),e.translate=function(e){return i.translate(e)},t.tooltips=!o.iOS}),r(je,[Ee],function(e){return e.extend({recalc:function(e){var t=e.settings,n,r,i,o,a,s,l,c,u,d,f,p,h,m,g,v,y,b,C,x,w,_,E=[],N=[],k,S,T,R,A,B;t=e.settings,i=e.items().filter(":visible"),o=e.layoutRect(),r=t.columns||Math.ceil(Math.sqrt(i.length)),n=Math.ceil(i.length/r),y=t.spacingH||t.spacing||0,b=t.spacingV||t.spacing||0,C=t.alignH||t.align,x=t.alignV||t.align,g=e._paddingBox,A="reverseRows"in t?t.reverseRows:e.isRtl(),C&&"string"==typeof C&&(C=[C]),x&&"string"==typeof x&&(x=[x]);for(d=0;r>d;d++)E.push(0);for(f=0;n>f;f++)N.push(0);for(f=0;n>f;f++)for(d=0;r>d&&(u=i[f*r+d],u);d++)c=u.layoutRect(),k=c.minW,S=c.minH,E[d]=k>E[d]?k:E[d],N[f]=S>N[f]?S:N[f];for(T=o.innerW-g.left-g.right,w=0,d=0;r>d;d++)w+=E[d]+(d>0?y:0),T-=(d>0?y:0)+E[d];for(R=o.innerH-g.top-g.bottom,_=0,f=0;n>f;fLine truncated
|
||||
Reference in new issue
Block a user