Merge branch 'sync-from-leanote.com'
This commit is contained in:
commit
f757e00f03
107 files changed
+2696
-9273
No files matched your search
+176
-3
@@ -90,6 +90,7 @@ gulp.task('devToProHtml', function() {
|
||||
.pipe(replace(/<!-- pro_app_js -->/, '<script src="/js/app.min.js"></script>')) // 替换
|
||||
.pipe(replace(/<!-- pro_markdown_js -->/, '<script src="/js/markdown.min.js"></script>')) // 替换
|
||||
.pipe(replace(/<!-- pro_tinymce_init_js -->/, "var tinyMCEPreInit = {base: '/public/tinymce', suffix: '.min'};")) // 替换
|
||||
.pipe(replace(/plugins\/main.js/, "plugins/main.min.js")) // 替换
|
||||
// 连续两个空行换成一个空行, 没用
|
||||
.pipe(replace(/\n\n/g, '\n'))
|
||||
.pipe(replace(/\n\n/g, '\n'))
|
||||
@@ -99,9 +100,180 @@ gulp.task('devToProHtml', function() {
|
||||
.pipe(gulp.dest(noteProBase));
|
||||
});
|
||||
|
||||
// tinymce
|
||||
// Get used keys
|
||||
// 只获取需要js i18n的key
|
||||
var path = require('path');
|
||||
gulp.task('i18n', function() {
|
||||
var keys = {};
|
||||
var reg = /getMsg\(["']+(.+?)["']+/g;
|
||||
function getKey(data) {
|
||||
while(ret = reg.exec(data)) {
|
||||
keys[ret[1]] = 1;
|
||||
}
|
||||
}
|
||||
// 先获取需要的key
|
||||
function ls(ff) {
|
||||
var files = fs.readdirSync(ff);
|
||||
for(fn in files) {
|
||||
var fname = ff + path.sep + files[fn];
|
||||
var stat = fs.lstatSync(fname);
|
||||
if(stat.isDirectory() == true) {
|
||||
ls(fname);
|
||||
}
|
||||
else {
|
||||
if ((fname.indexOf('.html') > 0 || fname.indexOf('.js') > 0)) {
|
||||
// console.log(fname);
|
||||
// if (fname.indexOf('min.js') < 0) {
|
||||
var data = fs.readFileSync(fname, "utf-8");
|
||||
// 得到getMsg里的key
|
||||
getKey(data);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var tinymceBase = base + '/tinymce_4.1.9';
|
||||
console.log('parsing used keys');
|
||||
|
||||
ls(base + '/admin');
|
||||
ls(base + '/blog');
|
||||
ls(base + '/dist');
|
||||
ls(base + '/js');
|
||||
ls(base + '/libs');
|
||||
ls(base + '/member');
|
||||
ls(base + '/tinymce');
|
||||
|
||||
console.log('parsed');
|
||||
|
||||
// msg.zh
|
||||
function getAllMsgs(fname) {
|
||||
var msg = {};
|
||||
|
||||
var data = fs.readFileSync(fname, "utf-8");
|
||||
var lines = data.split('\n');
|
||||
for (var i = 0; i < lines.length; ++i) {
|
||||
var line = lines[i];
|
||||
// 忽略注释
|
||||
if (line[0] == '#' || line[1] == '#') {
|
||||
continue;
|
||||
}
|
||||
var lineArr = line.split('=');
|
||||
if (lineArr.length >= 2) {
|
||||
var key = lineArr[0];
|
||||
lineArr.shift();
|
||||
msg[key] = lineArr.join('=');
|
||||
// msg[lineArr[0]] = lineArr[1];
|
||||
}
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
// msg.zh, msg.js
|
||||
function genI18nJsFile(fromFilename, keys) {
|
||||
var msgs = getAllMsgs(leanoteBase + '/messages/' + fromFilename);
|
||||
var toFilename = fromFilename + '.js';
|
||||
var toMsgs = {};
|
||||
for (var i in msgs) {
|
||||
// 只要需要的
|
||||
if (i in keys) {
|
||||
toMsgs[i] = msgs[i];
|
||||
}
|
||||
}
|
||||
var str = 'var MSG=' + JSON.stringify(toMsgs) + ';';
|
||||
str += '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;' +
|
||||
'}';
|
||||
// 写入到文件中
|
||||
fs.writeFile(base + '/js/i18n/' + toFilename, str);
|
||||
}
|
||||
|
||||
genI18nJsFile('msg.zh', keys);
|
||||
genI18nJsFile('msg.en', keys);
|
||||
genI18nJsFile('msg.fr', keys);
|
||||
genI18nJsFile('blog.zh', keys);
|
||||
genI18nJsFile('blog.en', keys);
|
||||
genI18nJsFile('blog.fr', keys);
|
||||
});
|
||||
|
||||
|
||||
// plugins压缩
|
||||
gulp.task('plugins', function() {
|
||||
gulp.src(base + '/js/plugins/libs/*.js')
|
||||
.pipe(uglify()) // 压缩
|
||||
// .pipe(concat('main.min.js'))
|
||||
.pipe(gulp.dest(base + '/js/plugins/libs-min'));
|
||||
|
||||
|
||||
// 所有js合并成一个
|
||||
var jss = [
|
||||
'note_info',
|
||||
'tips',
|
||||
'history',
|
||||
'attachment_upload',
|
||||
'editor_drop_paste',
|
||||
'main'
|
||||
];
|
||||
|
||||
for(var i in jss) {
|
||||
jss[i] = base + '/js/plugins/' + jss[i] + '.js';
|
||||
}
|
||||
|
||||
gulp.src(jss)
|
||||
.pipe(uglify()) // 压缩
|
||||
.pipe(concat('main.min.js'))
|
||||
.pipe(gulp.dest(base + '/js/plugins'));
|
||||
});
|
||||
|
||||
|
||||
// mincss
|
||||
var minifycss = require('gulp-minify-css');
|
||||
gulp.task('minifycss', function() {
|
||||
gulp.src(base + '/css/bootstrap.css')
|
||||
.pipe(rename({suffix: '-min'}))
|
||||
.pipe(minifycss())
|
||||
.pipe(gulp.dest(base + '/css'));
|
||||
|
||||
gulp.src(base + '/css/font-awesome-4.2.0/css/font-awesome.css')
|
||||
.pipe(rename({suffix: '-min'}))
|
||||
.pipe(minifycss())
|
||||
.pipe(gulp.dest(base + '/css/font-awesome-4.2.0/css'));
|
||||
|
||||
gulp.src(base + '/css/zTreeStyle/zTreeStyle.css')
|
||||
.pipe(rename({suffix: '-min'}))
|
||||
.pipe(minifycss())
|
||||
.pipe(gulp.dest(base + '/css/zTreeStyle'));
|
||||
|
||||
gulp.src(base + '/dist/themes/default.css')
|
||||
.pipe(rename({suffix: '-min'}))
|
||||
.pipe(minifycss())
|
||||
.pipe(gulp.dest(base + '/dist/themes'));
|
||||
|
||||
gulp.src(base + '/js/contextmenu/css/contextmenu.css')
|
||||
.pipe(rename({suffix: '-min'}))
|
||||
.pipe(minifycss())
|
||||
.pipe(gulp.dest(base + '/js/contextmenu/css'));
|
||||
|
||||
// theme
|
||||
// 用codekit
|
||||
var as = ['default', 'simple', 'writting', /*'writting-overwrite', */ 'mobile'];
|
||||
/*
|
||||
for(var i = 0; i < as.length; ++i) {
|
||||
gulp.src(base + '/css/theme/' + as[i] + '.css')
|
||||
.pipe(minifycss())
|
||||
.pipe(gulp.dest(base + '/css/theme'));
|
||||
}
|
||||
*/
|
||||
});
|
||||
|
||||
// tinymce
|
||||
// !! You must has tinymce_dev on public/
|
||||
var tinymceBase = base + '/tinymce_dev';
|
||||
gulp.task('tinymce', function() {
|
||||
// 先清理
|
||||
fs.unlink(tinymceBase + '/js/tinymce/tinymce.dev.js');
|
||||
@@ -126,6 +298,7 @@ gulp.task('tinymce', function() {
|
||||
});
|
||||
|
||||
// 合并css, 无用
|
||||
// Deprecated
|
||||
gulp.task('concatCss', function() {
|
||||
return gulp
|
||||
.src([markdownRaw + '/css/default.css', markdownRaw + '/css/md.css'])
|
||||
@@ -135,4 +308,4 @@ gulp.task('concatCss', function() {
|
||||
|
||||
gulp.task('concat', ['concatDepJs', 'concatAppJs', 'concatMarkdownJs']);
|
||||
gulp.task('html', ['devToProHtml']);
|
||||
gulp.task('default', ['concat', 'html']);
|
||||
gulp.task('default', ['concat', 'plugins', 'minifycss', 'i18n', 'html']);
|
||||
@@ -2,11 +2,11 @@ package controllers
|
||||
|
||||
import (
|
||||
"github.com/revel/revel"
|
||||
// "encoding/json"
|
||||
// "encoding/json"
|
||||
"github.com/leanote/leanote/app/info"
|
||||
"gopkg.in/mgo.v2/bson"
|
||||
// . "github.com/leanote/leanote/app/lea"
|
||||
// "io/ioutil"
|
||||
// . "github.com/leanote/leanote/app/lea"
|
||||
// "io/ioutil"
|
||||
)
|
||||
|
||||
// Album controller
|
||||
@@ -19,7 +19,6 @@ func (c Album) GetAlbums() revel.Result {
|
||||
re := albumService.GetAlbums(c.GetUserId())
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
func (c Album) DeleteAlbum(albumId string) revel.Result {
|
||||
re, msg := albumService.DeleteAlbum(c.GetUserId(), albumId)
|
||||
return c.RenderJson(info.Re{Ok: re, Msg: msg})
|
||||
@@ -34,7 +33,7 @@ func (c Album) AddAlbum(name string) revel.Result {
|
||||
UserId: c.GetObjectUserId()}
|
||||
re := albumService.AddAlbum(album)
|
||||
|
||||
if(re) {
|
||||
if re {
|
||||
return c.RenderJson(album)
|
||||
} else {
|
||||
return c.RenderJson(false)
|
||||
|
||||
@@ -86,7 +86,8 @@ func (c Auth) Logout() revel.Result {
|
||||
// 体验一下
|
||||
func (c Auth) Demo() revel.Result {
|
||||
email := configService.GetGlobalStringConfig("demoUsername")
|
||||
pwd := configService.GetGlobalStringConfig("demoPassword");
|
||||
pwd := configService.GetGlobalStringConfig("demoPassword")
|
||||
|
||||
userInfo, err := authService.Login(email, pwd)
|
||||
if err != nil {
|
||||
return c.RenderJson(info.Re{Ok: false})
|
||||
|
||||
@@ -84,6 +84,13 @@ func (c BaseController) GetUserInfo() info.User {
|
||||
return info.User{}
|
||||
}
|
||||
|
||||
func (c BaseController) GetUserAndBlogUrl() info.UserAndBlogUrl {
|
||||
if userId, ok := c.Session["UserId"]; ok && userId != "" {
|
||||
return userService.GetUserAndBlogUrl(userId);
|
||||
}
|
||||
return info.UserAndBlogUrl{}
|
||||
}
|
||||
|
||||
// 这里的session都是cookie中的, 与数据库session无关
|
||||
func (c BaseController) GetSession(key string) string {
|
||||
v, ok := c.Session[key]
|
||||
|
||||
@@ -265,10 +265,6 @@ func (c Blog) getCates(userBlog info.UserBlog) {
|
||||
}
|
||||
}
|
||||
|
||||
Log("cates")
|
||||
LogJ(cates)
|
||||
LogJ(catesTree);
|
||||
|
||||
c.RenderArgs["cates"] = cates
|
||||
c.RenderArgs["catesTree"] = catesTree
|
||||
}
|
||||
@@ -352,9 +348,10 @@ func (c Blog) blogCommon(userId string, userBlog info.UserBlog, userInfo info.Us
|
||||
// 得到主题信息
|
||||
themeInfo := themeService.GetThemeInfo(userBlog.ThemeId.Hex(), userBlog.Style)
|
||||
c.RenderArgs["themeInfo"] = themeInfo
|
||||
Log(">>")
|
||||
Log(userBlog.Style)
|
||||
Log(userBlog.ThemeId.Hex())
|
||||
|
||||
// Log(">>")
|
||||
// Log(userBlog.Style)
|
||||
// Log(userBlog.ThemeId.Hex())
|
||||
|
||||
return true, userBlog
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ func (c File) UploadAvatar() revel.Result {
|
||||
|
||||
// leaui image plugin upload image
|
||||
func (c File) UploadImageLeaui(albumId string) revel.Result {
|
||||
re := c.uploadImage("", albumId);
|
||||
re := c.uploadImage("", albumId)
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
@@ -100,12 +100,18 @@ func (c File) uploadImage(from, albumId string) (re info.Re) {
|
||||
return re
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
// 生成上传路径
|
||||
newGuid := NewGuid()
|
||||
|
||||
userId := c.GetUserId()
|
||||
|
||||
if(from == "logo" || from == "blogLogo") {
|
||||
fileUrlPath = "public/upload/" + c.GetUserId() + "/images/logo"
|
||||
fileUrlPath = "public/upload/" + Digest3(userId) + "/" + userId + "/images/logo"
|
||||
} else {
|
||||
fileUrlPath = "files/" + c.GetUserId() + "/images"
|
||||
fileUrlPath = "files/" + Digest3(userId) + "/" + userId + "/" + Digest2(newGuid) + "/images"
|
||||
}
|
||||
|
||||
dir := revel.BasePath + "/" + fileUrlPath
|
||||
err = os.MkdirAll(dir, 0755)
|
||||
if err != nil {
|
||||
@@ -114,18 +120,18 @@ func (c File) uploadImage(from, albumId string) (re info.Re) {
|
||||
// 生成新的文件名
|
||||
filename := handel.Filename
|
||||
|
||||
var ext string;
|
||||
var ext string
|
||||
if from == "pasteImage" {
|
||||
ext = ".png"; // TODO 可能不是png类型
|
||||
ext = ".png" // TODO 可能不是png类型
|
||||
} else {
|
||||
_, ext = SplitFilename(filename)
|
||||
if(ext != ".gif" && ext != ".jpg" && ext != ".png" && ext != ".bmp" && ext != ".jpeg") {
|
||||
if ext != ".gif" && ext != ".jpg" && ext != ".png" && ext != ".bmp" && ext != ".jpeg" {
|
||||
resultMsg = "Please upload image"
|
||||
return re
|
||||
}
|
||||
}
|
||||
|
||||
filename = NewGuid() + ext
|
||||
filename = newGuid + ext
|
||||
data, err := ioutil.ReadAll(file)
|
||||
if err != nil {
|
||||
LogJ(err)
|
||||
@@ -133,25 +139,25 @@ func (c File) uploadImage(from, albumId string) (re info.Re) {
|
||||
}
|
||||
|
||||
var maxFileSize float64
|
||||
if(from == "logo") {
|
||||
maxFileSize = configService.GetUploadSize("uploadAvatarSize");
|
||||
if from == "logo" {
|
||||
maxFileSize = configService.GetUploadSize("uploadAvatarSize")
|
||||
} else if from == "blogLogo" {
|
||||
maxFileSize = configService.GetUploadSize("uploadBlogLogoSize");
|
||||
maxFileSize = configService.GetUploadSize("uploadBlogLogoSize")
|
||||
} else {
|
||||
maxFileSize = configService.GetUploadSize("uploadImageSize");
|
||||
maxFileSize = configService.GetUploadSize("uploadImageSize")
|
||||
}
|
||||
if maxFileSize <= 0 {
|
||||
maxFileSize = 1000
|
||||
}
|
||||
|
||||
// > 2M?
|
||||
if(float64(len(data)) > maxFileSize * float64(1024*1024)) {
|
||||
if float64(len(data)) > maxFileSize*float64(1024*1024) {
|
||||
resultCode = 0
|
||||
resultMsg = fmt.Sprintf("The file Size is bigger than %vM", maxFileSize)
|
||||
return re
|
||||
}
|
||||
|
||||
toPath := dir + "/" + filename;
|
||||
toPath := dir + "/" + filename
|
||||
err = ioutil.WriteFile(toPath, data, 0777)
|
||||
if err != nil {
|
||||
LogJ(err)
|
||||
@@ -171,17 +177,18 @@ func (c File) uploadImage(from, albumId string) (re info.Re) {
|
||||
Path: fileUrlPath,
|
||||
Size: filesize}
|
||||
|
||||
id := bson.NewObjectId();
|
||||
id := bson.NewObjectId()
|
||||
fileInfo.FileId = id
|
||||
fileId = id.Hex()
|
||||
|
||||
if(from == "logo" || from == "blogLogo") {
|
||||
fileId = "public/upload/" + c.GetUserId() + "/images/logo/" + filename
|
||||
fileId = fileUrlPath
|
||||
}
|
||||
|
||||
Ok, resultMsg = fileService.AddImage(fileInfo, albumId, c.GetUserId(), from == "" || from == "pasteImage")
|
||||
resultMsg = c.Message(resultMsg)
|
||||
|
||||
fileInfo.Path = ""; // 不要返回
|
||||
fileInfo.Path = "" // 不要返回
|
||||
re.Item = fileInfo
|
||||
|
||||
return re
|
||||
@@ -204,6 +211,7 @@ func (c File) DeleteImage(fileId string) revel.Result {
|
||||
re.Ok, re.Msg = fileService.DeleteImage(c.GetUserId(), fileId)
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
//-----------
|
||||
|
||||
// 输出image
|
||||
@@ -226,12 +234,16 @@ func (c File) CopyImage(userId, fileId, toUserId string) revel.Result {
|
||||
return c.RenderJson(re)
|
||||
}
|
||||
|
||||
// 复制外网的图片, 成公共图片 放在/upload下
|
||||
// 复制外网的图片
|
||||
// 都要好好的计算大小
|
||||
func (c File) CopyHttpImage(src string) revel.Result {
|
||||
re := info.NewRe()
|
||||
fileUrlPath := "upload/" + c.GetUserId() + "/images"
|
||||
dir := revel.BasePath + "/public/" + fileUrlPath
|
||||
|
||||
// 生成上传路径
|
||||
newGuid := NewGuid()
|
||||
userId := c.GetUserId()
|
||||
fileUrlPath := "files/" + Digest3(userId) + "/" + userId + "/" + Digest2(newGuid) + "/images"
|
||||
dir := revel.BasePath + "/" + fileUrlPath
|
||||
err := os.MkdirAll(dir, 0755)
|
||||
if err != nil {
|
||||
return c.RenderJson(re)
|
||||
@@ -249,11 +261,11 @@ func (c File) CopyHttpImage(src string) revel.Result {
|
||||
Path: fileUrlPath + "/" + filename,
|
||||
Size: filesize}
|
||||
|
||||
id := bson.NewObjectId();
|
||||
id := bson.NewObjectId()
|
||||
fileInfo.FileId = id
|
||||
|
||||
re.Id = id.Hex()
|
||||
re.Item = fileInfo.Path
|
||||
// re.Item = fileInfo.Path
|
||||
re.Ok, re.Msg = fileService.AddImage(fileInfo, "", c.GetUserId(), true)
|
||||
|
||||
return c.RenderJson(re)
|
||||
|
||||
@@ -21,13 +21,12 @@ func (c Index) Default() revel.Result {
|
||||
}
|
||||
// leanote展示页, 没有登录的, 或已登录明确要进该页的
|
||||
func (c Index) Index() revel.Result {
|
||||
|
||||
c.SetUserInfo()
|
||||
c.RenderArgs["title"] = "leanote"
|
||||
c.RenderArgs["openRegister"] = configService.GlobalStringConfigs["openRegister"]
|
||||
lang := c.SetLocale()
|
||||
c.SetLocale()
|
||||
|
||||
return c.RenderTemplate("home/index_" + lang + ".html");
|
||||
return c.RenderTemplate("home/index.html");
|
||||
}
|
||||
|
||||
// 建议
|
||||
|
||||
@@ -24,7 +24,7 @@ type Note struct {
|
||||
// 否则, 转向登录页面
|
||||
func (c Note) Index(noteId, online string) revel.Result {
|
||||
c.SetLocale()
|
||||
userInfo := c.GetUserInfo()
|
||||
userInfo := c.GetUserAndBlogUrl()
|
||||
|
||||
userId := userInfo.UserId.Hex()
|
||||
|
||||
@@ -138,13 +138,13 @@ func (c Note) Index(noteId, online string) revel.Result {
|
||||
// 已登录, 得到用户基本信息(notebook, shareNotebook), 跳转到index.html中
|
||||
// 否则, 转向登录页面
|
||||
func (c Note) ListNotes(notebookId string) revel.Result {
|
||||
_, notes := noteService.ListNotes(c.GetUserId(), notebookId, false, c.GetPage(), pageSize, defaultSortField, false, false);
|
||||
_, notes := noteService.ListNotes(c.GetUserId(), notebookId, false, c.GetPage(), pageSize, defaultSortField, false, false)
|
||||
return c.RenderJson(notes)
|
||||
}
|
||||
|
||||
// 得到trash
|
||||
func (c Note) ListTrashNotes() revel.Result {
|
||||
_, notes := noteService.ListNotes(c.GetUserId(), "", true, c.GetPage(), pageSize, defaultSortField, false, false);
|
||||
_, notes := noteService.ListNotes(c.GetUserId(), "", true, c.GetPage(), pageSize, defaultSortField, false, false)
|
||||
return c.RenderJson(notes)
|
||||
}
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@ func (c User) Account(tab int) revel.Result {
|
||||
|
||||
// 修改用户名, 需要重置session
|
||||
func (c User) UpdateUsername(username string) revel.Result {
|
||||
re := info.NewRe();
|
||||
if(c.GetUsername() == "demo") {
|
||||
re := info.NewRe()
|
||||
if c.GetUserId() == configService.GetGlobalStringConfig("demoUserId") {
|
||||
re.Msg = "cannotUpdateDemo"
|
||||
return c.RenderRe(re);
|
||||
}
|
||||
@@ -48,8 +48,8 @@ func (c User) UpdateUsername(username string) revel.Result {
|
||||
|
||||
// 修改密码
|
||||
func (c User) UpdatePwd(oldPwd, pwd string) revel.Result {
|
||||
re := info.NewRe();
|
||||
if(c.GetUsername() == "demo") {
|
||||
re := info.NewRe()
|
||||
if c.GetUserId() == configService.GetGlobalStringConfig("demoUserId") {
|
||||
re.Msg = "cannotUpdateDemo"
|
||||
return c.RenderRe(re);
|
||||
}
|
||||
@@ -94,9 +94,9 @@ func (c User) ReSendActiveEmail() revel.Result {
|
||||
}
|
||||
|
||||
// 修改Email发送激活邮箱
|
||||
func (c User) UpdateEmailSendActiveEmail(email string) revel.Result {
|
||||
func (c User) updateEmailSendActiveEmail(email, pwd string) revel.Result {
|
||||
re := info.NewRe()
|
||||
if(c.GetUsername() == "demo") {
|
||||
if c.GetUserId() == configService.GetGlobalStringConfig("demoUserId") {
|
||||
re.Msg = "cannotUpdateDemo"
|
||||
return c.RenderJson(re);
|
||||
}
|
||||
|
||||
@@ -25,13 +25,13 @@ func (c ApiAuth) Login(email, pwd string) revel.Result {
|
||||
var msg = ""
|
||||
|
||||
userInfo, err := authService.Login(email, pwd)
|
||||
if err != nil {
|
||||
// 登录错误, 则错误次数++
|
||||
msg = "wrongUsernameOrPassword"
|
||||
} else {
|
||||
if err == nil {
|
||||
token := bson.NewObjectId().Hex()
|
||||
sessionService.SetUserId(token, userInfo.UserId.Hex())
|
||||
return c.RenderJson(info.AuthOk{Ok: true, Token: token, UserId: userInfo.UserId, Email: userInfo.Email, Username: userInfo.Username})
|
||||
} else {
|
||||
// 登录错误, 则错误次数++
|
||||
msg = "wrongUsernameOrPassword"
|
||||
}
|
||||
return c.RenderJson(info.ApiRe{Ok: false, Msg: c.Message(msg)})
|
||||
}
|
||||
|
||||
@@ -74,7 +74,9 @@ func (c ApiBaseContrller) uploadAttach(name string, noteId string) (ok bool, msg
|
||||
}
|
||||
|
||||
// 生成上传路径
|
||||
filePath := "files/" + userId + "/attachs"
|
||||
newGuid := NewGuid()
|
||||
filePath := "files/" + Digest3(userId) + "/" + userId + "/" + Digest2(newGuid) + "/attachs"
|
||||
|
||||
dir := revel.BasePath + "/" + filePath
|
||||
err = os.MkdirAll(dir, 0755)
|
||||
if err != nil {
|
||||
@@ -83,7 +85,7 @@ func (c ApiBaseContrller) uploadAttach(name string, noteId string) (ok bool, msg
|
||||
// 生成新的文件名
|
||||
filename := handel.Filename
|
||||
_, ext := SplitFilename(filename) // .doc
|
||||
filename = NewGuid() + ext
|
||||
filename = newGuid + ext
|
||||
toPath := dir + "/" + filename;
|
||||
err = ioutil.WriteFile(toPath, data, 0777)
|
||||
if err != nil {
|
||||
@@ -124,8 +126,12 @@ func (c ApiBaseContrller) upload(name string, noteId string, isAttach bool) (ok
|
||||
return
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
newGuid := NewGuid()
|
||||
// 生成上传路径
|
||||
fileUrlPath := "files/" + c.getUserId() + "/images"
|
||||
userId := c.getUserId()
|
||||
fileUrlPath := "files/" + Digest3(userId) + "/" + userId + "/" + Digest2(newGuid) + "/images"
|
||||
|
||||
dir := revel.BasePath + "/" + fileUrlPath
|
||||
err = os.MkdirAll(dir, 0755)
|
||||
if err != nil {
|
||||
@@ -139,7 +145,7 @@ func (c ApiBaseContrller) upload(name string, noteId string, isAttach bool) (ok
|
||||
return
|
||||
}
|
||||
|
||||
filename = NewGuid() + ext
|
||||
filename = newGuid + ext
|
||||
data, err := ioutil.ReadAll(file)
|
||||
if err != nil {
|
||||
return
|
||||
|
||||
@@ -70,6 +70,7 @@ func (c ApiNote) GetNotes(notebookId string) revel.Result {
|
||||
func (c ApiNote) GetTrashNotes() revel.Result {
|
||||
_, notes := noteService.ListNotes(c.getUserId(), "", true, c.GetPage(), pageSize, defaultSortField, false, false)
|
||||
return c.RenderJson(noteService.ToApiNotes(notes))
|
||||
|
||||
}
|
||||
|
||||
// get Note
|
||||
|
||||
@@ -68,7 +68,7 @@ var commonUrl = map[string]map[string]bool{"Index": map[string]bool{"Index": tru
|
||||
},
|
||||
"Oauth": map[string]bool{"GithubCallback": true},
|
||||
"File": map[string]bool{"OutputImage": true, "OutputFile": true},
|
||||
"Attach": map[string]bool{"Download": true, "DownloadAll": true},
|
||||
"Attach": map[string]bool{"Download": true/*, "DownloadAll": true*/},
|
||||
}
|
||||
|
||||
func needValidate(controller, method string) bool {
|
||||
|
||||
@@ -355,3 +355,20 @@ func Err(err error) bool {
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// 检查mognodb是否lost connection
|
||||
// 每个请求之前都要检查!!
|
||||
func CheckMongoSessionLost() {
|
||||
// fmt.Println("检查CheckMongoSessionLostErr")
|
||||
err := Session.Ping()
|
||||
if err != nil {
|
||||
Log("Lost connection to db!")
|
||||
Session.Refresh()
|
||||
err = Session.Ping()
|
||||
if err == nil {
|
||||
Log("Reconnect to db successful.")
|
||||
} else {
|
||||
Log("重连失败!!!! 警告")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -70,6 +70,13 @@ type UserAccount struct {
|
||||
MaxPerAttachSize int `bson:"MaxPerAttachSize" json:"-"` // 单个附件大小
|
||||
}
|
||||
|
||||
// note主页需要
|
||||
type UserAndBlogUrl struct {
|
||||
User
|
||||
BlogUrl string `BlogUrl`
|
||||
PostUrl string `PostUrl`
|
||||
}
|
||||
|
||||
// 用户与博客信息结合, 公开
|
||||
type UserAndBlog struct {
|
||||
UserId bson.ObjectId `bson:"_id,omitempty"` // 必须要设置bson:"_id" 不然mgo不会认为是主键
|
||||
|
||||
+103
-45
@@ -11,6 +11,8 @@ import (
|
||||
"gopkg.in/mgo.v2/bson"
|
||||
"time"
|
||||
"strings"
|
||||
"github.com/PuerkitoBio/goquery"
|
||||
"bytes"
|
||||
math_rand "math/rand"
|
||||
)
|
||||
|
||||
@@ -23,6 +25,22 @@ func Md5(s string) string {
|
||||
return hex.EncodeToString(h.Sum(nil))
|
||||
}
|
||||
|
||||
// 3位数的转换, 为了用bson.id -> 3位数
|
||||
func Digest3(str string) string {
|
||||
var b rune = 0
|
||||
for _, k := range str {
|
||||
b += k
|
||||
}
|
||||
return fmt.Sprintf("%d", b % 1000)
|
||||
}
|
||||
func Digest2(str string) string {
|
||||
var b rune = 0
|
||||
for _, k := range str {
|
||||
b += k
|
||||
}
|
||||
return fmt.Sprintf("%d", b % 100)
|
||||
}
|
||||
|
||||
// Guid
|
||||
func NewGuid() string {
|
||||
b := make([]byte, 48)
|
||||
@@ -124,73 +142,48 @@ func ReplaceAll(oldStr, pattern, newStr string) string {
|
||||
}
|
||||
|
||||
// 获取纯文本
|
||||
func SubStringHTMLToRaw(param string, length int) (result string) {
|
||||
func SubStringHTMLToRaw(param string, length int) string {
|
||||
if param == "" {
|
||||
return ""
|
||||
return param
|
||||
}
|
||||
result = ""
|
||||
n := 0
|
||||
var temp rune // 中文问题, 用rune来解决
|
||||
rStr := []rune(param)
|
||||
lenStr := len(rStr)
|
||||
isCode := false
|
||||
for i := 0; i < len(rStr); i++ {
|
||||
|
||||
resultRune := make([]rune, length)
|
||||
// s := ""
|
||||
for i := 0; i < lenStr; i++ {
|
||||
temp = rStr[i]
|
||||
if temp == '<' {
|
||||
isCode = true
|
||||
continue
|
||||
} else if temp == '>' {
|
||||
isCode = false
|
||||
result += " "; // 空格
|
||||
resultRune[n] = ' ';
|
||||
|
||||
n++
|
||||
if n >= length {
|
||||
break
|
||||
}
|
||||
continue
|
||||
}
|
||||
if !isCode {
|
||||
result += string(temp)
|
||||
resultRune[n] = temp;
|
||||
// s += string(temp)
|
||||
n++
|
||||
if n >= length {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
result := string(resultRune[0:n])
|
||||
return strings.Trim(result, " ")
|
||||
}
|
||||
|
||||
// 获取摘要, HTML
|
||||
func SubStringHTML(param string, length int, end string) string {
|
||||
if param == "" {
|
||||
return ""
|
||||
}
|
||||
|
||||
// 先取出<pre></pre>占位..
|
||||
result := ""
|
||||
|
||||
// 1
|
||||
n := 0
|
||||
var temp rune // 中文问题, 用rune来解决
|
||||
isCode := false //是不是HTML代码
|
||||
isHTML := false //是不是HTML特殊字符,如
|
||||
rStr := []rune(param)
|
||||
for i := 0; i < len(rStr); i++ {
|
||||
temp = rStr[i]
|
||||
if temp == '<' {
|
||||
isCode = true
|
||||
} else if temp == '&' {
|
||||
isHTML = true
|
||||
} else if temp == '>' && isCode {
|
||||
n = n - 1
|
||||
isCode = false
|
||||
} else if temp == ';' && isHTML {
|
||||
isHTML = false
|
||||
}
|
||||
if !isCode && !isHTML {
|
||||
n = n + 1
|
||||
}
|
||||
result += string(temp)
|
||||
if n >= length {
|
||||
break
|
||||
}
|
||||
}
|
||||
result += end
|
||||
|
||||
// 自带方法补全html
|
||||
func fixHtml(result string) string {
|
||||
// 取出所有标签
|
||||
tempResult := ReplaceAll(result, "(>)[^<>]*(<?)", "$1$2") // 把标签中间的所有内容都去掉了
|
||||
|
||||
@@ -233,6 +226,71 @@ func SubStringHTML(param string, length int, end string) string {
|
||||
return result
|
||||
}
|
||||
|
||||
// 获取摘要, HTML
|
||||
func SubStringHTML(param string, length int, end string) string {
|
||||
if param == "" {
|
||||
return param
|
||||
}
|
||||
result := ""
|
||||
|
||||
rStr := []rune(param)
|
||||
lenStr := len(rStr)
|
||||
|
||||
if lenStr <= length {
|
||||
result = param
|
||||
} else {
|
||||
// 1
|
||||
n := 0
|
||||
var temp rune // 中文问题, 用rune来解决
|
||||
isCode := false //是不是HTML代码
|
||||
isHTML := false //是不是HTML特殊字符,如
|
||||
var i = 0;
|
||||
for ; i < lenStr; i++ {
|
||||
temp = rStr[i]
|
||||
if temp == '<' {
|
||||
isCode = true
|
||||
} else if temp == '&' {
|
||||
isHTML = true
|
||||
} else if temp == '>' && isCode {
|
||||
// n = n - 1
|
||||
isCode = false
|
||||
} else if temp == ';' && isHTML {
|
||||
isHTML = false
|
||||
}
|
||||
if !isCode && !isHTML {
|
||||
n = n + 1
|
||||
}
|
||||
// 每一次都相加, 速度非常慢!, 重新分配内存, 7倍的差距
|
||||
// result += string(temp)
|
||||
if n >= length {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
result = string(rStr[0:i])
|
||||
|
||||
if end != "" {
|
||||
result += end
|
||||
}
|
||||
}
|
||||
|
||||
// 使用goquery来取出html, 为了补全html
|
||||
htmlReader := bytes.NewBufferString(result)
|
||||
dom, err1 := goquery.NewDocumentFromReader(htmlReader)
|
||||
if err1 == nil {
|
||||
html, _ := dom.Html()
|
||||
html = strings.Replace(html, "<html><head></head><body>", "", 1)
|
||||
html = strings.Replace(html, "</body></html>", "", 1)
|
||||
|
||||
// TODO 把style="float: left"去掉
|
||||
return html
|
||||
|
||||
// 如果有错误, 则使用自己的方法补全, 有风险
|
||||
} else {
|
||||
return fixHtml(result)
|
||||
}
|
||||
}
|
||||
|
||||
// 是否是合格的密码
|
||||
func IsGoodPwd(pwd string) (bool, string) {
|
||||
if pwd == "" {
|
||||
@@ -249,7 +307,7 @@ func IsEmail(email string) bool {
|
||||
if email == "" {
|
||||
return false;
|
||||
}
|
||||
ok, _ := regexp.MatchString(`^([a-zA-Z0-9]+[_|\_|\.|\-]?)*[a-z\-A-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.|\-]?)*[a-zA-Z0-9\-]+\.[0-9a-zA-Z]{2,3}$`, email)
|
||||
ok, _ := regexp.MatchString(`^([a-zA-Z0-9]+[_|\_|\.|\-]?)*[_a-z\-A-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.|\-]?)*[a-zA-Z0-9\-]+\.[0-9a-zA-Z]{2,6}$`, email)
|
||||
return ok
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package route
|
||||
|
||||
import (
|
||||
"github.com/revel/revel"
|
||||
// "github.com/leanote/leanote/app/service"
|
||||
"github.com/leanote/leanote/app/db"
|
||||
// . "github.com/leanote/leanote/app/lea"
|
||||
"net/url"
|
||||
"strings"
|
||||
@@ -42,6 +42,10 @@ func RouterFilter(c *revel.Controller, fc []revel.Filter) {
|
||||
}
|
||||
*/
|
||||
if route.ControllerName != "Static" {
|
||||
|
||||
// 检查mongodb 是否lost
|
||||
db.CheckMongoSessionLost()
|
||||
|
||||
// api设置
|
||||
// leanote.com/api/user/get => ApiUser::Get
|
||||
//* /api/login ApiAuth.Login, 这里的设置, 其实已经转成了ApiAuth了
|
||||
|
||||
@@ -63,11 +63,20 @@ func (this *AttachService) updateNoteAttachNum(noteId bson.ObjectId, addNum int)
|
||||
// list attachs
|
||||
func (this *AttachService) ListAttachs(noteId, userId string) []info.Attach {
|
||||
attachs := []info.Attach{}
|
||||
// 判断是否有权限为笔记添加附件
|
||||
if !shareService.HasUpdateNotePerm(noteId, userId) {
|
||||
|
||||
// 判断是否有权限为笔记添加附件, userId为空时表示是分享笔记的附件
|
||||
if userId != "" && !shareService.HasUpdateNotePerm(noteId, userId) {
|
||||
return attachs
|
||||
}
|
||||
|
||||
// 笔记是否是自己的
|
||||
note := noteService.GetNoteByIdAndUserId(noteId, userId)
|
||||
if note.NoteId == "" {
|
||||
return attachs
|
||||
}
|
||||
|
||||
// TODO 这里, 优化权限控制
|
||||
|
||||
db.ListByQ(db.Attachs, bson.M{"NoteId": bson.ObjectIdHex(noteId)}, &attachs)
|
||||
|
||||
return attachs
|
||||
|
||||
@@ -45,7 +45,9 @@ func (this *BlogService) GetBlogByIdAndUrlTitle(userId string, noteIdOrUrlTitle
|
||||
return this.GetBlog(noteIdOrUrlTitle)
|
||||
}
|
||||
note := info.Note{}
|
||||
db.GetByQ(db.Notes, bson.M{"UserId": bson.ObjectIdHex(userId), "UrlTitle": encodeValue(noteIdOrUrlTitle), "IsBlog": true, "IsTrash": false}, ¬e)
|
||||
db.GetByQ(db.Notes, bson.M{"UserId": bson.ObjectIdHex(userId), "UrlTitle": encodeValue(noteIdOrUrlTitle),
|
||||
"IsBlog": true,
|
||||
"IsTrash": false, "IsDeleted": false}, ¬e)
|
||||
return this.GetBlogItem(note)
|
||||
}
|
||||
|
||||
@@ -56,7 +58,7 @@ func (this *BlogService) GetBlog(noteId string) (blog info.BlogItem) {
|
||||
}
|
||||
func (this *BlogService) GetBlogItem(note info.Note) (blog info.BlogItem) {
|
||||
if note.NoteId == "" || !note.IsBlog {
|
||||
return
|
||||
return info.BlogItem{}
|
||||
}
|
||||
|
||||
// 内容
|
||||
@@ -131,7 +133,8 @@ func (this *BlogService) ListBlogs(userId, notebookId string, page, pageSize int
|
||||
func (this *BlogService) GetBlogTags(userId string) []info.TagCount {
|
||||
// 得到所有博客
|
||||
tagCounts := []info.TagCount{}
|
||||
query := bson.M{"UserId": bson.ObjectIdHex(userId), "IsBlog": true}
|
||||
// tag不能为空
|
||||
query := bson.M{"UserId": bson.ObjectIdHex(userId), "IsBlog": true, "Tag": bson.M{"$ne": ""}}
|
||||
db.TagCounts.Find(query).Sort("-Count").All(&tagCounts)
|
||||
return tagCounts
|
||||
}
|
||||
@@ -142,7 +145,7 @@ func (this *BlogService) ReCountBlogTags(userId string) bool {
|
||||
// 得到所有博客
|
||||
notes := []info.Note{}
|
||||
userIdO := bson.ObjectIdHex(userId)
|
||||
query := bson.M{"UserId": userIdO, "IsTrash": false, "IsBlog": true}
|
||||
query := bson.M{"UserId": userIdO, "IsTrash": false, "IsDeleted": false, "IsBlog": true}
|
||||
db.ListByQWithFields(db.Notes, query, []string{"Tags"}, ¬es)
|
||||
|
||||
db.DeleteAll(db.TagCounts, bson.M{"UserId": userIdO, "IsBlog": true})
|
||||
@@ -184,7 +187,7 @@ Posts: []
|
||||
*/
|
||||
func (this *BlogService) ListBlogsArchive(userId, notebookId string, year, month int, sortField string, isAsc bool) []info.Archive {
|
||||
// _, notes := noteService.ListNotes(userId, notebookId, false, 1, 99999, sortField, isAsc, true);
|
||||
q := bson.M{"UserId": bson.ObjectIdHex(userId), "IsBlog": true, "IsTrash": false}
|
||||
q := bson.M{"UserId": bson.ObjectIdHex(userId), "IsBlog": true, "IsTrash": false, "IsDeleted": false}
|
||||
if notebookId != "" {
|
||||
q["NotebookId"] = bson.ObjectIdHex(notebookId)
|
||||
}
|
||||
@@ -292,6 +295,7 @@ func (this *BlogService) SearchBlogByTags(tags []string, userId string, pageNumb
|
||||
// 不是trash的
|
||||
query := bson.M{"UserId": bson.ObjectIdHex(userId),
|
||||
"IsTrash": false,
|
||||
"IsDeleted": false,
|
||||
"IsBlog": true,
|
||||
"Tags": bson.M{"$all": tags}}
|
||||
|
||||
@@ -393,10 +397,12 @@ func (this *BlogService) PreNextBlog(userId string, sorterField string, isAsc bo
|
||||
sortFieldR2 = sorterField
|
||||
}
|
||||
|
||||
// 1
|
||||
// 上一篇, 比基时间要小, 但是是最后一篇, 所以是降序
|
||||
note := info.Note{}
|
||||
query := bson.M{"UserId": userIdO,
|
||||
"IsTrash": false,
|
||||
"IsDeleted": false,
|
||||
"IsBlog": true,
|
||||
"_id": bson.M{"$ne": bson.ObjectIdHex(noteId)},
|
||||
sorterField: sortFieldT1,
|
||||
@@ -430,7 +436,7 @@ func (this *BlogService) ListAllBlogs(userId, tag string, keywords string, isRec
|
||||
skipNum, sortFieldR := parsePageAndSort(page, pageSize, sorterField, isAsc)
|
||||
|
||||
// 不是trash的
|
||||
query := bson.M{"IsTrash": false, "IsBlog": true, "Title": bson.M{"$ne": "欢迎来到leanote!"}}
|
||||
query := bson.M{"IsTrash": false, "IsDeleted": false, "IsBlog": true, "Title": bson.M{"$ne": "欢迎来到leanote!"}}
|
||||
if tag != "" {
|
||||
query["Tags"] = bson.M{"$in": []string{tag}}
|
||||
}
|
||||
@@ -496,6 +502,9 @@ func (this *BlogService) ListAllBlogs(userId, tag string, keywords string, isRec
|
||||
content = noteContent.Abstract
|
||||
}
|
||||
*/
|
||||
if len(note.Tags) == 1 && note.Tags[0] == "" {
|
||||
note.Tags = nil
|
||||
}
|
||||
blogs[i] = info.BlogItem{note, "", content, hasMore, userMap[note.UserId]}
|
||||
}
|
||||
pageInfo = info.NewPage(page, pageSize, count, nil)
|
||||
|
||||
@@ -21,14 +21,26 @@ func (this *NoteService) GetNote(noteId, userId string) (note info.Note) {
|
||||
// 不能是已经删除了的, life bug, 客户端删除后, 竟然还能在web上打开
|
||||
func (this *NoteService) GetNoteById(noteId string) (note info.Note) {
|
||||
note = info.Note{}
|
||||
if noteId == "" {
|
||||
return
|
||||
}
|
||||
db.GetByQ(db.Notes, bson.M{"_id": bson.ObjectIdHex(noteId), "IsDeleted": false}, ¬e)
|
||||
return
|
||||
}
|
||||
func (this *NoteService) GetNoteByIdAndUserId(noteId, userId string) (note info.Note) {
|
||||
note = info.Note{}
|
||||
if noteId == "" || userId == "" {
|
||||
return
|
||||
}
|
||||
db.GetByQ(db.Notes, bson.M{"_id": bson.ObjectIdHex(noteId), "UserId": bson.ObjectIdHex(userId), "IsDeleted": false}, ¬e)
|
||||
return
|
||||
}
|
||||
// 得到blog, blogService用
|
||||
// 不要传userId, 因为是公开的
|
||||
func (this *NoteService) GetBlogNote(noteId string) (note info.Note) {
|
||||
note = info.Note{}
|
||||
db.GetByQ(db.Notes, bson.M{"_id": bson.ObjectIdHex(noteId), "IsBlog": true, "IsTrash": false}, ¬e)
|
||||
db.GetByQ(db.Notes, bson.M{"_id": bson.ObjectIdHex(noteId),
|
||||
"IsBlog": true, "IsTrash": false, "IsDeleted": false}, ¬e)
|
||||
return
|
||||
}
|
||||
// 通过id, userId得到noteContent
|
||||
@@ -418,7 +430,7 @@ func (this *NoteService) UpdateNote(updatedUserId, noteId string, needUpdate bso
|
||||
if isBlog, ok := needUpdate["IsBlog"]; ok {
|
||||
isBlog2 := isBlog.(bool)
|
||||
if note.IsBlog != isBlog2 {
|
||||
db.UpdateByIdAndUserIdMap(db.NoteContents, noteId, userId, bson.M{"IsBlog": isBlog2})
|
||||
this.UpdateNoteContentIsBlog(noteId, userId, isBlog2);
|
||||
|
||||
// 重新发布成博客
|
||||
if !note.IsBlog {
|
||||
@@ -459,6 +471,11 @@ func (this *NoteService) UpdateNote(updatedUserId, noteId string, needUpdate bso
|
||||
return true, "", afterUsn
|
||||
}
|
||||
|
||||
// 当设置/取消了笔记为博客
|
||||
func (this *NoteService) UpdateNoteContentIsBlog(noteId, userId string, isBlog bool) {
|
||||
db.UpdateByIdAndUserIdMap(db.NoteContents, noteId, userId, bson.M{"IsBlog": isBlog})
|
||||
}
|
||||
|
||||
// 附件修改, 增加noteIncr
|
||||
func (this *NoteService) IncrNoteUsn(noteId, userId string) int {
|
||||
afterUsn := userService.IncrUsn(userId)
|
||||
@@ -572,6 +589,8 @@ func (this *NoteService) ToBlog(userId, noteId string, isBlog, isTop bool) bool
|
||||
ok := db.UpdateByIdAndUserIdMap(db.Notes, noteId, userId, noteUpdate)
|
||||
// 重新计算tags
|
||||
go (func() {
|
||||
this.UpdateNoteContentIsBlog(noteId, userId, isBlog);
|
||||
|
||||
blogService.ReCountBlogTags(userId)
|
||||
})()
|
||||
return ok
|
||||
@@ -734,6 +753,7 @@ func (this *NoteService) SearchNote(key, userId string, pageNumber, pageSize int
|
||||
// 不是trash的
|
||||
query := bson.M{"UserId": bson.ObjectIdHex(userId),
|
||||
"IsTrash": false,
|
||||
"IsDeleted": false, // 不能搜索已删除了的
|
||||
"$or": orQ,
|
||||
}
|
||||
if isBlog {
|
||||
@@ -819,14 +839,14 @@ func (this *NoteService) SearchNoteByTags(tags []string, userId string, pageNumb
|
||||
//------------
|
||||
// 统计
|
||||
func (this *NoteService) CountNote(userId string) int {
|
||||
q := bson.M{"IsTrash": false}
|
||||
q := bson.M{"IsTrash": false, "IsDeleted": false}
|
||||
if userId != "" {
|
||||
q["UserId"] = bson.ObjectIdHex(userId)
|
||||
}
|
||||
return db.Count(db.Notes, q)
|
||||
}
|
||||
func (this *NoteService) CountBlog(userId string) int {
|
||||
q := bson.M{"IsBlog": true, "IsTrash": false}
|
||||
q := bson.M{"IsBlog": true, "IsTrash": false, "IsDeleted": false}
|
||||
if userId != "" {
|
||||
q["UserId"] = bson.ObjectIdHex(userId)
|
||||
}
|
||||
|
||||
@@ -85,13 +85,13 @@ func (this *ThemeService) getDefaultTheme(style string) info.Theme {
|
||||
|
||||
// 用户的主题路径设置
|
||||
func (this *ThemeService) getUserThemeBasePath(userId string) string {
|
||||
return revel.BasePath + "/public/upload/" + userId + "/themes"
|
||||
return revel.BasePath + "/public/upload/" + Digest3(userId) + "/" + userId + "/themes"
|
||||
}
|
||||
func (this *ThemeService) getUserThemePath(userId, themeId string) string {
|
||||
return this.getUserThemeBasePath(userId) + "/" + themeId
|
||||
}
|
||||
func (this *ThemeService) getUserThemePath2(userId, themeId string) string {
|
||||
return "public/upload/" + userId + "/themes/" + themeId
|
||||
return "public/upload/" + Digest3(userId) + "/" + userId + "/themes/" + themeId
|
||||
}
|
||||
|
||||
// 新建主题
|
||||
@@ -412,10 +412,18 @@ func (this *ThemeService) ImportTheme(userId, path string) (ok bool, msg string)
|
||||
themeIdO := bson.NewObjectId()
|
||||
themeId := themeIdO.Hex()
|
||||
targetPath := this.getUserThemePath(userId, themeId) // revel.BasePath + "/public/upload/" + userId + "/themes/" + themeId
|
||||
if ok, msg = archive.Unzip(path, targetPath); !ok {
|
||||
DeleteFile(targetPath)
|
||||
|
||||
err := os.MkdirAll(targetPath, 0755)
|
||||
if err != nil {
|
||||
msg = "error"
|
||||
return
|
||||
}
|
||||
if ok, msg = archive.Unzip(path, targetPath); !ok {
|
||||
DeleteFile(targetPath)
|
||||
Log("oh no")
|
||||
return
|
||||
}
|
||||
|
||||
// 主题验证
|
||||
if ok, msg = this.ValidateTheme(targetPath, "", ""); !ok {
|
||||
DeleteFile(targetPath)
|
||||
|
||||
@@ -69,6 +69,13 @@ func (this *UserService) GetUsername(userId string) string {
|
||||
return user.Username
|
||||
}
|
||||
|
||||
// 得到用户名
|
||||
func (this *UserService) GetUsernameById(userId bson.ObjectId) string {
|
||||
user := info.User{}
|
||||
db.GetByQWithFields(db.Users, bson.M{"_id": userId}, []string{"Username"}, &user)
|
||||
return user.Username
|
||||
}
|
||||
|
||||
// 是否存在该用户 email
|
||||
func (this *UserService) IsExistsUser(email string) bool {
|
||||
if this.GetUserId(email) == "" {
|
||||
@@ -107,6 +114,13 @@ func (this *UserService) setUserLogo(user *info.User) {
|
||||
}
|
||||
}
|
||||
|
||||
// 仅得到用户
|
||||
func (this *UserService) GetUser(userId string) info.User {
|
||||
user := info.User{}
|
||||
db.Get(db.Users, userId, &user)
|
||||
return user
|
||||
}
|
||||
|
||||
// 得到用户信息 userId
|
||||
func (this *UserService) GetUserInfo(userId string) info.User {
|
||||
user := info.User{}
|
||||
@@ -202,6 +216,20 @@ func (this *UserService) MapUserAndBlogByUserIds(userIds []bson.ObjectId) map[st
|
||||
return userAndBlogMap
|
||||
}
|
||||
|
||||
// 得到用户信息+博客主页
|
||||
func (this *UserService) GetUserAndBlogUrl(userId string) info.UserAndBlogUrl {
|
||||
user := this.GetUserInfo(userId)
|
||||
userBlog := blogService.GetUserBlog(userId)
|
||||
|
||||
blogUrls := blogService.GetBlogUrls(&userBlog, &user)
|
||||
|
||||
return info.UserAndBlogUrl{
|
||||
User: user,
|
||||
BlogUrl: blogUrls.IndexUrl,
|
||||
PostUrl: blogUrls.PostUrl,
|
||||
}
|
||||
}
|
||||
|
||||
// 得到userAndBlog公开信息
|
||||
func (this *UserService) GetUserAndBlog(userId string) info.UserAndBlog {
|
||||
user := this.GetUserInfo(userId)
|
||||
@@ -362,7 +390,7 @@ func (this *UserService) UpdateEmail(token string) (ok bool, msg, email string)
|
||||
tokenInfo := info.Token{}
|
||||
if ok, msg, tokenInfo = tokenService.VerifyToken(token, info.TokenUpdateEmail); ok {
|
||||
// 修改之后的邮箱
|
||||
email = tokenInfo.Email
|
||||
email = strings.ToLower(tokenInfo.Email)
|
||||
// 先验证该email是否被注册了
|
||||
if userService.IsExistsUser(email) {
|
||||
ok = false
|
||||
|
||||
+13
-2
@@ -99,16 +99,17 @@ func encodeValue(val string) string {
|
||||
v.Set("", val)
|
||||
return v.Encode()[1:]
|
||||
}
|
||||
|
||||
// 添加笔记时通过title得到urlTitle
|
||||
func fixUrlTitle(urlTitle string) string {
|
||||
if urlTitle != "" {
|
||||
// 把特殊字段给替换掉
|
||||
// str := `life "%&()+,/:;<>=?@\|`
|
||||
// str := `life "%&()+,/:;<>=?@\|`
|
||||
reg, _ := regexp.Compile("/|#|\\$|!|\\^|\\*|'| |\"|%|&|\\(|\\)|\\+|\\,|/|:|;|<|>|=|\\?|@|\\||\\\\")
|
||||
urlTitle = reg.ReplaceAllString(urlTitle, "-")
|
||||
urlTitle = strings.Trim(urlTitle, "-") // 左右单独的-去掉
|
||||
// 把空格替换成-
|
||||
// urlTitle = strings.Replace(urlTitle, " ", "-", -1)
|
||||
// urlTitle = strings.Replace(urlTitle, " ", "-", -1)
|
||||
for strings.Index(urlTitle, "--") >= 0 { // 防止出现连续的--
|
||||
urlTitle = strings.Replace(urlTitle, "--", "-", -1)
|
||||
}
|
||||
@@ -119,6 +120,15 @@ func fixUrlTitle(urlTitle string) string {
|
||||
|
||||
func getUniqueUrlTitle(userId string, urlTitle string, types string, padding int) string {
|
||||
urlTitle2 := urlTitle
|
||||
|
||||
// 判断urlTitle是不是过长, 过长则截断, 300
|
||||
// 不然生成index有问题
|
||||
// it will not index a single field with more than 1024 bytes.
|
||||
// If you're indexing a field that is 2.5MB, it's not really indexing it, it's being skipped.
|
||||
if len(urlTitle2) > 320 {
|
||||
urlTitle2 = urlTitle2[:300] // 为什么要少些, 因为怕无限循环, 因为把padding截了
|
||||
}
|
||||
|
||||
if padding > 1 {
|
||||
urlTitle2 = urlTitle + "-" + strconv.Itoa(padding)
|
||||
}
|
||||
@@ -139,6 +149,7 @@ func getUniqueUrlTitle(userId string, urlTitle string, types string, padding int
|
||||
|
||||
return urlTitle2
|
||||
}
|
||||
|
||||
// types == note,notebook,single
|
||||
func GetUrTitle(userId string, title string, types string) string {
|
||||
urlTitle := strings.Trim(title, " ")
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
</section>
|
||||
<div id="boxFooter">
|
||||
<p>
|
||||
<a href="/index">leanote</a> © 2014
|
||||
<a href="/index">leanote</a> © 2015
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
</section>
|
||||
<div id="boxFooter">
|
||||
<p>
|
||||
<a href="/index">leanote</a> © 2014
|
||||
<a href="/index">leanote</a> © 2015
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -8,14 +8,16 @@
|
||||
<br />
|
||||
leanote@leanote.com
|
||||
<br />
|
||||
Copyright © 2014-2015 <a href="http://leanote.com">Leanote</a>
|
||||
Copyright © 2014-2015 <a href="https://leanote.com">Leanote</a>
|
||||
<br />
|
||||
Powered by <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>
|
||||
<a href="https://github.com/leanote/leanote">Github Leanote</a>
|
||||
<br />
|
||||
QQ Group: 158716820
|
||||
QQ Group: 158716820, 158716820
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="keywords" content="leanote,leanote.com">
|
||||
<meta name="description" content="Leanote, {{msg $ "moto"}}">
|
||||
<meta property="qc:admins" content="2451332115167456375" />
|
||||
<meta name="author" content="leanote">
|
||||
<title>{{.title}}</title>
|
||||
|
||||
@@ -46,16 +45,16 @@ function log(o) {
|
||||
|
||||
<ul class="nav navbar-nav navbar-left">
|
||||
<li><a href="/index#" data-target="body" class="smooth-scroll">{{msg . "home"}}</a></li>
|
||||
<li style="position: relative;">
|
||||
<a id="" href="http://leanote.com/service" title="" class="">{{msg . "service"}}</a>
|
||||
<div class="red-circle" style=""></div>
|
||||
</li>
|
||||
|
||||
<li style="position: relative; margin-right: 3px;">
|
||||
<a href="http://bbs.leanote.com" target="_blank" class="">{{msg . "discussion"}}</a>
|
||||
</li>
|
||||
<li><a id="leanoteBlog" href="http://lea.leanote.com" target="_blank" title="lea++, leanote blog platform" class="">lea++</a></li>
|
||||
|
||||
<li><a id="leanoteBlog" href="http://lea.leanote.com" target="_blank" title="Lea++, leanote blog platform" class="">Lea++</a></li>
|
||||
<li><a id="leanoteApp" href="http://app.leanote.com" target="_blank" title="Leanote App" class="">{{msg . "desktopApp"}}</a></li>
|
||||
<li>
|
||||
<a href="http://leanote.org#donate" target="_blank" class="">{{msg . "donate"}}</a>
|
||||
</li>
|
||||
|
||||
<li><a href="http://leanote.org" target="_blank" title="leanote.org" class="">leanote.org</a></li>
|
||||
|
||||
{{if .userInfo.Email}}
|
||||
|
||||
+35
-79
@@ -1,26 +1,22 @@
|
||||
{{template "home/header.html" .}}
|
||||
<style>
|
||||
|
||||
</style>
|
||||
<section>
|
||||
<div class="header">
|
||||
<h2>leanote, {{msg . "moto"}}</h2>
|
||||
<h2>Leanote, {{msg . "moto"}}</h2>
|
||||
<p>{{msg . "moto3"}}</p>
|
||||
<p>{{msg . "moto2"}}</p>
|
||||
|
||||
<div>
|
||||
<a class="btn btn-primary" href="https://github.com/leanote/leanote">{{msg . "fork github"}}</a>
|
||||
<a class="btn btn-default btn-primary" href="/register">{{msg . "register"}}</a>
|
||||
|
||||
|
||||
<a class="btn btn-default" href="/demo">{{msg . "try"}}</a>
|
||||
{{if .openRegister}}
|
||||
{{if not .userInfo.UserId}}
|
||||
<a class="btn btn-default" href="/login">{{msg . "login"}}</a>
|
||||
|
||||
|
||||
OR
|
||||
|
||||
|
||||
<a class="btn btn-default" href="/register">{{msg . "register"}}</a>
|
||||
{{end}}
|
||||
|
||||
<a class="btn btn-default" href="/demo">{{msg . "try"}}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -29,13 +25,23 @@
|
||||
<div class="img-header">
|
||||
<img src="/images/home/mac-btns.png"/>
|
||||
</div>
|
||||
<img src="/images/home/preview2.png" style="width: 750px;" />
|
||||
<div id="webSliderContainer">
|
||||
<img class="web-slider" data-text="Default theme - markdown" src="/images/slider/v2/default_markdown.png"/>
|
||||
<img class="web-slider hide-img" data-text="Default theme - rich editor" src="/images/slider/v2/simple_tinymce.png"/>
|
||||
<img class="web-slider hide-img" data-text="Simple theme - markdown" src="/images/slider/v2/simple_markdown.png"/>
|
||||
<img class="web-slider hide-img" data-text="Writting mode" src="/images/slider/v2/writting.png"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="slider-desc"><span id="webText">Default theme - markdown</span></div>
|
||||
<div class="mobile">
|
||||
<div class="mobile-header">
|
||||
<img src="/images/home/mac-dot.png" />
|
||||
</div>
|
||||
<img class="mobile-image" src="/images/home/mobile.png" />
|
||||
<div id="mobileSliderContainer">
|
||||
<img class="mobile-slider" data-text="Mobile" src="/images/slider/v2/mobile_simple_list.png" />
|
||||
<img class="mobile-slider hide-img" data-text="Mobile markdown" src="/images/slider/v2/mobile_markdown.png" />
|
||||
</div>
|
||||
<div class="slider-desc mobile-text"><span id="mobileText">Default theme - markdown</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -46,6 +52,10 @@
|
||||
<div class="col-md-3">
|
||||
<h3>{{msg . "knowledge"}}</h3>
|
||||
<p>{{msg . "knowledgeInfo"}}</p>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<h3>{{msg . "blog"}}</h3>
|
||||
<p>{{msg . "blogInfo"}}</p>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<h3>{{msg . "share"}}</h3>
|
||||
@@ -55,81 +65,27 @@
|
||||
<h3>{{msg . "cooperation"}}</h3>
|
||||
<p>{{msg . "cooperationInfo"}}</p>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<h3>{{msg . "blog"}}</h3>
|
||||
<p>{{msg . "blogInfo"}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container" id="download">
|
||||
<h2 style="margin: 20px 0;text-align: center;">{{msg . "download"}}</h2>
|
||||
<div class="row">
|
||||
<div style="width:300px; margin:auto; padding: 10px;">
|
||||
Linux : <a href="https://github.com/leanote/leanote/releases/download/0.4/leanote-linux-v0.4.bin.tar.gz">leanote-linux-v0.4.bin.tar.gz</a> <br />
|
||||
MacOS X : <a href="https://github.com/leanote/leanote/releases/download/0.4/leanote-mac-v0.4.bin.tar.gz">leanote-mac-v0.4.bin.tar.gz</a> <br />
|
||||
<br />
|
||||
<a href="https://github.com/leanote/leanote#3-how-to-install-leanote">{{msg . "howToInstallLeanote"}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container" id="donate">
|
||||
<h2 style="margin: 20px 0;text-align: center;">{{msg . "donate"}}</h2>
|
||||
<div class="row">
|
||||
<div style="width:500px; margin:auto; padding: 10px;">
|
||||
<p>
|
||||
您可以通过支付宝向leanote捐赠, 所捐赠的钱将用来leanote开发.
|
||||
</p>
|
||||
<p>
|
||||
支付宝账号: <b>pay@leanote.com</b>
|
||||
</p>
|
||||
<p>
|
||||
或使用支付宝扫以下二维码捐赠:
|
||||
</p>
|
||||
<p style="text-align: center">
|
||||
<img src="/images/leanote/leanote_alipay.jpg" style="padding: 10px;
|
||||
border: 2px solid #eee;
|
||||
border-radius: 10px;"/>
|
||||
</p>
|
||||
<p>
|
||||
我们会定期将捐赠名单发布在 <a href="http://leanote.com/blog/view/5417ecf81a910828fd000000">捐赠列表</a>
|
||||
</p>
|
||||
<p>
|
||||
感谢您对leanote的支持!
|
||||
</p>
|
||||
|
||||
<hr />
|
||||
|
||||
<p>
|
||||
有任何疑问, 建议或需其它服务或支持, 欢迎联系 <code>leanote@leanote.com</code> 或加入官方QQ群: <code>158716820</code> 谢谢!
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "home/footer.html"}}
|
||||
|
||||
<script src="/js/jquery-1.9.0.min.js"></script>
|
||||
<script src="/js/bootstrap.js"></script>
|
||||
<script>
|
||||
var lang = '{{.locale}}';
|
||||
</script>
|
||||
<script src="/js/home/index.js"></script>
|
||||
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
/*
|
||||
var u = navigator.userAgent;
|
||||
var isMobile = u.indexOf('Android')>-1 || u.indexOf('Linux')>-1;
|
||||
if(isMobile || $("body").width() < 600) {
|
||||
location.href = "/mobile/index";
|
||||
}
|
||||
*/
|
||||
// 平滑滚动
|
||||
$(".smooth-scroll").click(function(e) {
|
||||
e.preventDefault();
|
||||
var t = $(this).attr("target");
|
||||
var targetOffset = $(t).offset().top - 80;
|
||||
$('html,body').animate({scrollTop: targetOffset}, 300);
|
||||
});
|
||||
});
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "//hm.baidu.com/hm.js?d0c988e37b452b3bf1220d45b30f2de2";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,138 +0,0 @@
|
||||
{{template "home/header.html" .}}
|
||||
<style>
|
||||
|
||||
</style>
|
||||
<section>
|
||||
<div class="header">
|
||||
<h2>Leanote, {{msg . "moto"}}</h2>
|
||||
<p>{{msg . "moto3"}}</p>
|
||||
<p>
|
||||
Knowledge, Blog, Sharing, Cooperation... all in leanote
|
||||
</p>
|
||||
<div>
|
||||
<a class="btn btn-primary" href="https://github.com/leanote/leanote">{{msg . "fork github"}}</a>
|
||||
|
||||
|
||||
<a class="btn btn-default" href="/demo">{{msg . "try"}}</a>
|
||||
|
||||
|
||||
<a class="btn btn-default" href="/login">{{msg . "login"}}</a>
|
||||
{{if .openRegister}}
|
||||
|
||||
|
||||
<a class="btn btn-default" href="/register">{{msg . "register"}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="preview" style="position: relative;">
|
||||
<div>
|
||||
<div class="img-header">
|
||||
<img src="/images/home/mac-btns.png"/>
|
||||
</div>
|
||||
<img src="/images/home/preview2.png" style="width: 750px;" />
|
||||
</div>
|
||||
<div class="mobile">
|
||||
<div class="mobile-header">
|
||||
<img src="/images/home/mac-dot.png" />
|
||||
</div>
|
||||
<img class="mobile-image" src="/images/home/mobile.png" />
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="container" id="aboutLeanote">
|
||||
<h2>{{msg . "aboutLeanote"}}</h2>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<h3>{{msg . "knowledge"}}</h3>
|
||||
<p>{{msg . "knowledgeInfo"}}</p>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<h3>{{msg . "share"}}</h3>
|
||||
<p>{{msg . "shareInfo"}}</p>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<h3>{{msg . "cooperation"}}</h3>
|
||||
<p>{{msg . "cooperationInfo"}}</p>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<h3>{{msg . "blog"}}</h3>
|
||||
<p>{{msg . "blogInfo"}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="container" id="donate">
|
||||
<h2 style="margin: 20px 0;text-align: center;">{{msg . "donate"}}</h2>
|
||||
<div class="row">
|
||||
<div style="width:500px; margin:auto; padding: 10px;">
|
||||
<p>
|
||||
You can use <a href="http://alipay.com">alipay</a> to donate us, The donated money will be used to develop leanote.
|
||||
</p>
|
||||
<p>
|
||||
Alipay Account: <b>pay@leanote.com</b>
|
||||
</p>
|
||||
<p>
|
||||
Or you can use alipay app to scan the code to donate us:
|
||||
</p>
|
||||
<p style="text-align: center">
|
||||
<img src="/images/leanote/leanote_alipay.jpg" style="padding: 10px;
|
||||
border: 2px solid #eee;
|
||||
border-radius: 10px; width: 200px;"/>
|
||||
</p>
|
||||
<p>
|
||||
The donation list will be published at <a href="http://leanote.com/blog/view/5417ecf81a910828fd000000">Donation List</a>
|
||||
</p>
|
||||
<p>
|
||||
Thanks for your support!
|
||||
</p>
|
||||
|
||||
<hr />
|
||||
<p>
|
||||
Any questions, suggestions or need more supports, you are welcomed to contact us via <code>leanote@leanote.com</code> or the QQ Group <code>158716820</code> Thanks!
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "home/footer.html"}}
|
||||
|
||||
<script src="/js/jquery-1.9.0.min.js"></script>
|
||||
<script src="/js/bootstrap.js"></script>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
/*
|
||||
var u = navigator.userAgent;
|
||||
var isMobile = u.indexOf('Android')>-1 || u.indexOf('Linux')>-1;
|
||||
if(isMobile || $("body").width() < 600) {
|
||||
location.href = "/mobile/index";
|
||||
}
|
||||
*/
|
||||
// 平滑滚动
|
||||
$(".smooth-scroll").click(function(e) {
|
||||
e.preventDefault();
|
||||
var t = $(this).attr("target");
|
||||
var targetOffset = $(t).offset().top - 80;
|
||||
$('html,body').animate({scrollTop: targetOffset}, 300);
|
||||
});
|
||||
|
||||
function setCookie(name, value) {
|
||||
var Days = 10*365;
|
||||
var exp = new Date();
|
||||
exp.setTime(exp.getTime() + Days*24*60*60*1000);
|
||||
document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
|
||||
}
|
||||
|
||||
$('#lang a').click(function() {
|
||||
var lang = $(this).data('lang');
|
||||
setCookie('LEANOTE_LANG', lang);
|
||||
location.reload();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,138 +0,0 @@
|
||||
{{template "home/header.html" .}}
|
||||
<style>
|
||||
|
||||
</style>
|
||||
<section>
|
||||
<div class="header">
|
||||
<h2>Leanote, {{msg . "moto"}}</h2>
|
||||
<p>{{msg . "moto3"}}</p>
|
||||
<p>{{msg . "moto2"}}</p>
|
||||
|
||||
<div>
|
||||
<a class="btn btn-primary" href="https://github.com/leanote/leanote">{{msg . "fork github"}}</a>
|
||||
|
||||
|
||||
<a class="btn btn-default" href="/demo">{{msg . "try"}}</a>
|
||||
|
||||
|
||||
<a class="btn btn-default" href="/login">{{msg . "login"}}</a>
|
||||
{{if .openRegister}}
|
||||
|
||||
|
||||
<a class="btn btn-default" href="/register">{{msg . "register"}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="preview" style="position: relative;">
|
||||
<div>
|
||||
<div class="img-header">
|
||||
<img src="/images/home/mac-btns.png"/>
|
||||
</div>
|
||||
<img src="/images/home/preview2.png" style="width: 750px;" />
|
||||
</div>
|
||||
<div class="mobile">
|
||||
<div class="mobile-header">
|
||||
<img src="/images/home/mac-dot.png" />
|
||||
</div>
|
||||
<img class="mobile-image" src="/images/home/mobile.png" />
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="container" id="aboutLeanote">
|
||||
<h2>{{msg . "aboutLeanote"}}</h2>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<h3>{{msg . "knowledge"}}</h3>
|
||||
<p>{{msg . "knowledgeInfo"}}</p>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<h3>{{msg . "share"}}</h3>
|
||||
<p>{{msg . "shareInfo"}}</p>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<h3>{{msg . "cooperation"}}</h3>
|
||||
<p>{{msg . "cooperationInfo"}}</p>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<h3>{{msg . "blog"}}</h3>
|
||||
<p>{{msg . "blogInfo"}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="container" id="donate">
|
||||
<h2 style="margin: 20px 0;text-align: center;">{{msg . "donate"}}</h2>
|
||||
<div class="row">
|
||||
<div style="width:500px; margin:auto; padding: 10px;">
|
||||
<p>
|
||||
您可以通过<a href="http://alipay.com">支付宝</a>向leanote捐赠, 所捐赠的款项将用于开发leanote.
|
||||
</p>
|
||||
<p>
|
||||
支付宝账号: <b>pay@leanote.com</b>
|
||||
</p>
|
||||
<p>
|
||||
或使用支付宝扫以下二维码捐赠:
|
||||
</p>
|
||||
<p style="text-align: center">
|
||||
<img src="/images/leanote/leanote_alipay.jpg" style="padding: 10px;
|
||||
border: 2px solid #eee;
|
||||
border-radius: 10px; width: 200px;"/>
|
||||
</p>
|
||||
<p>
|
||||
我们会定期将捐赠名单发布在 <a href="http://leanote.com/blog/view/5417ecf81a910828fd000000">捐赠列表</a>
|
||||
</p>
|
||||
<p>
|
||||
感谢您对leanote的支持!
|
||||
</p>
|
||||
|
||||
<hr />
|
||||
|
||||
<p>
|
||||
有任何疑问, 建议或需其它服务或支持, 欢迎联系 <code>leanote@leanote.com</code> 或加入官方QQ群: <code>158716820</code> 谢谢!
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "home/footer.html"}}
|
||||
|
||||
<script src="/js/jquery-1.9.0.min.js"></script>
|
||||
<script src="/js/bootstrap.js"></script>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
/*
|
||||
var u = navigator.userAgent;
|
||||
var isMobile = u.indexOf('Android')>-1 || u.indexOf('Linux')>-1;
|
||||
if(isMobile || $("body").width() < 600) {
|
||||
location.href = "/mobile/index";
|
||||
}
|
||||
*/
|
||||
// 平滑滚动
|
||||
$(".smooth-scroll").click(function(e) {
|
||||
e.preventDefault();
|
||||
var t = $(this).attr("target");
|
||||
var targetOffset = $(t).offset().top - 80;
|
||||
$('html,body').animate({scrollTop: targetOffset}, 300);
|
||||
});
|
||||
|
||||
function setCookie(name, value) {
|
||||
var Days = 10*365;
|
||||
var exp = new Date();
|
||||
exp.setTime(exp.getTime() + Days*24*60*60*1000);
|
||||
document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
|
||||
}
|
||||
|
||||
$('#lang a').click(function() {
|
||||
var lang = $(this).data('lang');
|
||||
setCookie('LEANOTE_LANG', lang);
|
||||
location.reload();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -72,7 +72,7 @@ $(function() {
|
||||
showMsg("{{msg . "inputEmail"}}", "email");
|
||||
return;
|
||||
} else {
|
||||
var myreg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[0-9a-zA-Z]{2,3}$/;
|
||||
var myreg = /^([a-zA-Z0-9]+[_|\_|\.|\-]?)*[a-zA-Z0-9\-_]+@([a-zA-Z0-9\-]+[_|\_|\.|\-]?)*[a-zA-Z0-9\-]+\.[0-9a-zA-Z]{2,6}$/;
|
||||
if(!myreg.test(email)) {
|
||||
showMsg("{{msg . "wrongEmail"}}", "email");
|
||||
return;
|
||||
|
||||
@@ -13,11 +13,15 @@
|
||||
<span class="label label-green">{{msg . "verified"}}</span>
|
||||
{{else}}
|
||||
<span class="label label-red">{{msg . "unVerified"}}</span>
|
||||
<a class="raw nowToActive">{{msg . "verifiedNow"}}</a>
|
||||
<a class="a raw nowToActive">{{msg . "verifiedNow"}}</a>
|
||||
{{msg . "or"}}
|
||||
<a class="raw reSendActiveEmail">{{msg . "resendVerifiedEmail"}}</a>
|
||||
<a class="a raw reSendActiveEmail">{{msg . "resendVerifiedEmail"}}</a>
|
||||
{{end}}
|
||||
|
||||
<!--
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="alert alert-danger" id="emailMsg" style="display: none"></div>
|
||||
<div class="form-group">
|
||||
<label>{{msg . "email"}}</label>
|
||||
@@ -29,12 +33,28 @@
|
||||
]'
|
||||
data-msg_target="#emailMsg"
|
||||
/>
|
||||
{{msg . "updateEmailTips"}}
|
||||
<div class="form-tips">{{msg . "updateEmailTips"}}</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="pwd">{{msg . "password"}}</label>
|
||||
<input type="password" class="form-control" id="pwd" name="pwd"
|
||||
data-rules='[
|
||||
{rule: "required", msg: "inputPassword"},
|
||||
{rule: "password", msg: "errorPassword"}
|
||||
]'
|
||||
data-msg_target="#emailMsg"
|
||||
>
|
||||
<div class="form-tips">{{msg . "inputLoginPasswordTips"}}</div>
|
||||
</div>
|
||||
|
||||
-->
|
||||
</div>
|
||||
<!--
|
||||
<footer class="panel-footer text-right bg-light lter">
|
||||
<button type="submit" id="emailBtn" class="btn btn-success">{{msg . "submit"}}</button>
|
||||
</footer>
|
||||
-->
|
||||
</section>
|
||||
</form>
|
||||
</div>
|
||||
@@ -76,7 +96,8 @@ $("#emailBtn").click(function(e) {
|
||||
return;
|
||||
}
|
||||
var email = $("#email").val();
|
||||
post("/user/updateEmailSendActiveEmail", {email: email}, function(e) {
|
||||
var pwd = $("#pwd").val();
|
||||
post("/user/updateEmailSendActiveEmail", {email: email, pwd: pwd}, function(e) {
|
||||
if(e.Ok) {
|
||||
var url = getEmailLoginAddress(email);
|
||||
showAlert("#emailMsg", getMsg("verifiedEmaiHasSent") +" <a href='" + url + "' target='_blank'>" + getMsg("checkEmail") + "</a>", "success");
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
]'
|
||||
data-msg_target="#pwdMsg"
|
||||
>
|
||||
{{msg . "passwordTips"}}
|
||||
<div class="form-tips">{{msg . "passwordTips"}}</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="pwd2">{{msg . "password2"}}</label>
|
||||
|
||||
@@ -10,23 +10,23 @@
|
||||
<meta name="description" content="Leanote, {{msg $ "moto"}}">
|
||||
<title>Leanote, {{msg $ "moto"}}</title>
|
||||
|
||||
<link href="/css/bootstrap.css" rel="stylesheet" />
|
||||
<link href="/css/bootstrap-min.css" rel="stylesheet" />
|
||||
<!-- 先加载, 没有样式, 宽度不定 -->
|
||||
<link rel="stylesheet" href="/tinymce/skins/custom/skin.min.css" rel="stylesheet"/>
|
||||
<!-- leanote css -->
|
||||
<link href="/css/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet" />
|
||||
<link href="/css/zTreeStyle/zTreeStyle.css" rel="stylesheet" />
|
||||
<link href="/css/font-awesome-4.2.0/css/font-awesome-min.css" rel="stylesheet" />
|
||||
<link href="/css/zTreeStyle/zTreeStyle-min.css" rel="stylesheet" />
|
||||
<!-- mdeditor -->
|
||||
<link href="/public/dist/themes/default.css" rel="stylesheet" />
|
||||
<link href="/public/dist/themes/default-min.css" rel="stylesheet" />
|
||||
<!-- context-menu -->
|
||||
<link rel="stylesheet" href="/js/contextmenu/css/contextmenu.css" type="text/css" />
|
||||
<link rel="stylesheet" href="/js/contextmenu/css/contextmenu-min.css" type="text/css" />
|
||||
|
||||
<script>
|
||||
var hash = location.hash;
|
||||
if(hash.indexOf("writing") >= 0) {
|
||||
var files = '<link rel="stylesheet" href="/css/theme/writting-overwrite.css" type="text/css" id="themeLink" />';
|
||||
} else {
|
||||
var files ='<link rel="stylesheet" href="/css/theme/{{if .userInfo.Theme}}{{.userInfo.Theme}}{{else}}default{{end}}.css?t=3" type="text/css" id="themeLink" />';
|
||||
var files ='<link rel="stylesheet" href="/css/theme/{{if .userInfo.Theme}}{{.userInfo.Theme}}{{else}}default{{end}}.css?t=4" type="text/css" id="themeLink" />';
|
||||
}
|
||||
document.write(files);
|
||||
</script>
|
||||
@@ -160,7 +160,7 @@ function log(o) {
|
||||
</li>
|
||||
|
||||
<li role="presentation" class="my-link" >
|
||||
<a target="_blank" href="{{$.blogUrl}}/{{.userInfo.Username}}">
|
||||
<a target="_blank" href="{{$.userInfo.BlogUrl}}">
|
||||
<i class="fa fa-bold"></i>
|
||||
{{msg . "myBlog"}}</a>
|
||||
</li>
|
||||
@@ -475,34 +475,36 @@ function log(o) {
|
||||
</div>
|
||||
|
||||
<ul class="pull-right" id="editorTool">
|
||||
<li><a class="ios7-a " id="saveBtn" title="ctrl+s"
|
||||
data-toggle="dropdown">
|
||||
<span class="fa fa-save"></span>
|
||||
{{msg . "save"}}</a></li>
|
||||
<li><a class="ios7-a " id="saveBtn"
|
||||
data-toggle="dropdown" title="ctrl+s {{msg . "save"}}">
|
||||
<span class="fa fa-save"></span></a></li>
|
||||
|
||||
<li class="dropdown" id="noteInfoDropdown">
|
||||
<a class="ios7-a dropdown-toggle" data-toggle="dropdown" id="showAttach" title="{{msg . "Information"}}">
|
||||
<span class="fa fa-info"></span>
|
||||
</a>
|
||||
<div class="dropdown-menu" id="noteInfo"></div>
|
||||
</li>
|
||||
|
||||
<li class="dropdown" id="attachDropdown">
|
||||
<a class="ios7-a dropdown-toggle" data-toggle="dropdown" id="showAttach">
|
||||
<a class="ios7-a dropdown-toggle" data-toggle="dropdown" id="showAttach" title="{{msg . "attachments"}}">
|
||||
<span class="fa fa-paperclip"></span>
|
||||
{{msg . "attachments"}}<span id="attachNum"></span>
|
||||
<span id="attachNum"></span>
|
||||
</a>
|
||||
<div class="dropdown-menu" id="attachMenu">
|
||||
<ul id="attachList">
|
||||
|
||||
</ul>
|
||||
<form id="uploadAttach" method="post" action="/attach/UploadAttach" enctype="multipart/form-data">
|
||||
<div id="dropAttach" class="dropzone">
|
||||
<a class="btn btn-success btn-choose-file">
|
||||
<i class="fa fa-upload"></i>
|
||||
<span>Choose File</span>
|
||||
<span>{{msg . "Choose File"}}</span>
|
||||
</a>
|
||||
<a class="btn btn-default" id="downloadAllBtn">
|
||||
<i class="fa fa-download"></i>
|
||||
<span>Download All</span>
|
||||
</a>
|
||||
<a class="btn btn-default" id="linkAllBtn">
|
||||
<i class="fa fa-link"></i>
|
||||
<span>Link All</span>
|
||||
<span>{{msg . "Download All"}}</span>
|
||||
</a>
|
||||
|
||||
<input type="file" name="file" multiple/>
|
||||
</div>
|
||||
<div id="attachUploadMsg">
|
||||
@@ -511,14 +513,12 @@ function log(o) {
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li><a class="ios7-a " id="tipsBtn"
|
||||
data-toggle="dropdown">
|
||||
<span class="fa fa-question"></span>
|
||||
{{msg . "editorTips"}}</a></li>
|
||||
<li><a class="ios7-a " id="contentHistory"
|
||||
data-toggle="dropdown">
|
||||
<span class="fa fa-history"></span>
|
||||
{{msg . "history"}}</a></li>
|
||||
data-toggle="dropdown" title="{{msg . "history"}}">
|
||||
<span class="fa fa-history"></span></a></li>
|
||||
<li><a class="ios7-a " id="tipsBtn"
|
||||
data-toggle="dropdown" title="{{msg . "editorTips"}}">
|
||||
<span class="fa fa-question"></span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -857,24 +857,7 @@ function log(o) {
|
||||
</div><!-- /.modal -->
|
||||
|
||||
<!-- 编辑器提示 -->
|
||||
<div class="modal fade bs-modal-sm" id="tipsDialog" 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">{{msg . "editorTips"}}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{{msg . "editorTipsInfo"}}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{{msg . "close"}}</button>
|
||||
</div>
|
||||
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
|
||||
<!-- modal 静态区域 -->
|
||||
<div class="display: hidden">
|
||||
@@ -946,7 +929,7 @@ window.require = {
|
||||
<script src="/public/dist/main.min.js"></script>
|
||||
<!-- /dev -->
|
||||
|
||||
<script src="/public/js/upload_paste/main.js"></script>
|
||||
<script src="/public/js/plugins/main.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
+28
-45
@@ -10,23 +10,23 @@
|
||||
<meta name="description" content="Leanote, {{msg $ "moto"}}">
|
||||
<title>Leanote, {{msg $ "moto"}}</title>
|
||||
|
||||
<link href="/css/bootstrap.css" rel="stylesheet" />
|
||||
<link href="/css/bootstrap-min.css" rel="stylesheet" />
|
||||
<!-- 先加载, 没有样式, 宽度不定 -->
|
||||
<link rel="stylesheet" href="/tinymce/skins/custom/skin.min.css" rel="stylesheet"/>
|
||||
<!-- leanote css -->
|
||||
<link href="/css/font-awesome-4.2.0/css/font-awesome.css" rel="stylesheet" />
|
||||
<link href="/css/zTreeStyle/zTreeStyle.css" rel="stylesheet" />
|
||||
<link href="/css/font-awesome-4.2.0/css/font-awesome-min.css" rel="stylesheet" />
|
||||
<link href="/css/zTreeStyle/zTreeStyle-min.css" rel="stylesheet" />
|
||||
<!-- mdeditor -->
|
||||
<link href="/public/dist/themes/default.css" rel="stylesheet" />
|
||||
<link href="/public/dist/themes/default-min.css" rel="stylesheet" />
|
||||
<!-- context-menu -->
|
||||
<link rel="stylesheet" href="/js/contextmenu/css/contextmenu.css" type="text/css" />
|
||||
<link rel="stylesheet" href="/js/contextmenu/css/contextmenu-min.css" type="text/css" />
|
||||
|
||||
<script>
|
||||
var hash = location.hash;
|
||||
if(hash.indexOf("writing") >= 0) {
|
||||
var files = '<link rel="stylesheet" href="/css/theme/writting-overwrite.css" type="text/css" id="themeLink" />';
|
||||
} else {
|
||||
var files ='<link rel="stylesheet" href="/css/theme/{{if .userInfo.Theme}}{{.userInfo.Theme}}{{else}}default{{end}}.css?t=3" type="text/css" id="themeLink" />';
|
||||
var files ='<link rel="stylesheet" href="/css/theme/{{if .userInfo.Theme}}{{.userInfo.Theme}}{{else}}default{{end}}.css?t=4" type="text/css" id="themeLink" />';
|
||||
}
|
||||
document.write(files);
|
||||
</script>
|
||||
@@ -160,7 +160,7 @@ function log(o) {
|
||||
</li>
|
||||
|
||||
<li role="presentation" class="my-link" >
|
||||
<a target="_blank" href="{{$.blogUrl}}/{{.userInfo.Username}}">
|
||||
<a target="_blank" href="{{$.userInfo.BlogUrl}}">
|
||||
<i class="fa fa-bold"></i>
|
||||
{{msg . "myBlog"}}</a>
|
||||
</li>
|
||||
@@ -475,34 +475,36 @@ function log(o) {
|
||||
</div>
|
||||
|
||||
<ul class="pull-right" id="editorTool">
|
||||
<li><a class="ios7-a " id="saveBtn" title="ctrl+s"
|
||||
data-toggle="dropdown">
|
||||
<span class="fa fa-save"></span>
|
||||
{{msg . "save"}}</a></li>
|
||||
<li><a class="ios7-a " id="saveBtn"
|
||||
data-toggle="dropdown" title="ctrl+s {{msg . "save"}}">
|
||||
<span class="fa fa-save"></span></a></li>
|
||||
|
||||
<li class="dropdown" id="noteInfoDropdown">
|
||||
<a class="ios7-a dropdown-toggle" data-toggle="dropdown" id="showAttach" title="{{msg . "Information"}}">
|
||||
<span class="fa fa-info"></span>
|
||||
</a>
|
||||
<div class="dropdown-menu" id="noteInfo"></div>
|
||||
</li>
|
||||
|
||||
<li class="dropdown" id="attachDropdown">
|
||||
<a class="ios7-a dropdown-toggle" data-toggle="dropdown" id="showAttach">
|
||||
<a class="ios7-a dropdown-toggle" data-toggle="dropdown" id="showAttach" title="{{msg . "attachments"}}">
|
||||
<span class="fa fa-paperclip"></span>
|
||||
{{msg . "attachments"}}<span id="attachNum"></span>
|
||||
<span id="attachNum"></span>
|
||||
</a>
|
||||
<div class="dropdown-menu" id="attachMenu">
|
||||
<ul id="attachList">
|
||||
|
||||
</ul>
|
||||
<form id="uploadAttach" method="post" action="/attach/UploadAttach" enctype="multipart/form-data">
|
||||
<div id="dropAttach" class="dropzone">
|
||||
<a class="btn btn-success btn-choose-file">
|
||||
<i class="fa fa-upload"></i>
|
||||
<span>Choose File</span>
|
||||
<span>{{msg . "Choose File"}}</span>
|
||||
</a>
|
||||
<a class="btn btn-default" id="downloadAllBtn">
|
||||
<i class="fa fa-download"></i>
|
||||
<span>Download All</span>
|
||||
</a>
|
||||
<a class="btn btn-default" id="linkAllBtn">
|
||||
<i class="fa fa-link"></i>
|
||||
<span>Link All</span>
|
||||
<span>{{msg . "Download All"}}</span>
|
||||
</a>
|
||||
|
||||
<input type="file" name="file" multiple/>
|
||||
</div>
|
||||
<div id="attachUploadMsg">
|
||||
@@ -511,14 +513,12 @@ function log(o) {
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li><a class="ios7-a " id="tipsBtn"
|
||||
data-toggle="dropdown">
|
||||
<span class="fa fa-question"></span>
|
||||
{{msg . "editorTips"}}</a></li>
|
||||
<li><a class="ios7-a " id="contentHistory"
|
||||
data-toggle="dropdown">
|
||||
<span class="fa fa-history"></span>
|
||||
{{msg . "history"}}</a></li>
|
||||
data-toggle="dropdown" title="{{msg . "history"}}">
|
||||
<span class="fa fa-history"></span></a></li>
|
||||
<li><a class="ios7-a " id="tipsBtn"
|
||||
data-toggle="dropdown" title="{{msg . "editorTips"}}">
|
||||
<span class="fa fa-question"></span></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -857,24 +857,7 @@ function log(o) {
|
||||
</div><!-- /.modal -->
|
||||
|
||||
<!-- 编辑器提示 -->
|
||||
<div class="modal fade bs-modal-sm" id="tipsDialog" 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">{{msg . "editorTips"}}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{{msg . "editorTipsInfo"}}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">{{msg . "close"}}</button>
|
||||
</div>
|
||||
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
|
||||
<!-- modal 静态区域 -->
|
||||
<div class="display: hidden">
|
||||
@@ -928,7 +911,7 @@ window.require = {
|
||||
|
||||
|
||||
|
||||
<script src="/public/js/upload_paste/main.js"></script>
|
||||
<script src="/public/js/plugins/main.min.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
+6
-3
@@ -53,6 +53,7 @@ inputEmail=Email is required
|
||||
wrongEmail=Wrong email
|
||||
wrongUsernameOrPassword=Wrong username or password
|
||||
inputPassword=Password is required
|
||||
inputLoginPasswordTips=Please input login password
|
||||
wrongPassword=Wrong password
|
||||
logining=Sign in
|
||||
loginSuccess=login success
|
||||
@@ -101,7 +102,7 @@ clearSearch=Clear Search
|
||||
all=Newest
|
||||
trash=Trash
|
||||
delete=Delete
|
||||
unTitled=Untitled
|
||||
unTitled=UnTitled
|
||||
defaultShare=Default sharing
|
||||
leftHidden=Hidden slide bar
|
||||
leftShow=Show slide bar
|
||||
@@ -112,6 +113,9 @@ saving=Saving
|
||||
saveSuccess=Save success
|
||||
SearchNote=Search Note
|
||||
SearchNotebook=Search Notebook
|
||||
Choose File=Choose File
|
||||
Download All=Download All
|
||||
Information=Information
|
||||
|
||||
update=Update
|
||||
create=Create
|
||||
@@ -213,8 +217,6 @@ inviteEmailBody=Hi,I am %s, %s is awesome, come on!
|
||||
# 历史记录
|
||||
historiesNum=We have saved at most <b>10</b> latest histories with each note
|
||||
noHistories=No histories
|
||||
fold=Fold
|
||||
unfold=Unfold
|
||||
datetime=Datetime
|
||||
restoreFromThisVersion=Restore from this version
|
||||
confirmBackup=Are you sure to restore from this version? We will backup the current note.
|
||||
@@ -252,6 +254,7 @@ themeValidHasRoundInclude=WARNING: Templates have circular references!
|
||||
memberCenter=Member Center
|
||||
userNotExists=The user is not exists
|
||||
hasUsers=The user already exists
|
||||
Leanote Blog Theme Api=Leanote Blog Theme Api
|
||||
|
||||
# yu
|
||||
service=Service
|
||||
|
||||
+20
-13
@@ -43,19 +43,20 @@ curUser=Email
|
||||
# form
|
||||
submit=提交
|
||||
Submit=提交
|
||||
register=Sign up
|
||||
login=Sign in
|
||||
register=注册
|
||||
login=登录
|
||||
Password=密码
|
||||
password2=Confirm your password
|
||||
password2=请确认密码
|
||||
email=Email
|
||||
inputUsername=Username(email) is required
|
||||
inputEmail=Email is required
|
||||
wrongEmail=Wrong email
|
||||
wrongUsernameOrPassword=Wrong username or password
|
||||
inputPassword=Password is required
|
||||
wrongPassword=Wrong password
|
||||
logining=Sign in
|
||||
loginSuccess=login success
|
||||
inputUsername=请输入用户名或Email
|
||||
inputEmail=请输入Email
|
||||
wrongEmail=Email错误
|
||||
wrongUsernameOrPassword=用户名或密码错误
|
||||
inputPassword=请输入密码
|
||||
inputLoginPasswordTips=请输入登录密码
|
||||
wrongPassword=密码错误
|
||||
logining=登录
|
||||
loginSuccess=登录成功
|
||||
|
||||
hi=Hi
|
||||
welcomeUseLeanote=欢迎使用leanote
|
||||
@@ -133,6 +134,13 @@ saving=正在保存
|
||||
saveSuccess=保存成功
|
||||
SearchNote=搜索笔记
|
||||
SearchNotebook=搜索笔记本
|
||||
Choose File=选择文件
|
||||
Download All=下载全部
|
||||
Information=信息
|
||||
Are you sure to delete it ?=确认删除?
|
||||
Insert link into content=将附件链接插入到内容中
|
||||
Download=下载
|
||||
Delete=删除
|
||||
|
||||
update=更新
|
||||
create=创建
|
||||
@@ -238,8 +246,6 @@ inviteEmailBody=Hi, 你好, 我是%s, %s非常好用, 快来注册吧!
|
||||
# 历史记录
|
||||
historiesNum=leanote会保存笔记的最近<b>10</b>份历史记录
|
||||
noHistories=无历史记录
|
||||
fold=折叠
|
||||
unfold=展开
|
||||
datetime=日期
|
||||
restoreFromThisVersion=从该版本还原
|
||||
confirmBackup=确定要从该版还原? 还原前leanote会备份当前版本到历史记录中.
|
||||
@@ -278,6 +284,7 @@ themeValidHasRoundInclude=警告: 模板存在循环引用问题!
|
||||
memberCenter=个人中心
|
||||
userNotExists=该成员沿未注册
|
||||
hasUsers=已存在该成员
|
||||
Leanote Blog Theme Api=Leanote博客主题API
|
||||
|
||||
# yu
|
||||
service=服务
|
||||
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
/*!
|
||||
* Bootstrap v3.0.2 by @fat and @mdo
|
||||
* Copyright 2013 Twitter, Inc.
|
||||
* Licensed under http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Designed and built with all the love in the world by @mdo and @fat.
|
||||
*//*! normalize.css v2.1.3 | MIT License | git.io/normalize */hr,img{border:0}body,figure{margin:0}.img-thumbnail,.thumbnail{-webkit-transition:all .2s ease-in-out}.breadcrumb,.carousel-indicators,.dropdown-menu,.media-list,.nav,.pager{list-style:none}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:0 0}a:active,a:hover{outline:0}h1{margin:.67em 0}b,strong{font-weight:700}dfn{font-style:italic}hr{height:0;-moz-box-sizing:content-box;box-sizing:content-box}mark{color:#000;background:#ff0}code,kbd,pre,samp{font-size:1em}pre{white-space:pre-wrap}q{quotes:"\201C" "\201D" "\2018" "\2019"}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{vertical-align:middle}svg:not(:root){overflow:hidden}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{cursor:pointer;-webkit-appearance:button}button[disabled],html input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{padding:0;box-sizing:border-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}@media print{blockquote,img,pre,tr{page-break-inside:avoid}*{color:#000!important;text-shadow:none!important;background:0 0!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}blockquote,pre{border:1px solid #999}thead{display:table-header-group}img{max-width:100%!important}@page{margin:2cm .5cm}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff!important}.navbar{display:none}.table td,.table th{background-color:#fff!important}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}.btn,.btn-danger.active,.btn-danger:active,.btn-default.active,.btn-default:active,.btn-info.active,.btn-info:active,.btn-success.active,.btn-success:active,.btn-warning.active,.btn-warning:active,.btn.active,.btn:active,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover,.form-control,.open .dropdown-toggle.btn-danger,.open .dropdown-toggle.btn-default,.open .dropdown-toggle.btn-info,.open .dropdown-toggle.btn-success,.open .dropdown-toggle.btn-warning{background-image:none}.img-thumbnail,body{background-color:#fff}*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;font-size:62.5%;-webkit-tap-highlight-color:transparent}body{font-family:Arial,Tahoma,sans-serif,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.428571429;color:#333}button,input,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}a{color:#428bca;text-decoration:none}a:focus,a:hover{color:#2a6496;text-decoration:underline}a:focus{outline:#333 dotted thin;outline:-webkit-focus-ring-color auto 5px;outline-offset:-2px}.img-responsive{display:block;height:auto;max-width:100%}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;height:auto;max-width:100%;padding:4px;line-height:1.428571429;border:1px solid #ddd;border-radius:4px;transition:all .2s ease-in-out}pre code,table{background-color:transparent}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.collapsing,.dropdown,.glyphicon{position:relative}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:200;line-height:1.4}h1,h2,h3,h4,h5,h6{margin-bottom:10px}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}cite{font-style:normal}.text-muted{color:#999}.text-primary{color:#428bca}.text-primary:hover{color:#3071a9}.text-warning{color:#c09853}.text-warning:hover{color:#a47e3c}.text-danger{color:#b94a48}.text-danger:hover{color:#953b39}.text-success{color:#468847}.text-success:hover{color:#356635}.text-info{color:#3a87ad}.text-info:hover{color:#2d6987}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:Arial,Tahoma,sans-serif,HelveticaNeue-Light,"Helvetica Neue Light","Helvetica Neue",Helvetica,"Microsoft Yahei",Arial,sans-serif;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4Line truncated
|
||||
@@ -0,0 +1,4 @@
|
||||
/*!
|
||||
* Font Awesome 4.2.0 by @davegandy - http://fontawesome.io - @fontawesome
|
||||
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
|
||||
*/.fa,.fa-stack{display:inline-block}.fa-fw,.fa-li{text-align:center}@font-face{font-family:FontAwesome;src:url(../fonts/fontawesome-webfont.eot?v=4.2.0);src:url(../fonts/fontawesome-webfont.eot?#iefix&v=4.2.0) format('embedded-opentype'),url(../fonts/fontawesome-webfont.woff?v=4.2.0) format('woff'),url(../fonts/fontawesome-webfont.ttf?v=4.2.0) format('truetype'),url(../fonts/fontawesome-webfont.svg?v=4.2.0#fontawesomeregular) format('svg');font-weight:400;font-style:normal}.fa{font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:.08em solid #eee;border-radius:.1em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);-webkit-transform:scale(1,-1);-ms-transform:scale(1,-1);transform:scale(1,-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-rotate-90{filter:none}.fa-stack{position:relative;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-close:before,.fa-remove:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-cog:before,.fa-gear:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-repeat:before,.fa-rotate-right:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-image:before,.fa-photo:before,.fa-Line truncated
|
||||
@@ -0,0 +1,16 @@
|
||||
// Bordered & Pulled
|
||||
// -------------------------
|
||||
|
||||
.#{$fa-css-prefix}-border {
|
||||
padding: .2em .25em .15em;
|
||||
border: solid .08em $fa-border-color;
|
||||
border-radius: .1em;
|
||||
}
|
||||
|
||||
.pull-right { float: right; }
|
||||
.pull-left { float: left; }
|
||||
|
||||
.#{$fa-css-prefix} {
|
||||
&.pull-left { margin-right: .3em; }
|
||||
&.pull-right { margin-left: .3em; }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// Base Class Definition
|
||||
// -------------------------
|
||||
|
||||
.#{$fa-css-prefix} {
|
||||
display: inline-block;
|
||||
font: normal normal normal 14px/1 FontAwesome; // shortening font declaration
|
||||
font-size: inherit; // can't have font-size inherit on line above, so need to override
|
||||
text-rendering: auto; // optimizelegibility throws things off #1094
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// Fixed Width Icons
|
||||
// -------------------------
|
||||
.#{$fa-css-prefix}-fw {
|
||||
width: (18em / 14);
|
||||
text-align: center;
|
||||
}
|
||||
@@ -0,0 +1,552 @@
|
||||
/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen
|
||||
readers do not read off random characters that represent icons */
|
||||
|
||||
.#{$fa-css-prefix}-glass:before { content: $fa-var-glass; }
|
||||
.#{$fa-css-prefix}-music:before { content: $fa-var-music; }
|
||||
.#{$fa-css-prefix}-search:before { content: $fa-var-search; }
|
||||
.#{$fa-css-prefix}-envelope-o:before { content: $fa-var-envelope-o; }
|
||||
.#{$fa-css-prefix}-heart:before { content: $fa-var-heart; }
|
||||
.#{$fa-css-prefix}-star:before { content: $fa-var-star; }
|
||||
.#{$fa-css-prefix}-star-o:before { content: $fa-var-star-o; }
|
||||
.#{$fa-css-prefix}-user:before { content: $fa-var-user; }
|
||||
.#{$fa-css-prefix}-film:before { content: $fa-var-film; }
|
||||
.#{$fa-css-prefix}-th-large:before { content: $fa-var-th-large; }
|
||||
.#{$fa-css-prefix}-th:before { content: $fa-var-th; }
|
||||
.#{$fa-css-prefix}-th-list:before { content: $fa-var-th-list; }
|
||||
.#{$fa-css-prefix}-check:before { content: $fa-var-check; }
|
||||
.#{$fa-css-prefix}-remove:before,
|
||||
.#{$fa-css-prefix}-close:before,
|
||||
.#{$fa-css-prefix}-times:before { content: $fa-var-times; }
|
||||
.#{$fa-css-prefix}-search-plus:before { content: $fa-var-search-plus; }
|
||||
.#{$fa-css-prefix}-search-minus:before { content: $fa-var-search-minus; }
|
||||
.#{$fa-css-prefix}-power-off:before { content: $fa-var-power-off; }
|
||||
.#{$fa-css-prefix}-signal:before { content: $fa-var-signal; }
|
||||
.#{$fa-css-prefix}-gear:before,
|
||||
.#{$fa-css-prefix}-cog:before { content: $fa-var-cog; }
|
||||
.#{$fa-css-prefix}-trash-o:before { content: $fa-var-trash-o; }
|
||||
.#{$fa-css-prefix}-home:before { content: $fa-var-home; }
|
||||
.#{$fa-css-prefix}-file-o:before { content: $fa-var-file-o; }
|
||||
.#{$fa-css-prefix}-clock-o:before { content: $fa-var-clock-o; }
|
||||
.#{$fa-css-prefix}-road:before { content: $fa-var-road; }
|
||||
.#{$fa-css-prefix}-download:before { content: $fa-var-download; }
|
||||
.#{$fa-css-prefix}-arrow-circle-o-down:before { content: $fa-var-arrow-circle-o-down; }
|
||||
.#{$fa-css-prefix}-arrow-circle-o-up:before { content: $fa-var-arrow-circle-o-up; }
|
||||
.#{$fa-css-prefix}-inbox:before { content: $fa-var-inbox; }
|
||||
.#{$fa-css-prefix}-play-circle-o:before { content: $fa-var-play-circle-o; }
|
||||
.#{$fa-css-prefix}-rotate-right:before,
|
||||
.#{$fa-css-prefix}-repeat:before { content: $fa-var-repeat; }
|
||||
.#{$fa-css-prefix}-refresh:before { content: $fa-var-refresh; }
|
||||
.#{$fa-css-prefix}-list-alt:before { content: $fa-var-list-alt; }
|
||||
.#{$fa-css-prefix}-lock:before { content: $fa-var-lock; }
|
||||
.#{$fa-css-prefix}-flag:before { content: $fa-var-flag; }
|
||||
.#{$fa-css-prefix}-headphones:before { content: $fa-var-headphones; }
|
||||
.#{$fa-css-prefix}-volume-off:before { content: $fa-var-volume-off; }
|
||||
.#{$fa-css-prefix}-volume-down:before { content: $fa-var-volume-down; }
|
||||
.#{$fa-css-prefix}-volume-up:before { content: $fa-var-volume-up; }
|
||||
.#{$fa-css-prefix}-qrcode:before { content: $fa-var-qrcode; }
|
||||
.#{$fa-css-prefix}-barcode:before { content: $fa-var-barcode; }
|
||||
.#{$fa-css-prefix}-tag:before { content: $fa-var-tag; }
|
||||
.#{$fa-css-prefix}-tags:before { content: $fa-var-tags; }
|
||||
.#{$fa-css-prefix}-book:before { content: $fa-var-book; }
|
||||
.#{$fa-css-prefix}-bookmark:before { content: $fa-var-bookmark; }
|
||||
.#{$fa-css-prefix}-print:before { content: $fa-var-print; }
|
||||
.#{$fa-css-prefix}-camera:before { content: $fa-var-camera; }
|
||||
.#{$fa-css-prefix}-font:before { content: $fa-var-font; }
|
||||
.#{$fa-css-prefix}-bold:before { content: $fa-var-bold; }
|
||||
.#{$fa-css-prefix}-italic:before { content: $fa-var-italic; }
|
||||
.#{$fa-css-prefix}-text-height:before { content: $fa-var-text-height; }
|
||||
.#{$fa-css-prefix}-text-width:before { content: $fa-var-text-width; }
|
||||
.#{$fa-css-prefix}-align-left:before { content: $fa-var-align-left; }
|
||||
.#{$fa-css-prefix}-align-center:before { content: $fa-var-align-center; }
|
||||
.#{$fa-css-prefix}-align-right:before { content: $fa-var-align-right; }
|
||||
.#{$fa-css-prefix}-align-justify:before { content: $fa-var-align-justify; }
|
||||
.#{$fa-css-prefix}-list:before { content: $fa-var-list; }
|
||||
.#{$fa-css-prefix}-dedent:before,
|
||||
.#{$fa-css-prefix}-outdent:before { content: $fa-var-outdent; }
|
||||
.#{$fa-css-prefix}-indent:before { content: $fa-var-indent; }
|
||||
.#{$fa-css-prefix}-video-camera:before { content: $fa-var-video-camera; }
|
||||
.#{$fa-css-prefix}-photo:before,
|
||||
.#{$fa-css-prefix}-image:before,
|
||||
.#{$fa-css-prefix}-picture-o:before { content: $fa-var-picture-o; }
|
||||
.#{$fa-css-prefix}-pencil:before { content: $fa-var-pencil; }
|
||||
.#{$fa-css-prefix}-map-marker:before { content: $fa-var-map-marker; }
|
||||
.#{$fa-css-prefix}-adjust:before { content: $fa-var-adjust; }
|
||||
.#{$fa-css-prefix}-tint:before { content: $fa-var-tint; }
|
||||
.#{$fa-css-prefix}-edit:before,
|
||||
.#{$fa-css-prefix}-pencil-square-o:before { content: $fa-var-pencil-square-o; }
|
||||
.#{$fa-css-prefix}-share-square-o:before { content: $fa-var-share-square-o; }
|
||||
.#{$fa-css-prefix}-check-square-o:before { content: $fa-var-check-square-o; }
|
||||
.#{$fa-css-prefix}-arrows:before { content: $fa-var-arrows; }
|
||||
.#{$fa-css-prefix}-step-backward:before { content: $fa-var-step-backward; }
|
||||
.#{$fa-css-prefix}-fast-backward:before { content: $fa-var-fast-backward; }
|
||||
.#{$fa-css-prefix}-backward:before { content: $fa-var-backward; }
|
||||
.#{$fa-css-prefix}-play:before { content: $fa-var-play; }
|
||||
.#{$fa-css-prefix}-pause:before { content: $fa-var-pause; }
|
||||
.#{$fa-css-prefix}-stop:before { content: $fa-var-stop; }
|
||||
.#{$fa-css-prefix}-forward:before { content: $fa-var-forward; }
|
||||
.#{$fa-css-prefix}-fast-forward:before { content: $fa-var-fast-forward; }
|
||||
.#{$fa-css-prefix}-step-forward:before { content: $fa-var-step-forward; }
|
||||
.#{$fa-css-prefix}-eject:before { content: $fa-var-eject; }
|
||||
.#{$fa-css-prefix}-chevron-left:before { content: $fa-var-chevron-left; }
|
||||
.#{$fa-css-prefix}-chevron-right:before { content: $fa-var-chevron-right; }
|
||||
.#{$fa-css-prefix}-plus-circle:before { content: $fa-var-plus-circle; }
|
||||
.#{$fa-css-prefix}-minus-circle:before { content: $fa-var-minus-circle; }
|
||||
.#{$fa-css-prefix}-times-circle:before { content: $fa-var-times-circle; }
|
||||
.#{$fa-css-prefix}-check-circle:before { content: $fa-var-check-circle; }
|
||||
.#{$fa-css-prefix}-question-circle:before { content: $fa-var-question-circle; }
|
||||
.#{$fa-css-prefix}-info-circle:before { content: $fa-var-info-circle; }
|
||||
.#{$fa-css-prefix}-crosshairs:before { content: $fa-var-crosshairs; }
|
||||
.#{$fa-css-prefix}-times-circle-o:before { content: $fa-var-times-circle-o; }
|
||||
.#{$fa-css-prefix}-check-circle-o:before { content: $fa-var-check-circle-o; }
|
||||
.#{$fa-css-prefix}-ban:before { content: $fa-var-ban; }
|
||||
.#{$fa-css-prefix}-arrow-left:before { content: $fa-var-arrow-left; }
|
||||
.#{$fa-css-prefix}-arrow-right:before { content: $fa-var-arrow-right; }
|
||||
.#{$fa-css-prefix}-arrow-up:before { content: $fa-var-arrow-up; }
|
||||
.#{$fa-css-prefix}-arrow-down:before { content: $fa-var-arrow-down; }
|
||||
.#{$fa-css-prefix}-mail-forward:before,
|
||||
.#{$fa-css-prefix}-share:before { content: $fa-var-share; }
|
||||
.#{$fa-css-prefix}-expand:before { content: $fa-var-expand; }
|
||||
.#{$fa-css-prefix}-compress:before { content: $fa-var-compress; }
|
||||
.#{$fa-css-prefix}-plus:before { content: $fa-var-plus; }
|
||||
.#{$fa-css-prefix}-minus:before { content: $fa-var-minus; }
|
||||
.#{$fa-css-prefix}-asterisk:before { content: $fa-var-asterisk; }
|
||||
.#{$fa-css-prefix}-exclamation-circle:before { content: $fa-var-exclamation-circle; }
|
||||
.#{$fa-css-prefix}-gift:before { content: $fa-var-gift; }
|
||||
.#{$fa-css-prefix}-leaf:before { content: $fa-var-leaf; }
|
||||
.#{$fa-css-prefix}-fire:before { content: $fa-var-fire; }
|
||||
.#{$fa-css-prefix}-eye:before { content: $fa-var-eye; }
|
||||
.#{$fa-css-prefix}-eye-slash:before { content: $fa-var-eye-slash; }
|
||||
.#{$fa-css-prefix}-warning:before,
|
||||
.#{$fa-css-prefix}-exclamation-triangle:before { content: $fa-var-exclamation-triangle; }
|
||||
.#{$fa-css-prefix}-plane:before { content: $fa-var-plane; }
|
||||
.#{$fa-css-prefix}-calendar:before { content: $fa-var-calendar; }
|
||||
.#{$fa-css-prefix}-random:before { content: $fa-var-random; }
|
||||
.#{$fa-css-prefix}-comment:before { content: $fa-var-comment; }
|
||||
.#{$fa-css-prefix}-magnet:before { content: $fa-var-magnet; }
|
||||
.#{$fa-css-prefix}-chevron-up:before { content: $fa-var-chevron-up; }
|
||||
.#{$fa-css-prefix}-chevron-down:before { content: $fa-var-chevron-down; }
|
||||
.#{$fa-css-prefix}-retweet:before { content: $fa-var-retweet; }
|
||||
.#{$fa-css-prefix}-shopping-cart:before { content: $fa-var-shopping-cart; }
|
||||
.#{$fa-css-prefix}-folder:before { content: $fa-var-folder; }
|
||||
.#{$fa-css-prefix}-folder-open:before { content: $fa-var-folder-open; }
|
||||
.#{$fa-css-prefix}-arrows-v:before { content: $fa-var-arrows-v; }
|
||||
.#{$fa-css-prefix}-arrows-h:before { content: $fa-var-arrows-h; }
|
||||
.#{$fa-css-prefix}-bar-chart-o:before,
|
||||
.#{$fa-css-prefix}-bar-chart:before { content: $fa-var-bar-chart; }
|
||||
.#{$fa-css-prefix}-twitter-square:before { content: $fa-var-twitter-square; }
|
||||
.#{$fa-css-prefix}-facebook-square:before { content: $fa-var-facebook-square; }
|
||||
.#{$fa-css-prefix}-camera-retro:before { content: $fa-var-camera-retro; }
|
||||
.#{$fa-css-prefix}-key:before { content: $fa-var-key; }
|
||||
.#{$fa-css-prefix}-gears:before,
|
||||
.#{$fa-css-prefix}-cogs:before { content: $fa-var-cogs; }
|
||||
.#{$fa-css-prefix}-comments:before { content: $fa-var-comments; }
|
||||
.#{$fa-css-prefix}-thumbs-o-up:before { content: $fa-var-thumbs-o-up; }
|
||||
.#{$fa-css-prefix}-thumbs-o-down:before { content: $fa-var-thumbs-o-down; }
|
||||
.#{$fa-css-prefix}-star-half:before { content: $fa-var-star-half; }
|
||||
.#{$fa-css-prefix}-heart-o:before { content: $fa-var-heart-o; }
|
||||
.#{$fa-css-prefix}-sign-out:before { content: $fa-var-sign-out; }
|
||||
.#{$fa-css-prefix}-linkedin-square:before { content: $fa-var-linkedin-square; }
|
||||
.#{$fa-css-prefix}-thumb-tack:before { content: $fa-var-thumb-tack; }
|
||||
.#{$fa-css-prefix}-external-link:before { content: $fa-var-external-link; }
|
||||
.#{$fa-css-prefix}-sign-in:before { content: $fa-var-sign-in; }
|
||||
.#{$fa-css-prefix}-trophy:before { content: $fa-var-trophy; }
|
||||
.#{$fa-css-prefix}-github-square:before { content: $fa-var-github-square; }
|
||||
.#{$fa-css-prefix}-upload:before { content: $fa-var-upload; }
|
||||
.#{$fa-css-prefix}-lemon-o:before { content: $fa-var-lemon-o; }
|
||||
.#{$fa-css-prefix}-phone:before { content: $fa-var-phone; }
|
||||
.#{$fa-css-prefix}-square-o:before { content: $fa-var-square-o; }
|
||||
.#{$fa-css-prefix}-bookmark-o:before { content: $fa-var-bookmark-o; }
|
||||
.#{$fa-css-prefix}-phone-square:before { content: $fa-var-phone-square; }
|
||||
.#{$fa-css-prefix}-twitter:before { content: $fa-var-twitter; }
|
||||
.#{$fa-css-prefix}-facebook:before { content: $fa-var-facebook; }
|
||||
.#{$fa-css-prefix}-github:before { content: $fa-var-github; }
|
||||
.#{$fa-css-prefix}-unlock:before { content: $fa-var-unlock; }
|
||||
.#{$fa-css-prefix}-credit-card:before { content: $fa-var-credit-card; }
|
||||
.#{$fa-css-prefix}-rss:before { content: $fa-var-rss; }
|
||||
.#{$fa-css-prefix}-hdd-o:before { content: $fa-var-hdd-o; }
|
||||
.#{$fa-css-prefix}-bullhorn:before { content: $fa-var-bullhorn; }
|
||||
.#{$fa-css-prefix}-bell:before { content: $fa-var-bell; }
|
||||
.#{$fa-css-prefix}-certificate:before { content: $fa-var-certificate; }
|
||||
.#{$fa-css-prefix}-hand-o-right:before { content: $fa-var-hand-o-right; }
|
||||
.#{$fa-css-prefix}-hand-o-left:before { content: $fa-var-hand-o-left; }
|
||||
.#{$fa-css-prefix}-hand-o-up:before { content: $fa-var-hand-o-up; }
|
||||
.#{$fa-css-prefix}-hand-o-down:before { content: $fa-var-hand-o-down; }
|
||||
.#{$fa-css-prefix}-arrow-circle-left:before { content: $fa-var-arrow-circle-left; }
|
||||
.#{$fa-css-prefix}-arrow-circle-right:before { content: $fa-var-arrow-circle-right; }
|
||||
.#{$fa-css-prefix}-arrow-circle-up:before { content: $fa-var-arrow-circle-up; }
|
||||
.#{$fa-css-prefix}-arrow-circle-down:before { content: $fa-var-arrow-circle-down; }
|
||||
.#{$fa-css-prefix}-globe:before { content: $fa-var-globe; }
|
||||
.#{$fa-css-prefix}-wrench:before { content: $fa-var-wrench; }
|
||||
.#{$fa-css-prefix}-tasks:before { content: $fa-var-tasks; }
|
||||
.#{$fa-css-prefix}-filter:before { content: $fa-var-filter; }
|
||||
.#{$fa-css-prefix}-briefcase:before { content: $fa-var-briefcase; }
|
||||
.#{$fa-css-prefix}-arrows-alt:before { content: $fa-var-arrows-alt; }
|
||||
.#{$fa-css-prefix}-group:before,
|
||||
.#{$fa-css-prefix}-users:before { content: $fa-var-users; }
|
||||
.#{$fa-css-prefix}-chain:before,
|
||||
.#{$fa-css-prefix}-link:before { content: $fa-var-link; }
|
||||
.#{$fa-css-prefix}-cloud:before { content: $fa-var-cloud; }
|
||||
.#{$fa-css-prefix}-flask:before { content: $fa-var-flask; }
|
||||
.#{$fa-css-prefix}-cut:before,
|
||||
.#{$fa-css-prefix}-scissors:before { content: $fa-var-scissors; }
|
||||
.#{$fa-css-prefix}-copy:before,
|
||||
.#{$fa-css-prefix}-files-o:before { content: $fa-var-files-o; }
|
||||
.#{$fa-css-prefix}-paperclip:before { content: $fa-var-paperclip; }
|
||||
.#{$fa-css-prefix}-save:before,
|
||||
.#{$fa-css-prefix}-floppy-o:before { content: $fa-var-floppy-o; }
|
||||
.#{$fa-css-prefix}-square:before { content: $fa-var-square; }
|
||||
.#{$fa-css-prefix}-navicon:before,
|
||||
.#{$fa-css-prefix}-reorder:before,
|
||||
.#{$fa-css-prefix}-bars:before { content: $fa-var-bars; }
|
||||
.#{$fa-css-prefix}-list-ul:before { content: $fa-var-list-ul; }
|
||||
.#{$fa-css-prefix}-list-ol:before { content: $fa-var-list-ol; }
|
||||
.#{$fa-css-prefix}-strikethrough:before { content: $fa-var-strikethrough; }
|
||||
.#{$fa-css-prefix}-underline:before { content: $fa-var-underline; }
|
||||
.#{$fa-css-prefix}-table:before { content: $fa-var-table; }
|
||||
.#{$fa-css-prefix}-magic:before { content: $fa-var-magic; }
|
||||
.#{$fa-css-prefix}-truck:before { content: $fa-var-truck; }
|
||||
.#{$fa-css-prefix}-pinterest:before { content: $fa-var-pinterest; }
|
||||
.#{$fa-css-prefix}-pinterest-square:before { content: $fa-var-pinterest-square; }
|
||||
.#{$fa-css-prefix}-google-plus-square:before { content: $fa-var-google-plus-square; }
|
||||
.#{$fa-css-prefix}-google-plus:before { content: $fa-var-google-plus; }
|
||||
.#{$fa-css-prefix}-money:before { content: $fa-var-money; }
|
||||
.#{$fa-css-prefix}-caret-down:before { content: $fa-var-caret-down; }
|
||||
.#{$fa-css-prefix}-caret-up:before { content: $fa-var-caret-up; }
|
||||
.#{$fa-css-prefix}-caret-left:before { content: $fa-var-caret-left; }
|
||||
.#{$fa-css-prefix}-caret-right:before { content: $fa-var-caret-right; }
|
||||
.#{$fa-css-prefix}-columns:before { content: $fa-var-columns; }
|
||||
.#{$fa-css-prefix}-unsorted:before,
|
||||
.#{$fa-css-prefix}-sort:before { content: $fa-var-sort; }
|
||||
.#{$fa-css-prefix}-sort-down:before,
|
||||
.#{$fa-css-prefix}-sort-desc:before { content: $fa-var-sort-desc; }
|
||||
.#{$fa-css-prefix}-sort-up:before,
|
||||
.#{$fa-css-prefix}-sort-asc:before { content: $fa-var-sort-asc; }
|
||||
.#{$fa-css-prefix}-envelope:before { content: $fa-var-envelope; }
|
||||
.#{$fa-css-prefix}-linkedin:before { content: $fa-var-linkedin; }
|
||||
.#{$fa-css-prefix}-rotate-left:before,
|
||||
.#{$fa-css-prefix}-undo:before { content: $fa-var-undo; }
|
||||
.#{$fa-css-prefix}-legal:before,
|
||||
.#{$fa-css-prefix}-gavel:before { content: $fa-var-gavel; }
|
||||
.#{$fa-css-prefix}-dashboard:before,
|
||||
.#{$fa-css-prefix}-tachometer:before { content: $fa-var-tachometer; }
|
||||
.#{$fa-css-prefix}-comment-o:before { content: $fa-var-comment-o; }
|
||||
.#{$fa-css-prefix}-comments-o:before { content: $fa-var-comments-o; }
|
||||
.#{$fa-css-prefix}-flash:before,
|
||||
.#{$fa-css-prefix}-bolt:before { content: $fa-var-bolt; }
|
||||
.#{$fa-css-prefix}-sitemap:before { content: $fa-var-sitemap; }
|
||||
.#{$fa-css-prefix}-umbrella:before { content: $fa-var-umbrella; }
|
||||
.#{$fa-css-prefix}-paste:before,
|
||||
.#{$fa-css-prefix}-clipboard:before { content: $fa-var-clipboard; }
|
||||
.#{$fa-css-prefix}-lightbulb-o:before { content: $fa-var-lightbulb-o; }
|
||||
.#{$fa-css-prefix}-exchange:before { content: $fa-var-exchange; }
|
||||
.#{$fa-css-prefix}-cloud-download:before { content: $fa-var-cloud-download; }
|
||||
.#{$fa-css-prefix}-cloud-upload:before { content: $fa-var-cloud-upload; }
|
||||
.#{$fa-css-prefix}-user-md:before { content: $fa-var-user-md; }
|
||||
.#{$fa-css-prefix}-stethoscope:before { content: $fa-var-stethoscope; }
|
||||
.#{$fa-css-prefix}-suitcase:before { content: $fa-var-suitcase; }
|
||||
.#{$fa-css-prefix}-bell-o:before { content: $fa-var-bell-o; }
|
||||
.#{$fa-css-prefix}-coffee:before { content: $fa-var-coffee; }
|
||||
.#{$fa-css-prefix}-cutlery:before { content: $fa-var-cutlery; }
|
||||
.#{$fa-css-prefix}-file-text-o:before { content: $fa-var-file-text-o; }
|
||||
.#{$fa-css-prefix}-building-o:before { content: $fa-var-building-o; }
|
||||
.#{$fa-css-prefix}-hospital-o:before { content: $fa-var-hospital-o; }
|
||||
.#{$fa-css-prefix}-ambulance:before { content: $fa-var-ambulance; }
|
||||
.#{$fa-css-prefix}-medkit:before { content: $fa-var-medkit; }
|
||||
.#{$fa-css-prefix}-fighter-jet:before { content: $fa-var-fighter-jet; }
|
||||
.#{$fa-css-prefix}-beer:before { content: $fa-var-beer; }
|
||||
.#{$fa-css-prefix}-h-square:before { content: $fa-var-h-square; }
|
||||
.#{$fa-css-prefix}-plus-square:before { content: $fa-var-plus-square; }
|
||||
.#{$fa-css-prefix}-angle-double-left:before { content: $fa-var-angle-double-left; }
|
||||
.#{$fa-css-prefix}-angle-double-right:before { content: $fa-var-angle-double-right; }
|
||||
.#{$fa-css-prefix}-angle-double-up:before { content: $fa-var-angle-double-up; }
|
||||
.#{$fa-css-prefix}-angle-double-down:before { content: $fa-var-angle-double-down; }
|
||||
.#{$fa-css-prefix}-angle-left:before { content: $fa-var-angle-left; }
|
||||
.#{$fa-css-prefix}-angle-right:before { content: $fa-var-angle-right; }
|
||||
.#{$fa-css-prefix}-angle-up:before { content: $fa-var-angle-up; }
|
||||
.#{$fa-css-prefix}-angle-down:before { content: $fa-var-angle-down; }
|
||||
.#{$fa-css-prefix}-desktop:before { content: $fa-var-desktop; }
|
||||
.#{$fa-css-prefix}-laptop:before { content: $fa-var-laptop; }
|
||||
.#{$fa-css-prefix}-tablet:before { content: $fa-var-tablet; }
|
||||
.#{$fa-css-prefix}-mobile-phone:before,
|
||||
.#{$fa-css-prefix}-mobile:before { content: $fa-var-mobile; }
|
||||
.#{$fa-css-prefix}-circle-o:before { content: $fa-var-circle-o; }
|
||||
.#{$fa-css-prefix}-quote-left:before { content: $fa-var-quote-left; }
|
||||
.#{$fa-css-prefix}-quote-right:before { content: $fa-var-quote-right; }
|
||||
.#{$fa-css-prefix}-spinner:before { content: $fa-var-spinner; }
|
||||
.#{$fa-css-prefix}-circle:before { content: $fa-var-circle; }
|
||||
.#{$fa-css-prefix}-mail-reply:before,
|
||||
.#{$fa-css-prefix}-reply:before { content: $fa-var-reply; }
|
||||
.#{$fa-css-prefix}-github-alt:before { content: $fa-var-github-alt; }
|
||||
.#{$fa-css-prefix}-folder-o:before { content: $fa-var-folder-o; }
|
||||
.#{$fa-css-prefix}-folder-open-o:before { content: $fa-var-folder-open-o; }
|
||||
.#{$fa-css-prefix}-smile-o:before { content: $fa-var-smile-o; }
|
||||
.#{$fa-css-prefix}-frown-o:before { content: $fa-var-frown-o; }
|
||||
.#{$fa-css-prefix}-meh-o:before { content: $fa-var-meh-o; }
|
||||
.#{$fa-css-prefix}-gamepad:before { content: $fa-var-gamepad; }
|
||||
.#{$fa-css-prefix}-keyboard-o:before { content: $fa-var-keyboard-o; }
|
||||
.#{$fa-css-prefix}-flag-o:before { content: $fa-var-flag-o; }
|
||||
.#{$fa-css-prefix}-flag-checkered:before { content: $fa-var-flag-checkered; }
|
||||
.#{$fa-css-prefix}-terminal:before { content: $fa-var-terminal; }
|
||||
.#{$fa-css-prefix}-code:before { content: $fa-var-code; }
|
||||
.#{$fa-css-prefix}-mail-reply-all:before,
|
||||
.#{$fa-css-prefix}-reply-all:before { content: $fa-var-reply-all; }
|
||||
.#{$fa-css-prefix}-star-half-empty:before,
|
||||
.#{$fa-css-prefix}-star-half-full:before,
|
||||
.#{$fa-css-prefix}-star-half-o:before { content: $fa-var-star-half-o; }
|
||||
.#{$fa-css-prefix}-location-arrow:before { content: $fa-var-location-arrow; }
|
||||
.#{$fa-css-prefix}-crop:before { content: $fa-var-crop; }
|
||||
.#{$fa-css-prefix}-code-fork:before { content: $fa-var-code-fork; }
|
||||
.#{$fa-css-prefix}-unlink:before,
|
||||
.#{$fa-css-prefix}-chain-broken:before { content: $fa-var-chain-broken; }
|
||||
.#{$fa-css-prefix}-question:before { content: $fa-var-question; }
|
||||
.#{$fa-css-prefix}-info:before { content: $fa-var-info; }
|
||||
.#{$fa-css-prefix}-exclamation:before { content: $fa-var-exclamation; }
|
||||
.#{$fa-css-prefix}-superscript:before { content: $fa-var-superscript; }
|
||||
.#{$fa-css-prefix}-subscript:before { content: $fa-var-subscript; }
|
||||
.#{$fa-css-prefix}-eraser:before { content: $fa-var-eraser; }
|
||||
.#{$fa-css-prefix}-puzzle-piece:before { content: $fa-var-puzzle-piece; }
|
||||
.#{$fa-css-prefix}-microphone:before { content: $fa-var-microphone; }
|
||||
.#{$fa-css-prefix}-microphone-slash:before { content: $fa-var-microphone-slash; }
|
||||
.#{$fa-css-prefix}-shield:before { content: $fa-var-shield; }
|
||||
.#{$fa-css-prefix}-calendar-o:before { content: $fa-var-calendar-o; }
|
||||
.#{$fa-css-prefix}-fire-extinguisher:before { content: $fa-var-fire-extinguisher; }
|
||||
.#{$fa-css-prefix}-rocket:before { content: $fa-var-rocket; }
|
||||
.#{$fa-css-prefix}-maxcdn:before { content: $fa-var-maxcdn; }
|
||||
.#{$fa-css-prefix}-chevron-circle-left:before { content: $fa-var-chevron-circle-left; }
|
||||
.#{$fa-css-prefix}-chevron-circle-right:before { content: $fa-var-chevron-circle-right; }
|
||||
.#{$fa-css-prefix}-chevron-circle-up:before { content: $fa-var-chevron-circle-up; }
|
||||
.#{$fa-css-prefix}-chevron-circle-down:before { content: $fa-var-chevron-circle-down; }
|
||||
.#{$fa-css-prefix}-html5:before { content: $fa-var-html5; }
|
||||
.#{$fa-css-prefix}-css3:before { content: $fa-var-css3; }
|
||||
.#{$fa-css-prefix}-anchor:before { content: $fa-var-anchor; }
|
||||
.#{$fa-css-prefix}-unlock-alt:before { content: $fa-var-unlock-alt; }
|
||||
.#{$fa-css-prefix}-bullseye:before { content: $fa-var-bullseye; }
|
||||
.#{$fa-css-prefix}-ellipsis-h:before { content: $fa-var-ellipsis-h; }
|
||||
.#{$fa-css-prefix}-ellipsis-v:before { content: $fa-var-ellipsis-v; }
|
||||
.#{$fa-css-prefix}-rss-square:before { content: $fa-var-rss-square; }
|
||||
.#{$fa-css-prefix}-play-circle:before { content: $fa-var-play-circle; }
|
||||
.#{$fa-css-prefix}-ticket:before { content: $fa-var-ticket; }
|
||||
.#{$fa-css-prefix}-minus-square:before { content: $fa-var-minus-square; }
|
||||
.#{$fa-css-prefix}-minus-square-o:before { content: $fa-var-minus-square-o; }
|
||||
.#{$fa-css-prefix}-level-up:before { content: $fa-var-level-up; }
|
||||
.#{$fa-css-prefix}-level-down:before { content: $fa-var-level-down; }
|
||||
.#{$fa-css-prefix}-check-square:before { content: $fa-var-check-square; }
|
||||
.#{$fa-css-prefix}-pencil-square:before { content: $fa-var-pencil-square; }
|
||||
.#{$fa-css-prefix}-external-link-square:before { content: $fa-var-external-link-square; }
|
||||
.#{$fa-css-prefix}-share-square:before { content: $fa-var-share-square; }
|
||||
.#{$fa-css-prefix}-compass:before { content: $fa-var-compass; }
|
||||
.#{$fa-css-prefix}-toggle-down:before,
|
||||
.#{$fa-css-prefix}-caret-square-o-down:before { content: $fa-var-caret-square-o-down; }
|
||||
.#{$fa-css-prefix}-toggle-up:before,
|
||||
.#{$fa-css-prefix}-caret-square-o-up:before { content: $fa-var-caret-square-o-up; }
|
||||
.#{$fa-css-prefix}-toggle-right:before,
|
||||
.#{$fa-css-prefix}-caret-square-o-right:before { content: $fa-var-caret-square-o-right; }
|
||||
.#{$fa-css-prefix}-euro:before,
|
||||
.#{$fa-css-prefix}-eur:before { content: $fa-var-eur; }
|
||||
.#{$fa-css-prefix}-gbp:before { content: $fa-var-gbp; }
|
||||
.#{$fa-css-prefix}-dollar:before,
|
||||
.#{$fa-css-prefix}-usd:before { content: $fa-var-usd; }
|
||||
.#{$fa-css-prefix}-rupee:before,
|
||||
.#{$fa-css-prefix}-inr:before { content: $fa-var-inr; }
|
||||
.#{$fa-css-prefix}-cny:before,
|
||||
.#{$fa-css-prefix}-rmb:before,
|
||||
.#{$fa-css-prefix}-yen:before,
|
||||
.#{$fa-css-prefix}-jpy:before { content: $fa-var-jpy; }
|
||||
.#{$fa-css-prefix}-ruble:before,
|
||||
.#{$fa-css-prefix}-rouble:before,
|
||||
.#{$fa-css-prefix}-rub:before { content: $fa-var-rub; }
|
||||
.#{$fa-css-prefix}-won:before,
|
||||
.#{$fa-css-prefix}-krw:before { content: $fa-var-krw; }
|
||||
.#{$fa-css-prefix}-bitcoin:before,
|
||||
.#{$fa-css-prefix}-btc:before { content: $fa-var-btc; }
|
||||
.#{$fa-css-prefix}-file:before { content: $fa-var-file; }
|
||||
.#{$fa-css-prefix}-file-text:before { content: $fa-var-file-text; }
|
||||
.#{$fa-css-prefix}-sort-alpha-asc:before { content: $fa-var-sort-alpha-asc; }
|
||||
.#{$fa-css-prefix}-sort-alpha-desc:before { content: $fa-var-sort-alpha-desc; }
|
||||
.#{$fa-css-prefix}-sort-amount-asc:before { content: $fa-var-sort-amount-asc; }
|
||||
.#{$fa-css-prefix}-sort-amount-desc:before { content: $fa-var-sort-amount-desc; }
|
||||
.#{$fa-css-prefix}-sort-numeric-asc:before { content: $fa-var-sort-numeric-asc; }
|
||||
.#{$fa-css-prefix}-sort-numeric-desc:before { content: $fa-var-sort-numeric-desc; }
|
||||
.#{$fa-css-prefix}-thumbs-up:before { content: $fa-var-thumbs-up; }
|
||||
.#{$fa-css-prefix}-thumbs-down:before { content: $fa-var-thumbs-down; }
|
||||
.#{$fa-css-prefix}-youtube-square:before { content: $fa-var-youtube-square; }
|
||||
.#{$fa-css-prefix}-youtube:before { content: $fa-var-youtube; }
|
||||
.#{$fa-css-prefix}-xing:before { content: $fa-var-xing; }
|
||||
.#{$fa-css-prefix}-xing-square:before { content: $fa-var-xing-square; }
|
||||
.#{$fa-css-prefix}-youtube-play:before { content: $fa-var-youtube-play; }
|
||||
.#{$fa-css-prefix}-dropbox:before { content: $fa-var-dropbox; }
|
||||
.#{$fa-css-prefix}-stack-overflow:before { content: $fa-var-stack-overflow; }
|
||||
.#{$fa-css-prefix}-instagram:before { content: $fa-var-instagram; }
|
||||
.#{$fa-css-prefix}-flickr:before { content: $fa-var-flickr; }
|
||||
.#{$fa-css-prefix}-adn:before { content: $fa-var-adn; }
|
||||
.#{$fa-css-prefix}-bitbucket:before { content: $fa-var-bitbucket; }
|
||||
.#{$fa-css-prefix}-bitbucket-square:before { content: $fa-var-bitbucket-square; }
|
||||
.#{$fa-css-prefix}-tumblr:before { content: $fa-var-tumblr; }
|
||||
.#{$fa-css-prefix}-tumblr-square:before { content: $fa-var-tumblr-square; }
|
||||
.#{$fa-css-prefix}-long-arrow-down:before { content: $fa-var-long-arrow-down; }
|
||||
.#{$fa-css-prefix}-long-arrow-up:before { content: $fa-var-long-arrow-up; }
|
||||
.#{$fa-css-prefix}-long-arrow-left:before { content: $fa-var-long-arrow-left; }
|
||||
.#{$fa-css-prefix}-long-arrow-right:before { content: $fa-var-long-arrow-right; }
|
||||
.#{$fa-css-prefix}-apple:before { content: $fa-var-apple; }
|
||||
.#{$fa-css-prefix}-windows:before { content: $fa-var-windows; }
|
||||
.#{$fa-css-prefix}-android:before { content: $fa-var-android; }
|
||||
.#{$fa-css-prefix}-linux:before { content: $fa-var-linux; }
|
||||
.#{$fa-css-prefix}-dribbble:before { content: $fa-var-dribbble; }
|
||||
.#{$fa-css-prefix}-skype:before { content: $fa-var-skype; }
|
||||
.#{$fa-css-prefix}-foursquare:before { content: $fa-var-foursquare; }
|
||||
.#{$fa-css-prefix}-trello:before { content: $fa-var-trello; }
|
||||
.#{$fa-css-prefix}-female:before { content: $fa-var-female; }
|
||||
.#{$fa-css-prefix}-male:before { content: $fa-var-male; }
|
||||
.#{$fa-css-prefix}-gittip:before { content: $fa-var-gittip; }
|
||||
.#{$fa-css-prefix}-sun-o:before { content: $fa-var-sun-o; }
|
||||
.#{$fa-css-prefix}-moon-o:before { content: $fa-var-moon-o; }
|
||||
.#{$fa-css-prefix}-archive:before { content: $fa-var-archive; }
|
||||
.#{$fa-css-prefix}-bug:before { content: $fa-var-bug; }
|
||||
.#{$fa-css-prefix}-vk:before { content: $fa-var-vk; }
|
||||
.#{$fa-css-prefix}-weibo:before { content: $fa-var-weibo; }
|
||||
.#{$fa-css-prefix}-renren:before { content: $fa-var-renren; }
|
||||
.#{$fa-css-prefix}-pagelines:before { content: $fa-var-pagelines; }
|
||||
.#{$fa-css-prefix}-stack-exchange:before { content: $fa-var-stack-exchange; }
|
||||
.#{$fa-css-prefix}-arrow-circle-o-right:before { content: $fa-var-arrow-circle-o-right; }
|
||||
.#{$fa-css-prefix}-arrow-circle-o-left:before { content: $fa-var-arrow-circle-o-left; }
|
||||
.#{$fa-css-prefix}-toggle-left:before,
|
||||
.#{$fa-css-prefix}-caret-square-o-left:before { content: $fa-var-caret-square-o-left; }
|
||||
.#{$fa-css-prefix}-dot-circle-o:before { content: $fa-var-dot-circle-o; }
|
||||
.#{$fa-css-prefix}-wheelchair:before { content: $fa-var-wheelchair; }
|
||||
.#{$fa-css-prefix}-vimeo-square:before { content: $fa-var-vimeo-square; }
|
||||
.#{$fa-css-prefix}-turkish-lira:before,
|
||||
.#{$fa-css-prefix}-try:before { content: $fa-var-try; }
|
||||
.#{$fa-css-prefix}-plus-square-o:before { content: $fa-var-plus-square-o; }
|
||||
.#{$fa-css-prefix}-space-shuttle:before { content: $fa-var-space-shuttle; }
|
||||
.#{$fa-css-prefix}-slack:before { content: $fa-var-slack; }
|
||||
.#{$fa-css-prefix}-envelope-square:before { content: $fa-var-envelope-square; }
|
||||
.#{$fa-css-prefix}-wordpress:before { content: $fa-var-wordpress; }
|
||||
.#{$fa-css-prefix}-openid:before { content: $fa-var-openid; }
|
||||
.#{$fa-css-prefix}-institution:before,
|
||||
.#{$fa-css-prefix}-bank:before,
|
||||
.#{$fa-css-prefix}-university:before { content: $fa-var-university; }
|
||||
.#{$fa-css-prefix}-mortar-board:before,
|
||||
.#{$fa-css-prefix}-graduation-cap:before { content: $fa-var-graduation-cap; }
|
||||
.#{$fa-css-prefix}-yahoo:before { content: $fa-var-yahoo; }
|
||||
.#{$fa-css-prefix}-google:before { content: $fa-var-google; }
|
||||
.#{$fa-css-prefix}-reddit:before { content: $fa-var-reddit; }
|
||||
.#{$fa-css-prefix}-reddit-square:before { content: $fa-var-reddit-square; }
|
||||
.#{$fa-css-prefix}-stumbleupon-circle:before { content: $fa-var-stumbleupon-circle; }
|
||||
.#{$fa-css-prefix}-stumbleupon:before { content: $fa-var-stumbleupon; }
|
||||
.#{$fa-css-prefix}-delicious:before { content: $fa-var-delicious; }
|
||||
.#{$fa-css-prefix}-digg:before { content: $fa-var-digg; }
|
||||
.#{$fa-css-prefix}-pied-piper:before { content: $fa-var-pied-piper; }
|
||||
.#{$fa-css-prefix}-pied-piper-alt:before { content: $fa-var-pied-piper-alt; }
|
||||
.#{$fa-css-prefix}-drupal:before { content: $fa-var-drupal; }
|
||||
.#{$fa-css-prefix}-joomla:before { content: $fa-var-joomla; }
|
||||
.#{$fa-css-prefix}-language:before { content: $fa-var-language; }
|
||||
.#{$fa-css-prefix}-fax:before { content: $fa-var-fax; }
|
||||
.#{$fa-css-prefix}-building:before { content: $fa-var-building; }
|
||||
.#{$fa-css-prefix}-child:before { content: $fa-var-child; }
|
||||
.#{$fa-css-prefix}-paw:before { content: $fa-var-paw; }
|
||||
.#{$fa-css-prefix}-spoon:before { content: $fa-var-spoon; }
|
||||
.#{$fa-css-prefix}-cube:before { content: $fa-var-cube; }
|
||||
.#{$fa-css-prefix}-cubes:before { content: $fa-var-cubes; }
|
||||
.#{$fa-css-prefix}-behance:before { content: $fa-var-behance; }
|
||||
.#{$fa-css-prefix}-behance-square:before { content: $fa-var-behance-square; }
|
||||
.#{$fa-css-prefix}-steam:before { content: $fa-var-steam; }
|
||||
.#{$fa-css-prefix}-steam-square:before { content: $fa-var-steam-square; }
|
||||
.#{$fa-css-prefix}-recycle:before { content: $fa-var-recycle; }
|
||||
.#{$fa-css-prefix}-automobile:before,
|
||||
.#{$fa-css-prefix}-car:before { content: $fa-var-car; }
|
||||
.#{$fa-css-prefix}-cab:before,
|
||||
.#{$fa-css-prefix}-taxi:before { content: $fa-var-taxi; }
|
||||
.#{$fa-css-prefix}-tree:before { content: $fa-var-tree; }
|
||||
.#{$fa-css-prefix}-spotify:before { content: $fa-var-spotify; }
|
||||
.#{$fa-css-prefix}-deviantart:before { content: $fa-var-deviantart; }
|
||||
.#{$fa-css-prefix}-soundcloud:before { content: $fa-var-soundcloud; }
|
||||
.#{$fa-css-prefix}-database:before { content: $fa-var-database; }
|
||||
.#{$fa-css-prefix}-file-pdf-o:before { content: $fa-var-file-pdf-o; }
|
||||
.#{$fa-css-prefix}-file-word-o:before { content: $fa-var-file-word-o; }
|
||||
.#{$fa-css-prefix}-file-excel-o:before { content: $fa-var-file-excel-o; }
|
||||
.#{$fa-css-prefix}-file-powerpoint-o:before { content: $fa-var-file-powerpoint-o; }
|
||||
.#{$fa-css-prefix}-file-photo-o:before,
|
||||
.#{$fa-css-prefix}-file-picture-o:before,
|
||||
.#{$fa-css-prefix}-file-image-o:before { content: $fa-var-file-image-o; }
|
||||
.#{$fa-css-prefix}-file-zip-o:before,
|
||||
.#{$fa-css-prefix}-file-archive-o:before { content: $fa-var-file-archive-o; }
|
||||
.#{$fa-css-prefix}-file-sound-o:before,
|
||||
.#{$fa-css-prefix}-file-audio-o:before { content: $fa-var-file-audio-o; }
|
||||
.#{$fa-css-prefix}-file-movie-o:before,
|
||||
.#{$fa-css-prefix}-file-video-o:before { content: $fa-var-file-video-o; }
|
||||
.#{$fa-css-prefix}-file-code-o:before { content: $fa-var-file-code-o; }
|
||||
.#{$fa-css-prefix}-vine:before { content: $fa-var-vine; }
|
||||
.#{$fa-css-prefix}-codepen:before { content: $fa-var-codepen; }
|
||||
.#{$fa-css-prefix}-jsfiddle:before { content: $fa-var-jsfiddle; }
|
||||
.#{$fa-css-prefix}-life-bouy:before,
|
||||
.#{$fa-css-prefix}-life-buoy:before,
|
||||
.#{$fa-css-prefix}-life-saver:before,
|
||||
.#{$fa-css-prefix}-support:before,
|
||||
.#{$fa-css-prefix}-life-ring:before { content: $fa-var-life-ring; }
|
||||
.#{$fa-css-prefix}-circle-o-notch:before { content: $fa-var-circle-o-notch; }
|
||||
.#{$fa-css-prefix}-ra:before,
|
||||
.#{$fa-css-prefix}-rebel:before { content: $fa-var-rebel; }
|
||||
.#{$fa-css-prefix}-ge:before,
|
||||
.#{$fa-css-prefix}-empire:before { content: $fa-var-empire; }
|
||||
.#{$fa-css-prefix}-git-square:before { content: $fa-var-git-square; }
|
||||
.#{$fa-css-prefix}-git:before { content: $fa-var-git; }
|
||||
.#{$fa-css-prefix}-hacker-news:before { content: $fa-var-hacker-news; }
|
||||
.#{$fa-css-prefix}-tencent-weibo:before { content: $fa-var-tencent-weibo; }
|
||||
.#{$fa-css-prefix}-qq:before { content: $fa-var-qq; }
|
||||
.#{$fa-css-prefix}-wechat:before,
|
||||
.#{$fa-css-prefix}-weixin:before { content: $fa-var-weixin; }
|
||||
.#{$fa-css-prefix}-send:before,
|
||||
.#{$fa-css-prefix}-paper-plane:before { content: $fa-var-paper-plane; }
|
||||
.#{$fa-css-prefix}-send-o:before,
|
||||
.#{$fa-css-prefix}-paper-plane-o:before { content: $fa-var-paper-plane-o; }
|
||||
.#{$fa-css-prefix}-history:before { content: $fa-var-history; }
|
||||
.#{$fa-css-prefix}-circle-thin:before { content: $fa-var-circle-thin; }
|
||||
.#{$fa-css-prefix}-header:before { content: $fa-var-header; }
|
||||
.#{$fa-css-prefix}-paragraph:before { content: $fa-var-paragraph; }
|
||||
.#{$fa-css-prefix}-sliders:before { content: $fa-var-sliders; }
|
||||
.#{$fa-css-prefix}-share-alt:before { content: $fa-var-share-alt; }
|
||||
.#{$fa-css-prefix}-share-alt-square:before { content: $fa-var-share-alt-square; }
|
||||
.#{$fa-css-prefix}-bomb:before { content: $fa-var-bomb; }
|
||||
.#{$fa-css-prefix}-soccer-ball-o:before,
|
||||
.#{$fa-css-prefix}-futbol-o:before { content: $fa-var-futbol-o; }
|
||||
.#{$fa-css-prefix}-tty:before { content: $fa-var-tty; }
|
||||
.#{$fa-css-prefix}-binoculars:before { content: $fa-var-binoculars; }
|
||||
.#{$fa-css-prefix}-plug:before { content: $fa-var-plug; }
|
||||
.#{$fa-css-prefix}-slideshare:before { content: $fa-var-slideshare; }
|
||||
.#{$fa-css-prefix}-twitch:before { content: $fa-var-twitch; }
|
||||
.#{$fa-css-prefix}-yelp:before { content: $fa-var-yelp; }
|
||||
.#{$fa-css-prefix}-newspaper-o:before { content: $fa-var-newspaper-o; }
|
||||
.#{$fa-css-prefix}-wifi:before { content: $fa-var-wifi; }
|
||||
.#{$fa-css-prefix}-calculator:before { content: $fa-var-calculator; }
|
||||
.#{$fa-css-prefix}-paypal:before { content: $fa-var-paypal; }
|
||||
.#{$fa-css-prefix}-google-wallet:before { content: $fa-var-google-wallet; }
|
||||
.#{$fa-css-prefix}-cc-visa:before { content: $fa-var-cc-visa; }
|
||||
.#{$fa-css-prefix}-cc-mastercard:before { content: $fa-var-cc-mastercard; }
|
||||
.#{$fa-css-prefix}-cc-discover:before { content: $fa-var-cc-discover; }
|
||||
.#{$fa-css-prefix}-cc-amex:before { content: $fa-var-cc-amex; }
|
||||
.#{$fa-css-prefix}-cc-paypal:before { content: $fa-var-cc-paypal; }
|
||||
.#{$fa-css-prefix}-cc-stripe:before { content: $fa-var-cc-stripe; }
|
||||
.#{$fa-css-prefix}-bell-slash:before { content: $fa-var-bell-slash; }
|
||||
.#{$fa-css-prefix}-bell-slash-o:before { content: $fa-var-bell-slash-o; }
|
||||
.#{$fa-css-prefix}-trash:before { content: $fa-var-trash; }
|
||||
.#{$fa-css-prefix}-copyright:before { content: $fa-var-copyright; }
|
||||
.#{$fa-css-prefix}-at:before { content: $fa-var-at; }
|
||||
.#{$fa-css-prefix}-eyedropper:before { content: $fa-var-eyedropper; }
|
||||
.#{$fa-css-prefix}-paint-brush:before { content: $fa-var-paint-brush; }
|
||||
.#{$fa-css-prefix}-birthday-cake:before { content: $fa-var-birthday-cake; }
|
||||
.#{$fa-css-prefix}-area-chart:before { content: $fa-var-area-chart; }
|
||||
.#{$fa-css-prefix}-pie-chart:before { content: $fa-var-pie-chart; }
|
||||
.#{$fa-css-prefix}-line-chart:before { content: $fa-var-line-chart; }
|
||||
.#{$fa-css-prefix}-lastfm:before { content: $fa-var-lastfm; }
|
||||
.#{$fa-css-prefix}-lastfm-square:before { content: $fa-var-lastfm-square; }
|
||||
.#{$fa-css-prefix}-toggle-off:before { content: $fa-var-toggle-off; }
|
||||
.#{$fa-css-prefix}-toggle-on:before { content: $fa-var-toggle-on; }
|
||||
.#{$fa-css-prefix}-bicycle:before { content: $fa-var-bicycle; }
|
||||
.#{$fa-css-prefix}-bus:before { content: $fa-var-bus; }
|
||||
.#{$fa-css-prefix}-ioxhost:before { content: $fa-var-ioxhost; }
|
||||
.#{$fa-css-prefix}-angellist:before { content: $fa-var-angellist; }
|
||||
.#{$fa-css-prefix}-cc:before { content: $fa-var-cc; }
|
||||
.#{$fa-css-prefix}-shekel:before,
|
||||
.#{$fa-css-prefix}-sheqel:before,
|
||||
.#{$fa-css-prefix}-ils:before { content: $fa-var-ils; }
|
||||
.#{$fa-css-prefix}-meanpath:before { content: $fa-var-meanpath; }
|
||||
@@ -0,0 +1,13 @@
|
||||
// Icon Sizes
|
||||
// -------------------------
|
||||
|
||||
/* makes the font 33% larger relative to the icon container */
|
||||
.#{$fa-css-prefix}-lg {
|
||||
font-size: (4em / 3);
|
||||
line-height: (3em / 4);
|
||||
vertical-align: -15%;
|
||||
}
|
||||
.#{$fa-css-prefix}-2x { font-size: 2em; }
|
||||
.#{$fa-css-prefix}-3x { font-size: 3em; }
|
||||
.#{$fa-css-prefix}-4x { font-size: 4em; }
|
||||
.#{$fa-css-prefix}-5x { font-size: 5em; }
|
||||
@@ -0,0 +1,19 @@
|
||||
// List Icons
|
||||
// -------------------------
|
||||
|
||||
.#{$fa-css-prefix}-ul {
|
||||
padding-left: 0;
|
||||
margin-left: $fa-li-width;
|
||||
list-style-type: none;
|
||||
> li { position: relative; }
|
||||
}
|
||||
.#{$fa-css-prefix}-li {
|
||||
position: absolute;
|
||||
left: -$fa-li-width;
|
||||
width: $fa-li-width;
|
||||
top: (2em / 14);
|
||||
text-align: center;
|
||||
&.#{$fa-css-prefix}-lg {
|
||||
left: -$fa-li-width + (4em / 14);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
// Mixins
|
||||
// --------------------------
|
||||
|
||||
@mixin fa-icon() {
|
||||
display: inline-block;
|
||||
font: normal normal normal 14px/1 FontAwesome; // shortening font declaration
|
||||
font-size: inherit; // can't have font-size inherit on line above, so need to override
|
||||
text-rendering: auto; // optimizelegibility throws things off #1094
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
@mixin fa-icon-rotate($degrees, $rotation) {
|
||||
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation});
|
||||
-webkit-transform: rotate($degrees);
|
||||
-ms-transform: rotate($degrees);
|
||||
transform: rotate($degrees);
|
||||
}
|
||||
|
||||
@mixin fa-icon-flip($horiz, $vert, $rotation) {
|
||||
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation});
|
||||
-webkit-transform: scale($horiz, $vert);
|
||||
-ms-transform: scale($horiz, $vert);
|
||||
transform: scale($horiz, $vert);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
/* FONT PATH
|
||||
* -------------------------- */
|
||||
|
||||
@font-face {
|
||||
font-family: 'FontAwesome';
|
||||
src: url('#{$fa-font-path}/fontawesome-webfont.eot?v=#{$fa-version}');
|
||||
src: url('#{$fa-font-path}/fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'),
|
||||
url('#{$fa-font-path}/fontawesome-webfont.woff?v=#{$fa-version}') format('woff'),
|
||||
url('#{$fa-font-path}/fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'),
|
||||
url('#{$fa-font-path}/fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg');
|
||||
//src: url('#{$fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// Rotated & Flipped Icons
|
||||
// -------------------------
|
||||
|
||||
.#{$fa-css-prefix}-rotate-90 { @include fa-icon-rotate(90deg, 1); }
|
||||
.#{$fa-css-prefix}-rotate-180 { @include fa-icon-rotate(180deg, 2); }
|
||||
.#{$fa-css-prefix}-rotate-270 { @include fa-icon-rotate(270deg, 3); }
|
||||
|
||||
.#{$fa-css-prefix}-flip-horizontal { @include fa-icon-flip(-1, 1, 0); }
|
||||
.#{$fa-css-prefix}-flip-vertical { @include fa-icon-flip(1, -1, 2); }
|
||||
|
||||
// Hook for IE8-9
|
||||
// -------------------------
|
||||
|
||||
:root .#{$fa-css-prefix}-rotate-90,
|
||||
:root .#{$fa-css-prefix}-rotate-180,
|
||||
:root .#{$fa-css-prefix}-rotate-270,
|
||||
:root .#{$fa-css-prefix}-flip-horizontal,
|
||||
:root .#{$fa-css-prefix}-flip-vertical {
|
||||
filter: none;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// Spinning Icons
|
||||
// --------------------------
|
||||
|
||||
.#{$fa-css-prefix}-spin {
|
||||
-webkit-animation: fa-spin 2s infinite linear;
|
||||
animation: fa-spin 2s infinite linear;
|
||||
}
|
||||
|
||||
@-webkit-keyframes fa-spin {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: rotate(359deg);
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fa-spin {
|
||||
0% {
|
||||
-webkit-transform: rotate(0deg);
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
-webkit-transform: rotate(359deg);
|
||||
transform: rotate(359deg);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// Stacked Icons
|
||||
// -------------------------
|
||||
|
||||
.#{$fa-css-prefix}-stack {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 2em;
|
||||
height: 2em;
|
||||
line-height: 2em;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.#{$fa-css-prefix}-stack-1x, .#{$fa-css-prefix}-stack-2x {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
.#{$fa-css-prefix}-stack-1x { line-height: inherit; }
|
||||
.#{$fa-css-prefix}-stack-2x { font-size: 2em; }
|
||||
.#{$fa-css-prefix}-inverse { color: $fa-inverse; }
|
||||
@@ -0,0 +1,561 @@
|
||||
// Variables
|
||||
// --------------------------
|
||||
|
||||
$fa-font-path: "../fonts" !default;
|
||||
//$fa-font-path: "//netdna.bootstrapcdn.com/font-awesome/4.2.0/fonts" !default; // for referencing Bootstrap CDN font files directly
|
||||
$fa-css-prefix: fa !default;
|
||||
$fa-version: "4.2.0" !default;
|
||||
$fa-border-color: #eee !default;
|
||||
$fa-inverse: #fff !default;
|
||||
$fa-li-width: (30em / 14) !default;
|
||||
|
||||
$fa-var-adjust: "\f042";
|
||||
$fa-var-adn: "\f170";
|
||||
$fa-var-align-center: "\f037";
|
||||
$fa-var-align-justify: "\f039";
|
||||
$fa-var-align-left: "\f036";
|
||||
$fa-var-align-right: "\f038";
|
||||
$fa-var-ambulance: "\f0f9";
|
||||
$fa-var-anchor: "\f13d";
|
||||
$fa-var-android: "\f17b";
|
||||
$fa-var-angellist: "\f209";
|
||||
$fa-var-angle-double-down: "\f103";
|
||||
$fa-var-angle-double-left: "\f100";
|
||||
$fa-var-angle-double-right: "\f101";
|
||||
$fa-var-angle-double-up: "\f102";
|
||||
$fa-var-angle-down: "\f107";
|
||||
$fa-var-angle-left: "\f104";
|
||||
$fa-var-angle-right: "\f105";
|
||||
$fa-var-angle-up: "\f106";
|
||||
$fa-var-apple: "\f179";
|
||||
$fa-var-archive: "\f187";
|
||||
$fa-var-area-chart: "\f1fe";
|
||||
$fa-var-arrow-circle-down: "\f0ab";
|
||||
$fa-var-arrow-circle-left: "\f0a8";
|
||||
$fa-var-arrow-circle-o-down: "\f01a";
|
||||
$fa-var-arrow-circle-o-left: "\f190";
|
||||
$fa-var-arrow-circle-o-right: "\f18e";
|
||||
$fa-var-arrow-circle-o-up: "\f01b";
|
||||
$fa-var-arrow-circle-right: "\f0a9";
|
||||
$fa-var-arrow-circle-up: "\f0aa";
|
||||
$fa-var-arrow-down: "\f063";
|
||||
$fa-var-arrow-left: "\f060";
|
||||
$fa-var-arrow-right: "\f061";
|
||||
$fa-var-arrow-up: "\f062";
|
||||
$fa-var-arrows: "\f047";
|
||||
$fa-var-arrows-alt: "\f0b2";
|
||||
$fa-var-arrows-h: "\f07e";
|
||||
$fa-var-arrows-v: "\f07d";
|
||||
$fa-var-asterisk: "\f069";
|
||||
$fa-var-at: "\f1fa";
|
||||
$fa-var-automobile: "\f1b9";
|
||||
$fa-var-backward: "\f04a";
|
||||
$fa-var-ban: "\f05e";
|
||||
$fa-var-bank: "\f19c";
|
||||
$fa-var-bar-chart: "\f080";
|
||||
$fa-var-bar-chart-o: "\f080";
|
||||
$fa-var-barcode: "\f02a";
|
||||
$fa-var-bars: "\f0c9";
|
||||
$fa-var-beer: "\f0fc";
|
||||
$fa-var-behance: "\f1b4";
|
||||
$fa-var-behance-square: "\f1b5";
|
||||
$fa-var-bell: "\f0f3";
|
||||
$fa-var-bell-o: "\f0a2";
|
||||
$fa-var-bell-slash: "\f1f6";
|
||||
$fa-var-bell-slash-o: "\f1f7";
|
||||
$fa-var-bicycle: "\f206";
|
||||
$fa-var-binoculars: "\f1e5";
|
||||
$fa-var-birthday-cake: "\f1fd";
|
||||
$fa-var-bitbucket: "\f171";
|
||||
$fa-var-bitbucket-square: "\f172";
|
||||
$fa-var-bitcoin: "\f15a";
|
||||
$fa-var-bold: "\f032";
|
||||
$fa-var-bolt: "\f0e7";
|
||||
$fa-var-bomb: "\f1e2";
|
||||
$fa-var-book: "\f02d";
|
||||
$fa-var-bookmark: "\f02e";
|
||||
$fa-var-bookmark-o: "\f097";
|
||||
$fa-var-briefcase: "\f0b1";
|
||||
$fa-var-btc: "\f15a";
|
||||
$fa-var-bug: "\f188";
|
||||
$fa-var-building: "\f1ad";
|
||||
$fa-var-building-o: "\f0f7";
|
||||
$fa-var-bullhorn: "\f0a1";
|
||||
$fa-var-bullseye: "\f140";
|
||||
$fa-var-bus: "\f207";
|
||||
$fa-var-cab: "\f1ba";
|
||||
$fa-var-calculator: "\f1ec";
|
||||
$fa-var-calendar: "\f073";
|
||||
$fa-var-calendar-o: "\f133";
|
||||
$fa-var-camera: "\f030";
|
||||
$fa-var-camera-retro: "\f083";
|
||||
$fa-var-car: "\f1b9";
|
||||
$fa-var-caret-down: "\f0d7";
|
||||
$fa-var-caret-left: "\f0d9";
|
||||
$fa-var-caret-right: "\f0da";
|
||||
$fa-var-caret-square-o-down: "\f150";
|
||||
$fa-var-caret-square-o-left: "\f191";
|
||||
$fa-var-caret-square-o-right: "\f152";
|
||||
$fa-var-caret-square-o-up: "\f151";
|
||||
$fa-var-caret-up: "\f0d8";
|
||||
$fa-var-cc: "\f20a";
|
||||
$fa-var-cc-amex: "\f1f3";
|
||||
$fa-var-cc-discover: "\f1f2";
|
||||
$fa-var-cc-mastercard: "\f1f1";
|
||||
$fa-var-cc-paypal: "\f1f4";
|
||||
$fa-var-cc-stripe: "\f1f5";
|
||||
$fa-var-cc-visa: "\f1f0";
|
||||
$fa-var-certificate: "\f0a3";
|
||||
$fa-var-chain: "\f0c1";
|
||||
$fa-var-chain-broken: "\f127";
|
||||
$fa-var-check: "\f00c";
|
||||
$fa-var-check-circle: "\f058";
|
||||
$fa-var-check-circle-o: "\f05d";
|
||||
$fa-var-check-square: "\f14a";
|
||||
$fa-var-check-square-o: "\f046";
|
||||
$fa-var-chevron-circle-down: "\f13a";
|
||||
$fa-var-chevron-circle-left: "\f137";
|
||||
$fa-var-chevron-circle-right: "\f138";
|
||||
$fa-var-chevron-circle-up: "\f139";
|
||||
$fa-var-chevron-down: "\f078";
|
||||
$fa-var-chevron-left: "\f053";
|
||||
$fa-var-chevron-right: "\f054";
|
||||
$fa-var-chevron-up: "\f077";
|
||||
$fa-var-child: "\f1ae";
|
||||
$fa-var-circle: "\f111";
|
||||
$fa-var-circle-o: "\f10c";
|
||||
$fa-var-circle-o-notch: "\f1ce";
|
||||
$fa-var-circle-thin: "\f1db";
|
||||
$fa-var-clipboard: "\f0ea";
|
||||
$fa-var-clock-o: "\f017";
|
||||
$fa-var-close: "\f00d";
|
||||
$fa-var-cloud: "\f0c2";
|
||||
$fa-var-cloud-download: "\f0ed";
|
||||
$fa-var-cloud-upload: "\f0ee";
|
||||
$fa-var-cny: "\f157";
|
||||
$fa-var-code: "\f121";
|
||||
$fa-var-code-fork: "\f126";
|
||||
$fa-var-codepen: "\f1cb";
|
||||
$fa-var-coffee: "\f0f4";
|
||||
$fa-var-cog: "\f013";
|
||||
$fa-var-cogs: "\f085";
|
||||
$fa-var-columns: "\f0db";
|
||||
$fa-var-comment: "\f075";
|
||||
$fa-var-comment-o: "\f0e5";
|
||||
$fa-var-comments: "\f086";
|
||||
$fa-var-comments-o: "\f0e6";
|
||||
$fa-var-compass: "\f14e";
|
||||
$fa-var-compress: "\f066";
|
||||
$fa-var-copy: "\f0c5";
|
||||
$fa-var-copyright: "\f1f9";
|
||||
$fa-var-credit-card: "\f09d";
|
||||
$fa-var-crop: "\f125";
|
||||
$fa-var-crosshairs: "\f05b";
|
||||
$fa-var-css3: "\f13c";
|
||||
$fa-var-cube: "\f1b2";
|
||||
$fa-var-cubes: "\f1b3";
|
||||
$fa-var-cut: "\f0c4";
|
||||
$fa-var-cutlery: "\f0f5";
|
||||
$fa-var-dashboard: "\f0e4";
|
||||
$fa-var-database: "\f1c0";
|
||||
$fa-var-dedent: "\f03b";
|
||||
$fa-var-delicious: "\f1a5";
|
||||
$fa-var-desktop: "\f108";
|
||||
$fa-var-deviantart: "\f1bd";
|
||||
$fa-var-digg: "\f1a6";
|
||||
$fa-var-dollar: "\f155";
|
||||
$fa-var-dot-circle-o: "\f192";
|
||||
$fa-var-download: "\f019";
|
||||
$fa-var-dribbble: "\f17d";
|
||||
$fa-var-dropbox: "\f16b";
|
||||
$fa-var-drupal: "\f1a9";
|
||||
$fa-var-edit: "\f044";
|
||||
$fa-var-eject: "\f052";
|
||||
$fa-var-ellipsis-h: "\f141";
|
||||
$fa-var-ellipsis-v: "\f142";
|
||||
$fa-var-empire: "\f1d1";
|
||||
$fa-var-envelope: "\f0e0";
|
||||
$fa-var-envelope-o: "\f003";
|
||||
$fa-var-envelope-square: "\f199";
|
||||
$fa-var-eraser: "\f12d";
|
||||
$fa-var-eur: "\f153";
|
||||
$fa-var-euro: "\f153";
|
||||
$fa-var-exchange: "\f0ec";
|
||||
$fa-var-exclamation: "\f12a";
|
||||
$fa-var-exclamation-circle: "\f06a";
|
||||
$fa-var-exclamation-triangle: "\f071";
|
||||
$fa-var-expand: "\f065";
|
||||
$fa-var-external-link: "\f08e";
|
||||
$fa-var-external-link-square: "\f14c";
|
||||
$fa-var-eye: "\f06e";
|
||||
$fa-var-eye-slash: "\f070";
|
||||
$fa-var-eyedropper: "\f1fb";
|
||||
$fa-var-facebook: "\f09a";
|
||||
$fa-var-facebook-square: "\f082";
|
||||
$fa-var-fast-backward: "\f049";
|
||||
$fa-var-fast-forward: "\f050";
|
||||
$fa-var-fax: "\f1ac";
|
||||
$fa-var-female: "\f182";
|
||||
$fa-var-fighter-jet: "\f0fb";
|
||||
$fa-var-file: "\f15b";
|
||||
$fa-var-file-archive-o: "\f1c6";
|
||||
$fa-var-file-audio-o: "\f1c7";
|
||||
$fa-var-file-code-o: "\f1c9";
|
||||
$fa-var-file-excel-o: "\f1c3";
|
||||
$fa-var-file-image-o: "\f1c5";
|
||||
$fa-var-file-movie-o: "\f1c8";
|
||||
$fa-var-file-o: "\f016";
|
||||
$fa-var-file-pdf-o: "\f1c1";
|
||||
$fa-var-file-photo-o: "\f1c5";
|
||||
$fa-var-file-picture-o: "\f1c5";
|
||||
$fa-var-file-powerpoint-o: "\f1c4";
|
||||
$fa-var-file-sound-o: "\f1c7";
|
||||
$fa-var-file-text: "\f15c";
|
||||
$fa-var-file-text-o: "\f0f6";
|
||||
$fa-var-file-video-o: "\f1c8";
|
||||
$fa-var-file-word-o: "\f1c2";
|
||||
$fa-var-file-zip-o: "\f1c6";
|
||||
$fa-var-files-o: "\f0c5";
|
||||
$fa-var-film: "\f008";
|
||||
$fa-var-filter: "\f0b0";
|
||||
$fa-var-fire: "\f06d";
|
||||
$fa-var-fire-extinguisher: "\f134";
|
||||
$fa-var-flag: "\f024";
|
||||
$fa-var-flag-checkered: "\f11e";
|
||||
$fa-var-flag-o: "\f11d";
|
||||
$fa-var-flash: "\f0e7";
|
||||
$fa-var-flask: "\f0c3";
|
||||
$fa-var-flickr: "\f16e";
|
||||
$fa-var-floppy-o: "\f0c7";
|
||||
$fa-var-folder: "\f07b";
|
||||
$fa-var-folder-o: "\f114";
|
||||
$fa-var-folder-open: "\f07c";
|
||||
$fa-var-folder-open-o: "\f115";
|
||||
$fa-var-font: "\f031";
|
||||
$fa-var-forward: "\f04e";
|
||||
$fa-var-foursquare: "\f180";
|
||||
$fa-var-frown-o: "\f119";
|
||||
$fa-var-futbol-o: "\f1e3";
|
||||
$fa-var-gamepad: "\f11b";
|
||||
$fa-var-gavel: "\f0e3";
|
||||
$fa-var-gbp: "\f154";
|
||||
$fa-var-ge: "\f1d1";
|
||||
$fa-var-gear: "\f013";
|
||||
$fa-var-gears: "\f085";
|
||||
$fa-var-gift: "\f06b";
|
||||
$fa-var-git: "\f1d3";
|
||||
$fa-var-git-square: "\f1d2";
|
||||
$fa-var-github: "\f09b";
|
||||
$fa-var-github-alt: "\f113";
|
||||
$fa-var-github-square: "\f092";
|
||||
$fa-var-gittip: "\f184";
|
||||
$fa-var-glass: "\f000";
|
||||
$fa-var-globe: "\f0ac";
|
||||
$fa-var-google: "\f1a0";
|
||||
$fa-var-google-plus: "\f0d5";
|
||||
$fa-var-google-plus-square: "\f0d4";
|
||||
$fa-var-google-wallet: "\f1ee";
|
||||
$fa-var-graduation-cap: "\f19d";
|
||||
$fa-var-group: "\f0c0";
|
||||
$fa-var-h-square: "\f0fd";
|
||||
$fa-var-hacker-news: "\f1d4";
|
||||
$fa-var-hand-o-down: "\f0a7";
|
||||
$fa-var-hand-o-left: "\f0a5";
|
||||
$fa-var-hand-o-right: "\f0a4";
|
||||
$fa-var-hand-o-up: "\f0a6";
|
||||
$fa-var-hdd-o: "\f0a0";
|
||||
$fa-var-header: "\f1dc";
|
||||
$fa-var-headphones: "\f025";
|
||||
$fa-var-heart: "\f004";
|
||||
$fa-var-heart-o: "\f08a";
|
||||
$fa-var-history: "\f1da";
|
||||
$fa-var-home: "\f015";
|
||||
$fa-var-hospital-o: "\f0f8";
|
||||
$fa-var-html5: "\f13b";
|
||||
$fa-var-ils: "\f20b";
|
||||
$fa-var-image: "\f03e";
|
||||
$fa-var-inbox: "\f01c";
|
||||
$fa-var-indent: "\f03c";
|
||||
$fa-var-info: "\f129";
|
||||
$fa-var-info-circle: "\f05a";
|
||||
$fa-var-inr: "\f156";
|
||||
$fa-var-instagram: "\f16d";
|
||||
$fa-var-institution: "\f19c";
|
||||
$fa-var-ioxhost: "\f208";
|
||||
$fa-var-italic: "\f033";
|
||||
$fa-var-joomla: "\f1aa";
|
||||
$fa-var-jpy: "\f157";
|
||||
$fa-var-jsfiddle: "\f1cc";
|
||||
$fa-var-key: "\f084";
|
||||
$fa-var-keyboard-o: "\f11c";
|
||||
$fa-var-krw: "\f159";
|
||||
$fa-var-language: "\f1ab";
|
||||
$fa-var-laptop: "\f109";
|
||||
$fa-var-lastfm: "\f202";
|
||||
$fa-var-lastfm-square: "\f203";
|
||||
$fa-var-leaf: "\f06c";
|
||||
$fa-var-legal: "\f0e3";
|
||||
$fa-var-lemon-o: "\f094";
|
||||
$fa-var-level-down: "\f149";
|
||||
$fa-var-level-up: "\f148";
|
||||
$fa-var-life-bouy: "\f1cd";
|
||||
$fa-var-life-buoy: "\f1cd";
|
||||
$fa-var-life-ring: "\f1cd";
|
||||
$fa-var-life-saver: "\f1cd";
|
||||
$fa-var-lightbulb-o: "\f0eb";
|
||||
$fa-var-line-chart: "\f201";
|
||||
$fa-var-link: "\f0c1";
|
||||
$fa-var-linkedin: "\f0e1";
|
||||
$fa-var-linkedin-square: "\f08c";
|
||||
$fa-var-linux: "\f17c";
|
||||
$fa-var-list: "\f03a";
|
||||
$fa-var-list-alt: "\f022";
|
||||
$fa-var-list-ol: "\f0cb";
|
||||
$fa-var-list-ul: "\f0ca";
|
||||
$fa-var-location-arrow: "\f124";
|
||||
$fa-var-lock: "\f023";
|
||||
$fa-var-long-arrow-down: "\f175";
|
||||
$fa-var-long-arrow-left: "\f177";
|
||||
$fa-var-long-arrow-right: "\f178";
|
||||
$fa-var-long-arrow-up: "\f176";
|
||||
$fa-var-magic: "\f0d0";
|
||||
$fa-var-magnet: "\f076";
|
||||
$fa-var-mail-forward: "\f064";
|
||||
$fa-var-mail-reply: "\f112";
|
||||
$fa-var-mail-reply-all: "\f122";
|
||||
$fa-var-male: "\f183";
|
||||
$fa-var-map-marker: "\f041";
|
||||
$fa-var-maxcdn: "\f136";
|
||||
$fa-var-meanpath: "\f20c";
|
||||
$fa-var-medkit: "\f0fa";
|
||||
$fa-var-meh-o: "\f11a";
|
||||
$fa-var-microphone: "\f130";
|
||||
$fa-var-microphone-slash: "\f131";
|
||||
$fa-var-minus: "\f068";
|
||||
$fa-var-minus-circle: "\f056";
|
||||
$fa-var-minus-square: "\f146";
|
||||
$fa-var-minus-square-o: "\f147";
|
||||
$fa-var-mobile: "\f10b";
|
||||
$fa-var-mobile-phone: "\f10b";
|
||||
$fa-var-money: "\f0d6";
|
||||
$fa-var-moon-o: "\f186";
|
||||
$fa-var-mortar-board: "\f19d";
|
||||
$fa-var-music: "\f001";
|
||||
$fa-var-navicon: "\f0c9";
|
||||
$fa-var-newspaper-o: "\f1ea";
|
||||
$fa-var-openid: "\f19b";
|
||||
$fa-var-outdent: "\f03b";
|
||||
$fa-var-pagelines: "\f18c";
|
||||
$fa-var-paint-brush: "\f1fc";
|
||||
$fa-var-paper-plane: "\f1d8";
|
||||
$fa-var-paper-plane-o: "\f1d9";
|
||||
$fa-var-paperclip: "\f0c6";
|
||||
$fa-var-paragraph: "\f1dd";
|
||||
$fa-var-paste: "\f0ea";
|
||||
$fa-var-pause: "\f04c";
|
||||
$fa-var-paw: "\f1b0";
|
||||
$fa-var-paypal: "\f1ed";
|
||||
$fa-var-pencil: "\f040";
|
||||
$fa-var-pencil-square: "\f14b";
|
||||
$fa-var-pencil-square-o: "\f044";
|
||||
$fa-var-phone: "\f095";
|
||||
$fa-var-phone-square: "\f098";
|
||||
$fa-var-photo: "\f03e";
|
||||
$fa-var-picture-o: "\f03e";
|
||||
$fa-var-pie-chart: "\f200";
|
||||
$fa-var-pied-piper: "\f1a7";
|
||||
$fa-var-pied-piper-alt: "\f1a8";
|
||||
$fa-var-pinterest: "\f0d2";
|
||||
$fa-var-pinterest-square: "\f0d3";
|
||||
$fa-var-plane: "\f072";
|
||||
$fa-var-play: "\f04b";
|
||||
$fa-var-play-circle: "\f144";
|
||||
$fa-var-play-circle-o: "\f01d";
|
||||
$fa-var-plug: "\f1e6";
|
||||
$fa-var-plus: "\f067";
|
||||
$fa-var-plus-circle: "\f055";
|
||||
$fa-var-plus-square: "\f0fe";
|
||||
$fa-var-plus-square-o: "\f196";
|
||||
$fa-var-power-off: "\f011";
|
||||
$fa-var-print: "\f02f";
|
||||
$fa-var-puzzle-piece: "\f12e";
|
||||
$fa-var-qq: "\f1d6";
|
||||
$fa-var-qrcode: "\f029";
|
||||
$fa-var-question: "\f128";
|
||||
$fa-var-question-circle: "\f059";
|
||||
$fa-var-quote-left: "\f10d";
|
||||
$fa-var-quote-right: "\f10e";
|
||||
$fa-var-ra: "\f1d0";
|
||||
$fa-var-random: "\f074";
|
||||
$fa-var-rebel: "\f1d0";
|
||||
$fa-var-recycle: "\f1b8";
|
||||
$fa-var-reddit: "\f1a1";
|
||||
$fa-var-reddit-square: "\f1a2";
|
||||
$fa-var-refresh: "\f021";
|
||||
$fa-var-remove: "\f00d";
|
||||
$fa-var-renren: "\f18b";
|
||||
$fa-var-reorder: "\f0c9";
|
||||
$fa-var-repeat: "\f01e";
|
||||
$fa-var-reply: "\f112";
|
||||
$fa-var-reply-all: "\f122";
|
||||
$fa-var-retweet: "\f079";
|
||||
$fa-var-rmb: "\f157";
|
||||
$fa-var-road: "\f018";
|
||||
$fa-var-rocket: "\f135";
|
||||
$fa-var-rotate-left: "\f0e2";
|
||||
$fa-var-rotate-right: "\f01e";
|
||||
$fa-var-rouble: "\f158";
|
||||
$fa-var-rss: "\f09e";
|
||||
$fa-var-rss-square: "\f143";
|
||||
$fa-var-rub: "\f158";
|
||||
$fa-var-ruble: "\f158";
|
||||
$fa-var-rupee: "\f156";
|
||||
$fa-var-save: "\f0c7";
|
||||
$fa-var-scissors: "\f0c4";
|
||||
$fa-var-search: "\f002";
|
||||
$fa-var-search-minus: "\f010";
|
||||
$fa-var-search-plus: "\f00e";
|
||||
$fa-var-send: "\f1d8";
|
||||
$fa-var-send-o: "\f1d9";
|
||||
$fa-var-share: "\f064";
|
||||
$fa-var-share-alt: "\f1e0";
|
||||
$fa-var-share-alt-square: "\f1e1";
|
||||
$fa-var-share-square: "\f14d";
|
||||
$fa-var-share-square-o: "\f045";
|
||||
$fa-var-shekel: "\f20b";
|
||||
$fa-var-sheqel: "\f20b";
|
||||
$fa-var-shield: "\f132";
|
||||
$fa-var-shopping-cart: "\f07a";
|
||||
$fa-var-sign-in: "\f090";
|
||||
$fa-var-sign-out: "\f08b";
|
||||
$fa-var-signal: "\f012";
|
||||
$fa-var-sitemap: "\f0e8";
|
||||
$fa-var-skype: "\f17e";
|
||||
$fa-var-slack: "\f198";
|
||||
$fa-var-sliders: "\f1de";
|
||||
$fa-var-slideshare: "\f1e7";
|
||||
$fa-var-smile-o: "\f118";
|
||||
$fa-var-soccer-ball-o: "\f1e3";
|
||||
$fa-var-sort: "\f0dc";
|
||||
$fa-var-sort-alpha-asc: "\f15d";
|
||||
$fa-var-sort-alpha-desc: "\f15e";
|
||||
$fa-var-sort-amount-asc: "\f160";
|
||||
$fa-var-sort-amount-desc: "\f161";
|
||||
$fa-var-sort-asc: "\f0de";
|
||||
$fa-var-sort-desc: "\f0dd";
|
||||
$fa-var-sort-down: "\f0dd";
|
||||
$fa-var-sort-numeric-asc: "\f162";
|
||||
$fa-var-sort-numeric-desc: "\f163";
|
||||
$fa-var-sort-up: "\f0de";
|
||||
$fa-var-soundcloud: "\f1be";
|
||||
$fa-var-space-shuttle: "\f197";
|
||||
$fa-var-spinner: "\f110";
|
||||
$fa-var-spoon: "\f1b1";
|
||||
$fa-var-spotify: "\f1bc";
|
||||
$fa-var-square: "\f0c8";
|
||||
$fa-var-square-o: "\f096";
|
||||
$fa-var-stack-exchange: "\f18d";
|
||||
$fa-var-stack-overflow: "\f16c";
|
||||
$fa-var-star: "\f005";
|
||||
$fa-var-star-half: "\f089";
|
||||
$fa-var-star-half-empty: "\f123";
|
||||
$fa-var-star-half-full: "\f123";
|
||||
$fa-var-star-half-o: "\f123";
|
||||
$fa-var-star-o: "\f006";
|
||||
$fa-var-steam: "\f1b6";
|
||||
$fa-var-steam-square: "\f1b7";
|
||||
$fa-var-step-backward: "\f048";
|
||||
$fa-var-step-forward: "\f051";
|
||||
$fa-var-stethoscope: "\f0f1";
|
||||
$fa-var-stop: "\f04d";
|
||||
$fa-var-strikethrough: "\f0cc";
|
||||
$fa-var-stumbleupon: "\f1a4";
|
||||
$fa-var-stumbleupon-circle: "\f1a3";
|
||||
$fa-var-subscript: "\f12c";
|
||||
$fa-var-suitcase: "\f0f2";
|
||||
$fa-var-sun-o: "\f185";
|
||||
$fa-var-superscript: "\f12b";
|
||||
$fa-var-support: "\f1cd";
|
||||
$fa-var-table: "\f0ce";
|
||||
$fa-var-tablet: "\f10a";
|
||||
$fa-var-tachometer: "\f0e4";
|
||||
$fa-var-tag: "\f02b";
|
||||
$fa-var-tags: "\f02c";
|
||||
$fa-var-tasks: "\f0ae";
|
||||
$fa-var-taxi: "\f1ba";
|
||||
$fa-var-tencent-weibo: "\f1d5";
|
||||
$fa-var-terminal: "\f120";
|
||||
$fa-var-text-height: "\f034";
|
||||
$fa-var-text-width: "\f035";
|
||||
$fa-var-th: "\f00a";
|
||||
$fa-var-th-large: "\f009";
|
||||
$fa-var-th-list: "\f00b";
|
||||
$fa-var-thumb-tack: "\f08d";
|
||||
$fa-var-thumbs-down: "\f165";
|
||||
$fa-var-thumbs-o-down: "\f088";
|
||||
$fa-var-thumbs-o-up: "\f087";
|
||||
$fa-var-thumbs-up: "\f164";
|
||||
$fa-var-ticket: "\f145";
|
||||
$fa-var-times: "\f00d";
|
||||
$fa-var-times-circle: "\f057";
|
||||
$fa-var-times-circle-o: "\f05c";
|
||||
$fa-var-tint: "\f043";
|
||||
$fa-var-toggle-down: "\f150";
|
||||
$fa-var-toggle-left: "\f191";
|
||||
$fa-var-toggle-off: "\f204";
|
||||
$fa-var-toggle-on: "\f205";
|
||||
$fa-var-toggle-right: "\f152";
|
||||
$fa-var-toggle-up: "\f151";
|
||||
$fa-var-trash: "\f1f8";
|
||||
$fa-var-trash-o: "\f014";
|
||||
$fa-var-tree: "\f1bb";
|
||||
$fa-var-trello: "\f181";
|
||||
$fa-var-trophy: "\f091";
|
||||
$fa-var-truck: "\f0d1";
|
||||
$fa-var-try: "\f195";
|
||||
$fa-var-tty: "\f1e4";
|
||||
$fa-var-tumblr: "\f173";
|
||||
$fa-var-tumblr-square: "\f174";
|
||||
$fa-var-turkish-lira: "\f195";
|
||||
$fa-var-twitch: "\f1e8";
|
||||
$fa-var-twitter: "\f099";
|
||||
$fa-var-twitter-square: "\f081";
|
||||
$fa-var-umbrella: "\f0e9";
|
||||
$fa-var-underline: "\f0cd";
|
||||
$fa-var-undo: "\f0e2";
|
||||
$fa-var-university: "\f19c";
|
||||
$fa-var-unlink: "\f127";
|
||||
$fa-var-unlock: "\f09c";
|
||||
$fa-var-unlock-alt: "\f13e";
|
||||
$fa-var-unsorted: "\f0dc";
|
||||
$fa-var-upload: "\f093";
|
||||
$fa-var-usd: "\f155";
|
||||
$fa-var-user: "\f007";
|
||||
$fa-var-user-md: "\f0f0";
|
||||
$fa-var-users: "\f0c0";
|
||||
$fa-var-video-camera: "\f03d";
|
||||
$fa-var-vimeo-square: "\f194";
|
||||
$fa-var-vine: "\f1ca";
|
||||
$fa-var-vk: "\f189";
|
||||
$fa-var-volume-down: "\f027";
|
||||
$fa-var-volume-off: "\f026";
|
||||
$fa-var-volume-up: "\f028";
|
||||
$fa-var-warning: "\f071";
|
||||
$fa-var-wechat: "\f1d7";
|
||||
$fa-var-weibo: "\f18a";
|
||||
$fa-var-weixin: "\f1d7";
|
||||
$fa-var-wheelchair: "\f193";
|
||||
$fa-var-wifi: "\f1eb";
|
||||
$fa-var-windows: "\f17a";
|
||||
$fa-var-won: "\f159";
|
||||
$fa-var-wordpress: "\f19a";
|
||||
$fa-var-wrench: "\f0ad";
|
||||
$fa-var-xing: "\f168";
|
||||
$fa-var-xing-square: "\f169";
|
||||
$fa-var-yahoo: "\f19e";
|
||||
$fa-var-yelp: "\f1e9";
|
||||
$fa-var-yen: "\f157";
|
||||
$fa-var-youtube: "\f167";
|
||||
$fa-var-youtube-play: "\f16a";
|
||||
$fa-var-youtube-square: "\f166";
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
/*!
|
||||
* Font Awesome 4.2.0 by @davegandy - http://fontawesome.io - @fontawesome
|
||||
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
|
||||
*/
|
||||
|
||||
@import "variables";
|
||||
@import "mixins";
|
||||
@import "path";
|
||||
@import "core";
|
||||
@import "larger";
|
||||
@import "fixed-width";
|
||||
@import "list";
|
||||
@import "bordered-pulled";
|
||||
@import "spinning";
|
||||
@import "rotated-flipped";
|
||||
@import "stacked";
|
||||
@import "icons";
|
||||
+167
-3
@@ -159,9 +159,13 @@ h1, h2, h3 {
|
||||
-webkit-overflow-scrolling: touch !important; // for iphone
|
||||
}
|
||||
|
||||
.btn * {
|
||||
cursor: pointer !important; // 下载所有, 被dropdown
|
||||
}
|
||||
|
||||
.ios7-a {
|
||||
display: inline-block;
|
||||
padding: 0 10px 0 5px;
|
||||
padding: 0 10px;
|
||||
height: 36px;
|
||||
vertical-align: middle;
|
||||
line-height: 36px;
|
||||
@@ -247,7 +251,7 @@ h1, h2, h3 {
|
||||
height: 12px;
|
||||
position: absolute;
|
||||
top: -12px;
|
||||
right: 20px;
|
||||
right: 8px;
|
||||
background-image: url("../../images/triangle_2x.png");
|
||||
background-size: 20px 12px;
|
||||
}
|
||||
@@ -414,7 +418,16 @@ h1, h2, h3 {
|
||||
line-height: 40px; margin-top: 10px;
|
||||
}
|
||||
|
||||
|
||||
/* editor */
|
||||
#editorTool {
|
||||
margin: 0;
|
||||
margin-right: 5px;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
#editorTool li {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#searchNotebookForAdd {
|
||||
line-height: normal;
|
||||
@@ -1481,3 +1494,154 @@ top: 4px;
|
||||
margin: 3px 0;
|
||||
height: 26px;
|
||||
}
|
||||
|
||||
// 笔记信息设置
|
||||
#noteInfo {
|
||||
width: 400px;
|
||||
box-sizing: border-box;
|
||||
padding: 10px 10px;
|
||||
-webkit-user-select: initial;
|
||||
table {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
th {
|
||||
width: 80px;
|
||||
}
|
||||
th, td {
|
||||
border-top: none;
|
||||
border-bottom: 1px solid #dddddd;
|
||||
}
|
||||
}
|
||||
a {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
a.post-url {
|
||||
background: #FDF936;
|
||||
}
|
||||
|
||||
.post-url-wrap {
|
||||
span {
|
||||
display: inline;
|
||||
}
|
||||
input {
|
||||
display: none;
|
||||
}
|
||||
&.post-url-edit {
|
||||
.post-url-pencil {
|
||||
display: none;
|
||||
}
|
||||
.post-url-text {
|
||||
display: none;
|
||||
}
|
||||
input {
|
||||
display: inline;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//===========
|
||||
// history
|
||||
.history-modal .modal-dialog {
|
||||
width: auto !important;
|
||||
position: absolute;
|
||||
/* width: 100%; */
|
||||
/* height: 100%; */
|
||||
left: 5px;
|
||||
right: 5px;
|
||||
top: 5px;
|
||||
bottom: 5px;
|
||||
|
||||
.modal-content {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: scroll;
|
||||
|
||||
.modal-body {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
padding: 0;
|
||||
.history-list-wrap {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
overflow-y: auto;
|
||||
width: 200px;
|
||||
border-right: 1px solid #ccc;
|
||||
box-shadow: 1px 1px 10px #ddd;
|
||||
|
||||
.history-list-header {
|
||||
line-height: 50px;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
padding-left: 15px;
|
||||
border-bottom: 1px solid #eee;
|
||||
background-color: #ccc;
|
||||
}
|
||||
|
||||
.history-list {
|
||||
position: absolute;
|
||||
top: 51px;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
overflow-y: auto;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.list-group-item {
|
||||
border-top: none;
|
||||
&.active, &:hover {
|
||||
color: #000;
|
||||
background-color: #eee;
|
||||
border-color: #eee;
|
||||
}
|
||||
}
|
||||
}
|
||||
.history-content-wrap {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
left: 200px;
|
||||
|
||||
.close {
|
||||
padding: 10px 15px;
|
||||
}
|
||||
|
||||
.back {
|
||||
margin-left: 10px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.history-content-header {
|
||||
// background-color: #eee;
|
||||
height: 51px;
|
||||
border-bottom: 1px solid #eee;
|
||||
box-shadow: 5px 0px 5px #ccc;
|
||||
}
|
||||
|
||||
.history-content {
|
||||
position: absolute;
|
||||
top: 51px;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
padding-top: 5px;
|
||||
padding-right: 5px;
|
||||
padding-left: 10px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
@font-face{font-family:leanote;src:url(../../fonts/leanote-font2/leanote.eot?-vcf23i);src:url(../../fonts/leanote-font2/leanote.eot?#iefix-vcf23i) format('embedded-opentype'),url(../../fonts/leanote-font2/leanote.ttf?-vcf23i) format('truetype'),url(../../fonts/leanote-font2/leanote.woff?-vcf23i) format('woff'),url(../../fonts/leanote-font2/leanote.svg?-vcf23i#leanote) format('svg');font-weight:400;font-style:normal}#logo,#switcher span,.mce-i-mind,.mce-i-ace-pre,.lea-icon{font-family:leanote!important;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-markdown:before{content:"\e604"}.mce-i-mind:before{content:"\e602"}.mce-i-ace-pre:before{content:"\e603"}#logo:before{content:"\e600";line-height:1;margin-top:5px;display:inline-block;vertical-align:top}#switcher span:before{content:"\e601"}.new-split{display:none}.new-note{background-color:#000;border-radius:3px;padding:3px 5px;border:1px solid #080303}.new-note,.new-note a{color:#fff}.new-note:hover{background:#3D3B3B;border-color:transparent}.new-note:hover,.new-note:hover a{color:#fff}.new-markdown{margin-left:3px;margin-right:3px}*,.h1,.h2,.h3,.h4,.h5,.h6{font-family:Helvetica,Tahoma,Arial,Hiragino Sans GB,"Microsoft YaHei","微软雅黑","Micro Hei",SimSun,"宋体",Heiti,"黑体",sans-serif}body{font-family:Helvetica,Tahoma,Arial,Hiragino Sans GB,"Microsoft YaHei","微软雅黑","Micro Hei",SimSun,"宋体",Heiti,"黑体",sans-serif;font-weight:400;font-size:14px}@media only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min-device-pixel-ratio:2){body{font-weight:300}}h1,h2,h3{font-family:Helvetica,Tahoma,Arial,Hiragino Sans GB,"Microsoft YaHei","微软雅黑","Micro Hei",SimSun,"宋体",Heiti,"黑体",sans-serif;font-weight:400!important}#noteItemList,#notebook,#leftNotebook,.slimScrollDiv,#editorContent,#editorContent_ifr,.mce-edit-area,.mce-container-body,.mce-tinymce,#editor .mce-ifr,.wmd-input,#noteReadContent,#attachList,#tags,.editor-content,.preview-container{-webkit-overflow-scrolling:touch!important}.ios7-a{display:inline-block;padding:0 10px 0 5px;height:36px;vertical-align:middle;line-height:36px;cursor:pointer}#tool{border-bottom:1px solid #ddd;height:36px;margin-left:-5px}#tag{height:36px;line-height:36px}#editor,#mdEditor{position:absolute;z-index:2;top:66px;bottom:0;right:0;left:5px;padding:0;display:none}#mdEditor{z-index:1;background-color:#fff;bottom:5px}#mdEditor #md-section-helper,#mdEditor #wmd-input{font-size:14px;line-height:22px}#tag .dropdown{line-height:30px}.btn{border-radius:2px}.alert{margin-bottom:10px}#logo{font-size:36px}#switcher span{border-radius:5px;display:inline-block;cursor:pointer;font-size:18px;height:34px;line-height:34px;margin-top:8px;padding:0 5px}.noteSplit{position:absolute;top:0;width:5px;height:100%;overflow:hidden;z-index:3333;cursor:col-resize}.dropdown-menu{border-radius:3px;margin:0;border:1px solid #0fb264;box-shadow:rgba(0,0,0,.172549)0 6px 12px 0}.dropdown-menu:before{content:"";width:20px;height:12px;position:absolute;top:-12px;right:20px;background-image:url(../../images/triangle_2x.png);background-size:20px 12px}.dropdown-submenu .dropdown-menu:before{background:0 0}#searchNotebookForAddDropdownList,#searchNotebookForAddShareDropdownList{left:-200px}#searchNotebookForAddDropdownList:before,#searchNotebookForAddShareDropdownList:before{left:190px;right:inherit}.dropdown-menu li{list-style:none;padding-left:10px;width:100%;height:30px;line-height:30px}.dropdown-menu li>a{color:#000;display:block;padding-right:20px}.dropdown-menu>li>a{padding:3px 20px 3px 0}#notebookNavForNewNote li:hover{background:0 0}#noteList{position:absolute;bottom:0;top:0}#noteAndEditorMask{position:absolute;left:0;right:0;top:0;bottom:0;background:#fff;text-align:center;padding-top:60px;opacity:.3;z-index:20;display:none}.dropdown-submenu{position:relative}.dropdown-submenu>ul.dropdown-menu{top:0;left:100%;margin-left:-3px!important;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;padding-top:10px!important}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropdown-submenu:after{display:block;content:" ";position:absolute;right:0;top:10px;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;border-left-color:#666}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown-submenu.pull-left{float:none}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.open>.dropdown-menu,.dropdown-submenu:hover>.dropdown-menu{opacity:1;transform:scale(1,1);-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-o-transform:scale(1,1)}.dropdown-menu{opacity:0;display:block;-webkit-transform:scale(0,0);-webkit-transform-origin:top;-webkit-animation-fill-mode:forwards;-webkit-transition:all .2s cubic-bezier(0.34,1.21,.4,1);-o-transform:scale(0,0Line truncated
|
||||
@font-face{font-family:leanote;src:url(../../fonts/leanote-font2/leanote.eot?-vcf23i);src:url(../../fonts/leanote-font2/leanote.eot?#iefix-vcf23i) format('embedded-opentype'),url(../../fonts/leanote-font2/leanote.ttf?-vcf23i) format('truetype'),url(../../fonts/leanote-font2/leanote.woff?-vcf23i) format('woff'),url(../../fonts/leanote-font2/leanote.svg?-vcf23i#leanote) format('svg');font-weight:400;font-style:normal}#logo,#switcher span,.mce-i-mind,.mce-i-ace-pre,.lea-icon{font-family:leanote!important;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-markdown:before{content:"\e604"}.mce-i-mind:before{content:"\e602"}.mce-i-ace-pre:before{content:"\e603"}#logo:before{content:"\e600";line-height:1;margin-top:5px;display:inline-block;vertical-align:top}#switcher span:before{content:"\e601"}.new-split{display:none}.new-note{background-color:#000;border-radius:3px;padding:3px 5px;border:1px solid #080303}.new-note,.new-note a{color:#fff}.new-note:hover{background:#3D3B3B;border-color:transparent}.new-note:hover,.new-note:hover a{color:#fff}.new-markdown{margin-left:3px;margin-right:3px}*,.h1,.h2,.h3,.h4,.h5,.h6{font-family:Helvetica,Tahoma,Arial,Hiragino Sans GB,"Microsoft YaHei","微软雅黑","Micro Hei",SimSun,"宋体",Heiti,"黑体",sans-serif}body{font-family:Helvetica,Tahoma,Arial,Hiragino Sans GB,"Microsoft YaHei","微软雅黑","Micro Hei",SimSun,"宋体",Heiti,"黑体",sans-serif;font-weight:400;font-size:14px}@media only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min-device-pixel-ratio:2){body{font-weight:300}}h1,h2,h3{font-family:Helvetica,Tahoma,Arial,Hiragino Sans GB,"Microsoft YaHei","微软雅黑","Micro Hei",SimSun,"宋体",Heiti,"黑体",sans-serif;font-weight:400!important}#noteItemList,#notebook,#leftNotebook,.slimScrollDiv,#editorContent,#editorContent_ifr,.mce-edit-area,.mce-container-body,.mce-tinymce,#editor .mce-ifr,.wmd-input,#noteReadContent,#attachList,#tags,.editor-content,.preview-container{-webkit-overflow-scrolling:touch!important}.btn *{cursor:pointer!important}.ios7-a{display:inline-block;padding:0 10px;height:36px;vertical-align:middle;line-height:36px;cursor:pointer}#tool{border-bottom:1px solid #ddd;height:36px;margin-left:-5px}#tag{height:36px;line-height:36px}#editor,#mdEditor{position:absolute;z-index:2;top:66px;bottom:0;right:0;left:5px;padding:0;display:none}#mdEditor{z-index:1;background-color:#fff;bottom:5px}#mdEditor #md-section-helper,#mdEditor #wmd-input{font-size:14px;line-height:22px}#tag .dropdown{line-height:30px}.btn{border-radius:2px}.alert{margin-bottom:10px}#logo{font-size:36px}#switcher span{border-radius:5px;display:inline-block;cursor:pointer;font-size:18px;height:34px;line-height:34px;margin-top:8px;padding:0 5px}.noteSplit{position:absolute;top:0;width:5px;height:100%;overflow:hidden;z-index:3333;cursor:col-resize}.dropdown-menu{border-radius:3px;margin:0;border:1px solid #0fb264;box-shadow:rgba(0,0,0,.172549)0 6px 12px 0}.dropdown-menu:before{content:"";width:20px;height:12px;position:absolute;top:-12px;right:8px;background-image:url(../../images/triangle_2x.png);background-size:20px 12px}.dropdown-submenu .dropdown-menu:before{background:0 0}#searchNotebookForAddDropdownList,#searchNotebookForAddShareDropdownList{left:-200px}#searchNotebookForAddDropdownList:before,#searchNotebookForAddShareDropdownList:before{left:190px;right:inherit}.dropdown-menu li{list-style:none;padding-left:10px;width:100%;height:30px;line-height:30px}.dropdown-menu li>a{color:#000;display:block;padding-right:20px}.dropdown-menu>li>a{padding:3px 20px 3px 0}#notebookNavForNewNote li:hover{background:0 0}#noteList{position:absolute;bottom:0;top:0}#noteAndEditorMask{position:absolute;left:0;right:0;top:0;bottom:0;background:#fff;text-align:center;padding-top:60px;opacity:.3;z-index:20;display:none}.dropdown-submenu{position:relative}.dropdown-submenu>ul.dropdown-menu{top:0;left:100%;margin-left:-3px!important;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;padding-top:10px!important}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropdown-submenu:after{display:block;content:" ";position:absolute;right:0;top:10px;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;border-left-color:#666}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown-submenu.pull-left{float:none}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.open>.dropdown-menu,.dropdown-submenu:hover>.dropdown-menu{opacity:1;transform:scale(1,1);-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-o-transform:scale(1,1)}.dropdown-menu{opacity:0;display:block;-webkit-transform:scale(0,0);-webkit-transform-origin:top;-webkit-animation-fill-mode:forwards;-webkit-transition:all .2s cubic-bezier(0.34,1.21,.4,Line truncated
|
||||
@@ -522,24 +522,6 @@ a.raw:hover {
|
||||
float: right;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* note */
|
||||
#noteTop {
|
||||
// background-color: #f0f0f0;
|
||||
}
|
||||
|
||||
/* editor */
|
||||
#editorTool {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
// width: 200px;
|
||||
}
|
||||
#editorTool li {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#noteTitleDiv {
|
||||
height: 30px;
|
||||
border-bottom: 1px solid #ddd;
|
||||
|
||||
@@ -1 +1 @@
|
||||
@font-face{font-family:leanote;src:url(../../fonts/leanote-font2/leanote.eot?-vcf23i);src:url(../../fonts/leanote-font2/leanote.eot?#iefix-vcf23i) format('embedded-opentype'),url(../../fonts/leanote-font2/leanote.ttf?-vcf23i) format('truetype'),url(../../fonts/leanote-font2/leanote.woff?-vcf23i) format('woff'),url(../../fonts/leanote-font2/leanote.svg?-vcf23i#leanote) format('svg');font-weight:400;font-style:normal}#logo,#switcher span,.mce-i-mind,.mce-i-ace-pre,.lea-icon{font-family:leanote!important;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-markdown:before{content:"\e604"}.mce-i-mind:before{content:"\e602"}.mce-i-ace-pre:before{content:"\e603"}#logo:before{content:"\e600";line-height:1;margin-top:5px;display:inline-block;vertical-align:top}#switcher span:before{content:"\e601"}.new-split{display:none}.new-note{background-color:#000;border-radius:3px;padding:3px 5px;border:1px solid #080303}.new-note,.new-note a{color:#fff}.new-note:hover{background:#3D3B3B;border-color:transparent}.new-note:hover,.new-note:hover a{color:#fff}.new-markdown{margin-left:3px;margin-right:3px}*,.h1,.h2,.h3,.h4,.h5,.h6{font-family:Helvetica,Tahoma,Arial,Hiragino Sans GB,"Microsoft YaHei","微软雅黑","Micro Hei",SimSun,"宋体",Heiti,"黑体",sans-serif}body{font-family:Helvetica,Tahoma,Arial,Hiragino Sans GB,"Microsoft YaHei","微软雅黑","Micro Hei",SimSun,"宋体",Heiti,"黑体",sans-serif;font-weight:400;font-size:14px}@media only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min-device-pixel-ratio:2){body{font-weight:300}}h1,h2,h3{font-family:Helvetica,Tahoma,Arial,Hiragino Sans GB,"Microsoft YaHei","微软雅黑","Micro Hei",SimSun,"宋体",Heiti,"黑体",sans-serif;font-weight:400!important}#noteItemList,#notebook,#leftNotebook,.slimScrollDiv,#editorContent,#editorContent_ifr,.mce-edit-area,.mce-container-body,.mce-tinymce,#editor .mce-ifr,.wmd-input,#noteReadContent,#attachList,#tags,.editor-content,.preview-container{-webkit-overflow-scrolling:touch!important}.ios7-a{display:inline-block;padding:0 10px 0 5px;height:36px;vertical-align:middle;line-height:36px;cursor:pointer}#tool{border-bottom:1px solid #ddd;height:36px;margin-left:-5px}#tag{height:36px;line-height:36px}#editor,#mdEditor{position:absolute;z-index:2;top:66px;bottom:0;right:0;left:5px;padding:0;display:none}#mdEditor{z-index:1;background-color:#fff;bottom:5px}#mdEditor #md-section-helper,#mdEditor #wmd-input{font-size:14px;line-height:22px}#tag .dropdown{line-height:30px}.btn{border-radius:2px}.alert{margin-bottom:10px}#logo{font-size:36px}#switcher span{border-radius:5px;display:inline-block;cursor:pointer;font-size:18px;height:34px;line-height:34px;margin-top:8px;padding:0 5px}.noteSplit{position:absolute;top:0;width:5px;height:100%;overflow:hidden;z-index:3333;cursor:col-resize}.dropdown-menu{border-radius:3px;margin:0;border:1px solid #0fb264;box-shadow:rgba(0,0,0,.172549)0 6px 12px 0}.dropdown-menu:before{content:"";width:20px;height:12px;position:absolute;top:-12px;right:20px;background-image:url(../../images/triangle_2x.png);background-size:20px 12px}.dropdown-submenu .dropdown-menu:before{background:0 0}#searchNotebookForAddDropdownList,#searchNotebookForAddShareDropdownList{left:-200px}#searchNotebookForAddDropdownList:before,#searchNotebookForAddShareDropdownList:before{left:190px;right:inherit}.dropdown-menu li{list-style:none;padding-left:10px;width:100%;height:30px;line-height:30px}.dropdown-menu li>a{color:#000;display:block;padding-right:20px}.dropdown-menu>li>a{padding:3px 20px 3px 0}#notebookNavForNewNote li:hover{background:0 0}#noteList{position:absolute;bottom:0;top:0}#noteAndEditorMask{position:absolute;left:0;right:0;top:0;bottom:0;background:#fff;text-align:center;padding-top:60px;opacity:.3;z-index:20;display:none}.dropdown-submenu{position:relative}.dropdown-submenu>ul.dropdown-menu{top:0;left:100%;margin-left:-3px!important;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;padding-top:10px!important}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropdown-submenu:after{display:block;content:" ";position:absolute;right:0;top:10px;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;border-left-color:#666}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown-submenu.pull-left{float:none}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.open>.dropdown-menu,.dropdown-submenu:hover>.dropdown-menu{opacity:1;transform:scale(1,1);-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-o-transform:scale(1,1)}.dropdown-menu{opacity:0;display:block;-webkit-transform:scale(0,0);-webkit-transform-origin:top;-webkit-animation-fill-mode:forwards;-webkit-transition:all .2s cubic-bezier(0.34,1.21,.4,1);-o-transform:scale(0,0Line truncated
|
||||
@font-face{font-family:leanote;src:url(../../fonts/leanote-font2/leanote.eot?-vcf23i);src:url(../../fonts/leanote-font2/leanote.eot?#iefix-vcf23i) format('embedded-opentype'),url(../../fonts/leanote-font2/leanote.ttf?-vcf23i) format('truetype'),url(../../fonts/leanote-font2/leanote.woff?-vcf23i) format('woff'),url(../../fonts/leanote-font2/leanote.svg?-vcf23i#leanote) format('svg');font-weight:400;font-style:normal}#logo,#switcher span,.mce-i-mind,.mce-i-ace-pre,.lea-icon{font-family:leanote!important;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-markdown:before{content:"\e604"}.mce-i-mind:before{content:"\e602"}.mce-i-ace-pre:before{content:"\e603"}#logo:before{content:"\e600";line-height:1;margin-top:5px;display:inline-block;vertical-align:top}#switcher span:before{content:"\e601"}.new-split{display:none}.new-note{background-color:#000;border-radius:3px;padding:3px 5px;border:1px solid #080303}.new-note,.new-note a{color:#fff}.new-note:hover{background:#3D3B3B;border-color:transparent}.new-note:hover,.new-note:hover a{color:#fff}.new-markdown{margin-left:3px;margin-right:3px}*,.h1,.h2,.h3,.h4,.h5,.h6{font-family:Helvetica,Tahoma,Arial,Hiragino Sans GB,"Microsoft YaHei","微软雅黑","Micro Hei",SimSun,"宋体",Heiti,"黑体",sans-serif}body{font-family:Helvetica,Tahoma,Arial,Hiragino Sans GB,"Microsoft YaHei","微软雅黑","Micro Hei",SimSun,"宋体",Heiti,"黑体",sans-serif;font-weight:400;font-size:14px}@media only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min-device-pixel-ratio:2){body{font-weight:300}}h1,h2,h3{font-family:Helvetica,Tahoma,Arial,Hiragino Sans GB,"Microsoft YaHei","微软雅黑","Micro Hei",SimSun,"宋体",Heiti,"黑体",sans-serif;font-weight:400!important}#noteItemList,#notebook,#leftNotebook,.slimScrollDiv,#editorContent,#editorContent_ifr,.mce-edit-area,.mce-container-body,.mce-tinymce,#editor .mce-ifr,.wmd-input,#noteReadContent,#attachList,#tags,.editor-content,.preview-container{-webkit-overflow-scrolling:touch!important}.btn *{cursor:pointer!important}.ios7-a{display:inline-block;padding:0 10px;height:36px;vertical-align:middle;line-height:36px;cursor:pointer}#tool{border-bottom:1px solid #ddd;height:36px;margin-left:-5px}#tag{height:36px;line-height:36px}#editor,#mdEditor{position:absolute;z-index:2;top:66px;bottom:0;right:0;left:5px;padding:0;display:none}#mdEditor{z-index:1;background-color:#fff;bottom:5px}#mdEditor #md-section-helper,#mdEditor #wmd-input{font-size:14px;line-height:22px}#tag .dropdown{line-height:30px}.btn{border-radius:2px}.alert{margin-bottom:10px}#logo{font-size:36px}#switcher span{border-radius:5px;display:inline-block;cursor:pointer;font-size:18px;height:34px;line-height:34px;margin-top:8px;padding:0 5px}.noteSplit{position:absolute;top:0;width:5px;height:100%;overflow:hidden;z-index:3333;cursor:col-resize}.dropdown-menu{border-radius:3px;margin:0;border:1px solid #0fb264;box-shadow:rgba(0,0,0,.172549)0 6px 12px 0}.dropdown-menu:before{content:"";width:20px;height:12px;position:absolute;top:-12px;right:8px;background-image:url(../../images/triangle_2x.png);background-size:20px 12px}.dropdown-submenu .dropdown-menu:before{background:0 0}#searchNotebookForAddDropdownList,#searchNotebookForAddShareDropdownList{left:-200px}#searchNotebookForAddDropdownList:before,#searchNotebookForAddShareDropdownList:before{left:190px;right:inherit}.dropdown-menu li{list-style:none;padding-left:10px;width:100%;height:30px;line-height:30px}.dropdown-menu li>a{color:#000;display:block;padding-right:20px}.dropdown-menu>li>a{padding:3px 20px 3px 0}#notebookNavForNewNote li:hover{background:0 0}#noteList{position:absolute;bottom:0;top:0}#noteAndEditorMask{position:absolute;left:0;right:0;top:0;bottom:0;background:#fff;text-align:center;padding-top:60px;opacity:.3;z-index:20;display:none}.dropdown-submenu{position:relative}.dropdown-submenu>ul.dropdown-menu{top:0;left:100%;margin-left:-3px!important;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;padding-top:10px!important}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropdown-submenu:after{display:block;content:" ";position:absolute;right:0;top:10px;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;border-left-color:#666}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown-submenu.pull-left{float:none}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.open>.dropdown-menu,.dropdown-submenu:hover>.dropdown-menu{opacity:1;transform:scale(1,1);-webkit-transform:scale(1,1);-moz-transform:scale(1,1);-o-transform:scale(1,1)}.dropdown-menu{opacity:0;display:block;-webkit-transform:scale(0,0);-webkit-transform-origin:top;-webkit-animation-fill-mode:forwards;-webkit-transition:all .2s cubic-bezier(0.34,1.21,.4,Line truncated
|
||||
@@ -499,17 +499,6 @@ a.raw:hover {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* editor */
|
||||
#editorTool {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
// width: 200px;
|
||||
}
|
||||
#editorTool li {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#noteTitleDiv {
|
||||
height: 30px;
|
||||
border-bottom: 1px solid #ddd;
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
+1
-2060
File diff suppressed because it is too large.
Load diff
+1
@@ -0,0 +1 @@
|
||||
.ztree,.ztree li a{margin:0;color:#333}.ztree li a.tmpTargetNode_inner,ul.tmpTargetzTree,ul.ztree.zTreeDragUL{opacity:.8;filter:alpha(opacity=80)}.ztree *{padding:0;margin:0;font-size:12px}.ztree{padding:5px}.ztree li{padding:0;margin:0;list-style:none;text-align:left;white-space:nowrap;outline:0}.ztree li a{padding:1px 3px 0 0;cursor:pointer;background-color:transparent;text-decoration:none;vertical-align:top;display:block;position:relative}.ztree li a.curSelectedNode,.ztree li a.curSelectedNode_Edit{padding-top:0;background-color:#FFE6B0;color:#000;height:16px;border:1px solid #FFB951;opacity:.8}.ztree li a.tmpTargetNode_inner{padding-top:0;background-color:#eee;color:#000;height:30px;border:1px solid #ccc}.ztree li span{margin-right:2px}.ztree li span.button{line-height:0;margin:0;width:16px;height:16px;display:inline-block;vertical-align:middle;border:0;cursor:pointer;outline:0}.ztree li,.ztree li span,span.tmpzTreeMove_arrow{line-height:30px}.ztree li span.button.ico_open{margin-right:2px;background-position:-110px -16px;vertical-align:top}.ztree li span.button.ico_close{margin-right:2px;background-position:-110px 0;vertical-align:top}.ztree li span.button.ico_docu{margin-right:2px;background-position:-110px -32px;vertical-align:top}.ztree li span.button.edit{margin-right:2px;background-position:-110px -48px;vertical-align:top}.ztree li span.button.remove{margin-right:2px;background-position:-110px -64px;vertical-align:top}ul.tmpTargetzTree{background-color:#FFE6B0}span.tmpzTreeMove_arrow{z-index:333;width:16px;height:30px;display:inline-block;padding:0;margin:0 0 0 15px;border:0;position:absolute}ul.ztree.zTreeDragUL{z-index:333;margin:0;padding:0;position:absolute;width:auto;height:auto;overflow:hidden;background-color:cfcfcf;border:1px dotted #00B83F}.zTreeMask{z-index:1000;background-color:#cfcfcf;opacity:0;filter:alpha(opacity=0);position:absolute}.ztree li ul{margin:0 0 0 10px;padding:0}.ztree>li{border-bottom:1px dashed #eee}.ztree li a{height:30px;padding-top:0}.ztree li a:hover{text-decoration:none;background-color:#E7E7E7}.ztree li a span.button.switch{visibility:hidden}.ztree.showIcon li a span.button.switch{visibility:visible}.ztree li a.curSelectedNode{background-color:#eee;border:0;height:30px}.ztree li span.button{margin-top:-5px;background-image:none}.ztree li span.button.switch{width:16px;height:30px;line-height:30px;text-align:center}.ztree li a.level0 span{font-size:14px}.ztree li span.button.switch.level0,.ztree li span.button.switch.level1{width:20px}.ztree li span.button.noline_open:before{content:"\f107"}.ztree li span.button.noline_close:before{content:"\f105"}.ztree li span.button.noline_open.level0{background-position:0 -18px}.ztree li span.button.noline_close.level0{background-position:-18px -18px}.ztree .tree-title{display:inline-block}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
.tour-backdrop,div.jGrowl.bottom-right{right:0;bottom:0}#wmd-input>.editor-margin .discussion.active,#wmd-input>.editor-margin .discussion:hover,.btn-link:hover{text-decoration:none}.form-control:focus{border-color:#f0f0f0;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.025),0 0 12px -1px rgba(128,128,128,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.025),0 0 12px -1px rgba(128,128,128,.6)}@media (min-width:768px){.navbar-form .col-sm-1{width:8.33333333%!important}.navbar-form .col-sm-2{width:16.66666667%!important}.navbar-form .col-sm-3{width:25%!important}.navbar-form .col-sm-4{width:33.33333333%!important}.navbar-form .col-sm-5{width:41.66666667%!important}.navbar-form .col-sm-6{width:50%!important}.navbar-form .col-sm-7{width:58.33333333%!important}.navbar-form .col-sm-8{width:66.66666667%!important}.navbar-form .col-sm-9{width:75%!important}.navbar-form .col-sm-10{width:83.33333333%!important}.navbar-form .col-sm-11{width:91.66666667%!important}.navbar-form .col-sm-12{width:100%!important}}.navbar-form *{float:none}pre.prettyprint *{font-family:Monaco,Menlo,Consolas,"Courier New",monospace}pre.prettyprint{white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}code.prettyprint,pre.prettyprint{padding:8px;background-color:#f7f7f9;border:1px solid #e1e1e8;-moz-border-radius:3px;-webkit-border-radius:3px;-o-border-radius:3px;-ms-border-radius:3px;-khtml-border-radius:3px;border-radius:3px;display:block}code.prettyprint ol.linenums,pre.prettyprint ol.linenums{padding:0 0 0 30px;margin:0}code.prettyprint ol.linenums li,pre.prettyprint ol.linenums li{padding-left:0;color:#bebec5;line-height:20px}code.prettyprint .com,pre.prettyprint .com{color:#93a1a1;font-style:italic}code.prettyprint .lit,pre.prettyprint .lit{color:#195f91}code.prettyprint .clo,code.prettyprint .opn,code.prettyprint .pun,pre.prettyprint .clo,pre.prettyprint .opn,pre.prettyprint .pun{color:#93a1a1}code.prettyprint .fun,pre.prettyprint .fun{color:#dc322f}code.prettyprint .atv,code.prettyprint .str,pre.prettyprint .atv,pre.prettyprint .str{color:#d14}code.prettyprint .kwd,code.prettyprint .tag,pre.prettyprint .kwd,pre.prettyprint .tag{color:#1e347b}code.prettyprint .atn,code.prettyprint .dec,code.prettyprint .typ,code.prettyprint .var,pre.prettyprint .atn,pre.prettyprint .dec,pre.prettyprint .typ,pre.prettyprint .var{color:teal}code.prettyprint .pln,pre.prettyprint .pln{color:#48484c}.container{margin-bottom:180px;text-align:justify}blockquote p,ol,ol ol,ol ul,ul,ul ol,ul ul{margin-bottom:.3em}a code{color:inherit}pre{word-break:break-word;border-radius:5px}blockquote,p{margin:0 0 .3em}hr{margin:2em 0}img{max-width:100%}.flow-chart,.sequence-diagram{text-align:center;margin-bottom:.3em}.flow-chart text,.sequence-diagram text{font-size:15px!important;font-family:"Source Sans Pro",sans-serif!important}.flow-chart [fill="#ffffff"],.sequence-diagram [fill="#ffffff"]{fill:#f8f8f8}.flow-chart [stroke="#000000"],.sequence-diagram [stroke="#000000"]{stroke:#3f3f3f}.flow-chart text[stroke="#000000"],.sequence-diagram text[stroke="#000000"]{stroke:none}.flow-chart [fill="#000000"],.flow-chart [fill="#000"],.flow-chart [fill=black],.sequence-diagram [fill="#000000"],.sequence-diagram [fill="#000"],.sequence-diagram [fill=black]{fill:#3f3f3f}code,pre{font-family:"Source Code Pro",monospace;font-size:.9em}code{white-space:normal}pre.prettyprint{text-align:start;border:0;padding:10px 20px}pre.prettyprint code{background-color:transparent!important}dd,dt{margin-top:5px;margin-bottom:5px}dd{margin-left:40px}table{margin-bottom:20px}table td,table th{padding:8px;line-height:20px;vertical-align:top;border-top:1px solid #ddd}table th{font-weight:700}table thead th{vertical-align:bottom}table caption+thead tr:first-child td,table caption+thead tr:first-child th,table colgroup+thead tr:first-child td,table colgroup+thead tr:first-child th,table thead:first-child tr:first-child td,table thead:first-child tr:first-child th{border-top:0}table tbody+tbody{border-top:2px solid #ddd}blockquote{border-left-width:10px;background-color:rgba(128,128,128,.05);border-top-right-radius:5px;border-bottom-right-radius:5px;padding:15px 20px}blockquote p{font-size:1em;line-height:1.45}blockquote ol:last-child,blockquote ul:last-child{margin-bottom:0}kbd{padding:.1em .6em;border:1px solid rgba(63,63,63,.25);-webkit-box-shadow:0 1px 0 rgba(63,63,63,.25);box-shadow:0 1px 0 rgba(63,63,63,.25);font-size:.7em;font-family:sans-serif;background-color:#fff;color:#333;border-radius:3px;display:inline-block;margin:0 .1em;white-space:nowrap}.toc ul{list-style-type:none;margin-bottom:15px}.footnote{vertical-align:top;position:relative;top:-.5em;font-size:.8em}.tour-backdrop{position:fixed;top:0;left:0;z-index:1030;background-color:#000;opacity:.8}.tour-step-backdrop{position:relative;z-index:1031;background:inherit}.tour-step-background{position:absolute;z-index:1030;background:inherit;border-radius:6px}.popover[class*=tour-]{z-iLine truncated
|
||||
Vendored
+3
-3
@@ -1,6 +1,6 @@
|
||||
function trimLeft(t,e){if(!e||" "==e)return $.trim(t);for(;0==t.indexOf(e);)t=t.substring(e.length);return t}function json(str){return eval("("+str+")")}function t(){var t=arguments;if(t.length<=1)return t[0];var e=t[0];if(!e)return e;var n="LEAAEL";e=e.replace(/\?/g,n);for(var o=1;o<=t.length;++o)e=e.replace(n,t[o]);return e}function arrayEqual(t,e){return t=t||[],e=e||[],t.join(",")==e.join(",")}function isArray(t){return"[object Array]"===Object.prototype.toString.call(t)}function isEmpty(t){return t?isArray(t)&&0==t.length?!0:!1:!0}function getFormJsonData(t){var e=formArrDataToJson($("#"+t).serializeArray());return e}function formArrDataToJson(t){var e={},n={};for(var o in t){var r=t[o].name,i=t[o].value;"[]"!=r.substring(r.length-2,r.length)?e[r]=i:(r=r.substring(0,r.length-2),void 0==n[r]?n[r]=[i]:n[r].push(i))}return $.extend(e,n)}function formSerializeDataToJson(t){for(var e=t.split("&"),n={},o={},r=0;r<e.length;++r){var i=e[r].split("="),a=decodeURI(i[0]),s=decodeURI(i[1]);"[]"!=a.substring(a.length-2,a.length)?n[a]=s:(a=a.substring(0,a.length-2),void 0==o[a]?o[a]=[s]:o[a].push(s))}return $.extend(n,o)}function _ajaxCallback(t,e,n){if(t===!0||"true"==t||"object"==typeof t){if(t&&"object"==typeof t&&"NOTLOGIN"==t.Msg)return void alert("你还没有登录, 请先登录!");"function"==typeof e&&e(t)}else"function"==typeof n?n(t):alert("error!")}function _ajax(t,e,n,o,r,i){return log("-------------------ajax:"),log(e),log(n),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){log("-------------------ajaxPostJson:"),log(t),log(e),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 editorIframeTabindex(t){var e=$("#editorContent");e.attr("tabindex",t),setTimeout(function(){e.attr("tabindex",t)},500),setTimeout(function(){e.attr("tabindex",t)},1e3)}function switchEditor(t){LEA.isM=t,t?($("#mdEditor").css("z-index",3).show(),editorIframeTabindex(3),$("#wmd-input").attr("tabindex",2),$("#leanoteNav").hide()):($("#editor").show(),$("#mdEditor").css("z-index",1).hide(),editorIframeTabindex(2),$("#wmd-input").attr("tabindex",3),$("#leanoteNav").show())}function setEditorContent(t,e,n,o){if(t||(t=""),clearIntervalForSetContent&&clearInterval(clearIntervalForSetContent),e)MD?(MD.setContent(t),o&&o(),LEA.s4=new Date,LEA.s4_1=LEA.s4.getTime()-LEA.s1.getTime()):clearIntervalForSetContent=setTimeout(function(){setEditorContent(t,!0,!1,o)},100);else if($("#editorContent").html(t),"undefined"!=typeof tinymce&&tinymce.activeEditor){var r=tinymce.activeEditor;LEA.s4=new Date,LEA.s4_1=LEA.s4.getTime()-LEA.s1.getTime(),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){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,$("#leanLine truncated
|
||||
Note.curNoteId="",Note.interval="",Note.itemIsBlog='<div class="item-blog"><i class="fa fa-bold" title="blog"></i></div><div class="item-setting"><i class="fa fa-cog" title="setting"></i></div>',Note.itemTplNoImg='<li href="#" class="item ?" noteId="?">',Note.itemTplNoImg+=Note.itemIsBlog+'<div class="item-desc"><p class="item-title">?</p><p class="item-info"><i class="fa fa-book"></i> <span class="note-notebook">?</span> <i class="fa fa-clock-o"></i> <span class="updated-time">?</span></p><p class="desc">?</p></div></li>',Note.itemTpl='<li href="#" class="item ? item-image" noteId="?"><div class="item-thumb" style=""><img src="?"/></div>',Note.itemTpl+=Note.itemIsBlog+'<div class="item-desc" style=""><p class="item-title">?</p><p class="item-info"><i class="fa fa-book"></i> <span class="note-notebook">?</span> <i class="fa fa-clock-o"></i> <span class="updated-time">?</span></p><p class="desc">?</p></div></li>',Note.newItemTpl='<li href="#" class="item item-active ?" fromUserId="?" noteId="?">',Note.newItemTpl+=Note.itemIsBlog+'<div class="item-desc" style="right: 0px;"><p class="item-title">?</p><p class="item-text"><i class="fa fa-book"></i> <span class="note-notebook">?</span> <i class="fa fa-clock-o"></i> <span class="updated-time">?</span><br /><span class="desc">?</span></p></div></li>',Note.noteItemListO=$("#noteItemList"),Note.cacheByNotebookId={all:{}},Note.notebookIds={},Note.isReadOnly=!1,Note.intervalTime=6e5,Note.startInterval=function(){Note.interval=setInterval(function(){log("自动保存开始..."),changedNote=Note.curChangedSaveIt(!1)},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.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.curNoteIsDirtied=function(){var t=this,e=t.getCurNote();e&&(e.isDirty=!0)},Note.renderNotesAndFirstOneContent=function(t){isArray(t)&&(Note.renderNotes(t),isEmpty(t[0])||Note.changeNoteForPjax(t[0].NoteId,!0,!1))},Note.curHasChanged=function(t){void 0==t&&(t=!0);var e,o,a,n=Note.cache[Note.curNoteId]||{},i=$("#noteTitle").val(),r=Tag.getTags(),s=getEditorContent(n.IsMarkdown);if(isArray(s))e=s[0],o=s[1],a=e,e&&previewIsEmpty(o)&&Converter&&(o=Converter.makeHtml(e)),e||(o=""),n.Preview=o;else{e=s;try{a=$(e).text()}catch(c){}}var d={hasChanged:!1,IsNew:n.IsNew,IsMarkdown:n.IsMarkdown,FromUserId:n.FromUserId,NoteId:n.NoteId,NotebookId:n.NotebookId,Version:n.Version||0};if(d.IsNew)$.extend(d,n);else if(!n.isDirty)return log("no dirty"),d.hasChanged=!1,d;if(n.Title!=i&&(d.hasChanged=!0,d.Title=i,!d.Title),arrayEqual(n.Tags,r)||(d.hasChanged=!0,d.Tags=r.join(",")),t&&n.Content!=e||!t&&(!n.IsMarkdown&&$(n.Content).text()!=a||n.IsMarkdown&&n.Content!=a)){d.hasChanged=!0,d.Content=e;var l=o||e;n.HasSelfDefined&&n.IsBlog||(d.Desc=Note.genDesc(l),d.ImgSrc=Note.getImgSrc(l),d.Abstract=Note.genAbstract(l))}else log("text相同"),log(n.Content==e);return d.UserId=n.UserId||"",d},Note.genDesc=function(t){return t?(t=t.replace(/<br \/>/g," <br />"),t=t.replace(/<\/p>/g," </p>"),t=t.replace(/<\/div>/g," </div>"),t=$("<div></div>").html(t).text(),t=t.replace(/</g,"<"),t=t.replace(/>/g,">"),t.length<300?t:t.substring(0,300)):""},Note.genAbstract=function(t,e){if(!t)return"";if(void 0==e&&(e=1e3),t.length<e)return t;for(var o=!1,a=!1,n=0,i="",r=e,s=0;s<t.length;++s){var c=t[s];if("<"==c?o=!0:"&"==c?a=!0:">"==c&&o?(n-=1,o=!1):";"==c&&a&&(a=!1),o||a||(n+=1),i+=c,n>=r)break}var d=document.createElement("div");return d.innerHTML=i,d.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=Note.curHasChanged(t);return a.hasChanged||a.IsNew?(Note.renderChangedNote(a),delete a.hasChanged,showMsg(getMsg("saving")),o.saveInProLine 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?(Note.saveNote(e),void LeaAce.removeCurToggleRaw()):void e.preventDefault()}),e.on("click",function(e){})},convert_urls:!0,relative_urls:!1,remove_script_host:!1,selector:"#editorContent",content_css:["/css/editor/editor.css"],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 pasteCopyImage | leanote_ace_pre | fontselect fontsizeselect",menubar:!1,toolbar_items_size:"small",statusbar:!1,url_converter:!1,font_formats:"Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Times New Roman=times new roman,times;Courier New=courier new,courier;Tahoma=tahoma,arial,helvetica,sans-serif;Verdana=verdana,geneva;宋体=SimSun;新宋体=NSimSun;黑体=SimHei;微软雅黑=Microsoft YaHei",block_formats:"Header 1=h1;Header 2=h2;Header 3=h3;Header 4=h4;Paragraph=p",paste_data_images:!0}),window.onbeforeunload=function(e){Note.curChangedSaveIt()},$("body").on("keydown",Note.saveNote)}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 openSetInfoDialog(e){showDialogRemote("/user/account",{tab:e})}function updateLeftIsMin(e){ajaxGet("/user/updateLeftIsMin",{leftIsMin:e})}function minLeft(e){$("#leftNotebook").width(30),$("#notebook").hide(),$("#noteAndEditor").css("left",30),$("#notebookSplitter").hide(),$("#logo").hide(),$("#leftSwitcher").hide(),$("#leftSwitcher2").show(),$("#leftNotebook .slimScrollDiv").hide(),e&&updateLeftIsMin(!0)}function maxLeft(e){$("#noteAndEditor").css("left",UserInfo.NotebookWidth),$("#leftNotebook").width(UserInfo.NotebookWidth),$("#notebook").show(),$("#notebookSplitter").show(),$("#leftSwitcher2").hide(),$("#logo").show(),$("#leftSwitcher").show(),$("#leftNotebook .slimScrollDiv").show(),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, #Line truncated
|
||||
function trimLeft(t,e){if(!e||" "==e)return $.trim(t);for(;0==t.indexOf(e);)t=t.substring(e.length);return t}function json(str){return eval("("+str+")")}function t(){var t=arguments;if(t.length<=1)return t[0];var e=t[0];if(!e)return e;var n="LEAAEL";e=e.replace(/\?/g,n);for(var o=1;o<=t.length;++o)e=e.replace(n,t[o]);return e}function arrayEqual(t,e){return t=t||[],e=e||[],t.join(",")==e.join(",")}function isArray(t){return"[object Array]"===Object.prototype.toString.call(t)}function isEmpty(t){return t?isArray(t)&&0==t.length?!0:!1:!0}function getFormJsonData(t){var e=formArrDataToJson($("#"+t).serializeArray());return e}function formArrDataToJson(t){var e={},n={};for(var o in t){var r=t[o].name,i=t[o].value;"[]"!=r.substring(r.length-2,r.length)?e[r]=i:(r=r.substring(0,r.length-2),void 0==n[r]?n[r]=[i]:n[r].push(i))}return $.extend(e,n)}function formSerializeDataToJson(t){for(var e=t.split("&"),n={},o={},r=0;r<e.length;++r){var i=e[r].split("="),a=decodeURI(i[0]),s=decodeURI(i[1]);"[]"!=a.substring(a.length-2,a.length)?n[a]=s:(a=a.substring(0,a.length-2),void 0==o[a]?o[a]=[s]:o[a].push(s))}return $.extend(n,o)}function _ajaxCallback(t,e,n){if(t===!0||"true"==t||"object"==typeof t){if(t&&"object"==typeof t&&"NOTLOGIN"==t.Msg)return void alert("你还没有登录, 请先登录!");"function"==typeof e&&e(t)}else"function"==typeof n?n(t):alert("error!")}function _ajax(t,e,n,o,r,i){return log("-------------------ajax:"),log(e),log(n),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){log("-------------------ajaxPostJson:"),log(t),log(e),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 editorIframeTabindex(t){var e=$("#editorContent");e.attr("tabindex",t),setTimeout(function(){e.attr("tabindex",t)},500),setTimeout(function(){e.attr("tabindex",t)},1e3)}function switchEditor(t){LEA.isM=t,t?($("#mdEditor").css("z-index",3).show(),editorIframeTabindex(3),$("#wmd-input").attr("tabindex",2),$("#leanoteNav").hide()):($("#editor").show(),$("#mdEditor").css("z-index",1).hide(),editorIframeTabindex(2),$("#wmd-input").attr("tabindex",3),$("#leanoteNav").show())}function setEditorContent(t,e,n,o){if(t||(t=""),clearIntervalForSetContent&&clearInterval(clearIntervalForSetContent),e)MD?(MD.setContent(t),o&&o(),LEA.s4=new Date,LEA.s4_1=LEA.s4.getTime()-LEA.s1.getTime()):clearIntervalForSetContent=setTimeout(function(){setEditorContent(t,!0,!1,o)},100);else if($("#editorContent").html(t),"undefined"!=typeof tinymce&&tinymce.activeEditor){var r=tinymce.activeEditor;LEA.s4=new Date,LEA.s4_1=LEA.s4.getTime()-LEA.s1.getTime(),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){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,$("#leanLine truncated
|
||||
Note.curNoteId="",Note.interval="",Note.itemIsBlog='<div class="item-blog"><i class="fa fa-bold" title="blog"></i></div><div class="item-setting"><i class="fa fa-cog" title="setting"></i></div>',Note.itemTplNoImg='<li href="#" class="item ?" noteId="?">',Note.itemTplNoImg+=Note.itemIsBlog+'<div class="item-desc"><p class="item-title">?</p><p class="item-info"><i class="fa fa-book"></i> <span class="note-notebook">?</span> <i class="fa fa-clock-o"></i> <span class="updated-time">?</span></p><p class="desc">?</p></div></li>',Note.itemTpl='<li href="#" class="item ? item-image" noteId="?"><div class="item-thumb" style=""><img src="?"/></div>',Note.itemTpl+=Note.itemIsBlog+'<div class="item-desc" style=""><p class="item-title">?</p><p class="item-info"><i class="fa fa-book"></i> <span class="note-notebook">?</span> <i class="fa fa-clock-o"></i> <span class="updated-time">?</span></p><p class="desc">?</p></div></li>',Note.newItemTpl='<li href="#" class="item item-active ?" fromUserId="?" noteId="?">',Note.newItemTpl+=Note.itemIsBlog+'<div class="item-desc" style="right: 0px;"><p class="item-title">?</p><p class="item-text"><i class="fa fa-book"></i> <span class="note-notebook">?</span> <i class="fa fa-clock-o"></i> <span class="updated-time">?</span><br /><span class="desc">?</span></p></div></li>',Note.noteItemListO=$("#noteItemList"),Note.cacheByNotebookId={all:{}},Note.notebookIds={},Note.isReadOnly=!1,Note.intervalTime=6e5,Note.startInterval=function(){Note.interval=setInterval(function(){log("自动保存开始..."),changedNote=Note.curChangedSaveIt(!1)},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.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.curNoteIsDirtied=function(){var t=this,e=t.getCurNote();e&&(e.isDirty=!0)},Note.renderNotesAndFirstOneContent=function(t){isArray(t)&&(Note.renderNotes(t),isEmpty(t[0])||Note.changeNoteForPjax(t[0].NoteId,!0,!1))},Note.curHasChanged=function(t){void 0==t&&(t=!0);var e,o,a,n=Note.cache[Note.curNoteId]||{},i=$("#noteTitle").val(),r=Tag.getTags(),s=getEditorContent(n.IsMarkdown);if(isArray(s))e=s[0],o=s[1],a=e,e&&previewIsEmpty(o)&&Converter&&(o=Converter.makeHtml(e)),e||(o=""),n.Preview=o;else{e=s;try{a=$(e).text()}catch(c){}}var d={hasChanged:!1,IsNew:n.IsNew,IsMarkdown:n.IsMarkdown,FromUserId:n.FromUserId,NoteId:n.NoteId,NotebookId:n.NotebookId,Version:n.Version||0};if(d.IsNew)$.extend(d,n);else if(!t&&!n.isDirty)return log("no dirty"),d.hasChanged=!1,d;if(n.Title!=i&&(d.hasChanged=!0,d.Title=i,!d.Title),arrayEqual(n.Tags,r)||(d.hasChanged=!0,d.Tags=r.join(",")),t&&n.Content!=e||!t&&(!n.IsMarkdown&&$(n.Content).text()!=a||n.IsMarkdown&&n.Content!=a)){d.hasChanged=!0,d.Content=e;var N=o||e;n.HasSelfDefined&&n.IsBlog||(d.Desc=Note.genDesc(N),d.ImgSrc=Note.getImgSrc(N),d.Abstract=Note.genAbstract(N))}else log("text相同"),log(n.Content==e);return d.UserId=n.UserId||"",d},Note.genDesc=function(t){return t?(t=t.replace(/<br \/>/g," <br />"),t=t.replace(/<\/p>/g," </p>"),t=t.replace(/<\/div>/g," </div>"),t=$("<div></div>").html(t).text(),t=t.replace(/</g,"<"),t=t.replace(/>/g,">"),t.length<300?t:t.substring(0,300)):""},Note.genAbstract=function(t,e){if(!t)return"";if(void 0==e&&(e=1e3),t.length<e)return t;for(var o=!1,a=!1,n=0,i="",r=e,s=0;s<t.length;++s){var c=t[s];if("<"==c?o=!0:"&"==c?a=!0:">"==c&&o?(n-=1,o=!1):";"==c&&a&&(a=!1),o||a||(n+=1),i+=c,n>=r)break}var d=document.createElement("div");return d.innerHTML=i,d.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=Note.curHasChanged(t);return a.hasChanged||a.IsNew?(Note.renderChangedNote(a),delete a.hasChanged,showMsg(getMsg("saving")),o.saveILine 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("click",function(e){})},convert_urls:!0,relative_urls:!1,remove_script_host:!1,selector:"#editorContent",content_css:["/css/editor/editor.css"],skin:"custom",language:LEA.locale,plugins:["autolink link leaui_image lists hr","paste","searchreplace leanote_nav leanote_code tabfocus","table textcolor"],toolbar1:"formatselect | forecolor backcolor | bold italic underline strikethrough | leaui_image | leanote_code leanote_inline_code | bullist numlist | alignleft aligncenter alignright alignjustify",toolbar2:"outdent indent blockquote | link unlink | table | hr removeformat | subscript superscript |searchreplace | pastetext | leanote_ace_pre | fontselect fontsizeselect",menubar:!1,toolbar_items_size:"small",statusbar:!1,url_converter:!1,font_formats:"Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Times New Roman=times new roman,times;Courier New=courier new,courier;Tahoma=tahoma,arial,helvetica,sans-serif;Verdana=verdana,geneva;宋体=SimSun;新宋体=NSimSun;黑体=SimHei;微软雅黑=Microsoft YaHei",block_formats:"Header 1=h1;Header 2=h2;Header 3=h3;Header 4=h4;Paragraph=p",paste_data_images:!0}),window.onbeforeunload=function(e){Note.curChangedSaveIt()},$("body").on("keydown",Note.saveNote)}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 openSetInfoDialog(e){showDialogRemote("/user/account",{tab:e})}function updateLeftIsMin(e){ajaxGet("/user/updateLeftIsMin",{leftIsMin:e})}function minLeft(e){$("#leftNotebook").width(30),$("#notebook").hide(),$("#noteAndEditor").css("left",30),$("#notebookSplitter").hide(),$("#logo").hide(),$("#leftSwitcher").hide(),$("#leftSwitcher2").show(),$("#leftNotebook .slimScrollDiv").hide(),e&&updateLeftIsMin(!0)}function maxLeft(e){$("#noteAndEditor").css("left",UserInfo.NotebookWidth),$("#leftNotebook").width(UserInfo.NotebookWidth),$("#notebook").show(),$("#notebookSplitter").show(),$("#leftSwitcher2").hide(),$("#logo").show(),$("#leftSwitcher").show(),$("#leftNotebook .slimScrollDiv").show(),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(),$("#noteListLine 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&&(Note.curNoteIsDirtied(),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,l=k.getNodesByFilter(a,!1,i)}else var l=k.getNodes();s.siblings=[];for(var c in l){var h=l[c].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("defaulthhare"),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
|
||||
-1
@@ -1 +0,0 @@
|
||||
var urlPrefix=UrlPrefix;define("attachment_upload",["jquery.ui.widget","fileupload"],function(){function formatFileSize(bytes){if(typeof bytes!=="number"){return""}if(bytes>=1e9){return(bytes/1e9).toFixed(2)+" GB"}if(bytes>=1e6){return(bytes/1e6).toFixed(2)+" MB"}return(bytes/1e3).toFixed(2)+" KB"}function setDropStyle(dropzoneId,formId){var dropZone=$(dropzoneId);$(formId).bind("dragover",function(e){e.preventDefault();var timeout=window.dropZoneTimeoutAttach;if(timeout){clearTimeout(timeout)}var found=false,node=e.target;do{if(node===dropZone[0]){found=true;break}node=node.parentNode}while(node!=null);if(found){dropZone.addClass("hover")}else{dropZone.removeClass("hover")}window.dropZoneTimeoutAttach=setTimeout(function(){window.dropZoneTimeoutAttach=null;dropZone.removeClass("in hover")},100)})}setDropStyle("#dropAttach","#uploadAttach");setDropStyle("#dropAvatar","#uploadAvatar");var initUploader=function(){$(".dropzone .btn-choose-file").click(function(){$(this).parent().find("input").click()});var $msg=$("#attachUploadMsg");$("#uploadAttach").fileupload({dataType:"json",pasteZone:"",dropZone:$("#dropAttach"),formData:function(form){return[{name:"noteId",value:Note.curNoteId}]},add:function(e,data){var note=Note.getCurNote();if(!note||note.IsNew){alert("This note hasn't saved, please save it firstly!");return}var tpl=$('<div class="alert alert-info"><img class="loader" src="/tinymce/plugins/leaui_image/public/images/ajax-loader.gif"> <a class="close" data-dismiss="alert">×</a></div>');tpl.append(data.files[0].name+" <small>[<i>"+formatFileSize(data.files[0].size)+"</i>]</small>");$msg.html(tpl);data.context=$msg;var size=data.files[0].size;var maxFileSize=+GlobalConfigs["uploadAttachSize"]||100;if(typeof size=="number"&&size>1024*1024*maxFileSize){tpl.find("img").remove();tpl.removeClass("alert-info").addClass("alert-danger");tpl.append(" Warning: File size is bigger than "+maxFileSize+"M");setTimeout(function(tpl){return function(){tpl.remove()}}(tpl),3e3);return}var jqXHR;setTimeout(function(){jqXHR=data.submit()},10)},done:function(e,data){if(data.result.Ok==true){data.context.html("");Attach.addAttach(data.result.Item)}else{var re=data.result;data.context.html("");var tpl=$('<div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div>');tpl.append("<b>Error:</b> "+data.files[0].name+" <small>[<i>"+formatFileSize(data.files[0].size)+"</i>]</small> "+data.result.Msg);data.context.html(tpl);setTimeout(function(tpl){return function(){tpl.remove()}}(tpl),3e3)}$("#uploadAttachMsg").scrollTop(1e3)},fail:function(e,data){data.context.html("");var tpl=$('<div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div>');tpl.append("<b>Error:</b> "+data.files[0].name+" <small>[<i>"+formatFileSize(data.files[0].size)+"</i>]</small> "+data.errorThrown);data.context.html(tpl);setTimeout(function(tpl){return function(){tpl.remove()}}(tpl),3e3);$("#uploadAttachMsg").scrollTop(1e3)}});var $msg2=$("#avatarUploadMsg");$("#uploadAvatar").fileupload({dataType:"json",dropZone:$("#dropAvatar"),pasteZone:"",add:function(e,data){var tpl=$('<div class="alert alert-info"><img class="loader" src="/tinymce/plugins/leaui_image/public/images/ajax-loader.gif"> <a class="close" data-dismiss="alert">×</a></div>');tpl.append(data.files[0].name+" <small>[<i>"+formatFileSize(data.files[0].size)+"</i>]</small>");$msg2.html(tpl);data.context=$msg2;var size=data.files[0].size;var maxFileSize=+GlobalConfigs["uploadAvatarSize"]||100;if(typeof size=="number"&&size>1024*1024*maxFileSize){tpl.find("img").remove();tpl.removeClass("alert-info").addClass("alert-danger");tpl.append(" Warning: File size is bigger than "+maxFileSize+"M");setTimeout(function(tpl){return function(){tpl.remove()}}(tpl),3e3);return}var jqXHR;setTimeout(function(){jqXHR=data.submit()},10)},done:function(e,data){if(data.result.Ok==true){data.context.html("");var re=data.result;$("#avatar").attr("src",UrlPrefix+"/"+re.Id)}else{var re=data.result;data.context.html("");var tpl=$('<div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div>');tpl.append("<b>Error:</b> "+data.files[0].name+" <small>[<i>"+formatFileSize(data.files[0].size)+"</i>]</small> "+data.result.Msg);data.context.html(tpl);setTimeout(function(tpl){return function(){tpl.remove()}}(tpl),3e3)}},fail:function(e,data){data.context.html("");var tpl=$('<div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div>');tpl.append("<b>Error:</b> "+data.files[0].name+" <small>[<i>"+formatFileSize(data.files[0].size)+"</i>]</small> "+data.errorThrown);data.context.html(tpl);setTimeout(function(tpl){return function(){tpl.remove()}}(tpl),3e3)}})};initUploader()});
|
||||
@@ -1,216 +0,0 @@
|
||||
// upload attachment
|
||||
// 依赖note
|
||||
var urlPrefix = UrlPrefix;
|
||||
define('attachment_upload', ['jquery.ui.widget', 'fileupload'], function(){
|
||||
// Helper function that formats the file sizes
|
||||
function formatFileSize(bytes) {
|
||||
if (typeof bytes !== 'number') {
|
||||
return '';
|
||||
}
|
||||
if (bytes >= 1000000000) {
|
||||
return (bytes / 1000000000).toFixed(2) + ' GB';
|
||||
}
|
||||
if (bytes >= 1000000) {
|
||||
return (bytes / 1000000).toFixed(2) + ' MB';
|
||||
}
|
||||
return (bytes / 1000).toFixed(2) + ' KB';
|
||||
}
|
||||
|
||||
function setDropStyle(dropzoneId, formId) {
|
||||
// drag css
|
||||
var dropZone = $(dropzoneId);
|
||||
$(formId).bind('dragover', function (e) {
|
||||
e.preventDefault();
|
||||
var timeout = window.dropZoneTimeoutAttach;
|
||||
if(timeout) {
|
||||
clearTimeout(timeout);
|
||||
}
|
||||
|
||||
var found = false,
|
||||
node = e.target;
|
||||
do {
|
||||
if (node === dropZone[0]) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
node = node.parentNode;
|
||||
} while (node != null);
|
||||
if (found) {
|
||||
dropZone.addClass('hover');
|
||||
} else {
|
||||
dropZone.removeClass('hover');
|
||||
}
|
||||
window.dropZoneTimeoutAttach = setTimeout(function () {
|
||||
window.dropZoneTimeoutAttach = null;
|
||||
dropZone.removeClass('in hover');
|
||||
}, 100);
|
||||
});
|
||||
}
|
||||
|
||||
setDropStyle("#dropAttach", "#uploadAttach");
|
||||
setDropStyle("#dropAvatar", "#uploadAvatar");
|
||||
|
||||
var initUploader = function() {
|
||||
$('.dropzone .btn-choose-file').click(function() {
|
||||
$(this).parent().find('input').click();
|
||||
});
|
||||
|
||||
var $msg = $('#attachUploadMsg');
|
||||
// Initialize the jQuery File Upload plugin
|
||||
$('#uploadAttach').fileupload({
|
||||
dataType: 'json',
|
||||
pasteZone: '', // 不能通过paste来上传图片
|
||||
// This element will accept file drag/drop uploading
|
||||
dropZone: $('#dropAttach'),
|
||||
formData: function(form) {
|
||||
return [{name: 'noteId', value: Note.curNoteId}] // 传递笔记本过去
|
||||
},
|
||||
// This function is called when a file is added to the queue;
|
||||
// either via the browse button, or via drag/drop:
|
||||
add: function(e, data) {
|
||||
var note = Note.getCurNote();
|
||||
if(!note || note.IsNew) {
|
||||
alert("This note hasn't saved, please save it firstly!")
|
||||
return;
|
||||
}
|
||||
|
||||
var tpl = $('<div class="alert alert-info"><img class="loader" src="/tinymce/plugins/leaui_image/public/images/ajax-loader.gif"> <a class="close" data-dismiss="alert">×</a></div>');
|
||||
|
||||
// Append the file name and file size
|
||||
tpl.append(data.files[0].name + ' <small>[<i>' + formatFileSize(data.files[0].size) + '</i>]</small>');
|
||||
|
||||
// Add the HTML to the UL element
|
||||
$msg.html(tpl);
|
||||
data.context = $msg;
|
||||
|
||||
// 检查文件大小
|
||||
var size = data.files[0].size;
|
||||
var maxFileSize = +GlobalConfigs["uploadAttachSize"] || 100;
|
||||
if(typeof size == 'number' && size > 1024 * 1024 * maxFileSize) {
|
||||
tpl.find("img").remove();
|
||||
tpl.removeClass("alert-info").addClass("alert-danger");
|
||||
tpl.append(" Warning: File size is bigger than " + maxFileSize + "M");
|
||||
setTimeout((function(tpl) {
|
||||
return function() {
|
||||
tpl.remove();
|
||||
}
|
||||
})(tpl), 3000);
|
||||
return;
|
||||
}
|
||||
|
||||
// Automatically upload the file once it is added to the queue
|
||||
var jqXHR;
|
||||
setTimeout(function() {
|
||||
jqXHR = data.submit();
|
||||
}, 10);
|
||||
},
|
||||
/*
|
||||
progress: function (e, data) {
|
||||
},
|
||||
*/
|
||||
done: function(e, data) {
|
||||
if (data.result.Ok == true) {
|
||||
data.context.html("");
|
||||
Attach.addAttach(data.result.Item);
|
||||
} else {
|
||||
var re = data.result;
|
||||
data.context.html("");
|
||||
var tpl = $('<div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div>');
|
||||
tpl.append('<b>Error:</b> ' + data.files[0].name + ' <small>[<i>' + formatFileSize(data.files[0].size) + '</i>]</small> ' + data.result.Msg);
|
||||
data.context.html(tpl);
|
||||
setTimeout((function(tpl) {
|
||||
return function() {
|
||||
tpl.remove();
|
||||
}
|
||||
})(tpl), 3000);
|
||||
}
|
||||
$("#uploadAttachMsg").scrollTop(1000);
|
||||
},
|
||||
fail: function(e, data) {
|
||||
data.context.html("");
|
||||
var tpl = $('<div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div>');
|
||||
tpl.append('<b>Error:</b> ' + data.files[0].name + ' <small>[<i>' + formatFileSize(data.files[0].size) + '</i>]</small> ' + data.errorThrown);
|
||||
data.context.html(tpl);
|
||||
setTimeout((function(tpl) {
|
||||
return function() {
|
||||
tpl.remove();
|
||||
}
|
||||
})(tpl), 3000);
|
||||
|
||||
$("#uploadAttachMsg").scrollTop(1000);
|
||||
}
|
||||
});
|
||||
|
||||
//-------------------
|
||||
// 已经过时, 没有avatar了
|
||||
|
||||
var $msg2 = $('#avatarUploadMsg');
|
||||
$('#uploadAvatar').fileupload({
|
||||
dataType: 'json',
|
||||
dropZone: $('#dropAvatar'),
|
||||
pasteZone: '',
|
||||
add: function(e, data) {
|
||||
var tpl = $('<div class="alert alert-info"><img class="loader" src="/tinymce/plugins/leaui_image/public/images/ajax-loader.gif"> <a class="close" data-dismiss="alert">×</a></div>');
|
||||
|
||||
// Append the file name and file size
|
||||
tpl.append(data.files[0].name + ' <small>[<i>' + formatFileSize(data.files[0].size) + '</i>]</small>');
|
||||
|
||||
// Add the HTML to the UL element
|
||||
$msg2.html(tpl);
|
||||
data.context = $msg2;
|
||||
|
||||
// 检查文件大小
|
||||
var size = data.files[0].size;
|
||||
var maxFileSize = +GlobalConfigs["uploadAvatarSize"] || 100;
|
||||
if(typeof size == 'number' && size > 1024 * 1024 * maxFileSize) {
|
||||
tpl.find("img").remove();
|
||||
tpl.removeClass("alert-info").addClass("alert-danger");
|
||||
tpl.append(" Warning: File size is bigger than " + maxFileSize + "M");
|
||||
setTimeout((function(tpl) {
|
||||
return function() {
|
||||
tpl.remove();
|
||||
}
|
||||
})(tpl), 3000);
|
||||
return;
|
||||
}
|
||||
|
||||
// Automatically upload the file once it is added to the queue
|
||||
var jqXHR;
|
||||
setTimeout(function() {
|
||||
jqXHR = data.submit();
|
||||
}, 10);
|
||||
},
|
||||
done: function(e, data) {
|
||||
if (data.result.Ok == true) {
|
||||
data.context.html("");
|
||||
var re = data.result;
|
||||
$("#avatar").attr("src", UrlPrefix + "/" + re.Id);
|
||||
} else {
|
||||
var re = data.result;
|
||||
data.context.html("");
|
||||
var tpl = $('<div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div>');
|
||||
tpl.append('<b>Error:</b> ' + data.files[0].name + ' <small>[<i>' + formatFileSize(data.files[0].size) + '</i>]</small> ' + data.result.Msg);
|
||||
data.context.html(tpl);
|
||||
setTimeout((function(tpl) {
|
||||
return function() {
|
||||
tpl.remove();
|
||||
}
|
||||
})(tpl), 3000);
|
||||
}
|
||||
},
|
||||
fail: function(e, data) {
|
||||
data.context.html("");
|
||||
var tpl = $('<div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div>');
|
||||
tpl.append('<b>Error:</b> ' + data.files[0].name + ' <small>[<i>' + formatFileSize(data.files[0].size) + '</i>]</small> ' + data.errorThrown);
|
||||
data.context.html(tpl);
|
||||
setTimeout((function(tpl) {
|
||||
return function() {
|
||||
tpl.remove();
|
||||
}
|
||||
})(tpl), 3000);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
initUploader();
|
||||
});
|
||||
-1
@@ -1 +0,0 @@
|
||||
var urlPrefix=UrlPrefix;define("editor_drop_paste",["jquery.ui.widget","fileupload"],function(){function Process(editor){var id="__mcenew"+(new Date).getTime();var str='<div contenteditable="false" id="'+id+'" 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=str;editor.insertContent(str);var container=$("#"+id);this.container=container;this.id=id;this.processBar=container.find(".progress-bar")}Process.prototype.update=function(process){var me=this;process=Math.ceil(process*100);if(process>=100){process=99}process+="%";$("#"+me.id+" .progress-bar").html(process).css("width",process)};Process.prototype.replace=function(src){var me=this;getImageSize(src,function(){$("#"+me.id).replaceWith('<img src="'+src+'" />')})};Process.prototype.remove=function(){var me=this;$("#"+me.id).remove()};function getImageSize(url,callback){var img=document.createElement("img");function done(width,height){img.parentNode.removeChild(img);callback({width:width,height:height})}img.onload=function(){done(img.clientWidth,img.clientHeight)};img.onerror=function(){done()};img.src=url;var style=img.style;style.visibility="hidden";style.position="fixed";style.bottom=style.left=0;style.width=style.height="auto";document.body.appendChild(img)}var i=1;function insertImage(data){var editor=tinymce.activeEditor;var dom=editor.dom;var renderImage=function(data2){var d={};var imgElm;d.id="__mcenew"+i++;d.src="http://leanote.com/images/loading-24.gif";imgElm=dom.createHTML("img",d);tinymce.activeEditor.insertContent(imgElm);imgElm=dom.get(d.id);function callback(wh){dom.setAttrib(imgElm,"src",data2.src);if(data2.title){dom.setAttrib(imgElm,"title",data2.title)}dom.setAttrib(imgElm,"id",null)}getImageSize(data.src,callback)};var fileId="";fileIds=data.src.split("fileId=");if(fileIds.length==2&&fileIds[1].length=="53aecf8a8a039a43c8036282".length){fileId=fileIds[1]}if(fileId){var curNote=Note.getCurNote();if(curNote&&curNote.UserId!=UserInfo.UserId){(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+"/file/outputImage?fileId="+re.Id}renderImage(data)})})(data)}else{renderImage(data)}}else{renderImage(data)}}var initUploader=function(){var ul=$("#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(form){return[{name:"albumId",value:""}]},add:function(e,data){var tpl=$('<li><div class="alert alert-info"><img class="loader" src="/tinymce/plugins/leaui_image/public/images/ajax-loader.gif"> <a class="close" data-dismiss="alert">×</a></div></li>');tpl.find("div").append(data.files[0].name+" <small>[<i>"+formatFileSize(data.files[0].size)+"</i>]</small>");data.context=tpl.appendTo(ul);var jqXHR=data.submit()},done:function(e,data){if(data.result.Ok==true){data.context.remove();var data2={src:urlPrefix+"/file/outputImage?fileId="+data.result.Id};insertImage(data2)}else{data.context.empty();var tpl=$('<li><div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div></li>');tpl.find("div").append("<b>Error:</b> "+data.files[0].name+" <small>[<i>"+formatFileSize(data.files[0].size)+"</i>]</small> "+data.result.Msg);data.context.append(tpl);setTimeout(function(tpl){return function(){tpl.remove()}}(tpl),2e3)}$("#uploadMsg").scrollTop(1e3)},fail:function(e,data){data.context.empty();var tpl=$('<li><div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div></li>');tpl.find("div").append("<b>Error:</b> "+data.files[0].name+" <small>[<i>"+formatFileSize(data.files[0].size)+"</i>]</small> "+data.errorThrown);data.context.append(tpl);setTimeout(function(tpl){return function(){tpl.remove()}}(tpl),2e3);$("#uploadMsg").scrollTop(1e3)}});$(document).on("drop dragover",function(e){e.preventDefault()});function formatFileSize(bytes){if(typeof bytes!=="number"){return""}if(bytes>=1e9){return(bytes/1e9).toFixed(2)+" GB"}if(bytes>=1e6){return(bytes/1e6).toFixed(2)+" MB"}return(bytes/1e3).toFixed(2)+" KB"}function showUpload(){$("#upload").css("z-index",12);var top=+$("#mceToolbar").css("height").slice(0,-2);$("#upload").css("top",top-8);$("#upload").show()}function hideUpload(){$("#upload").css("z-index",0).css("top","auto").hide()}$(document).bind("dragover",function(e){var dropZone=$("#drop"),timeout=window.dropZoneTimeout;if(!timeout){dropZone.addClass("in");showUpload()}else{clearTimeout(timeout)}var found=false,node=e.target;do{if(node===dropZone[0]){found=true;break}node=node.parentNode}while(noLine truncated
|
||||
@@ -1,375 +0,0 @@
|
||||
// for editor.
|
||||
// drag image to editor
|
||||
var urlPrefix = UrlPrefix; // window.location.protocol + "//" + window.location.host;
|
||||
define('editor_drop_paste', ['jquery.ui.widget', 'fileupload'], function(){
|
||||
function Process(editor) {
|
||||
var id = '__mcenew' + (new Date()).getTime();
|
||||
var str = '<div contenteditable="false" id="' + id + '" 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 = str;
|
||||
editor.insertContent(str);
|
||||
var container = $('#' + id);
|
||||
this.container = container;
|
||||
this.id = id;
|
||||
this.processBar = container.find('.progress-bar');
|
||||
}
|
||||
Process.prototype.update = function(process) {
|
||||
var me = this;
|
||||
// 98%, 不要小数
|
||||
process = Math.ceil(process * 100);
|
||||
if(process >= 100) {
|
||||
process = 99;
|
||||
}
|
||||
process += "%";
|
||||
$('#' + me.id + ' .progress-bar').html(process).css('width', process);
|
||||
}
|
||||
Process.prototype.replace = function(src) {
|
||||
var me = this;
|
||||
getImageSize(src, function() {
|
||||
$('#' + me.id).replaceWith('<img src="' + src + '" />');
|
||||
});
|
||||
}
|
||||
Process.prototype.remove = function() {
|
||||
var me = this;
|
||||
$('#' + me.id).remove();
|
||||
}
|
||||
|
||||
// 当url改变时, 得到图片的大小
|
||||
function getImageSize(url, callback) {
|
||||
var img = document.createElement('img');
|
||||
|
||||
function done(width, height) {
|
||||
img.parentNode.removeChild(img);
|
||||
callback({width: width, height: height});
|
||||
}
|
||||
|
||||
img.onload = function() {
|
||||
done(img.clientWidth, img.clientHeight);
|
||||
};
|
||||
|
||||
img.onerror = function() {
|
||||
done();
|
||||
};
|
||||
|
||||
img.src = url;
|
||||
|
||||
var style = img.style;
|
||||
style.visibility = 'hidden';
|
||||
style.position = 'fixed';
|
||||
style.bottom = style.left = 0;
|
||||
style.width = style.height = 'auto';
|
||||
|
||||
document.body.appendChild(img);
|
||||
}
|
||||
|
||||
var i = 1;
|
||||
function insertImage(data) {
|
||||
var editor = tinymce.activeEditor;
|
||||
var dom = editor.dom;
|
||||
|
||||
var renderImage = function(data2) {
|
||||
// 这里, 如果图片宽度过大, 这里设置成500px
|
||||
var d = {};
|
||||
var imgElm;
|
||||
// 先显示loading...
|
||||
d.id = '__mcenew' + (i++);
|
||||
d.src = "http://leanote.com/images/loading-24.gif";
|
||||
imgElm = dom.createHTML('img', d);
|
||||
tinymce.activeEditor.insertContent(imgElm);
|
||||
imgElm = dom.get(d.id);
|
||||
|
||||
function callback (wh) {
|
||||
dom.setAttrib(imgElm, 'src', data2.src);
|
||||
// dom.setAttrib(imgElm, 'width', data2.width);
|
||||
if(data2.title) {
|
||||
dom.setAttrib(imgElm, 'title', data2.title);
|
||||
}
|
||||
|
||||
dom.setAttrib(imgElm, 'id', null);
|
||||
};
|
||||
getImageSize(data.src, callback);
|
||||
}
|
||||
|
||||
//-------------
|
||||
// outputImage?fileId=123232323
|
||||
var fileId = "";
|
||||
fileIds = data.src.split("fileId=")
|
||||
if(fileIds.length == 2 && fileIds[1].length == "53aecf8a8a039a43c8036282".length) {
|
||||
fileId = fileIds[1];
|
||||
}
|
||||
if(fileId) {
|
||||
// 得到fileId, 如果这个笔记不是我的, 那么肯定是协作的笔记, 那么需要将图片copy给原note owner
|
||||
var curNote = Note.getCurNote();
|
||||
if(curNote && curNote.UserId != UserInfo.UserId) {
|
||||
(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 + "/file/outputImage?fileId=" + re.Id;
|
||||
}
|
||||
renderImage(data);
|
||||
});
|
||||
})(data);
|
||||
} else {
|
||||
renderImage(data);
|
||||
}
|
||||
} else {
|
||||
renderImage(data);
|
||||
}
|
||||
}
|
||||
|
||||
var initUploader = function() {
|
||||
var ul = $('#upload ul');
|
||||
|
||||
$('#drop a').click(function() {
|
||||
// trigger to show file select
|
||||
$(this).parent().find('input').click();
|
||||
});
|
||||
|
||||
// Initialize the jQuery File Upload plugin
|
||||
$('#upload').fileupload({
|
||||
dataType: 'json',
|
||||
pasteZone: '', // 不允许paste
|
||||
acceptFileTypes: /(\.|\/)(gif|jpg|jpeg|png|jpe)$/i,
|
||||
maxFileSize: 210000,
|
||||
|
||||
// This element will accept file drag/drop uploading
|
||||
dropZone: $('#drop'),
|
||||
formData: function(form) {
|
||||
return [{name: 'albumId', value: ""}]
|
||||
},
|
||||
// This function is called when a file is added to the queue;
|
||||
// either via the browse button, or via drag/drop:
|
||||
add: function(e, data) {
|
||||
var tpl = $('<li><div class="alert alert-info"><img class="loader" src="/tinymce/plugins/leaui_image/public/images/ajax-loader.gif"> <a class="close" data-dismiss="alert">×</a></div></li>');
|
||||
|
||||
// Append the file name and file size
|
||||
tpl.find('div').append(data.files[0].name + ' <small>[<i>' + formatFileSize(data.files[0].size) + '</i>]</small>');
|
||||
|
||||
// Add the HTML to the UL element
|
||||
data.context = tpl.appendTo(ul);
|
||||
|
||||
// data.form[0].action += "&album_id=" + $("#albumsForUpload").val();
|
||||
|
||||
// Automatically upload the file once it is added to the queue
|
||||
var jqXHR = data.submit();
|
||||
},
|
||||
|
||||
done: function(e, data) {
|
||||
if (data.result.Ok == true) {
|
||||
data.context.remove();
|
||||
// life
|
||||
var data2 = {src: urlPrefix + "/file/outputImage?fileId=" + data.result.Id}
|
||||
insertImage(data2);
|
||||
} else {
|
||||
data.context.empty();
|
||||
var tpl = $('<li><div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div></li>');
|
||||
tpl.find('div').append('<b>Error:</b> ' + data.files[0].name + ' <small>[<i>' + formatFileSize(data.files[0].size) + '</i>]</small> ' + data.result.Msg);
|
||||
data.context.append(tpl);
|
||||
setTimeout((function(tpl) {
|
||||
return function() {
|
||||
tpl.remove();
|
||||
}
|
||||
})(tpl), 2000);
|
||||
}
|
||||
$("#uploadMsg").scrollTop(1000);
|
||||
},
|
||||
fail: function(e, data) {
|
||||
data.context.empty();
|
||||
var tpl = $('<li><div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div></li>');
|
||||
tpl.find('div').append('<b>Error:</b> ' + data.files[0].name + ' <small>[<i>' + formatFileSize(data.files[0].size) + '</i>]</small> ' + data.errorThrown);
|
||||
data.context.append(tpl);
|
||||
setTimeout((function(tpl) {
|
||||
return function() {
|
||||
tpl.remove();
|
||||
}
|
||||
})(tpl), 2000);
|
||||
|
||||
$("#uploadMsg").scrollTop(1000);
|
||||
}
|
||||
});
|
||||
|
||||
// Prevent the default action when a file is dropped on the window
|
||||
$(document).on('drop dragover', function(e) {
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
// Helper function that formats the file sizes
|
||||
function formatFileSize(bytes) {
|
||||
if (typeof bytes !== 'number') {
|
||||
return '';
|
||||
}
|
||||
if (bytes >= 1000000000) {
|
||||
return (bytes / 1000000000).toFixed(2) + ' GB';
|
||||
}
|
||||
if (bytes >= 1000000) {
|
||||
return (bytes / 1000000).toFixed(2) + ' MB';
|
||||
}
|
||||
return (bytes / 1000).toFixed(2) + ' KB';
|
||||
}
|
||||
|
||||
function showUpload() {
|
||||
$("#upload").css("z-index", 12);
|
||||
var top = +$("#mceToolbar").css("height").slice(0, -2); // px
|
||||
$("#upload").css("top", top - 8);
|
||||
$("#upload").show();
|
||||
}
|
||||
|
||||
function hideUpload() {
|
||||
$("#upload").css("z-index", 0).css("top", "auto").hide();
|
||||
}
|
||||
|
||||
// drag css
|
||||
$(document).bind('dragover', function (e) {
|
||||
var dropZone = $('#drop'),
|
||||
timeout = window.dropZoneTimeout;
|
||||
if (!timeout) {
|
||||
dropZone.addClass('in');
|
||||
showUpload();
|
||||
} else {
|
||||
clearTimeout(timeout);
|
||||
}
|
||||
|
||||
var found = false,
|
||||
node = e.target;
|
||||
do {
|
||||
if (node === dropZone[0]) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
node = node.parentNode;
|
||||
} while (node != null);
|
||||
if (found) {
|
||||
dropZone.addClass('hover');
|
||||
} else {
|
||||
dropZone.removeClass('hover');
|
||||
}
|
||||
window.dropZoneTimeout = setTimeout(function () {
|
||||
window.dropZoneTimeout = null;
|
||||
dropZone.removeClass('in hover');
|
||||
hideUpload();
|
||||
}, 100);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
// pasteImage
|
||||
var pasteImageInit = function() {
|
||||
// Initialize the jQuery File Upload plugin
|
||||
var dom, editor;
|
||||
$('#editorContent').fileupload({
|
||||
dataType: 'json',
|
||||
pasteZone: $('#editorContent'),
|
||||
dropZone: '', // 只允许paste
|
||||
maxFileSize: 210000,
|
||||
url: "/file/pasteImage",
|
||||
paramName: 'file',
|
||||
formData: function(form) {
|
||||
return [{name: 'from', value: 'pasteImage'}, {name: 'noteId', value: Note.curNoteId}]
|
||||
},
|
||||
/*
|
||||
paste: function(e, data) {
|
||||
var jqXHR = data.submit();
|
||||
},
|
||||
*/
|
||||
progress: function(e, data) {
|
||||
data.process.update(data.loaded / data.total);
|
||||
},
|
||||
add: function(e, data) {
|
||||
var note = Note.getCurNote();
|
||||
if(!note || note.IsNew) {
|
||||
alert("This note hasn't saved, please save it firstly!")
|
||||
return;
|
||||
}
|
||||
// 先显示loading...
|
||||
editor = tinymce.EditorManager.activeEditor;
|
||||
var process = new Process(editor);
|
||||
data.process = process;
|
||||
var jqXHR = data.submit();
|
||||
/*
|
||||
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 + "/file/outputImage?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 + "/file/outputImage?fileId=" + re.Id;
|
||||
|
||||
data.process.replace(src);
|
||||
/*
|
||||
getImageSize(src, function() {
|
||||
$img.attr('src', src);
|
||||
$img.removeAttr('id');
|
||||
});
|
||||
*/
|
||||
} else {
|
||||
data.process.remove();
|
||||
}
|
||||
},
|
||||
fail: function(e, data) {
|
||||
data.process.remove();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
initUploader();
|
||||
pasteImageInit();
|
||||
});
|
||||
+62
-84
@@ -61,7 +61,10 @@ Note.setNoteCache = function(content, clear) {
|
||||
if(!Note.cache[content.NoteId]) {
|
||||
Note.cache[content.NoteId] = content;
|
||||
} else {
|
||||
// console.log('pre');
|
||||
// console.log(Note.cache[content.NoteId].IsBlog);
|
||||
$.extend(Note.cache[content.NoteId], content);
|
||||
// console.log(Note.cache[content.NoteId].IsBlog);
|
||||
}
|
||||
|
||||
if(clear == undefined) {
|
||||
@@ -242,7 +245,7 @@ Note.curHasChanged = function(force) {
|
||||
if(hasChanged.IsNew) {
|
||||
$.extend(hasChanged, cacheNote);
|
||||
} else {
|
||||
if(!cacheNote.isDirty) {
|
||||
if(!force && !cacheNote.isDirty) {
|
||||
log("no dirty");
|
||||
hasChanged.hasChanged = false;
|
||||
return hasChanged;
|
||||
@@ -619,7 +622,10 @@ Note.changeNote = function(selectNoteId, isShare, needSaveChanged, callback) {
|
||||
}
|
||||
|
||||
// 这里要切换编辑器
|
||||
switchEditor(cacheNote.IsMarkdown)
|
||||
switchEditor(cacheNote.IsMarkdown);
|
||||
|
||||
// 发送事件
|
||||
LEA.trigger('noteChanged', cacheNote);
|
||||
|
||||
Attach.renderNoteAttachNum(selectNoteId, true);
|
||||
|
||||
@@ -631,9 +637,9 @@ Note.changeNote = function(selectNoteId, isShare, needSaveChanged, callback) {
|
||||
return;
|
||||
}
|
||||
Note.setNoteCache(ret, false);
|
||||
|
||||
// 把其它信息也带上
|
||||
ret = Note.cache[selectNoteId]
|
||||
|
||||
Note.renderNoteContent(ret);
|
||||
/* 都用editable的render
|
||||
if(hasPerm) {
|
||||
@@ -663,7 +669,11 @@ Note.changeNote = function(selectNoteId, isShare, needSaveChanged, callback) {
|
||||
if(Note.contentAjax != null) {
|
||||
Note.contentAjax.abort();
|
||||
}
|
||||
Note.contentAjax = ajaxGet(url, param, setContent);
|
||||
Note.contentAjax = ajaxGet(url, param, function (ret) {
|
||||
// 因为之前Content内的IsBlog和Note的IsBlog不同步, 所以去掉Content中的IsBlog
|
||||
delete ret['IsBlog'];
|
||||
setContent(ret);
|
||||
});
|
||||
}
|
||||
|
||||
// 渲染
|
||||
@@ -1075,69 +1085,16 @@ Note.shareNote = function(target) {
|
||||
|
||||
var noteId = $(target).attr("noteId");
|
||||
shareNoteOrNotebook(noteId, true);
|
||||
}
|
||||
};
|
||||
|
||||
// 历史记录
|
||||
Note.listNoteContentHistories = function() {
|
||||
// 弹框
|
||||
$("#leanoteDialog #modalTitle").html(getMsg("history"));
|
||||
$content = $("#leanoteDialog .modal-body");
|
||||
$content.html("");
|
||||
$("#leanoteDialog .modal-footer").html('<button type="button" class="btn btn-default" data-dismiss="modal">' + getMsg("close") + '</button>');
|
||||
options = {}
|
||||
options.show = true;
|
||||
$("#leanoteDialog").modal(options);
|
||||
|
||||
ajaxGet("/noteContentHistory/listHistories", {noteId: Note.curNoteId}, function(re) {
|
||||
if(!isArray(re)) {$content.html(getMsg("noHistories")); return}
|
||||
// 组装成一个tab
|
||||
var str = "<p>" + getMsg("historiesNum") + '</p><div id="historyList"><table class="table table-hover">';
|
||||
note = Note.cache[Note.curNoteId];
|
||||
var s = "div"
|
||||
if(note.IsMarkdown) {
|
||||
s = "pre";
|
||||
// 下载
|
||||
Note.download = function(url, params) {
|
||||
var inputs = '';
|
||||
for (var i in params) {
|
||||
inputs += '<input name="' + i + '" value="' + params[i] + '">';
|
||||
}
|
||||
for (i in re) {
|
||||
var content = re[i]
|
||||
content.Ab = Note.genAbstract(content.Content, 200);
|
||||
// 为什么不用tt(), 因为content可能含??
|
||||
str += '<tr><td seq="' + i + '">#' + (i+1) +'<' + s + ' class="each-content">' + content.Ab + '</' + s + '> <div class="btns">' + getMsg("datetime") + ': <span class="label label-default">' + goNowToDatetime(content.UpdatedTime) + '</span> <button class="btn btn-default all">' + getMsg("unfold") + '</button> <button class="btn btn-primary back">' + getMsg('restoreFromThisVersion') + '</button></div></td></tr>';
|
||||
}
|
||||
str += "</table></div>";
|
||||
$content.html(str);
|
||||
$("#historyList .all").click(function() {
|
||||
$p = $(this).parent().parent();
|
||||
var seq = $p.attr("seq");
|
||||
var $c = $p.find(".each-content");
|
||||
var info = re[seq];
|
||||
if(!info.unfold) { // 默认是折叠的
|
||||
$(this).text(getMsg("fold")); // 折叠
|
||||
$c.html(info.Content);
|
||||
info.unfold = true;
|
||||
} else {
|
||||
$(this).text(getMsg("unfold")); // 展开
|
||||
$c.html(info.Ab);
|
||||
info.unfold = false
|
||||
}
|
||||
});
|
||||
|
||||
// 还原
|
||||
$("#historyList .back").click(function() {
|
||||
$p = $(this).parent().parent();
|
||||
var seq = $p.attr("seq");
|
||||
if(confirm(getMsg("confirmBackup"))) {
|
||||
// 保存当前版本
|
||||
Note.curChangedSaveIt();
|
||||
// 设置之
|
||||
note = Note.cache[Note.curNoteId];
|
||||
setEditorContent(re[seq].Content, note.IsMarkdown);
|
||||
//
|
||||
hideDialog();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
$('<form target="mdImageManager" action="' + url + '" method="GET">' + inputs + '</form>').appendTo('body').submit().remove();
|
||||
};
|
||||
|
||||
//--------------
|
||||
// read only
|
||||
@@ -1256,14 +1213,15 @@ Note.setNote2Blog = function(target) {
|
||||
if(note.IsBlog != undefined) {
|
||||
isBlog = !note.IsBlog;
|
||||
}
|
||||
|
||||
ajaxPost("/note/setNote2Blog", {noteId: noteId, isBlog: isBlog}, function(ret) {
|
||||
if(ret) {
|
||||
// 标志添加/去掉
|
||||
if(isBlog) {
|
||||
$(target).find(".item-blog").show();
|
||||
} else {
|
||||
$(target).find(".item-blog").hide();
|
||||
}
|
||||
ajaxPost("/note/setNote2Blog", {noteId: noteId, isBlog: isBlog}, function(ret) {
|
||||
if(ret) {
|
||||
Note.setNoteCache({NoteId: noteId, IsBlog: isBlog}, false); // 不清空NotesByNotebookId缓存
|
||||
}
|
||||
});
|
||||
@@ -1482,6 +1440,11 @@ Note.toggleWriteable = function() {
|
||||
Note.readOnly = false;
|
||||
};
|
||||
|
||||
Note.getPostUrl = function (note) {
|
||||
var urlTitle = note.UrlTitle || note.NoteId;
|
||||
return UserInfo.PostUrl + '/' + urlTitle;
|
||||
};
|
||||
|
||||
// 这里速度不慢, 很快
|
||||
Note.getContextNotebooks = function(notebooks) {
|
||||
var moves = [];
|
||||
@@ -1578,6 +1541,8 @@ Note.initContextmenu = function() {
|
||||
items.push("set2Blog");
|
||||
items.push("copy");
|
||||
} else {
|
||||
// console.log('haha');
|
||||
// console.log(note);
|
||||
// 是否已公开为blog
|
||||
if(!note.IsBlog) {
|
||||
items.push("unset2Blog");
|
||||
@@ -1591,6 +1556,7 @@ Note.initContextmenu = function() {
|
||||
items.push("copy." + notebookTitle);
|
||||
}
|
||||
|
||||
// diable 这里
|
||||
menu.applyrule({
|
||||
name: "target..",
|
||||
disable: true,
|
||||
@@ -1630,7 +1596,7 @@ var Attach = {
|
||||
e.stopPropagation();
|
||||
var attachId = $(this).closest('li').data("id");
|
||||
var t = this;
|
||||
if(confirm("Are you sure to delete it ?")) {
|
||||
if(confirm(getMsg("Are you sure to delete it ?"))) {
|
||||
$(t).button("loading");
|
||||
ajaxPost("/attach/deleteAttach", {attachId: attachId}, function(re) {
|
||||
$(t).button("reset");
|
||||
@@ -1646,13 +1612,11 @@ var Attach = {
|
||||
self.attachListO.on("click", ".download-attach", function(e) {
|
||||
e.stopPropagation();
|
||||
var attachId = $(this).closest('li').data("id");
|
||||
window.open(UrlPrefix + "/attach/download?attachId=" + attachId);
|
||||
// location.href = "/attach/download?attachId=" + attachId;
|
||||
Note.download(UrlPrefix + "/attach/download", {attachId:attachId});
|
||||
});
|
||||
// 下载全部
|
||||
self.downloadAllBtnO.click(function() {
|
||||
window.open(UrlPrefix + "/attach/downloadAll?noteId=" + Note.curNoteId);
|
||||
// location.href = "/attach/downloadAll?noteId=" + Note.curNoteId;
|
||||
Note.download(UrlPrefix + "/attach/downloadAll", {noteId: Note.curNoteId});
|
||||
});
|
||||
|
||||
// make link
|
||||
@@ -1661,6 +1625,7 @@ var Attach = {
|
||||
var attachId = $(this).closest('li').data("id");
|
||||
var attach = self.attachsMap[attachId];
|
||||
var src = UrlPrefix + "/attach/download?attachId=" + attachId;
|
||||
Note.toggleWriteable();
|
||||
if(LEA.isMarkdownEditor() && MD) {
|
||||
MD.insertLink(src, attach.Title);
|
||||
} else {
|
||||
@@ -1670,6 +1635,7 @@ var Attach = {
|
||||
});
|
||||
|
||||
// make all link
|
||||
/*
|
||||
self.linkAllBtnO.on("click",function(e) {
|
||||
e.stopPropagation();
|
||||
var note = Note.getCurNote();
|
||||
@@ -1685,6 +1651,7 @@ var Attach = {
|
||||
tinymce.activeEditor.insertContent('<a target="_blank" href="' + src + '">' + title + '</a>');
|
||||
}
|
||||
});
|
||||
*/
|
||||
},
|
||||
attachListO: $("#attachList"),
|
||||
attachNumO: $("#attachNum"),
|
||||
@@ -1728,14 +1695,17 @@ var Attach = {
|
||||
*/
|
||||
var html = "";
|
||||
var attachNum = attachs.length;
|
||||
var titleDelete = getMsg('Delete');
|
||||
var titleDownload = getMsg('Download');
|
||||
var titleLink = getMsg('Insert link into content');
|
||||
for(var i = 0; i < attachNum; ++i) {
|
||||
var each = attachs[i];
|
||||
html += '<li class="clearfix" data-id="' + each.AttachId + '">' +
|
||||
'<div class="attach-title">' + each.Title + '</div>' +
|
||||
'<div class="attach-process"> ' +
|
||||
' <button class="btn btn-sm btn-warning delete-attach" data-loading-text="..."><i class="fa fa-trash-o"></i></button> ' +
|
||||
' <button type="button" class="btn btn-sm btn-primary download-attach"><i class="fa fa-download"></i></button> ' +
|
||||
' <button type="button" class="btn btn-sm btn-default link-attach" title="Insert link into content"><i class="fa fa-link"></i></button> ' +
|
||||
' <button class="btn btn-sm btn-warning delete-attach" data-loading-text="..." title="' + titleDelete + '"><i class="fa fa-trash-o"></i></button> ' +
|
||||
' <button type="button" class="btn btn-sm btn-primary download-attach" title="' + titleDownload + '"><i class="fa fa-download"></i></button> ' +
|
||||
' <button type="button" class="btn btn-sm btn-default link-attach" title="' + titleLink + '"><i class="fa fa-link"></i></button> ' +
|
||||
'</div>' +
|
||||
'</li>';
|
||||
self.attachsMap[each.AttachId] = each;
|
||||
@@ -1807,7 +1777,7 @@ var Attach = {
|
||||
},
|
||||
downloadAll: function() {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//------------------- 事件
|
||||
$(function() {
|
||||
@@ -1824,7 +1794,9 @@ $(function() {
|
||||
}
|
||||
});
|
||||
$("#noteItemList").on("click", ".item", function(event) {
|
||||
event.stopPropagation();
|
||||
// 为什么要stop, 这会导致context, dropdown不隐藏
|
||||
// event.stopPropagation();
|
||||
|
||||
var noteId = $(this).attr("noteId");
|
||||
|
||||
// 手机端处理
|
||||
@@ -1901,12 +1873,6 @@ $(function() {
|
||||
//--------------------
|
||||
// Note.initContextmenu();
|
||||
|
||||
//------------
|
||||
// 文档历史
|
||||
$("#contentHistory").click(function() {
|
||||
Note.listNoteContentHistories()
|
||||
});
|
||||
|
||||
$("#saveBtn").click(function() {
|
||||
Note.curChangedSaveIt(true);
|
||||
});
|
||||
@@ -1914,16 +1880,28 @@ $(function() {
|
||||
// blog
|
||||
$("#noteItemList").on("click", ".item-blog", function(e) {
|
||||
e.preventDefault();
|
||||
// 这导致其它dropdown不能隐藏
|
||||
e.stopPropagation();
|
||||
// 所以
|
||||
$(document).click();
|
||||
|
||||
// 得到ID
|
||||
var noteId = $(this).parent().attr('noteId');
|
||||
window.open("/blog/view/" + noteId);
|
||||
var note = Note.getNote(noteId);
|
||||
if (note) {
|
||||
window.open(Note.getPostUrl(note));
|
||||
}
|
||||
});
|
||||
|
||||
// note setting
|
||||
$("#noteItemList").on("click", ".item-my .item-setting", function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
// 这导致其它dropdown不能隐藏
|
||||
e.stopPropagation();
|
||||
// 所以
|
||||
$(document).click();
|
||||
|
||||
var $p = $(this).parent();
|
||||
Note.contextmenu.showMenu(e, $p);
|
||||
});
|
||||
|
||||
@@ -480,7 +480,8 @@ function initEditor() {
|
||||
e.preventDefault();
|
||||
return;
|
||||
}
|
||||
Note.saveNote(e);
|
||||
// 这里就不要了, 避免两次updateNote
|
||||
// Note.saveNote(e);
|
||||
|
||||
// 当输入的时候, 把当前raw删除掉
|
||||
LeaAce.removeCurToggleRaw();
|
||||
@@ -511,7 +512,7 @@ function initEditor() {
|
||||
"searchreplace leanote_nav leanote_code tabfocus",
|
||||
"table textcolor" ], // nonbreaking directionality charmap
|
||||
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 pasteCopyImage | leanote_ace_pre | fontselect fontsizeselect",
|
||||
toolbar2 : "outdent indent blockquote | link unlink | table | hr removeformat | subscript superscript |searchreplace | pastetext | leanote_ace_pre | fontselect fontsizeselect",
|
||||
|
||||
// 使用tab键: http://www.tinymce.com/wiki.php/Plugin3x:nonbreaking
|
||||
// http://stackoverflow.com/questions/13543220/tiny-mce-how-to-allow-people-to-indent
|
||||
@@ -813,12 +814,7 @@ function scrollTo(self, tagName, text) {
|
||||
// $ul.css("max-height", getMaxDropdownHeight(this));
|
||||
});
|
||||
|
||||
//--------
|
||||
// 编辑器帮助
|
||||
$("#tipsBtn").click(function() {
|
||||
showDialog2("#tipsDialog");
|
||||
});
|
||||
|
||||
/*
|
||||
//--------
|
||||
// 建议
|
||||
$("#yourSuggestions").click(function() {
|
||||
@@ -843,6 +839,7 @@ function scrollTo(self, tagName, text) {
|
||||
}
|
||||
});
|
||||
});
|
||||
*/
|
||||
|
||||
// 编辑器模式
|
||||
em.init();
|
||||
@@ -916,10 +913,12 @@ var Pjax = {
|
||||
// ajax后调用
|
||||
changeNote: function(noteInfo) {
|
||||
var me = this;
|
||||
log("push");
|
||||
var noteId = noteInfo.NoteId;
|
||||
var title = noteInfo.Title;
|
||||
var url = '/note/' + noteId;
|
||||
if (location.href.indexOf('?online') > 0) {
|
||||
url += '?online=1'
|
||||
}
|
||||
if(location.hash) {
|
||||
url += location.hash;
|
||||
}
|
||||
|
||||
+51
-2
@@ -28,6 +28,54 @@ var MarkdownEditor;
|
||||
var ScrollLink;
|
||||
var MD;
|
||||
|
||||
//-------------
|
||||
// 全局事件机制
|
||||
|
||||
$.extend(LEA, {
|
||||
_eventCallbacks: {},
|
||||
_listen: function(type, callback) {
|
||||
var callbacks = this._eventCallbacks[type] || (this._eventCallbacks[type] = []);
|
||||
callbacks.push(callback);
|
||||
},
|
||||
// on('a b', function(params) {})
|
||||
on: function(name, callback) {
|
||||
var names = name.split(/\s+/);
|
||||
for (var i = 0; i < names.length; ++i) {
|
||||
this._listen(names[i], callback);
|
||||
}
|
||||
return this;
|
||||
},
|
||||
// off('a b', function(params) {})
|
||||
off: function(name, callback) {
|
||||
var types = name.split(/\s+/);
|
||||
var i, j, callbacks, removeIndex;
|
||||
for (i = 0; i < types.length; i++) {
|
||||
callbacks = this._eventCallbacks[types[i].toLowerCase()];
|
||||
if (callbacks) {
|
||||
removeIndex = null;
|
||||
for (j = 0; j < callbacks.length; j++) {
|
||||
if (callbacks[j] == callback) {
|
||||
removeIndex = j;
|
||||
}
|
||||
}
|
||||
if (removeIndex !== null) {
|
||||
callbacks.splice(removeIndex, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// LEA.trigger('a', {});
|
||||
trigger: function(type, params) {
|
||||
var callbacks = this._eventCallbacks[type] || [];
|
||||
if (callbacks.length === 0) {
|
||||
return;
|
||||
}
|
||||
for (var i = 0; i < callbacks.length; i++) {
|
||||
callbacks[i].call(this, params);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//---------------------
|
||||
// 公用方法
|
||||
|
||||
@@ -829,10 +877,11 @@ function hideLoading() {
|
||||
}
|
||||
|
||||
// 注销, 先清空cookie
|
||||
function setCookie(c_name, value, expiredays){
|
||||
function setCookie(c_name, value, expiredays) {
|
||||
var exdate = new Date();
|
||||
exdate.setDate(exdate.getDate() + expiredays);
|
||||
document.cookie = c_name+ "=" + escape(value) + ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
|
||||
document.cookie = c_name+ "=" + escape(value) + ((expiredays==null) ? "" : ";expires="+exdate.toGMTString()) + 'path=/';
|
||||
document.cookie = c_name+ "=" + escape(value) + ((expiredays==null) ? "" : ";expires="+exdate.toGMTString()) + 'path=/note';
|
||||
}
|
||||
function logout() {
|
||||
setCookie("LEANOTE_SESSION", '', -1);
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
.b-m-mpanel{background:url(images/contextmenu/menu_bg.gif) left repeat-y #fff;border:1px solid #ccc;position:absolute;padding:2px 0;z-index:99997;left:0;top:0;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175);background-clip:padding-box;overflow:auto}.b-m-split{height:6px;background:url(images/contextmenu/m_splitLine.gif) center repeat-x;font-size:0;margin:0 2px}.b-m-idisable,.b-m-ifocus,.b-m-item{padding:4px 10px 4px 4px;cursor:default;line-height:100%}.b-m-idisable{color:grey}.b-m-arrow,.b-m-ibody{overflow:hidden;text-overflow:ellipsis}.b-m-arrow{background:url(images/contextmenu/m_arrow.gif) right no-repeat}.b-m-idisable .b-m-arrow{background:0 0}.b-m-idisable img,.b-m-ifocus img,.b-m-item img{margin-right:8px;width:16px}.b-m-ifocus{background-color:#CDE3F6}.b-m-idisable img{visibility:hidden}.c-text{display:inline-block;padding-left:3px}.b-m-icon{width:23px;padding-left:3px}
|
||||
Vendored
+1
-1
@@ -18,7 +18,7 @@ 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
|
||||
(function($){jQuery.fn.extend({slimScroll:function(options){var defaults={width:"auto",height:"250px",size:"7px",color:"#000",position:"right",distance:"1px",start:"top",opacity:.4,alwaysVisible:false,disableFadeOut:false,railVisible:false,railColor:"#333",railOpacity:.2,railDraggable:true,railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:false,wheelStep:20,touchScrollStep:200,borderRadius:"7px",railBorderRadius:"7px"};var o=$.extend(defaults,options);this.each(function(){var isOverPanel,isOverBar,isDragg,queueHide,touchDif,barHeight,percentScroll,lastScroll,divS="<div></div>",minBarHeight=30,releaseScroll=false;var me=$(this);if(me.parent().hasClass(o.wrapperClass)){var offset=me.scrollTop();bar=me.parent().find("."+o.barClass);rail=me.parent().find("."+o.railClass);getBarHeight();if($.isPlainObject(options)){if("height"in options&&options.height=="auto"){me.parent().css("height","auto");me.css("height","auto");var height=me.parent().parent().height();me.parent().css("height",height);me.css("height",height)}if("scrollTo"in options){offset=parseInt(o.scrollTo)}else if("scrollBy"in options){offset+=parseInt(o.scrollBy)}else if("destroy"in options){bar.remove();rail.remove();me.unwrap();return}scrollContent(offset,false,true,options.onlyScrollBar)}return}o.height=o.height=="auto"?me.parent().height():o.height;var wrapper=$(divS).addClass(o.wrapperClass).css({position:"relative",overflow:"hidden",width:o.width,height:o.height});me.css({overflow:"hidden",width:o.width,height:o.height});var rail=$(divS).addClass(o.railClass).css({width:o.size,height:"100%",position:"absolute",top:0,display:o.alwaysVisible&&o.railVisible?"block":"none","border-radius":o.railBorderRadius,background:o.railColor,opacity:o.railOpacity,zIndex:90});var bar=$(divS).addClass(o.barClass).css({background:o.color,width:o.size,position:"absolute",top:0,opacity:o.opacity,display:o.alwaysVisible?"block":"none","border-radius":o.borderRadius,BorderRadius:o.borderRadius,MozBorderRadius:o.borderRadius,WebkitBorderRadius:o.borderRadius,zIndex:99});var posCss=o.position=="right"?{right:o.distance}:{left:o.distance};rail.css(posCss);bar.css(posCss);me.wrap(wrapper);me.parent().append(bar);me.parent().append(rail);if(o.railDraggable){bar.bind("mousedown",function(e){var $doc=$(document);isDragg=true;t=parseFloat(bar.css("top"));pageY=e.pageY;$doc.bind("mousemove.slimscroll",function(e){currTop=t+e.pageY-pageY;bar.css("top",currTop);scrollContent(0,bar.position().top,false)});$doc.bind("mouseup.slimscroll",function(e){isDragg=false;hideBar();$doc.unbind(".slimscroll")});return false}).bind("selectstart.slimscroll",function(e){e.stopPropagation();e.preventDefault();return false})}rail.hover(function(){showBar()},function(){hideBar()});bar.hover(function(){isOverBar=true},function(){isOverBar=false});me.hover(function(){isOverPanel=true;showBar();hideBar()},function(){isOverPanel=false;hideBar()});me.bind("touchstart",function(e,b){if(e.originalEvent.touches.length){touchDif=e.originalEvent.touches[0].pageY}});me.bind("touchmove",function(e){if(!releaseScroll){e.originalEvent.preventDefault()}if(e.originalEvent.touches.length){var diff=(touchDif-e.originalEvent.touches[0].pageY)/o.touchScrollStep;scrollContent(diff,true);touchDif=e.originalEvent.touches[0].pageY}});getBarHeight();if(o.start==="bottom"){bar.css({top:me.outerHeight()-bar.outerHeight()});scrollContent(0,true)}else if(o.start!=="top"){scrollContent($(o.start).position().top,null,true);if(!o.alwaysVisible){bar.hide()}}attachWheel();function _onWheel(e){if(!isOverPanel){return}var e=e||window.event;var delta=0;if(e.wheelDelta){delta=-e.wheelDelta/120}if(e.detail){delta=e.detail/3}var target=e.target||e.srcTarget||e.srcElement;if($(target).closest("."+o.wrapperClass).is(me.parent())){scrollContent(delta,true)}if(e.preventDefault&&!releaseScroll){e.preventDefault()}if(!releaseScroll){e.returnValue=false}}function scrollContent(y,isWheel,isJump,onlyScrollBar){releaseScroll=false;var delta=y;var maxTop=me.outerHeight()-bar.outerHeight();if(isWheel){delta=parseInt(bar.css("top"))+y*parseInt(o.wheelStep)/100*bar.outerHeight();delta=Math.min(Math.max(delta,0),maxTop);delta=y>0?Math.ceil(delta):Math.floor(delta);bar.css({top:delta+"px"})}percentScroll=parseInt(bar.css("top"))/(me.outerHeight()-bar.outerHeight());delta=percentScroll*(me[0].scrollHeight-me.outerHeight());if(isJump){delta=y;var offsetTop=delta/me[0].scrollHeight*me.outerHeight();offsetTop=Math.min(Math.max(offsetTop,0),maxTop);bar.css({top:offsetTop+"px"})}if(!onlyScrollBar){me.scrollTop(delta)}me.trigger("slimscrolling",~~delta);showBar();hideBar()}function attachWheel(){if(window.addEventListener){this.addEventListener("DOMMouseScroll",_onWheel,false);this.addEventListener("mousewheel",_onWheel,false);this.addEventListener("MozMousePixelScroll",_onWheel,false)}else{document.attachEvent("onmousewheel",_onWheel)}}function getBarHeight(){barHeight=Math.max(me.outerHeight()/me[0].scrollHeighLine truncated
|
||||
LEA.cmroot=1;(function($){function returnfalse(){return false}$.fn.contextmenu=function(option){var cmroot="contextmenu"+LEA.cmroot;LEA.cmroot++;option=$.extend({alias:cmroot,width:150},option);var ruleName=null,target=null,groups={},mitems={},actions={},showGroups=[],itemTpl='<div class="b-m-$[type]" unselectable="on"><div class="clearfix cm-item"><div class="b-m-icon pull-left"><i class="fa $[faIcon]"></i>$[imgIcon]</div><div class="pull-left cm-text"><span class="c-text" unselectable="on">$[text]</span></div></div></div>';itemNoIconTpl="<div class='b-m-$[type]' unselectable=on><nobr unselectable=on><span align='absmiddle'></span><span class='c-text' unselectable=on>$[text]</span></nobr></div>";var gTemplet=$("<div/>").addClass("b-m-mpanel").attr("unselectable","on").css("display","none");var iTemplet=$("<div/>").addClass("b-m-item").attr("unselectable","on");var sTemplet=$("<div/>").addClass("b-m-split");var $body=$("body");var itemsCache={};var buildGroup=function(obj){groups[obj.alias]=this;this.gidx=obj.alias;this.id=obj.alias;if(obj.disable){this.disable=obj.disable;this.className="b-m-idisable"}$(this).width(obj.width).click(function(){}).mousedown(returnfalse).appendTo($body);obj=null;return this};var buildItem=function(obj){var T=this;T.title=obj.text;T.idx=obj.alias;T.gidx=obj.gidx;T.data=obj;var imgIcon="";if(obj.icon){imgIcon='<img src="'+obj.icon+'"/>'}obj.imgIcon=imgIcon;if(obj.icon){T.innerHTML=itemTpl.replace(/\$\[([^\]]+)\]/g,function(){return obj[arguments[1]]})}else{T.innerHTML=itemTpl.replace(/\$\[([^\]]+)\]/g,function(){return obj[arguments[1]]})}if(obj.disable){T.disable=obj.disable;T.className="b-m-idisable"}obj.items&&(T.group=true);obj.action&&(actions[obj.alias]=obj.action);mitems[obj.alias]=T;T=obj=null;return this};var addItems=function(gidx,items,parentAlias){var tmp=null;var len=items.length;for(var i=0;i<len;i++){var item=items[i];if(item.type=="splitLine"){tmp=sTemplet.clone()[0]}else{if(!item.alias){if(parentAlias){item.alias=parentAlias+"."+item.text}else{item.alias=item.text}}item.gidx=gidx;if(item.type=="group"&&!item.action){buildGroup.apply(gTemplet.clone()[0],[item]);itemsCache[item.alias]=item.items;item.type="arrow";tmp=buildItem.apply(iTemplet.clone()[0],[item])}else{if(item.type=="group"){buildGroup.apply(gTemplet.clone()[0],[item]);itemsCache[item.alias]=item.items;item.type="arrow";tmp=buildItem.apply(iTemplet.clone()[0],[item])}else{item.type="ibody";tmp=buildItem.apply(iTemplet.clone()[0],[item])}var thisItem=item;(function(thisItem,tmp){$(tmp).click(function(e){if(!this.disable){if($.isFunction(actions[this.idx])){actions[this.idx].call(this,target,thisItem)}hideMenuPane();$(target).removeClass("contextmenu-hover")}return false})})(thisItem,tmp)}$(tmp).bind("contextmenu",returnfalse).hover(overItem,outItem)}groups[gidx].appendChild(tmp);tmp=item=item.items=null}gidx=items=null};var overItem=function(e){if(this.disable)return false;hideMenuPane.call(groups[this.gidx]);if(this.group){var pos=$(this).offset();var width=$(this).outerWidth();showMenuGroup.apply(groups[this.idx],[pos,width,this])}this.className="b-m-ifocus";return false};var outItem=function(e){if(this.disable)return false;if(!this.group){this.className="b-m-item"}return false};var showMenuGroup=function(pos,width,t){var $this=$(this);if($this.html()==""){addItems(t.idx,itemsCache[t.idx],t.idx)}var bwidth=$body.width();var bheight=document.documentElement.clientHeight-10;bheight=bheight<0?100:bheight;var mwidth=$(this).outerWidth();var mheight=$(this).outerHeight()-10;mheight=mheight<0?100:mheight;var mwidth=$(this).outerWidth();pos.left=pos.left+width+mwidth>bwidth?pos.left-mwidth<0?0:pos.left-mwidth:pos.left+width;pos.top=pos.top+mheight>bheight?pos.top-mheight+(width>0?25:0)<0?0:pos.top-mheight+(width>0?25:0):pos.top;$(this).css(pos).show().css("max-height",bheight);showGroups.push(this.gidx)};var hideMenuPane=function(){var alias=null;for(var i=showGroups.length-1;i>=0;i--){if(showGroups[i]==this.gidx)break;alias=showGroups.pop();groups[alias].style.display="none";mitems[alias]&&(mitems[alias].className="b-m-item")}};function applyRule(rule){for(var i in mitems)disable(i,!rule.disable);for(var i=0;i<rule.items.length;i++)disable(rule.items[i],rule.disable);ruleName=rule.name}function disable(alias,disabled){var item=mitems[alias];if(!item||!item.lastChild){return}item.className=(item.disable=item.lastChild.disabled=disabled)?"b-m-idisable":"b-m-item"}function showMenu(e,menutarget){target=menutarget;showMenuGroup.call(groups[cmroot],{left:e.pageX,top:e.pageY},0);if(!$(target).hasClass("item-active")){$(target).addClass("contextmenu-hover")}$(document).one("click",function(){hideMenuPane();$(target).removeClass("contextmenu-hover")})}var $root=$("#"+option.alias);var root=null;if($root.length==0){root=buildGroup.apply(gTemplet.clone()[0],[option]);root.applyrule=applyRule;root.showMenu=showMenu;addItems(option.alias,option.items)}else{root=$root[0]}function onShowMenu(e){var bShowContext=optionLine truncated
|
||||
if(typeof jQuery==="undefined"){throw new Error("Bootstrap requires jQuery")}+function($){"use strict";function transitionEnd(){var el=document.createElement("bootstrap");var transEndEventNames={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var name in transEndEventNames){if(el.style[name]!==undefined){return{end:transEndEventNames[name]}}}}$.fn.emulateTransitionEnd=function(duration){var called=false,$el=this;$(this).one($.support.transition.end,function(){called=true});var callback=function(){if(!called)$($el).trigger($.support.transition.end)};setTimeout(callback,duration);return this};$(function(){$.support.transition=transitionEnd()})}(jQuery);+function($){"use strict";var dismiss='[data-dismiss="alert"]';var Alert=function(el){$(el).on("click",dismiss,this.close)};Alert.prototype.close=function(e){var $this=$(this);var selector=$this.attr("data-target");if(!selector){selector=$this.attr("href");selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,"")}var $parent=$(selector);if(e)e.preventDefault();if(!$parent.length){$parent=$this.hasClass("alert")?$this:$this.parent()}$parent.trigger(e=$.Event("close.bs.alert"));if(e.isDefaultPrevented())return;$parent.removeClass("in");function removeElement(){$parent.trigger("closed.bs.alert").remove()}$.support.transition&&$parent.hasClass("fade")?$parent.one($.support.transition.end,removeElement).emulateTransitionEnd(150):removeElement()};var old=$.fn.alert;$.fn.alert=function(option){return this.each(function(){var $this=$(this);var data=$this.data("bs.alert");if(!data)$this.data("bs.alert",data=new Alert(this));if(typeof option=="string")data[option].call($this)})};$.fn.alert.Constructor=Alert;$.fn.alert.noConflict=function(){$.fn.alert=old;return this};$(document).on("click.bs.alert.data-api",dismiss,Alert.prototype.close)}(jQuery);+function($){"use strict";var Button=function(element,options){this.$element=$(element);this.options=$.extend({},Button.DEFAULTS,options)};Button.DEFAULTS={loadingText:"loading..."};Button.prototype.setState=function(state){var d="disabled";var $el=this.$element;var val=$el.is("input")?"val":"html";var data=$el.data();state=state+"Text";if(!data.resetText)$el.data("resetText",$el[val]());$el[val](data[state]||this.options[state]);setTimeout(function(){state=="loadingText"?$el.addClass(d).attr(d,d):$el.removeClass(d).removeAttr(d)},0)};Button.prototype.toggle=function(){var $parent=this.$element.closest('[data-toggle="buttons"]');if($parent.length){var $input=this.$element.find("input").prop("checked",!this.$element.hasClass("active")).trigger("change");if($input.prop("type")==="radio")$parent.find(".active").removeClass("active")}this.$element.toggleClass("active")};var old=$.fn.button;$.fn.button=function(option){return this.each(function(){var $this=$(this);var data=$this.data("bs.button");var options=typeof option=="object"&&option;if(!data)$this.data("bs.button",data=new Button(this,options));if(option=="toggle")data.toggle();else if(option)data.setState(option)})};$.fn.button.Constructor=Button;$.fn.button.noConflict=function(){$.fn.button=old;return this};$(document).on("click.bs.button.data-api","[data-toggle^=button]",function(e){var $btn=$(e.target);if(!$btn.hasClass("btn"))$btn=$btn.closest(".btn");$btn.button("toggle");e.preventDefault()})}(jQuery);+function($){"use strict";var Carousel=function(element,options){this.$element=$(element);this.$indicators=this.$element.find(".carousel-indicators");this.options=options;this.paused=this.sliding=this.interval=this.$active=this.$items=null;this.options.pause=="hover"&&this.$element.on("mouseenter",$.proxy(this.pause,this)).on("mouseleave",$.proxy(this.cycle,this))};Carousel.DEFAULTS={interval:5e3,pause:"hover",wrap:true};Carousel.prototype.cycle=function(e){e||(this.paused=false);this.interval&&clearInterval(this.interval);this.options.interval&&!this.paused&&(this.interval=setInterval($.proxy(this.next,this),this.options.interval));return this};Carousel.prototype.getActiveIndex=function(){this.$active=this.$element.find(".item.active");this.$items=this.$active.parent().children();return this.$items.index(this.$active)};Carousel.prototype.to=function(pos){var that=this;var activeIndex=this.getActiveIndex();if(pos>this.$items.length-1||pos<0)return;if(this.sliding)return this.$element.one("slid",function(){that.to(pos)});if(activeIndex==pos)return this.pause().cycle();return this.slide(pos>activeIndex?"next":"prev",$(this.$items[pos]))};Carousel.prototype.pause=function(e){e||(this.paused=true);if(this.$element.find(".next, .prev").length&&$.support.transition.end){this.$element.trigger($.support.transition.end);this.cycle(true)}this.interval=clearInterval(this.interval);return this};Carousel.prototype.next=function(){if(this.sliding)return;return this.slide("next")};Carousel.prototype.prev=function(){if(this.sliding)return;return this.slide("prev")};Carousel.prototype.slide=funcLine truncated
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
/* /index 首页 */
|
||||
|
||||
$(function() {
|
||||
// 平滑滚动
|
||||
$(".smooth-scroll").click(function(e) {
|
||||
e.preventDefault();
|
||||
var t = $(this).data("target");
|
||||
var targetOffset = $(t).offset().top - 80;
|
||||
$('html,body').animate({scrollTop: targetOffset}, 300);
|
||||
});
|
||||
function slider(webImgs, descT) {
|
||||
var webImgsLen = webImgs.length;
|
||||
var curIndex = 0;
|
||||
setInterval(function() {
|
||||
webImgs.eq(curIndex).stop().animate({opacity: '0'}, 1000);
|
||||
curIndex = (curIndex+1)%webImgsLen;
|
||||
var curImg = webImgs.eq(curIndex);
|
||||
curImg.stop().animate({opacity: '1'}, 1000);
|
||||
descT.text(curImg.data("text"));
|
||||
}, 5000);
|
||||
}
|
||||
slider($(".web-slider"), $("#webText"));
|
||||
slider($(".mobile-slider"), $("#mobileText"));
|
||||
|
||||
function setCookie(name, value) {
|
||||
var Days = 10*365;
|
||||
var exp = new Date();
|
||||
exp.setTime(exp.getTime() + Days*24*60*60*1000);
|
||||
document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
|
||||
}
|
||||
|
||||
$('#lang a').click(function() {
|
||||
var lang = $(this).data('lang');
|
||||
setCookie('LEANOTE_LANG', lang);
|
||||
location.reload();
|
||||
});
|
||||
});
|
||||
@@ -1,16 +1 @@
|
||||
var MSG = {"a":"a","aboutMe":"About Me","author":"Author","baseInfoSet":"Base info","blogClass":"Category","blogDesc":"Description","blogLogo":"Logo","blogLogoTips":"Upload image to replace blog title","blogName":"Title","blogNav":"Blog nav","blogNavs":"Navs","blogSet":"Blog configuration","cancel":"Cancel","chooseComment":"Comment System","chooseReason":"请选择举报理由","comment":"Comment","commentSet":"Comment","comments":"Comments","community":"Community","confirm":"Confirm","confirmDeleteComment":"Are you sure?","createdTime":"Created at","daysAgo":"days ago","delete":"Delete","disqusHelp":"Please input your Disqus Id","domain":"Custom domain","domainSet":"Domain","elegant":"Elegant","error":"Error","fullBlog":"Full blog","home":"Home","hoursAgo":"hours ago","justNow":"Just now","latestPosts":"Latest posts","like":"Like","minutesAgo":"minutes ago","monthsAgo":"months ago","more":"More...","moreShare":"More","navFixed":"Nav fixed at left side","needHelp":"Need help?","next":"Next","noBlog":"No blog","noTag":"No tag","none":"None","openComment":"Open comment?","other":"Other","previous":"Previous","qqZone":"QQ Zone","quickLinks":"Quick links","renren":"Renren","reply":"Reply","report":"Report","reportBlog?":"举报该博客?","reportComment?":"举报该评论?","reportReason":"Reason","reportReason1":"不友善内容","reportReason2":"广告等垃圾信息","reportReason3":"违法违规内容","reportReason4":"不宜公开讨论的政治内容","reportSuccess":"举报成功, 我们处理后会通知作者, 感谢您的监督","saveSuccess":"Save success","scanQRCode":"Open weichat and scan the QR code","signIn":"Sign In","signUp":"Sign Up","sinaWeibo":"Weibo","subDomain":"Sub domain","submitComment":"Submit","tencentWeibo":"Tencent Weibo","theme":"Theme","themeSet":"Theme","unlike":"Unlike","updatedTime":"Updated at","viewers":"Viewers","weeksAgo":"weeks ago","weixin":"Weichat"};
|
||||
function getMsg(key, data) {
|
||||
var msg = MSG[key]
|
||||
if(msg) {
|
||||
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":"请选择举报理由","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;}
|
||||
@@ -1,16 +1 @@
|
||||
var MSG = {"a":"a","aboutMe":"A propos de moi","author":"Auteur","baseInfoSet":"Information de base","blogClass":"Catégorie","blogDesc":"Description","blogLogo":"Logo","blogLogoTips":"Téléverser une image pour remplacer le titre du blog","blogName":"Titre","blogNav":"Navigation du blog","blogNavs":"Navigation","blogSet":"Configuration du blog","cancel":"Annuler","chooseComment":"Système de commentaires","chooseReason":"请选择举报理由","comment":"Commenter","commentSet":"Commentaires","comments":"Commentaires","community":"Communauté","confirm":"Confirmer","confirmDeleteComment":"Êtes-vous sûr?","createdTime":"Créé à","daysAgo":"Il y a plusieurs jours","delete":"Effacer","disqusHelp":"Veuillez renseigner votre identifiant Disqus","domain":"Domaine personnalisé","domainSet":"Domaine","elegant":"Elegant","error":"Erreur","fullBlog":"Blog entier","home":"Accueil","hoursAgo":"Il y a plusieurs heures","justNow":"Seulement maintenant","latestPosts":"Dernières publications","like":"J'aime","minutesAgo":"Il y a quelques minutes","monthsAgo":"Il y a plusieurs mois","more":"Plus...","moreShare":"Plus","navFixed":"Navigation figée sur le côté gauche","needHelp":"Besoin d'aide?","next":"Suivant","noBlog":"Aucun blog","noTag":"Aucune étiquette","none":"Aucun","openComment":"Ouvrir un commentaire?","other":"Autre","previous":"Précédent","qqZone":"QQ Zone","quickLinks":"Liens rapides","renren":"Renren","reply":"Répondre","report":"Rapport","reportBlog?":"举报该博客?","reportComment?":"举报该评论?","reportReason":"Raison","reportReason1":"不友善内容","reportReason2":"广告等垃圾信息","reportReason3":"违法违规内容","reportReason4":"不宜公开讨论的政治内容","reportSuccess":"举报成功, 我们处理后会通知作者, 感谢您的监督","saveSuccess":"Sauvegarde réussie","scanQRCode":"Ouvrez Weichat et scannez le QR Code","signIn":"S'identifier","signUp":"S'incrire","sinaWeibo":"Weibo","subDomain":"Sous-domaine","submitComment":"Soumettre","tencentWeibo":"Tencent Weibo","theme":"Thème","themeSet":"Thème","unlike":"Je n'aime plus","updatedTime":"Mis à jour à","viewers":"Lecteurs","weeksAgo":"Il y a plusieurs semaines","weixin":"Weichat"};
|
||||
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":"Aucune étiquette","saveSuccess":"Sauvegarde réussie","none":"Aucun","like":"J'aime","unlike":"Je n'aime plus","delete":"Effacer","cancel":"Annuler","confirm":"Confirmer","chooseReason":"请选择举报理由","reportSuccess":"举报成功, 我们处理后会通知作者, 感谢您的监督","error":"Erreur","reportComment?":"举报该评论?","reportBlog?":"举报该博客?","confirmDeleteComment":"Êtes-vous sûr?","scanQRCode":"Ouvrez Weichat et scannez le QR Code","justNow":"Seulement maintenant","minutesAgo":"Il y a quelques minutes","hoursAgo":"Il y a plusieurs heures","daysAgo":"Il y a plusieurs jours","weeksAgo":"Il y a plusieurs semaines","monthsAgo":"Il y a plusieurs mois"};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,16 +1 @@
|
||||
var MSG = {"a":"a","aboutMe":"关于我","author":"作者","baseInfoSet":"基本设置","blog":"博客","blogClass":"分类","blogDesc":"博客描述","blogLogo":"博客Logo","blogLogoTips":"上传logo将显示logo(替代博客标题)","blogName":"博客标题","blogNav":"导航","blogNavs":"导航","blogSet":"博客设置","cancel":"取消","chooseComment":"选择评论系统","chooseReason":"请选择举报理由","comment":"评论","commentSet":"评论设置","comments":"条评论","community":"社区","confirm":"确认","confirmDeleteComment":"确定删除该评论?","createdTime":"创建","daysAgo":"天前","delete":"删除","disqusHelp":"请填写您申请的Disqus唯一url前缀. 建议您申请Disqus帐号, 这样可以自己管理评论. 或使用leanote的默认Disqus Id. ","domain":"自定义域名","domainSet":"域名设置","elegant":"大气","error":"错误","fullBlog":"全文","home":"主页","hoursAgo":"个小时前","justNow":"刚刚","latestPosts":"最近发表","like":"赞","minutesAgo":"分钟前","monthsAgo":"个月前","more":"更多...","moreShare":"更多分享","navFixed":"导航左侧固定","needHelp":"需要帮助?","next":"下一页","noBlog":"无博客","noTag":"无","none":"无","openComment":"开启评论?","other":"其它","previous":"上一页","qqZone":"QQ空间","quickLinks":"快速链接","renren":"人人网","reply":"回复","report":"举报","reportBlog?":"举报该博客?","reportComment?":"举报该评论?","reportReason":"举报理由","reportReason1":"不友善内容","reportReason2":"广告等垃圾信息","reportReason3":"违法违规内容","reportReason4":"不宜公开讨论的政治内容","reportSuccess":"举报成功, 我们处理后会通知作者, 感谢您的监督","saveSuccess":"保存成功","scanQRCode":"打开微信扫一扫二维码","signIn":"登录","signUp":"注册","sinaWeibo":"新浪微博","subDomain":"博客子域名","submitComment":"发表评论","tencentWeibo":"腾讯微博","theme":"主题","themeSet":"主题设置","unlike":"取消赞","updatedTime":"更新","viewers":"人读过","weeksAgo":"周前","weixin":"微信"};
|
||||
function getMsg(key, data) {
|
||||
var msg = MSG[key]
|
||||
if(msg) {
|
||||
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":"无","saveSuccess":"保存成功","none":"无","like":"赞","unlike":"取消赞","delete":"删除","cancel":"取消","confirm":"确认","chooseReason":"请选择举报理由","reportSuccess":"举报成功, 我们处理后会通知作者, 感谢您的监督","error":"错误","reportComment?":"举报该评论?","reportBlog?":"举报该博客?","confirmDeleteComment":"确定删除该评论?","scanQRCode":"打开微信扫一扫二维码","justNow":"刚刚","minutesAgo":"分钟前","hoursAgo":"个小时前","daysAgo":"天前","weeksAgo":"周前","monthsAgo":"个月前"};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,16 +1 @@
|
||||
var MSG = {"3th":"Third-party accounts","Password":"Password","SearchNote":"Search Note","SearchNotebook":"Search Notebook","Share":"Share","Submit":"Submit","aboutLeanote":"About Leanote","aboutMe":"About me","accountInfo":"Account Info","accountSetting":"Account","accountType":"Account Type","addChildNotebook":"Add child notebook","addLeanoteAccount":"New Leanote Account","addMemberTips":"Input username or email to add member","addNotebook":"Add notebook","addShare":"Add Friend","addSingle":"New single page","addTheme":"New theme","admin":"Admin","all":"Newest","app":"Leanote","archive":"Archive","asc":"Asc","attachSize":"Attachment Capacity","attachSizeOver":"Sorry, you have no attachment opacity, please go \u003ca href=\"/service\"\u003eupgrade your account\u003c/a\u003e.","attachments ":" Attachments","avatar":"Avatar","basicInfo":"Basic","basicInfoSet":"Blog Basic Setting","blog":"Blog","blogInfo":"You can public your knowledge and leanote is your blog!","blogSet":"Blog Settings","blue":"blue","cancel":"Cancel","cancelPublic":"Cancel public","cancelShare":"Cancel","canntNewNoteTips":"Sorry, cannot new note in here, please choose a notebook at first.","captcha":"Captcha","captchaError":"Captcha Do Not Match","cate":"Category","cateIsPublicNotebook":"Category is the published notebooks","checkEmai":"Check email","checkEmail":"Check email","chooseImage":"Choose Image","clearSearch":"Clear Search","clickAddTag":"Click to add Tag","clickToChangePermission":"Click to change permission","clickToCopy":"Click to copy","close":"Close","confirmBackup":"Are you sure to restore from this version? We will backup the current note.","confirmPassword":"Password not matched","content":"Content","cooperation":"Cooperation","cooperationInfo":"Collaborate with friends to improve your knowledge.","copy":"Copy","copyFailed":"Copy failed","copySuccess":"Copy success","copyToMyNotebook":"Copy to my notebook","create":"Create","createAccount":"Create account","createAccountFailed":"Account create failed","createAccountSuccess":"Account create success","created":"Created","createdTime":"Created time","curUser":"Email","currentEmail":"Your current email is: \u003ccode\u003e%s\u003c/code\u003e ","currentFile":"Current file","currentTheme":"Current theme","datetime":"Datetime","default":"Default","defaultComment":"Default leanote comment system","defaultShare":"Default sharing","defaulthhare":"Default","delete":"Delete","deleteAllShared":"Delete shared user","deleteGroup":"Delete group","deleteMember":"Delete member","deleteSharedNotebook":"Delete shared notebook","demoRegister":"\u003ca href=\"/register\"\u003eSign up\u003c/a\u003e","desc":"Desc","desktopApp":"App","discussion":"Discussion","domainExisted":"Custom domain is already existed","domainNotPointToLeanote":"The custom domin hasn't pointed to d.leanote.com","donate ":" Donate","download":"Download","dragAndSort":"Drag it to sort","edit":"Edit","editorTips":"Tips","editorTipsInfo":"\u003ch4\u003e1. Short cuts\u003c/h4\u003ectrl+shift+c Toggle code\u003ch4\u003e2. shift+enter Get out of current block\u003c/h4\u003e eg. \u003cimg src=\"/images/outofcode.png\" style=\"width: 90px\"/\u003e in this situation you can use shift+enter to get out of current code block.","email":"Email","emailBodyRequired":"Email body is required","emailInSending":"In sending to ","emailOrOthers":"Email or other contact way","emailSendFailed":"Email send failed","errorDomain":"The custom domain is invalid, eg. www.myblog.com","errorEmail":"Please input the right email","errorPassword":"The passowd's length is at least 6 and be sure as complex as possible","errorPerPageSize":"Page size is error","errorSortField":"Sort Field is error","errorSubDomain":"Please input the valid sub domain, the length is at least 4 and no special chars","export":"Export","exportPdf":"Export PDF","exportTheme":"Export theme","findPassword":"Find password","findPasswordSendEmailOver":"We have already send the find password link to your email, please check out your email","findPasswordTimeout":"time out","fold":"Fold","followers":"Followers","following":"Following","footer":"Footer","forgetPassword ":" Forget password?","fork github":"Fork Leanote on Github","friendEmail":"Friend email","friendNotExits":"Your friend hasn't %s's account, invite register link: %s","friends":"Friends","getShareLinkAndPwd":"Get link and password","green":"green","group":"Group","groupAndMemberManage":"Manage group/member","groupName":"Group Name","hadAcount ":" Already have an account?","hasAcount ":" Do not have an account?","hasSelfDefined":"Has defined","hasSharedThisNote":"has shared this note","hasUsers":"The user already exists","header":"Header","hi":"Hi","highlight":"Code highlight","historiesNum":"We have saved at most \u003cb\u003e10\u003c/b\u003e latest histories with each note","history":"Histories","home":"Home","howToInstallLeanote":"How to install leanote","image":"Image","imageSize":"Image Capacity","imageSizeOver":"Sorry, you
Line truncated
|
||||
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={"app":"Leanote","share":"Share","noTag":"No Tags","inputEmail":"Email is required","history":"History","editorTips":"Tips","editorTipsInfo":"<h4>1. Short cuts</h4>ctrl+shift+c Toggle code<h4>2. shift+enter Get out of current block</h4> eg. <img src=\"/images/outofcode.png\" style=\"width: 90px\"/> in this situation you can use shift+enter to get out of current code block.","all":"Newest","trash":"Trash","delete":"Delete","unTitled":"UnTitled","writingMode":"Writing Mode","normalMode":"Normal Mode","saving":"Saving","saveSuccess":"Save success","update":"Update","close":"Close","cancel":"Cancel","send":"Send","shareToFriends":"Share to friends","publicAsBlog":"Public as blog","cancelPublic":"Cancel public","move":"Move","copy":"Copy","rename":"Rename","exportPdf":"Export PDF","addChildNotebook":"Add child notebook","deleteAllShared":"Delete shared user","deleteSharedNotebook":"Delete shared notebook","copyToMyNotebook":"Copy to my notebook","defaulthhare":"Default","friendEmail":"Friend email","readOnly":"Read only","writable":"Writable","inputFriendEmail":"Friend email is required","clickToChangePermission":"Click to change permission","sendInviteEmailToYourFriend":"Send invite email to your friend","friendNotExits":"Your friend hasn't %s's account, invite register link: %s","emailBodyRequired":"Email body is required","sendSuccess":"success","inviteEmailBody":"Hi,I am %s, %s is awesome, come on!","historiesNum":"We have saved at most <b>10</b> latest histories with each note","noHistories":"No histories","datetime":"Datetime","restoreFromThisVersion":"Restore from this version","confirmBackup":"Are you sure to restore from this version? We will backup the current note.","errorEmail":"Please input the right email"};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,16 +1 @@
|
||||
var MSG = {"3th":"Comptes tiers","SearchNote":"Search Note","SearchNotebook":"Search Notebook","Share":"Share","Submit":"Soumettre","aboutLeanote":"A propos de leanote","aboutMe":"A propos de moi","accountInfo":"Info sur le Compte","accountSetting":"Compte","accountType":"Type de Compte","addChildNotebook":"Ajouer un bloc-note enfant","addLeanoteAccount":"Nouveau compte Leanote","addMemberTips":"Rentrer le nom d'utilisateur et le courriel pour ajouter un membre","addNotebook":"Ajouter un bloc-note","addShare":"Ajouter un ami","addSingle":"Nouvelle page simple","addTheme":"Nouveau thème","admin":"Administrateur","all":"Le plus récent","app":"Leanote","archive":"Archive","asc":"Asc","attachSize":"Taille de la pièce-jointe","attachSizeOver":"Désolé, la pièce-jointe est trop volumineuse, veuillez \u003ca href=\"/service\"\u003emettre votre compte à niveau.\u003c/a\u003e.","attachments ":" Pièces-jointes","avatar":"Avatar","basicInfo":"Basique","basicInfoSet":"Réglages de base du blog","blog":"Blog","blogInfo":"Vous pouvez publier vos connaissances et leanote et votre blog!","blogSet":"Réglages du blog","blue":"bleu","cancel":"Annuler","cancelPublic":"Annuler la publication","cancelShare":"Cancel","canntNewNoteTips":"Désolé, impossible de créer une nouvelle note ici, veuillez d'abord choisir un bloc-note.","captcha":"Captcha","captchaError":"Le Captcha ne correspond pas","cate":"Catégorie","cateIsPublicNotebook":"La catégorie est le bloc-note publié","checkEmai":"Vérifier le courriel","checkEmail":"Vérifier courriel","chooseImage":"Choisir une image","clearSearch":"Nettoyer la recherche","clickAddTag":"Cliquez pour ajouter une étiquette","clickToChangePermission":"Cliquez pour changer l'autorisation.","clickToCopy":"Cliquer pour copier","close":"Fermer","confirmBackup":"Êtes-vous sûr de vouloir restaurer depuis cette version? Nous allons réaliser une copie de sauvegarde de la note actuelle.","confirmPassword":"Le mot de passe ne correspond pas.","content":"Contenu","cooperation":"Coopération","cooperationInfo":"Collaborez avec vos amis pour augmenter vos connaissances.","copy":"Copier","copyFailed":"Copie échouée","copySuccess":"Copie réussie","copyToMyNotebook":"Copier vers mon bloc-notes","create":"Créer","createAccount":"Créer un compte","createAccountFailed":"Echec de la création du compte","createAccountSuccess":"Compte créé avec succès","created":"Created","createdTime":"Heure de création","curUser":"Adresse courriel","currentEmail":"Votre courriel actuel est: \u003ccode\u003e%s\u003c/code\u003e ","currentFile":"Fichier actuel","currentTheme":"Thème actuel","datetime":"Date \u0026 Heure","default":"Par défaut","defaultComment":"Système de commentaires Leanote par défaut","defaultShare":"Partage par défaut","defaulthhare":"Par défaut","delete":"Effacer","deleteAllShared":"Effacer l'utilisateur partagé","deleteGroup":"Effacer groupe","deleteMember":"Effacer membre","deleteSharedNotebook":"Effacer le bloc-notes partagé","demoRegister":"\u003ca href=\"/register\"\u003eS'inscrire\u003c/a\u003e","desc":"Desc","desktopApp":"Application","discussion":"Discussion","domainExisted":"Le domaine personnalisé existe déjà.","domainNotPointToLeanote":"Le domaine personnalisé ne pointe pas vers d.leanote.com","donate ":" Faire un don","download":"Téléchargement","dragAndSort":"Faire glisser pour trier","edit":"Editer","editorTips":"Astuces","editorTipsInfo":"\u003ch4\u003e1. Raccourcis\u003c/h4\u003ectrl+maj+c Active/désactive le code\u003ch4\u003e2. maj+entrée Sortir du bloc courant\u003c/h4\u003e ex. \u003cimg src=\"/images/outofcode.png\" style=\"width: 90px\"/\u003e dans cette situation vous pouvez utiliser maj+entrée pour sortir du bloc de code courant.","email":"Adresse de courriel","emailBodyRequired":"Corps du message requis","emailInSending":"Envoi vers ","emailOrOthers":"Courriel ou autre méthode de contact","emailSendFailed":"Envoi du courriel échoué.","errorDomain":"Le domaine personnalisé n'est pas valide, ex. www.myblog.com","errorEmail":"Veuillez renseigner le courriel correct","errorPassword":"La taille du mot de passe est d'au moins 6 caractères et aussi complexe que possible.","errorPerPageSize":"Erreur dans la taille de la page","errorSortField":"Erreur dans le tri du champs","errorSubDomain":"Veuillez entrer un sous domaine valide, au moins 4 caractères (non spéciaux)","export":"Exporter","exportTheme":"Exporter thème","findPassword":"Demander le mot de passe","findPasswordSendEmailOver":"Nous avons déjà envoyer le lien pour demander un mot de passe sur votre adresse de courriel, veuillez consulter votre boite de réception.","findPasswordTimeout":"Temps imparti écoulé","fold":"Plier","footer":"Pied de page","forgetPassword ":" Mot de passe oublié?","fork github":"Fork leanote sur Github","friendEmail":"Courriel de l'ami","friendNotExits":"Votre ami n'a pas de compte %s, lien d'invitation à s'enregistrer: %s","getShareLinkAndPwd":"Get linkLine truncated
|
||||
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={"app":"Leanote","share":"Partager","noTag":"No Tags","inputEmail":"L'adresse courriel est requis","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","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","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.","errorEmail":"Veuillez renseigner le courriel correct"};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,16 +1 @@
|
||||
var MSG = {"3th":"第三方登录","Password":"密码","SearchNote":"搜索笔记","SearchNotebook":"搜索笔记本","Share":"分享","Submit":"提交","aboutLeanote":"关于Leanote","aboutMe":"关于我","accountInfo":"帐户信息","accountSetting":"帐户设置","accountType":"帐户类型","addChildNotebook":"添加子笔记本","addLeanoteAccount":"新建Leanote帐户","addMemberTips":"输入用户名或邮箱添加成员","addNotebook":"添加笔记本","addShare":"添加分享","addSingle":"添加单页面","addTheme":"添加主题","admin":"后台管理","all":"最新","app":"Leanote","archive":"归档页","asc":"升序","attachSize":"附件空间","attachSizeOver":"对不起, 您的附件容量不足, 请至\u003ca href=\"/service\"\u003e升级您的帐户\u003c/a\u003e","attachments ":" 附件","avatar":"头像","basicInfo":"基本信息","basicInfoSet":"博客基本设置","blog":"博客","blogInfo":"将笔记公开, 让知识传播的更远!","blogSet":"博客设置","blue":"蓝色","cancel":"取消","cancelPublic":"取消公开为博客","cancelShare":"取消分享","cannotUpdateDemo":"抱歉, Demo用户不允许修改","canntNewNoteTips":"Sorry, 这里不能添加笔记的. 你需要先选择一个笔记本.","captcha":"验证码","captchaError":"验证码错误","cate":"分类页","cateIsPublicNotebook":"分类是公开为博客的笔记本","checkEmai":"查收邮箱","checkEmail":"查看邮件","chooseImage":"选择图片","clearSearch":"清除搜索","clickAddTag":"点击添加标签","clickToChangePermission":"点击改变权限","clickToCopy":"点击复制","close":"关闭","confirmBackup":"确定要从该版还原? 还原前leanote会备份当前版本到历史记录中.","confirmPassword":"两次密码输入不正确","content":"内容","cooperation":"协作","cooperationInfo":"分享给好友的同时也可以让你的好友和你一起来完善它.","copy":"复制","copyFailed":"对不起, 复制失败, 请自行复制","copySuccess":"复制成功","copyToMyNotebook":"复制到我的笔记本","create":"创建","createAccount":"创建帐号","createAccountFailed":"帐号创建失败","createAccountSuccess":"帐号创建成功","created":"创建","createdTime":"创建时间","curUser":"当前登录帐户","currentEmail":"当前邮箱为: \u003ccode\u003e%s\u003c/code\u003e ","currentFile":"当前文件","currentTheme":"当前主题","datetime":"日期","default":"默认","defaultComment":"默认leanote评论系统","defaultShare":"默认分享","defaulthhare":"默认共享","delete":"删除","deleteAllShared":"删除所有共享","deleteGroup":"删除组","deleteMember":"删除成员","deleteSharedNotebook":"删除共享笔记本","demoRegister":"\u003ca href=\"/register\"\u003e立即注册\u003c/a\u003e","desc":"降序","desktopApp":"客户端","discussion":"社区讨论","domainExisted":"域名已存在","domainNotPointToLeanote":"该域名还未指向 d.leanote.com, 请稍后再试","donate ":" 捐赠","download":"下载","dragAndSort":"拖动可排序","edit":"编辑","editorTips":"帮助","editorTipsInfo":"\u003ch4\u003e1. 快捷键\u003c/h4\u003ectrl+shift+c 代码块切换 \u003ch4\u003e2. shift+enter 跳出当前区域\u003c/h4\u003e比如在代码块中\u003cimg src=\"/images/outofcode.png\" style=\"width: 90px\"/\u003e按shift+enter可跳出当前代码块.","email":"Email","emailBodyRequired":"邮件内容不能为空","emailInSending":"正在发送邮件到","emailOrOthers":"Email或其它联系方式","emailSendFailed":"邮件发送失败","errorDomain":"请输入正确的域名, 如www.myblog.com","errorEmail":"请输入正确的email","errorPassword":"请输入长度不少于6位的密码, 尽量复杂","errorPerPageSize":"每页记录数至少为1","errorSortField":"排序类型错误","errorSubDomain":"请输入正确的博客子域名, 长度至少为4, 不能包含特殊字符","export":"导出","exportPdf":"导出PDF","exportTheme":"导出主题","findPassword":"找回密码","findPasswordSendEmailOver":"已经将修改密码的链接发送到您的邮箱, 请查收邮件.","findPasswordTimeout":"链接已过期","fold":"折叠","followers":"谁关注我","following":"我的关注","footer":"底部","forgetPassword ":" 忘记密码?","fork github":"Github 源码","friendEmail":"好友邮箱","friendNotExits":"该用户还没有注册%s, 复制邀请链接发送给Ta, 邀请链接: %s","friends":"我的朋友","getShareLinkAndPwd":"生成该笔记的分享链接和密码","green":"绿色","group":"用户组","groupAndMemberManage":"项目组/成员管理","groupName":"分组名","hadAcount ":" 已有帐户?","hasAcount ":" 还无帐户?","hasSelfDefined":"已设置","hasSharedThisNote":"分享了笔记","hasUsers":"已存在该成员","header":"头部","hi":"Hi","highlight":"高亮","historiesNum":"leanote会保存笔记的最近\u003cb\u003e10\u003c/b\u003e份历史记录","history":"历史记录","home":"主页","howToInstallLeanote":"leanote安装步骤","image"Line truncated
|
||||
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={"app":"Leanote","share":"分享","noTag":"无标签","inputEmail":"请输入Email","history":"历史记录","editorTips":"帮助","editorTipsInfo":"<h4>1. 快捷键</h4>ctrl+shift+c 代码块切换 <h4>2. shift+enter 跳出当前区域</h4>比如在代码块中<img src=\"/images/outofcode.png\" style=\"width: 90px\"/>按shift+enter可跳出当前代码块.","all":"最新","trash":"废纸篓","delete":"删除","unTitled":"无标题","writingMode":"写作模式","normalMode":"普通模式","saving":"正在保存","saveSuccess":"保存成功","Are you sure to delete it ?":"确认删除?","Insert link into content":"将附件链接插入到内容中","Download":"下载","Delete":"删除","update":"更新","close":"关闭","cancel":"取消","send":"发送","shareToFriends":"分享给好友","publicAsBlog":"公开为博客","cancelPublic":"取消公开为博客","move":"移动","copy":"复制","rename":"重命名","exportPdf":"导出PDF","addChildNotebook":"添加子笔记本","deleteAllShared":"删除所有共享","deleteSharedNotebook":"删除共享笔记本","copyToMyNotebook":"复制到我的笔记本","sendSuccess":"发送成功","defaulthhare":"默认共享","friendEmail":"好友邮箱","readOnly":"只读","writable":"可写","inputFriendEmail":"请输入好友邮箱","clickToChangePermission":"点击改变权限","sendInviteEmailToYourFriend":"发送邀请email给Ta","friendNotExits":"该用户还没有注册%s, 复制邀请链接发送给Ta, 邀请链接: %s","emailBodyRequired":"邮件内容不能为空","inviteEmailBody":"Hi, 你好, 我是%s, %s非常好用, 快来注册吧!","historiesNum":"leanote会保存笔记的最近<b>10</b>份历史记录","noHistories":"无历史记录","datetime":"日期","restoreFromThisVersion":"从该版本还原","confirmBackup":"确定要从该版还原? 还原前leanote会备份当前版本到历史记录中.","errorEmail":"请输入正确的email"};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;}
|
||||
@@ -25,7 +25,6 @@ define('attachment_upload', ['jquery.ui.widget', 'fileupload'], function(){
|
||||
if(timeout) {
|
||||
clearTimeout(timeout);
|
||||
}
|
||||
|
||||
var found = false,
|
||||
node = e.target;
|
||||
do {
|
||||
@@ -48,7 +47,6 @@ define('attachment_upload', ['jquery.ui.widget', 'fileupload'], function(){
|
||||
}
|
||||
|
||||
setDropStyle("#dropAttach", "#uploadAttach");
|
||||
setDropStyle("#dropAvatar", "#uploadAvatar");
|
||||
|
||||
var initUploader = function() {
|
||||
$('.dropzone .btn-choose-file').click(function() {
|
||||
@@ -140,76 +138,6 @@ define('attachment_upload', ['jquery.ui.widget', 'fileupload'], function(){
|
||||
$("#uploadAttachMsg").scrollTop(1000);
|
||||
}
|
||||
});
|
||||
|
||||
//-------------------
|
||||
// 已经过时, 没有avatar了
|
||||
|
||||
var $msg2 = $('#avatarUploadMsg');
|
||||
$('#uploadAvatar').fileupload({
|
||||
dataType: 'json',
|
||||
dropZone: $('#dropAvatar'),
|
||||
pasteZone: '',
|
||||
add: function(e, data) {
|
||||
var tpl = $('<div class="alert alert-info"><img class="loader" src="/tinymce/plugins/leaui_image/public/images/ajax-loader.gif"> <a class="close" data-dismiss="alert">×</a></div>');
|
||||
|
||||
// Append the file name and file size
|
||||
tpl.append(data.files[0].name + ' <small>[<i>' + formatFileSize(data.files[0].size) + '</i>]</small>');
|
||||
|
||||
// Add the HTML to the UL element
|
||||
$msg2.html(tpl);
|
||||
data.context = $msg2;
|
||||
|
||||
// 检查文件大小
|
||||
var size = data.files[0].size;
|
||||
var maxFileSize = +GlobalConfigs["uploadAvatarSize"] || 100;
|
||||
if(typeof size == 'number' && size > 1024 * 1024 * maxFileSize) {
|
||||
tpl.find("img").remove();
|
||||
tpl.removeClass("alert-info").addClass("alert-danger");
|
||||
tpl.append(" Warning: File size is bigger than " + maxFileSize + "M");
|
||||
setTimeout((function(tpl) {
|
||||
return function() {
|
||||
tpl.remove();
|
||||
}
|
||||
})(tpl), 3000);
|
||||
return;
|
||||
}
|
||||
|
||||
// Automatically upload the file once it is added to the queue
|
||||
var jqXHR;
|
||||
setTimeout(function() {
|
||||
jqXHR = data.submit();
|
||||
}, 10);
|
||||
},
|
||||
done: function(e, data) {
|
||||
if (data.result.Ok == true) {
|
||||
data.context.html("");
|
||||
var re = data.result;
|
||||
$("#avatar").attr("src", UrlPrefix + "/" + re.Id);
|
||||
} else {
|
||||
var re = data.result;
|
||||
data.context.html("");
|
||||
var tpl = $('<div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div>');
|
||||
tpl.append('<b>Error:</b> ' + data.files[0].name + ' <small>[<i>' + formatFileSize(data.files[0].size) + '</i>]</small> ' + data.result.Msg);
|
||||
data.context.html(tpl);
|
||||
setTimeout((function(tpl) {
|
||||
return function() {
|
||||
tpl.remove();
|
||||
}
|
||||
})(tpl), 3000);
|
||||
}
|
||||
},
|
||||
fail: function(e, data) {
|
||||
data.context.html("");
|
||||
var tpl = $('<div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div>');
|
||||
tpl.append('<b>Error:</b> ' + data.files[0].name + ' <small>[<i>' + formatFileSize(data.files[0].size) + '</i>]</small> ' + data.errorThrown);
|
||||
data.context.html(tpl);
|
||||
setTimeout((function(tpl) {
|
||||
return function() {
|
||||
tpl.remove();
|
||||
}
|
||||
})(tpl), 3000);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
initUploader();
|
||||
@@ -258,6 +258,7 @@ define('editor_drop_paste', ['jquery.ui.widget', 'fileupload'], function(){
|
||||
});
|
||||
};
|
||||
|
||||
var lastTime = 0;
|
||||
|
||||
// pasteImage
|
||||
var pasteImageInit = function() {
|
||||
@@ -285,7 +286,19 @@ define('editor_drop_paste', ['jquery.ui.widget', 'fileupload'], function(){
|
||||
data.process.update(data.loaded / data.total);
|
||||
}
|
||||
},
|
||||
|
||||
// 调用了两次
|
||||
// 不知道为什么会触发两次
|
||||
add: function(e, data) {
|
||||
// 防止两次
|
||||
var now = (new Date()).getTime();
|
||||
if (now - lastTime < 500) {
|
||||
// console.log('haha');
|
||||
return;
|
||||
}
|
||||
// console.log('nono');
|
||||
lastTime = now;
|
||||
|
||||
var note = Note.getCurNote();
|
||||
curNote = note;
|
||||
if(!note || note.IsNew) {
|
||||
@@ -0,0 +1,161 @@
|
||||
/**
|
||||
* @file 历史记录
|
||||
* @author life
|
||||
*
|
||||
*/
|
||||
define('history', [], function() {
|
||||
|
||||
var tpl = ['<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">' + + '</h4>',
|
||||
'</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('');
|
||||
var $tpl = $(tpl);
|
||||
|
||||
var $historyContent = $tpl.find('.history-content');
|
||||
var $historyList = $tpl.find('.history-list');
|
||||
var $historyNum = $tpl.find('.history-num');
|
||||
var view = {
|
||||
note: null,
|
||||
list: [],
|
||||
curIndex: 0,
|
||||
|
||||
renderContent: function (i) {
|
||||
var content = this.list[i].Content;
|
||||
this.curIndex = i;
|
||||
|
||||
var wrap = '<div>';
|
||||
var wrapEnd = '</div>';
|
||||
if (this.note.IsMarkdown) {
|
||||
wrap = '<pre>';
|
||||
wrapEnd = '</pre>';
|
||||
}
|
||||
$historyContent.html(wrap + content + wrapEnd);
|
||||
|
||||
var as = $historyList.find('a');
|
||||
as.removeClass('active');
|
||||
as.eq(i).addClass('active');
|
||||
},
|
||||
render: function (list) {
|
||||
var navs = '';
|
||||
this.list = list;
|
||||
if (list) {
|
||||
for(var i = 0; i < list.length; ++i) {
|
||||
var content = list[i];
|
||||
navs += '<a class="list-group-item" data-index="' + i + '"><span class="badge">#' + (i+1)+ '</span>' + goNowToDatetime(content.UpdatedTime) + '</a>';
|
||||
}
|
||||
}
|
||||
$historyList.html(navs);
|
||||
|
||||
this.renderContent(0);
|
||||
$historyNum.html(list.length);
|
||||
// show
|
||||
$tpl.modal({show: true});
|
||||
},
|
||||
|
||||
bind: function () {
|
||||
var me = this;
|
||||
$("#contentHistory").click(function() {
|
||||
me.getHistories();
|
||||
});
|
||||
|
||||
$historyList.on('click', 'a', function () {
|
||||
var index = $(this).data('index');
|
||||
me.renderContent(index);
|
||||
});
|
||||
|
||||
// 还原
|
||||
$tpl.find('.back').click(function() {
|
||||
if(confirm(getMsg("confirmBackup"))) {
|
||||
// 保存当前版本
|
||||
Note.curChangedSaveIt(true);
|
||||
|
||||
// 设置之
|
||||
note = Note.cache[Note.curNoteId];
|
||||
setEditorContent(me.list[me.curIndex].Content, note.IsMarkdown);
|
||||
|
||||
$tpl.modal('hide');
|
||||
// 保存
|
||||
Note.curChangedSaveIt(true);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
getHistories: function () {
|
||||
var me = this;
|
||||
var note = Note.getCurNote();
|
||||
me.note = note;
|
||||
ajaxGet("/noteContentHistory/listHistories", {noteId: Note.curNoteId}, function(re) {
|
||||
if(!isArray(re)) {
|
||||
alert(getMsg('noHistories'));
|
||||
return;
|
||||
}
|
||||
|
||||
me.render(re);
|
||||
|
||||
return;
|
||||
|
||||
// 组装成一个tab
|
||||
var str = "<p>" + getMsg("historiesNum") + '</p><div id="historyList"><table class="table table-hover">';
|
||||
note = Note.cache[Note.curNoteId];
|
||||
var s = "div"
|
||||
if(note.IsMarkdown) {
|
||||
s = "pre";
|
||||
}
|
||||
for (i in re) {
|
||||
var content = re[i]
|
||||
content.Ab = Note.genAbstract(content.Content, 200);
|
||||
// 为什么不用tt(), 因为content可能含??
|
||||
str += '<tr><td seq="' + i + '">#' + (i+1) +'<' + s + ' class="each-content">' + content.Ab + '</' + s + '> <div class="btns">' + getMsg("datetime") + ': <span class="label label-default">' + goNowToDatetime(content.UpdatedTime) + '</span> <button class="btn btn-default all">' + getMsg("unfold") + '</button> <button class="btn btn-primary back">' + getMsg('restoreFromThisVersion') + '</button></div></td></tr>';
|
||||
}
|
||||
str += "</table></div>";
|
||||
$content.html(str);
|
||||
$("#historyList .all").click(function() {
|
||||
$p = $(this).parent().parent();
|
||||
var seq = $p.attr("seq");
|
||||
var $c = $p.find(".each-content");
|
||||
var info = re[seq];
|
||||
if(!info.unfold) { // 默认是折叠的
|
||||
$(this).text(getMsg("fold")); // 折叠
|
||||
$c.html(info.Content);
|
||||
info.unfold = true;
|
||||
} else {
|
||||
$(this).text(getMsg("unfold")); // 展开
|
||||
$c.html(info.Ab);
|
||||
info.unfold = false
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
init: function () {
|
||||
var me = this;
|
||||
this.bind();
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
view.init();
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
!function(e){"use strict";e(window.jQuery)}(function(e){"use strict";e.support.xhrFileUpload=!(!window.XMLHttpRequestUpload||!window.FileReader),e.support.xhrFormDataFileUpload=!!window.FormData,e.widget("blueimp.fileupload",{options:{dropZone:e(document),pasteZone:e(document),fileInput:void 0,replaceFileInput:!0,paramName:void 0,singleFileUploads:!0,limitMultiFileUploads:void 0,sequentialUploads:!1,limitConcurrentUploads:void 0,forceIframeTransport:!1,redirect:void 0,redirectParamName:void 0,postMessage:void 0,multipart:!0,maxChunkSize:void 0,uploadedBytes:void 0,recalculateProgress:!0,progressInterval:100,bitrateInterval:500,autoUpload:!0,formData:function(e){return e.serializeArray()},add:function(t,i){(i.autoUpload||i.autoUpload!==!1&&(e(this).data("blueimp-fileupload")||e(this).data("fileupload")).options.autoUpload)&&i.submit()},processData:!1,contentType:!1,cache:!1},_refreshOptionsList:["fileInput","dropZone","pasteZone","multipart","forceIframeTransport"],_BitrateTimer:function(){this.timestamp=+new Date,this.loaded=0,this.bitrate=0,this.getBitrate=function(e,t,i){var r=e-this.timestamp;return(!this.bitrate||!i||r>i)&&(this.bitrate=(t-this.loaded)*(1e3/r)*8,this.loaded=t,this.timestamp=e),this.bitrate}},_isXHRUpload:function(t){return!t.forceIframeTransport&&(!t.multipart&&e.support.xhrFileUpload||e.support.xhrFormDataFileUpload)},_getFormData:function(t){var i;return"function"==typeof t.formData?t.formData(t.form):e.isArray(t.formData)?t.formData:t.formData?(i=[],e.each(t.formData,function(e,t){i.push({name:e,value:t})}),i):[]},_getTotal:function(t){var i=0;return e.each(t,function(e,t){i+=t.size||1}),i},_initProgressObject:function(e){e._progress={loaded:0,total:0,bitrate:0}},_onProgress:function(e,t){if(e.lengthComputable){var i,r=+new Date;if(t._time&&t.progressInterval&&r-t._time<t.progressInterval&&e.loaded!==e.total)return;t._time=r,i=Math.floor(e.loaded/e.total*(t.chunkSize||t._progress.total))+(t.uploadedBytes||0),this._progress.loaded+=i-t._progress.loaded,this._progress.bitrate=this._bitrateTimer.getBitrate(r,this._progress.loaded,t.bitrateInterval),t._progress.loaded=t.loaded=i,t._progress.bitrate=t.bitrate=t._bitrateTimer.getBitrate(r,i,t.bitrateInterval),this._trigger("progress",e,t),this._trigger("progressall",e,this._progress)}},_initProgressListener:function(t){var i=this,r=t.xhr?t.xhr():e.ajaxSettings.xhr();r.upload&&(e(r.upload).bind("progress",function(e){var r=e.originalEvent;e.lengthComputable=r.lengthComputable,e.loaded=r.loaded,e.total=r.total,i._onProgress(e,t)}),t.xhr=function(){return r})},_initXHRData:function(t){var i,r=t.files[0],n=t.multipart||!e.support.xhrFileUpload,o=t.paramName[0];if(t.headers=t.headers||{},t.contentRange&&(t.headers["Content-Range"]=t.contentRange),n){if(e.support.xhrFormDataFileUpload){if(t.postMessage)i=this._getFormData(t),t.blob?i.push({name:o,value:t.blob}):e.each(t.files,function(e,r){i.push({name:t.paramName[e]||o,value:r})});else{if(t.formData instanceof FormData)i=t.formData;else{i=new FormData;var s=this._getFormData(t);log(s),e.each(this._getFormData(t),function(e,t){i.append(t.name,t.value)})}t.blob?(t.headers["Content-Disposition"]='attachment; filename="'+encodeURI(r.name)+'"',i.append(o,t.blob,r.name)):e.each(t.files,function(e,r){(window.Blob&&r instanceof Blob||window.File&&r instanceof File)&&i.append(t.paramName[e]||o,r,r.name)})}t.data=i}}else t.headers["Content-Disposition"]='attachment; filename="'+encodeURI(r.name)+'"',t.contentType=r.type,t.data=t.blob||r;t.blob=null},_initIframeSettings:function(t){t.dataType="iframe "+(t.dataType||""),t.formData=this._getFormData(t),t.redirect&&e("<a></a>").prop("href",t.url).prop("host")!==location.host&&t.formData.push({name:t.redirectParamName||"redirect",value:t.redirect})},_initDataSettings:function(e){this._isXHRUpload(e)?(this._chunkedUpload(e,!0)||(e.data||this._initXHRData(e),this._initProgressListener(e)),e.postMessage&&(e.dataType="postmessage "+(e.dataType||""))):this._initIframeSettings(e,"iframe")},_getParamName:function(t){var i=e(t.fileInput),r=t.paramName;return r?e.isArray(r)||(r=[r]):(r=[],i.each(function(){for(var t=e(this),i=t.prop("name")||"files[]",n=(t.prop("files")||[1]).length;n;)r.push(i),n-=1}),r.length||(r=[i.prop("name")||"files[]"])),r},_initFormSettings:function(t){t.form&&t.form.length||(t.form=e(t.fileInput.prop("form")),t.form.length||(t.form=e(this.options.fileInput.prop("form")))),t.paramName=this._getParamName(t),t.urlFunc&&(t.url=t.urlFunc()),t.url||(t.url=t.form.prop("action")||location.href),t.type=(t.type||t.form.prop("method")||"").toUpperCase(),"POST"!==t.type&&"PUT"!==t.type&&"PATCH"!==t.type&&(t.type="POST"),t.formAcceptCharset||(t.formAcceptCharset=t.form.attr("accept-charset"))},_getAJAXSettings:function(t){var i=e.extend({},this.options,t);return this._initFormSettings(i),this._initDataSettings(i),i},_getDeferredState:function(e){return e.state?e.state():e.isResolved()?"resolved":e.isRejected()?"rejected":"pending"},_enhancePromise:functiLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
!function(t){"use strict";t(window.jQuery)}(function(t){"use strict";var e=0;t.ajaxTransport("iframe",function(r){if(r.async){var a,n,p;return{send:function(o,i){a=t('<form style="display:none;"></form>'),a.attr("accept-charset",r.formAcceptCharset),p=/\?/.test(r.url)?"&":"?","DELETE"===r.type?(r.url=r.url+p+"_method=DELETE",r.type="POST"):"PUT"===r.type?(r.url=r.url+p+"_method=PUT",r.type="POST"):"PATCH"===r.type&&(r.url=r.url+p+"_method=PATCH",r.type="POST"),n=t('<iframe src="javascript:false;" name="iframe-transport-'+(e+=1)+'"></iframe>').bind("load",function(){var e,p=t.isArray(r.paramName)?r.paramName:[r.paramName];n.unbind("load").bind("load",function(){var e;try{if(e=n.contents(),!e.length||!e[0].firstChild)throw new Error}catch(r){e=void 0}i(200,"success",{iframe:e}),t('<iframe src="javascript:false;"></iframe>').appendTo(a),a.remove()}),a.prop("target",n.prop("name")).prop("action",r.url).prop("method",r.type),r.formData&&t.each(r.formData,function(e,r){t('<input type="hidden"/>').prop("name",r.name).val(r.value).appendTo(a)}),r.fileInput&&r.fileInput.length&&"POST"===r.type&&(e=r.fileInput.clone(),r.fileInput.after(function(t){return e[t]}),r.paramName&&r.fileInput.each(function(e){t(this).prop("name",p[e]||r.paramName)}),a.append(r.fileInput).prop("enctype","multipart/form-data").prop("encoding","multipart/form-data")),a.submit(),e&&e.length&&r.fileInput.each(function(r,a){var n=t(e[r]);t(a).prop("name",n.prop("name")),n.replaceWith(a)})}),a.append(n).appendTo(document.body)},abort:function(){n&&n.unbind("load").prop("src","javascript".concat(":false;")),a&&a.remove()}}}}),t.ajaxSetup({converters:{"iframe text":function(e){return e&&t(e[0].body).text()},"iframe json":function(e){return e&&t.parseJSON(t(e[0].body).text())},"iframe html":function(e){return e&&t(e[0].body).html()},"iframe script":function(e){return e&&t.globalEval(t(e[0].body).text())}}})});
|
||||
@@ -0,0 +1 @@
|
||||
!function(t){t(jQuery)}(function(t,e){var i=0,n=Array.prototype.slice,s=t.cleanData;t.cleanData=function(e){for(var i,n=0;null!=(i=e[n]);n++)try{t(i).triggerHandler("remove")}catch(o){}s(e)},t.widget=function(e,i,n){var s,o,a,r,u={},d=e.split(".")[0];e=e.split(".")[1],s=d+"-"+e,n||(n=i,i=t.Widget),t.expr[":"][s.toLowerCase()]=function(e){return!!t.data(e,s)},t[d]=t[d]||{},o=t[d][e],a=t[d][e]=function(t,e){return this._createWidget?void(arguments.length&&this._createWidget(t,e)):new a(t,e)},t.extend(a,o,{version:n.version,_proto:t.extend({},n),_childConstructors:[]}),r=new i,r.options=t.widget.extend({},r.options),t.each(n,function(e,n){return t.isFunction(n)?void(u[e]=function(){var t=function(){return i.prototype[e].apply(this,arguments)},s=function(t){return i.prototype[e].apply(this,t)};return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=s,e=n.apply(this,arguments),this._super=i,this._superApply=o,e}}()):void(u[e]=n)}),a.prototype=t.widget.extend(r,{widgetEventPrefix:o?r.widgetEventPrefix:e},u,{constructor:a,namespace:d,widgetName:e,widgetFullName:s}),o?(t.each(o._childConstructors,function(e,i){var n=i.prototype;t.widget(n.namespace+"."+n.widgetName,a,i._proto)}),delete o._childConstructors):i._childConstructors.push(a),t.widget.bridge(e,a)},t.widget.extend=function(i){for(var s,o,a=n.call(arguments,1),r=0,u=a.length;u>r;r++)for(s in a[r])o=a[r][s],a[r].hasOwnProperty(s)&&o!==e&&(t.isPlainObject(o)?i[s]=t.isPlainObject(i[s])?t.widget.extend({},i[s],o):t.widget.extend({},o):i[s]=o);return i},t.widget.bridge=function(i,s){var o=s.prototype.widgetFullName||i;t.fn[i]=function(a){var r="string"==typeof a,u=n.call(arguments,1),d=this;return a=!r&&u.length?t.widget.extend.apply(null,[a].concat(u)):a,r?this.each(function(){var n,s=t.data(this,o);return s?t.isFunction(s[a])&&"_"!==a.charAt(0)?(n=s[a].apply(s,u),n!==s&&n!==e?(d=n&&n.jquery?d.pushStack(n.get()):n,!1):void 0):t.error("no such method '"+a+"' for "+i+" widget instance"):t.error("cannot call methods on "+i+" prior to initialization; attempted to call method '"+a+"'")}):this.each(function(){var e=t.data(this,o);e?e.option(a||{})._init():t.data(this,o,new s(a,this))}),d}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(e,n){n=t(n||this.defaultElement||this)[0],this.element=t(n),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this.bindings=t(),this.hoverable=t(),this.focusable=t(),n!==this&&(t.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===n&&this.destroy()}}),this.document=t(n.style?n.ownerDocument:n.document||n),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(i,n){var s,o,a,r=i;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof i)if(r={},s=i.split("."),i=s.shift(),s.length){for(o=r[i]=t.widget.extend({},this.options[i]),a=0;a<s.length-1;a++)o[s[a]]=o[s[a]]||{},o=o[s[a]];if(i=s.pop(),n===e)return o[i]===e?null:o[i];o[i]=n}else{if(n===e)return this.options[i]===e?null:this.options[i];r[i]=n}return this._setOptions(r),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(e,i,n){var s,o=this;"boolean"!=typeof e&&(n=i,i=e,e=!1),n?(i=s=t(i),this.bindings=this.bindings.add(i)):(n=i,i=this.element,s=this.widget()),t.each(n,function(n,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var u=n.match(/^(\w+)\s*(.*)$/),d=u[1]+o.eventNamespace,h=u[2];h?s.delegate(h,d,r):i.bind(d,r)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+"
Line truncated
|
||||
Vendored
File renamed without changes.
File renamed without changes.
Vendored
File renamed without changes.
@@ -0,0 +1,38 @@
|
||||
// 插件, 不是立刻就需要的功能
|
||||
// 1. 上传, 粘贴图片2
|
||||
// 2. 笔记信息
|
||||
// 3. 历史记录
|
||||
// 4. 附件
|
||||
requirejs.config({
|
||||
paths: {
|
||||
// life
|
||||
'editor_drop_paste': 'js/plugins/editor_drop_paste',
|
||||
'attachment_upload': 'js/plugins/attachment_upload',
|
||||
|
||||
'jquery.ui.widget': 'js/plugins/libs-min/jquery.ui.widget',
|
||||
'fileupload': 'js/plugins/libs-min/jquery.fileupload',
|
||||
'iframe-transport': 'js/plugins/libs-min/jquery.iframe-transport',
|
||||
|
||||
'note_info': 'js/plugins/note_info',
|
||||
'tips': 'js/plugins/tips',
|
||||
'history': 'js/plugins/history',
|
||||
},
|
||||
shim: {
|
||||
// life
|
||||
'fileupload': {deps: ['jquery.ui.widget', 'iframe-transport']},
|
||||
}
|
||||
});
|
||||
|
||||
// 异步加载
|
||||
setTimeout(function () {
|
||||
// 小异步
|
||||
require(["editor_drop_paste", "attachment_upload"]);
|
||||
|
||||
require(['note_info']);
|
||||
|
||||
// 大异步
|
||||
setTimeout(function () {
|
||||
require(['tips']);
|
||||
require(['history']);
|
||||
}, 10);
|
||||
});
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
define("note_info",[],function(){var t=["<table>","<tr><th>"+getMsg("Create Time")+'</th><td id="noteInfoCreatedTime"></td></tr>',"<tr><th>"+getMsg("Update Time")+'</th><td id="noteInfoUpdatedTime"></td></tr>','<tr class="post-url-tr">',"<th>"+getMsg("Post Url")+"</th>","<td>",'<div class="post-url-wrap">','<span class="post-url-base">http://blog.leanote.com/life/post/</span><span><span class="post-url-text">life-life-life-a-leanote</span>','<input type="text" class="form-control">',"</span>",' <a class="post-url-pencil" title="'+getMsg("update")+'"><i class="fa fa-pencil"></i></a>',"</div>","</td>","</tr>","</table>"].join(""),e=$(t),n=e.find("#noteInfoCreatedTime"),o=e.find("#noteInfoUpdatedTime"),i=(e.find("#noteInfoPostUrl"),e.find(".post-url-tr")),r=e.find(".post-url-wrap"),l=e.find("input"),d=e.find(".post-url-base"),s=e.find(".post-url-text"),a={$noteInfo:$("#noteInfo"),note:null,bind:function(){var t=this;$("#noteInfoDropdown").click(function(){t.render()}),e.find(".post-url-pencil").click(function(){r.addClass("post-url-edit"),l.val(decodeURI(t.note.UrlTitle)),l.focus()}),l.keydown(function(t){13===t.keyCode&&l.blur()}),l.blur(function(){r.removeClass("post-url-edit");var e=l.val();e&&ajaxPost("/member/blog/updateBlogUrlTitle",{noteId:t.note.NoteId,urlTitle:e},function(e){if(reIsOk(e)){var n=encodeURI(e.Item);t.note.UrlTitle=n,s.text(decodeURI(t.note.UrlTitle))}else alert(e.Msg||"error")})}),LEA.on("noteChanged",function(e){t.render(e)})},getPostUrl:function(t){return""},rendered:!1,render:function(t){var r=this;t||(t=Note.getCurNote()),t&&(r.note=t,n.html(goNowToDatetime(t.CreatedTime)),o.html(goNowToDatetime(t.UpdatedTime)),t.IsBlog?(i.removeClass("hide"),d.text(UserInfo.PostUrl+"/"),s.text(decodeURI(t.UrlTitle))):i.addClass("hide"),r.rendered||(r.$noteInfo.html(e),r.rendered=!0))},init:function(){this.bind()}};a.init()});
|
||||
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",["jquery.ui.widget","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 i=!1,o=e.target;do{if(o===a[0]){i=!0;break}o=o.parentNode}while(null!=o);i?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,i){var o=Note.getCurNote();if(!o||o.IsNew)return void alert("This note hasn't saved, please save it firstly!");var n=$('<div class="alert alert-info"><img class="loader" src="/tinymce/plugins/leaui_image/public/images/ajax-loader.gif"> <a class="close" data-dismiss="alert">×</a></div>');n.append(i.files[0].name+" <small>[<i>"+e(i.files[0].size)+"</i>]</small>"),t.html(n),i.context=t;var r=i.files[0].size,l=+GlobalConfigs.uploadAttachSize||100;if("number"==typeof r&&r>1048576*l)return n.find("img").remove(),n.removeClass("alert-info").addClass("alert-danger"),n.append(" Warning: File size is bigger than "+l+"M"),void setTimeout(function(e){return function(){e.remove()}}(n),3e3);var s;setTimeout(function(){s=i.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 i=$('<div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div>');i.append("<b>Error:</b> "+a.files[0].name+" <small>[<i>"+e(a.files[0].size)+"</i>]</small> "+a.result.Msg),a.context.html(i),setTimeout(function(e){return function(){e.remove()}}(i),3e3)}$("#uploadAttachMsg").scrollTop(1e3)},fail:function(t,a){a.context.html("");var i=$('<div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div>');i.append("<b>Error:</b> "+a.files[0].name+" <small>[<i>"+e(a.files[0].size)+"</i>]</small> "+a.errorThrown),a.context.html(i),setTimeout(function(e){return function(){e.remove()}}(i),3e3),$("#uploadAttachMsg").scrollTop(1e3)}})};a()});
|
||||
var urlPrefix=UrlPrefix;define("editor_drop_paste",["jquery.ui.widget","fileupload"],function(){function e(e){var i="__mcenew"+(new Date).getTime(),t='<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=t,e.insertContent(t);var o=$("#"+i);this.container=o,this.id=i,this.processBar=o.find(".progress-bar")}function i(e,i){function t(e,t){o.parentNode.removeChild(o),i({width:e,height:t})}var o=document.createElement("img");o.onload=function(){t(o.clientWidth,o.clientHeight)},o.onerror=function(){t()},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 t(e){var t=tinymce.activeEditor,a=t.dom,r=function(t){function r(e){a.setAttrib(n,"src",t.src),t.title&&a.setAttrib(n,"title",t.title),a.setAttrib(n,"id",null)}var n,s={};s.id="__mcenew"+o++,s.src="http://leanote.com/images/loading-24.gif",n=a.createHTML("img",s),tinymce.activeEditor.insertContent(n),n=a.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(i){if(reIsOk(i)&&i.Id){var t=window.location.protocol+"//"+window.location.host;e.src=t+"/file/outputImage?fileId="+i.Id}r(e)})}(e):r(e)}else r(e)}e.prototype.update=function(e){var i=this;e=Math.ceil(100*e),e>=100&&(e=99),e+="%",$("#"+i.id+" .progress-bar").html(e).css("width",e)},e.prototype.replace=function(e){var t=this;i(e,function(){$("#"+t.id).replaceWith('<img src="'+e+'" />')})},e.prototype.remove=function(){var e=this;$("#"+e.id).remove()};var o=1,a=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 i(){$("#upload").css("z-index",12);var e=+$("#mceToolbar").css("height").slice(0,-2);$("#upload").css("top",e-8),$("#upload").show()}function o(){$("#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(i,t){var o=$('<li><div class="alert alert-info"><img class="loader" src="/tinymce/plugins/leaui_image/public/images/ajax-loader.gif"> <a class="close" data-dismiss="alert">×</a></div></li>');o.find("div").append(t.files[0].name+" <small>[<i>"+e(t.files[0].size)+"</i>]</small>"),t.context=o.appendTo(a);t.submit()},done:function(i,o){if(1==o.result.Ok){o.context.remove();var a={src:urlPrefix+"/file/outputImage?fileId="+o.result.Id};t(a)}else{o.context.empty();var r=$('<li><div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div></li>');r.find("div").append("<b>Error:</b> "+o.files[0].name+" <small>[<i>"+e(o.files[0].size)+"</i>]</small> "+o.result.Msg),o.context.append(r),setTimeout(function(e){return function(){e.remove()}}(r),2e3)}$("#uploadMsg").scrollTop(1e3)},fail:function(i,t){t.context.empty();var o=$('<li><div class="alert alert-danger"><a class="close" data-dismiss="alert">×</a></div></li>');o.find("div").append("<b>Error:</b> "+t.files[0].name+" <small>[<i>"+e(t.files[0].size)+"</i>]</small> "+t.errorThrown),t.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 t=$("#drop"),a=window.dropZoneTimeout;a?clearTimeout(a):(t.addClass("in"),i());var r=!1,n=e.target;do{if(n===t[0]){r=!0;break}n=n.parentNode}while(null!=n);r?t.addClass("hover"):t.removeClass("hover"),window.dropZoneTimeout=setTimeout(function(){window.dropZoneTimeout=null,t.removeClass("in hover"),o()},100)})},r=0,n=function(){var i,t;$("#editorContent, #wmd-input .editor-content").fileupload({dataType:"json",pasteZone:$("#editorContent, #wmd-input .editor-content"),dropZone:"",maxFileSize:21e4,url:"/file/pasteImage",paramName:"file",formData:function(e){return[{name:"from",value:"pasteImage"},{name:"noteId",value:Note.curNoteId}]},progress:function(e,t){i&&!i.IsMarkdown&&t.process.update(t.loaded/t.total)},add:function(o,a){var n=(new Date).getTime();if(!(500>n-r)){r=n;var s=Note.getCurNote();if(i=s,!s||s.IsNew)return void alert("This note hasn't saved, please save it firstly!");if(t=tinymce.EditorManager.activeEditor,!s.IsMarkdown)var l=new e(t);a.process=l;a.submit()}},done:function(e,t){if(1==t.result.Ok){var o=t.result,a=UrLine truncated
|
||||
requirejs.config({paths:{editor_drop_paste:"js/plugins/editor_drop_paste",attachment_upload:"js/plugins/attachment_upload","jquery.ui.widget":"js/plugins/libs-min/jquery.ui.widget",fileupload:"js/plugins/libs-min/jquery.fileupload","iframe-transport":"js/plugins/libs-min/jquery.iframe-transport",note_info:"js/plugins/note_info",tips:"js/plugins/tips",history:"js/plugins/history"},shim:{fileupload:{deps:["jquery.ui.widget","iframe-transport"]}}}),setTimeout(function(){require(["editor_drop_paste","attachment_upload"]),require(["note_info"]),setTimeout(function(){require(["tips"]),require(["history"])},10)});
|
||||
@@ -0,0 +1,123 @@
|
||||
/**
|
||||
* @file 笔记信息
|
||||
* @author life
|
||||
*
|
||||
*/
|
||||
define('note_info', [], function() {
|
||||
var tpl = ['<table>',
|
||||
'<tr><th>' + getMsg('Create Time') + '</th><td id="noteInfoCreatedTime"></td></tr>',
|
||||
'<tr><th>' + getMsg('Update Time') + '</th><td id="noteInfoUpdatedTime"></td></tr>',
|
||||
'<tr class="post-url-tr">',
|
||||
'<th>' + getMsg('Post Url') + '</th>',
|
||||
'<td>',
|
||||
'<div class="post-url-wrap">',
|
||||
'<span class="post-url-base">http://blog.leanote.com/life/post/</span><span><span class="post-url-text">life-life-life-a-leanote</span>',
|
||||
'<input type="text" class="form-control">',
|
||||
'</span>',
|
||||
' <a class="post-url-pencil" title="' + getMsg('update') + '"><i class="fa fa-pencil"></i></a>',
|
||||
'</div>',
|
||||
'</td>',
|
||||
'</tr>',
|
||||
'</table>'].join('');
|
||||
var $tpl = $(tpl);
|
||||
|
||||
var $noteInfoCreatedTime = $tpl.find('#noteInfoCreatedTime');
|
||||
var $noteInfoUpdatedTime = $tpl.find('#noteInfoUpdatedTime');
|
||||
var $noteInfoPostUrl = $tpl.find('#noteInfoPostUrl');
|
||||
|
||||
var $noteInfoPostUrlTr = $tpl.find('.post-url-tr');
|
||||
var $postUrlWrap = $tpl.find('.post-url-wrap');
|
||||
var $input = $tpl.find('input');
|
||||
|
||||
var $postUrlBase = $tpl.find('.post-url-base');
|
||||
var $postUrlText = $tpl.find('.post-url-text');
|
||||
|
||||
var view = {
|
||||
|
||||
$noteInfo: $('#noteInfo'),
|
||||
|
||||
note: null,
|
||||
|
||||
bind: function () {
|
||||
var me = this;
|
||||
$('#noteInfoDropdown').click(function () {
|
||||
me.render();
|
||||
});
|
||||
|
||||
$tpl.find('.post-url-pencil').click(function () {
|
||||
$postUrlWrap.addClass('post-url-edit');
|
||||
$input.val(decodeURI(me.note.UrlTitle));
|
||||
$input.focus();
|
||||
});
|
||||
$input.keydown(function (e) {
|
||||
if(e.keyCode === 13) {
|
||||
$input.blur();
|
||||
}
|
||||
});
|
||||
$input.blur(function () {
|
||||
$postUrlWrap.removeClass('post-url-edit');
|
||||
|
||||
var val = $input.val();
|
||||
if (!val) {
|
||||
return;
|
||||
}
|
||||
|
||||
ajaxPost("/member/blog/updateBlogUrlTitle", {noteId: me.note.NoteId, urlTitle: val}, function(re) {
|
||||
if(reIsOk(re)) {
|
||||
var encodedUrl = encodeURI(re.Item);
|
||||
me.note.UrlTitle = encodedUrl;
|
||||
$postUrlText.text(decodeURI(me.note.UrlTitle));
|
||||
} else {
|
||||
alert(re.Msg || "error");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 当笔记Change时, 重新render
|
||||
LEA.on('noteChanged', function (note) {
|
||||
me.render(note);
|
||||
});
|
||||
},
|
||||
|
||||
getPostUrl: function (note) {
|
||||
return '';
|
||||
},
|
||||
|
||||
rendered: false,
|
||||
render: function (note) {
|
||||
var me = this;
|
||||
if (!note) {
|
||||
note = Note.getCurNote();
|
||||
}
|
||||
if (!note) {
|
||||
return;
|
||||
}
|
||||
me.note = note;
|
||||
|
||||
$noteInfoCreatedTime.html(goNowToDatetime(note.CreatedTime));
|
||||
$noteInfoUpdatedTime.html(goNowToDatetime(note.UpdatedTime));
|
||||
|
||||
if (!note.IsBlog) {
|
||||
$noteInfoPostUrlTr.addClass('hide');
|
||||
}
|
||||
else {
|
||||
$noteInfoPostUrlTr.removeClass('hide');
|
||||
|
||||
// post-url
|
||||
$postUrlBase.text(UserInfo.PostUrl + '/');
|
||||
$postUrlText.text(decodeURI(note.UrlTitle));
|
||||
}
|
||||
|
||||
if (!me.rendered) {
|
||||
me.$noteInfo.html($tpl);
|
||||
me.rendered = true;
|
||||
}
|
||||
},
|
||||
|
||||
init: function () {
|
||||
this.bind();
|
||||
}
|
||||
};
|
||||
|
||||
view.init();
|
||||
});
|
||||
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* @file 提示帮助
|
||||
* @author life
|
||||
*
|
||||
*/
|
||||
define('tips', [], function() {
|
||||
var tpl = ['<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('');
|
||||
var $tpl = $(tpl);
|
||||
|
||||
var view = {
|
||||
init: function () {
|
||||
$("#tipsBtn").click(function() {
|
||||
$tpl.modal({show: true});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
view.init();
|
||||
});
|
||||
@@ -1,17 +0,0 @@
|
||||
// 上传, 粘贴图片
|
||||
requirejs.config({
|
||||
paths: {
|
||||
// life
|
||||
'editor_drop_paste': 'js/upload_paste/editor_drop_paste',
|
||||
'attachment_upload': 'js/upload_paste/attachment_upload',
|
||||
'jquery.ui.widget': 'js/upload_paste/libs/jquery.ui.widget',
|
||||
'fileupload': 'js/upload_paste/libs/jquery.fileupload',
|
||||
'iframe-transport': 'js/upload_paste/libs/jquery.iframe-transport'
|
||||
},
|
||||
shim: {
|
||||
// life
|
||||
'fileupload': {deps: ['jquery.ui.widget', 'iframe-transport']},
|
||||
}
|
||||
});
|
||||
require(["editor_drop_paste", "attachment_upload"], function() {
|
||||
});
|
||||
@@ -47,8 +47,9 @@ define("tinymce/pasteplugin/Clipboard", [
|
||||
ajaxPost("/file/copyHttpImage", {src: src}, function(ret) {
|
||||
if(reIsOk(ret)) {
|
||||
// 将图片替换之
|
||||
var src = urlPrefix + "/" + ret.Item;
|
||||
var dom = editor.dom
|
||||
// var src = urlPrefix + "/" + ret.Item;
|
||||
var src = urlPrefix + "/file/outputImage?fileId=" + ret.Id;
|
||||
var dom = editor.dom;
|
||||
for(var i in ids) {
|
||||
var id = ids[i];
|
||||
var imgElm = dom.get(id);
|
||||
@@ -114,7 +115,7 @@ define("tinymce/pasteplugin/Clipboard", [
|
||||
var needCopyImages = {}; // src => [id1,id2]
|
||||
var time = (new Date()).getTime();
|
||||
try {
|
||||
var $html = $("<div>" + html + "</div");
|
||||
var $html = $("<div>" + html + "</div>");
|
||||
var $imgs = $html.find("img");
|
||||
for(var i = 0; i < $imgs.length; ++i) {
|
||||
var $img = $imgs.eq(i)
|
||||
|
||||
@@ -45,25 +45,10 @@ define("tinymce/pasteplugin/Plugin", [
|
||||
}
|
||||
}
|
||||
|
||||
function togglePasteCopyImage() {
|
||||
if (clipboard.copyImage) {
|
||||
this.active(false);
|
||||
clipboard.copyImage = false
|
||||
} else {
|
||||
clipboard.copyImage = true;
|
||||
this.active(true);
|
||||
if (!userIsInformed2) {
|
||||
editor.windowManager.alert(
|
||||
"When copy other site's images (not in leanote) into editor, it will copy the image into your album."
|
||||
);
|
||||
userIsInformed2 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.clipboard = clipboard = new Clipboard(editor);
|
||||
self.quirks = new Quirks(editor);
|
||||
self.wordFilter = new WordFilter(editor);
|
||||
clipboard.copyImage = true;
|
||||
|
||||
if (editor.settings.paste_as_text) {
|
||||
self.clipboard.pasteFormat = "text";
|
||||
@@ -117,13 +102,6 @@ define("tinymce/pasteplugin/Plugin", [
|
||||
active: self.clipboard.pasteFormat == "text"
|
||||
});
|
||||
|
||||
editor.addButton('pasteCopyImage', {
|
||||
icon: 'copy',
|
||||
tooltip: "When Paste other site's image, copy it into my album as public image",
|
||||
onclick: togglePasteCopyImage,
|
||||
active: self.clipboard.copyImage === true
|
||||
});
|
||||
|
||||
editor.addMenuItem('pastetext', {
|
||||
text: 'Paste as text',
|
||||
selectable: true,
|
||||
|
||||
@@ -117,4 +117,4 @@
|
||||
writeScripts();
|
||||
})(this);
|
||||
|
||||
// $hash: e0933a5a75e12f26b54b4e7b86f5bdc2
|
||||
// $hash: 769ceeebf4bee26f9b01e49867bcf0ce
|
||||
@@ -232,8 +232,9 @@ define("tinymce/pasteplugin/Clipboard", [
|
||||
ajaxPost("/file/copyHttpImage", {src: src}, function(ret) {
|
||||
if(reIsOk(ret)) {
|
||||
// 将图片替换之
|
||||
var src = urlPrefix + "/" + ret.Item;
|
||||
var dom = editor.dom
|
||||
// var src = urlPrefix + "/" + ret.Item;
|
||||
var src = urlPrefix + "/file/outputImage?fileId=" + ret.Id;
|
||||
var dom = editor.dom;
|
||||
for(var i in ids) {
|
||||
var id = ids[i];
|
||||
var imgElm = dom.get(id);
|
||||
@@ -299,7 +300,7 @@ define("tinymce/pasteplugin/Clipboard", [
|
||||
var needCopyImages = {}; // src => [id1,id2]
|
||||
var time = (new Date()).getTime();
|
||||
try {
|
||||
var $html = $("<div>" + html + "</div");
|
||||
var $html = $("<div>" + html + "</div>");
|
||||
var $imgs = $html.find("img");
|
||||
for(var i = 0; i < $imgs.length; ++i) {
|
||||
var $img = $imgs.eq(i)
|
||||
@@ -1104,25 +1105,10 @@ define("tinymce/pasteplugin/Plugin", [
|
||||
}
|
||||
}
|
||||
|
||||
function togglePasteCopyImage() {
|
||||
if (clipboard.copyImage) {
|
||||
this.active(false);
|
||||
clipboard.copyImage = false
|
||||
} else {
|
||||
clipboard.copyImage = true;
|
||||
this.active(true);
|
||||
if (!userIsInformed2) {
|
||||
editor.windowManager.alert(
|
||||
"When copy other site's images (not in leanote) into editor, it will copy the image into your album."
|
||||
);
|
||||
userIsInformed2 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.clipboard = clipboard = new Clipboard(editor);
|
||||
self.quirks = new Quirks(editor);
|
||||
self.wordFilter = new WordFilter(editor);
|
||||
clipboard.copyImage = true;
|
||||
|
||||
if (editor.settings.paste_as_text) {
|
||||
self.clipboard.pasteFormat = "text";
|
||||
@@ -1176,13 +1162,6 @@ define("tinymce/pasteplugin/Plugin", [
|
||||
active: self.clipboard.pasteFormat == "text"
|
||||
});
|
||||
|
||||
editor.addButton('pasteCopyImage', {
|
||||
icon: 'copy',
|
||||
tooltip: "When Paste other site's image, copy it into my album as public image",
|
||||
onclick: togglePasteCopyImage,
|
||||
active: self.clipboard.copyImage === true
|
||||
});
|
||||
|
||||
editor.addMenuItem('pastetext', {
|
||||
text: 'Paste as text',
|
||||
selectable: true,
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
!function(a,b){"use strict";function c(a,b){for(var c,d=[],f=0;f<a.length;++f){if(c=g[a[f]]||e(a[f]),!c)throw"module definition dependecy not found: "+a[f];d.push(c)}b.apply(null,d)}function d(a,d,e){if("string"!=typeof a)throw"invalid module definition, module id must be defined and be a string";if(d===b)throw"invalid module definition, dependencies must be specified";if(e===b)throw"invalid module definition, definition function must be specified";c(d,function(){g[a]=e.apply(null,arguments)})}function e(b){for(var c=a,d=b.split(/[.\/]/),e=0;e<d.length;++e){if(!c[d[e]])return;c=c[d[e]]}return c}function f(c){for(var d=0;d<c.length;d++){for(var e=a,f=c[d],h=f.split(/[.\/]/),i=0;i<h.length-1;++i)e[h[i]]===b&&(e[h[i]]={}),e=e[h[i]];e[h[h.length-1]]=g[f]}}var g={};d("tinymce/pasteplugin/Utils",["tinymce/util/Tools","tinymce/html/DomParser","tinymce/html/Schema"],function(a,b,c){function d(b,c){return a.each(c,function(a){b=a.constructor==RegExp?b.replace(a,""):b.replace(a[0],a[1])}),b}function e(d){function e(a){var b=a.name,c=a;if("br"===b)return void(h+="\n");if(i[b]&&(h+=" "),j[b])return void(h+=" ");if(3==a.type&&(h+=a.value),!a.shortEnded&&(a=a.firstChild))do e(a);while(a=a.next);k[b]&&c.next&&(h+="\n","p"==b&&(h+="\n"))}var f=new c,g=new b({},f),h="",i=f.getShortEndedElements(),j=a.makeMap("script noscript style textarea video audio iframe object"," "),k=f.getBlockElements();return e(g.parse(d)),h}return{filter:d,innerText:e}}),d("tinymce/pasteplugin/Clipboard",["tinymce/Env","tinymce/util/VK","tinymce/pasteplugin/Utils"],function(a,b,c){return function(d){function e(a,b){ajaxPost("/file/copyHttpImage",{src:a},function(a){if(reIsOk(a)){var c=urlPrefix+"/"+a.Item,e=d.dom;for(var f in b){var g=b[f],h=e.get(g);e.setAttrib(h,"src",c)}}})}function f(a,b){var c,f=d.dom;if(d.settings.paste_data_images||(a=a.replace(/<img[^>]+src=\"data:image[^>]+>/g,"")),c=d.fire("BeforePastePreProcess",{content:a}),c=d.fire("PastePreProcess",c),a=c.content,!c.isDefaultPrevented()){if(d.hasEventListeners("PastePostProcess")&&!c.isDefaultPrevented()){var g=f.add(d.getBody(),"div",{style:"display:none"},a);c=d.fire("PastePostProcess",{node:g}),f.remove(g),a=c.node.innerHTML}if(!c.isDefaultPrevented()){var h=d.selection.getNode();if("PRE"==h.nodeName){if(!b)try{b=$(a).text()}catch(i){}b=b.replace(/</g,"<"),b=b.replace(/>/g,">"),d.insertRawContent(b)}else if(p.copyImage){var j=UrlPrefix,k={},l=(new Date).getTime();try{for(var m=$("<div>"+a+"</div"),n=m.find("img"),o=0;o<n.length;++o){var q=n.eq(o),r=q.attr("src");if(-1==r.indexOf(j)){l++;var s="__LEANOTE_IMAGE_"+l;q.attr("id",s),k[r]?k[r].push(s):k[r]=[s]}}d.insertContent(m.html());for(var r in k){var t=k[r];e(r,t)}}catch(i){d.insertContent(a)}}else d.insertContent(a)}}}function g(a){var b=a;a=d.dom.encode(a).replace(/\r\n/g,"\n");var e,g=d.dom.getParent(d.selection.getStart(),d.dom.isBlock),h=d.settings.forced_root_block;h&&(e=d.dom.createHTML(h,d.settings.forced_root_block_attrs),e=e.substr(0,e.length-3)+">"),g&&/^(PRE|DIV)$/.test(g.nodeName)||!h?a=c.filter(a,[[/\n/g,"<br>"]]):(a=c.filter(a,[[/\n\n/g,"</p>"+e],[/^(.*<\/p>)(<p>)$/,e+"$1"],[/\n/g,"<br />"]]),-1!=a.indexOf("<p>")&&(a=e+a)),f(a,b)}function h(){var a=d.dom,b=d.getBody(),c=d.dom.getViewPort(d.getWin()),e=d.inline?b.scrollTop:c.y,f=d.inline?b.clientHeight:c.h;i(),m=a.add(d.getBody(),"div",{id:"mcepastebin",contentEditable:!0,"data-mce-bogus":"1",style:"position: absolute; top: "+(e+20)+"px;width: 10px; height: "+(f-40)+"px; overflow: hidden; opacity: 0"},r),a.setStyle(m,"left","rtl"==a.getStyle(b,"direction",!0)?65535:-65535),a.bind(m,"beforedeactivate focusin focusout",function(a){a.stopPropagation()}),n=d.selection.getRng(),m.focus(),d.selection.select(m,!0)}function i(){m&&(d.dom.unbind(m),d.dom.remove(m),n&&d.selection.setRng(n)),o=!1,m=n=null}function j(){return m?m.innerHTML:r}function k(a){var b={},c=a.clipboardData||d.getDoc().dataTransfer;if(c&&c.types){b["text/plain"]=c.getData("Text");for(var e=0;e<c.types.length;e++){var f=c.types[e];b[f]=c.getData(f)}}return b}function l(){var a=LeaAce.nowIsInAce();return a?(setTimeout(function(){a[0].focus()}),!0):!1}var m,n,o,p=this,q=0,r="%MCEPASTEBIN%";d.on("keydown",function(c){if(!c.isDefaultPrevented()&&(b.metaKeyPressed(c)&&86==c.keyCode||c.shiftKey&&45==c.keyCode)){if(l())return;if(o=c.shiftKey&&86==c.keyCode,c.stopImmediatePropagation(),q=(new Date).getTime(),a.ie&&o)return c.preventDefault(),void d.fire("paste",{ieFake:!0});h()}}),d.on("paste",function(b){if(!l()){var e=k(b),n=(new Date).getTime()-q<100,s="text"==p.pasteFormat||o;n||b.preventDefault(),!a.ie||n&&!b.ieFake||(h(),d.dom.bind(m,"paste",function(a){a.stopPropagation()}),d.getDoc().execCommand("Paste",!1,null),e["text/html"]=j(),i()),setTimeout(function(){var a=j();m&&m.firstChild&&"mcepastebin"===m.firstChild.id&&(s=!0),i(),(a!=r&&n||(a=e["text/html"]||e["text/plain"]||r,a!=r))&&(s?g(e["text/plain"]||c.innerText(a)):f(a,e["text/plain"]))},0);try{}catch(b){}}}),p.pasteHtml=f,p.pasteText=g}}),d("tiLine truncated
|
||||
!function(a,b){"use strict";function c(a,b){for(var c,d=[],f=0;f<a.length;++f){if(c=g[a[f]]||e(a[f]),!c)throw"module definition dependecy not found: "+a[f];d.push(c)}b.apply(null,d)}function d(a,d,e){if("string"!=typeof a)throw"invalid module definition, module id must be defined and be a string";if(d===b)throw"invalid module definition, dependencies must be specified";if(e===b)throw"invalid module definition, definition function must be specified";c(d,function(){g[a]=e.apply(null,arguments)})}function e(b){for(var c=a,d=b.split(/[.\/]/),e=0;e<d.length;++e){if(!c[d[e]])return;c=c[d[e]]}return c}function f(c){for(var d=0;d<c.length;d++){for(var e=a,f=c[d],h=f.split(/[.\/]/),i=0;i<h.length-1;++i)e[h[i]]===b&&(e[h[i]]={}),e=e[h[i]];e[h[h.length-1]]=g[f]}}var g={};d("tinymce/pasteplugin/Utils",["tinymce/util/Tools","tinymce/html/DomParser","tinymce/html/Schema"],function(a,b,c){function d(b,c){return a.each(c,function(a){b=a.constructor==RegExp?b.replace(a,""):b.replace(a[0],a[1])}),b}function e(d){function e(a){var b=a.name,c=a;if("br"===b)return void(h+="\n");if(i[b]&&(h+=" "),j[b])return void(h+=" ");if(3==a.type&&(h+=a.value),!a.shortEnded&&(a=a.firstChild))do e(a);while(a=a.next);k[b]&&c.next&&(h+="\n","p"==b&&(h+="\n"))}var f=new c,g=new b({},f),h="",i=f.getShortEndedElements(),j=a.makeMap("script noscript style textarea video audio iframe object"," "),k=f.getBlockElements();return e(g.parse(d)),h}return{filter:d,innerText:e}}),d("tinymce/pasteplugin/Clipboard",["tinymce/Env","tinymce/util/VK","tinymce/pasteplugin/Utils"],function(a,b,c){return function(d){function e(a,b){ajaxPost("/file/copyHttpImage",{src:a},function(a){if(reIsOk(a)){var c=urlPrefix+"/file/outputImage?fileId="+a.Id,e=d.dom;for(var f in b){var g=b[f],h=e.get(g);e.setAttrib(h,"src",c)}}})}function f(a,b){var c,f=d.dom;if(d.settings.paste_data_images||(a=a.replace(/<img[^>]+src=\"data:image[^>]+>/g,"")),c=d.fire("BeforePastePreProcess",{content:a}),c=d.fire("PastePreProcess",c),a=c.content,!c.isDefaultPrevented()){if(d.hasEventListeners("PastePostProcess")&&!c.isDefaultPrevented()){var g=f.add(d.getBody(),"div",{style:"display:none"},a);c=d.fire("PastePostProcess",{node:g}),f.remove(g),a=c.node.innerHTML}if(!c.isDefaultPrevented()){var h=d.selection.getNode();if("PRE"==h.nodeName){if(!b)try{b=$(a).text()}catch(i){}b=b.replace(/</g,"<"),b=b.replace(/>/g,">"),d.insertRawContent(b)}else if(p.copyImage){var j=UrlPrefix,k={},l=(new Date).getTime();try{for(var m=$("<div>"+a+"</div>"),n=m.find("img"),o=0;o<n.length;++o){var q=n.eq(o),r=q.attr("src");if(-1==r.indexOf(j)){l++;var s="__LEANOTE_IMAGE_"+l;q.attr("id",s),k[r]?k[r].push(s):k[r]=[s]}}d.insertContent(m.html());for(var r in k){var t=k[r];e(r,t)}}catch(i){d.insertContent(a)}}else d.insertContent(a)}}}function g(a){var b=a;a=d.dom.encode(a).replace(/\r\n/g,"\n");var e,g=d.dom.getParent(d.selection.getStart(),d.dom.isBlock),h=d.settings.forced_root_block;h&&(e=d.dom.createHTML(h,d.settings.forced_root_block_attrs),e=e.substr(0,e.length-3)+">"),g&&/^(PRE|DIV)$/.test(g.nodeName)||!h?a=c.filter(a,[[/\n/g,"<br>"]]):(a=c.filter(a,[[/\n\n/g,"</p>"+e],[/^(.*<\/p>)(<p>)$/,e+"$1"],[/\n/g,"<br />"]]),-1!=a.indexOf("<p>")&&(a=e+a)),f(a,b)}function h(){var a=d.dom,b=d.getBody(),c=d.dom.getViewPort(d.getWin()),e=d.inline?b.scrollTop:c.y,f=d.inline?b.clientHeight:c.h;i(),m=a.add(d.getBody(),"div",{id:"mcepastebin",contentEditable:!0,"data-mce-bogus":"1",style:"position: absolute; top: "+(e+20)+"px;width: 10px; height: "+(f-40)+"px; overflow: hidden; opacity: 0"},r),a.setStyle(m,"left","rtl"==a.getStyle(b,"direction",!0)?65535:-65535),a.bind(m,"beforedeactivate focusin focusout",function(a){a.stopPropagation()}),n=d.selection.getRng(),m.focus(),d.selection.select(m,!0)}function i(){m&&(d.dom.unbind(m),d.dom.remove(m),n&&d.selection.setRng(n)),o=!1,m=n=null}function j(){return m?m.innerHTML:r}function k(a){var b={},c=a.clipboardData||d.getDoc().dataTransfer;if(c&&c.types){b["text/plain"]=c.getData("Text");for(var e=0;e<c.types.length;e++){var f=c.types[e];b[f]=c.getData(f)}}return b}function l(){var a=LeaAce.nowIsInAce();return a?(setTimeout(function(){a[0].focus()}),!0):!1}var m,n,o,p=this,q=0,r="%MCEPASTEBIN%";d.on("keydown",function(c){if(!c.isDefaultPrevented()&&(b.metaKeyPressed(c)&&86==c.keyCode||c.shiftKey&&45==c.keyCode)){if(l())return;if(o=c.shiftKey&&86==c.keyCode,c.stopImmediatePropagation(),q=(new Date).getTime(),a.ie&&o)return c.preventDefault(),void d.fire("paste",{ieFake:!0});h()}}),d.on("paste",function(b){if(!l()){var e=k(b),n=(new Date).getTime()-q<100,s="text"==p.pasteFormat||o;n||b.preventDefault(),!a.ie||n&&!b.ieFake||(h(),d.dom.bind(m,"paste",function(a){a.stopPropagation()}),d.getDoc().execCommand("Paste",!1,null),e["text/html"]=j(),i()),setTimeout(function(){var a=j();m&&m.firstChild&&"mcepastebin"===m.firstChild.id&&(s=!0),i(),(a!=r&&n||(a=e["text/html"]||e["text/plain"]||r,a!=r))&&(s?g(e["text/plain"]||c.innerText(a)):f(a,e["text/plain"]))},0);try{}catch(b){}}}),p.pasteHtml=fLine truncated
|
||||
@@ -1,611 +0,0 @@
|
||||
/**
|
||||
* Clipboard.js
|
||||
*
|
||||
* Copyright, Moxiecode Systems AB
|
||||
* Released under LGPL License.
|
||||
*
|
||||
* License: http://www.tinymce.com/license
|
||||
* Contributing: http://www.tinymce.com/contributing
|
||||
*/
|
||||
|
||||
/**
|
||||
* This class contains logic for getting HTML contents out of the clipboard.
|
||||
*
|
||||
* We need to make a lot of ugly hacks to get the contents out of the clipboard since
|
||||
* the W3C Clipboard API is broken in all browsers that have it: Gecko/WebKit/Blink.
|
||||
* We might rewrite this the way those API:s stabilize. Browsers doesn't handle pasting
|
||||
* from applications like Word the same way as it does when pasting into a contentEditable area
|
||||
* so we need to do lots of extra work to try to get to this clipboard data.
|
||||
*
|
||||
* Current implementation steps:
|
||||
* 1. On keydown with paste keys Ctrl+V or Shift+Insert create
|
||||
* a paste bin element and move focus to that element.
|
||||
* 2. Wait for the browser to fire a "paste" event and get the contents out of the paste bin.
|
||||
* 3. Check if the paste was successful if true, process the HTML.
|
||||
* (4). If the paste was unsuccessful use IE execCommand, Clipboard API, document.dataTransfer old WebKit API etc.
|
||||
*
|
||||
* @class tinymce.pasteplugin.Clipboard
|
||||
* @private
|
||||
*/
|
||||
define("tinymce/pasteplugin/Clipboard", [
|
||||
"tinymce/Env",
|
||||
"tinymce/dom/RangeUtils",
|
||||
"tinymce/util/VK",
|
||||
"tinymce/pasteplugin/Utils"
|
||||
], function(Env, RangeUtils, VK, Utils) {
|
||||
return function(editor) {
|
||||
var self = this, pasteBinElm, lastRng, keyboardPasteTimeStamp = 0, draggingInternally = false;
|
||||
var pasteBinDefaultContent = '%MCEPASTEBIN%', keyboardPastePlainTextState;
|
||||
var mceInternalUrlPrefix = 'data:text/mce-internal,';
|
||||
|
||||
/**
|
||||
* Pastes the specified HTML. This means that the HTML is filtered and then
|
||||
* inserted at the current selection in the editor. It will also fire paste events
|
||||
* for custom user filtering.
|
||||
*
|
||||
* @param {String} html HTML code to paste into the current selection.
|
||||
*/
|
||||
function pasteHtml(html) {
|
||||
var args, dom = editor.dom;
|
||||
|
||||
args = editor.fire('BeforePastePreProcess', {content: html}); // Internal event used by Quirks
|
||||
args = editor.fire('PastePreProcess', args);
|
||||
html = args.content;
|
||||
|
||||
if (!args.isDefaultPrevented()) {
|
||||
// User has bound PastePostProcess events then we need to pass it through a DOM node
|
||||
// This is not ideal but we don't want to let the browser mess up the HTML for example
|
||||
// some browsers add to P tags etc
|
||||
if (editor.hasEventListeners('PastePostProcess') && !args.isDefaultPrevented()) {
|
||||
// We need to attach the element to the DOM so Sizzle selectors work on the contents
|
||||
var tempBody = dom.add(editor.getBody(), 'div', {style: 'display:none'}, html);
|
||||
args = editor.fire('PastePostProcess', {node: tempBody});
|
||||
dom.remove(tempBody);
|
||||
html = args.node.innerHTML;
|
||||
}
|
||||
|
||||
if (!args.isDefaultPrevented()) {
|
||||
editor.insertContent(html, {merge: editor.settings.paste_merge_formats !== false});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Pastes the specified text. This means that the plain text is processed
|
||||
* and converted into BR and P elements. It will fire paste events for custom filtering.
|
||||
*
|
||||
* @param {String} text Text to paste as the current selection location.
|
||||
*/
|
||||
function pasteText(text) {
|
||||
text = editor.dom.encode(text).replace(/\r\n/g, '\n');
|
||||
|
||||
var startBlock = editor.dom.getParent(editor.selection.getStart(), editor.dom.isBlock);
|
||||
|
||||
// Create start block html for example <p attr="value">
|
||||
var forcedRootBlockName = editor.settings.forced_root_block;
|
||||
var forcedRootBlockStartHtml;
|
||||
if (forcedRootBlockName) {
|
||||
forcedRootBlockStartHtml = editor.dom.createHTML(forcedRootBlockName, editor.settings.forced_root_block_attrs);
|
||||
forcedRootBlockStartHtml = forcedRootBlockStartHtml.substr(0, forcedRootBlockStartHtml.length - 3) + '>';
|
||||
}
|
||||
|
||||
if ((startBlock && /^(PRE|DIV)$/.test(startBlock.nodeName)) || !forcedRootBlockName) {
|
||||
text = Utils.filter(text, [
|
||||
[/\n/g, "<br>"]
|
||||
]);
|
||||
} else {
|
||||
text = Utils.filter(text, [
|
||||
[/\n\n/g, "</p>" + forcedRootBlockStartHtml],
|
||||
[/^(.*<\/p>)(<p>)$/, forcedRootBlockStartHtml + '$1'],
|
||||
[/\n/g, "<br />"]
|
||||
]);
|
||||
|
||||
if (text.indexOf('<p>') != -1) {
|
||||
text = forcedRootBlockStartHtml + text;
|
||||
}
|
||||
}
|
||||
|
||||
pasteHtml(text);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a paste bin element as close as possible to the current caret location and places the focus inside that element
|
||||
* so that when the real paste event occurs the contents gets inserted into this element
|
||||
* instead of the current editor selection element.
|
||||
*/
|
||||
function createPasteBin() {
|
||||
var dom = editor.dom, body = editor.getBody();
|
||||
var viewport = editor.dom.getViewPort(editor.getWin()), scrollTop = viewport.y, top = 20;
|
||||
var scrollContainer;
|
||||
|
||||
lastRng = editor.selection.getRng();
|
||||
|
||||
if (editor.inline) {
|
||||
scrollContainer = editor.selection.getScrollContainer();
|
||||
|
||||
// Can't always rely on scrollTop returning a useful value.
|
||||
// It returns 0 if the browser doesn't support scrollTop for the element or is non-scrollable
|
||||
if (scrollContainer && scrollContainer.scrollTop > 0) {
|
||||
scrollTop = scrollContainer.scrollTop;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the rect of the current caret if the caret is in an empty block before a
|
||||
* BR we insert a temporary invisible character that we get the rect this way we always get a proper rect.
|
||||
*
|
||||
* TODO: This might be useful in core.
|
||||
*/
|
||||
function getCaretRect(rng) {
|
||||
var rects, textNode, node, container = rng.startContainer;
|
||||
|
||||
rects = rng.getClientRects();
|
||||
if (rects.length) {
|
||||
return rects[0];
|
||||
}
|
||||
|
||||
if (!rng.collapsed || container.nodeType != 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
node = container.childNodes[lastRng.startOffset];
|
||||
|
||||
// Skip empty whitespace nodes
|
||||
while (node && node.nodeType == 3 && !node.data.length) {
|
||||
node = node.nextSibling;
|
||||
}
|
||||
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if the location is |<br>
|
||||
// TODO: Might need to expand this to say |<table>
|
||||
if (node.tagName == 'BR') {
|
||||
textNode = dom.doc.createTextNode('\uFEFF');
|
||||
node.parentNode.insertBefore(textNode, node);
|
||||
|
||||
rng = dom.createRng();
|
||||
rng.setStartBefore(textNode);
|
||||
rng.setEndAfter(textNode);
|
||||
|
||||
rects = rng.getClientRects();
|
||||
dom.remove(textNode);
|
||||
}
|
||||
|
||||
if (rects.length) {
|
||||
return rects[0];
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate top cordinate this is needed to avoid scrolling to top of document
|
||||
// We want the paste bin to be as close to the caret as possible to avoid scrolling
|
||||
if (lastRng.getClientRects) {
|
||||
var rect = getCaretRect(lastRng);
|
||||
|
||||
if (rect) {
|
||||
// Client rects gets us closes to the actual
|
||||
// caret location in for example a wrapped paragraph block
|
||||
top = scrollTop + (rect.top - dom.getPos(body).y);
|
||||
} else {
|
||||
top = scrollTop;
|
||||
|
||||
// Check if we can find a closer location by checking the range element
|
||||
var container = lastRng.startContainer;
|
||||
if (container) {
|
||||
if (container.nodeType == 3 && container.parentNode != body) {
|
||||
container = container.parentNode;
|
||||
}
|
||||
|
||||
if (container.nodeType == 1) {
|
||||
top = dom.getPos(container, scrollContainer || body).y;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Create a pastebin
|
||||
pasteBinElm = dom.add(editor.getBody(), 'div', {
|
||||
id: "mcepastebin",
|
||||
contentEditable: true,
|
||||
"data-mce-bogus": "all",
|
||||
style: 'position: absolute; top: ' + top + 'px;' +
|
||||
'width: 10px; height: 10px; overflow: hidden; opacity: 0'
|
||||
}, pasteBinDefaultContent);
|
||||
|
||||
// Move paste bin out of sight since the controlSelection rect gets displayed otherwise on IE and Gecko
|
||||
if (Env.ie || Env.gecko) {
|
||||
dom.setStyle(pasteBinElm, 'left', dom.getStyle(body, 'direction', true) == 'rtl' ? 0xFFFF : -0xFFFF);
|
||||
}
|
||||
|
||||
// Prevent focus events from bubbeling fixed FocusManager issues
|
||||
dom.bind(pasteBinElm, 'beforedeactivate focusin focusout', function(e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
pasteBinElm.focus();
|
||||
editor.selection.select(pasteBinElm, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the paste bin if it exists.
|
||||
*/
|
||||
function removePasteBin() {
|
||||
if (pasteBinElm) {
|
||||
var pasteBinClone;
|
||||
|
||||
// WebKit/Blink might clone the div so
|
||||
// lets make sure we remove all clones
|
||||
// TODO: Man o man is this ugly. WebKit is the new IE! Remove this if they ever fix it!
|
||||
while ((pasteBinClone = editor.dom.get('mcepastebin'))) {
|
||||
editor.dom.remove(pasteBinClone);
|
||||
editor.dom.unbind(pasteBinClone);
|
||||
}
|
||||
|
||||
if (lastRng) {
|
||||
editor.selection.setRng(lastRng);
|
||||
}
|
||||
}
|
||||
|
||||
pasteBinElm = lastRng = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the contents of the paste bin as a HTML string.
|
||||
*
|
||||
* @return {String} Get the contents of the paste bin.
|
||||
*/
|
||||
function getPasteBinHtml() {
|
||||
var html = '', pasteBinClones, i, clone, cloneHtml;
|
||||
|
||||
// Since WebKit/Chrome might clone the paste bin when pasting
|
||||
// for example: <img style="float: right"> we need to check if any of them contains some useful html.
|
||||
// TODO: Man o man is this ugly. WebKit is the new IE! Remove this if they ever fix it!
|
||||
pasteBinClones = editor.dom.select('div[id=mcepastebin]');
|
||||
for (i = 0; i < pasteBinClones.length; i++) {
|
||||
clone = pasteBinClones[i];
|
||||
|
||||
// Pasting plain text produces pastebins in pastebinds makes sence right!?
|
||||
if (clone.firstChild && clone.firstChild.id == 'mcepastebin') {
|
||||
clone = clone.firstChild;
|
||||
}
|
||||
|
||||
cloneHtml = clone.innerHTML;
|
||||
if (html != pasteBinDefaultContent) {
|
||||
html += cloneHtml;
|
||||
}
|
||||
}
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets various content types out of a datatransfer object.
|
||||
*
|
||||
* @param {DataTransfer} dataTransfer Event fired on paste.
|
||||
* @return {Object} Object with mime types and data for those mime types.
|
||||
*/
|
||||
function getDataTransferItems(dataTransfer) {
|
||||
var data = {};
|
||||
|
||||
if (dataTransfer) {
|
||||
// Use old WebKit/IE API
|
||||
if (dataTransfer.getData) {
|
||||
var legacyText = dataTransfer.getData('Text');
|
||||
if (legacyText && legacyText.length > 0) {
|
||||
if (legacyText.indexOf(mceInternalUrlPrefix) == -1) {
|
||||
data['text/plain'] = legacyText;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (dataTransfer.types) {
|
||||
for (var i = 0; i < dataTransfer.types.length; i++) {
|
||||
var contentType = dataTransfer.types[i];
|
||||
data[contentType] = dataTransfer.getData(contentType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets various content types out of the Clipboard API. It will also get the
|
||||
* plain text using older IE and WebKit API:s.
|
||||
*
|
||||
* @param {ClipboardEvent} clipboardEvent Event fired on paste.
|
||||
* @return {Object} Object with mime types and data for those mime types.
|
||||
*/
|
||||
function getClipboardContent(clipboardEvent) {
|
||||
return getDataTransferItems(clipboardEvent.clipboardData || editor.getDoc().dataTransfer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the clipboard contains image data if it does it will take that data
|
||||
* and convert it into a data url image and paste that image at the caret location.
|
||||
*
|
||||
* @param {ClipboardEvent} e Paste/drop event object.
|
||||
* @param {DOMRange} rng Optional rng object to move selection to.
|
||||
* @return {Boolean} true/false if the image data was found or not.
|
||||
*/
|
||||
function pasteImageData(e, rng) {
|
||||
var dataTransfer = e.clipboardData || e.dataTransfer;
|
||||
|
||||
function processItems(items) {
|
||||
var i, item, reader, hadImage = false;
|
||||
|
||||
function pasteImage(reader) {
|
||||
if (rng) {
|
||||
editor.selection.setRng(rng);
|
||||
rng = null;
|
||||
}
|
||||
|
||||
pasteHtml('<img src="' + reader.result + '">');
|
||||
}
|
||||
|
||||
if (items) {
|
||||
for (i = 0; i < items.length; i++) {
|
||||
item = items[i];
|
||||
|
||||
if (/^image\/(jpeg|png|gif|bmp)$/.test(item.type)) {
|
||||
reader = new FileReader();
|
||||
reader.onload = pasteImage.bind(null, reader);
|
||||
reader.readAsDataURL(item.getAsFile ? item.getAsFile() : item);
|
||||
|
||||
e.preventDefault();
|
||||
hadImage = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return hadImage;
|
||||
}
|
||||
|
||||
if (editor.settings.paste_data_images && dataTransfer) {
|
||||
return processItems(dataTransfer.items) || processItems(dataTransfer.files);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Chrome on Android doesn't support proper clipboard access so we have no choice but to allow the browser default behavior.
|
||||
*
|
||||
* @param {Event} e Paste event object to check if it contains any data.
|
||||
* @return {Boolean} true/false if the clipboard is empty or not.
|
||||
*/
|
||||
function isBrokenAndroidClipboardEvent(e) {
|
||||
var clipboardData = e.clipboardData;
|
||||
|
||||
return navigator.userAgent.indexOf('Android') != -1 && clipboardData && clipboardData.items && clipboardData.items.length === 0;
|
||||
}
|
||||
|
||||
function getCaretRangeFromEvent(e) {
|
||||
return RangeUtils.getCaretRangeFromPoint(e.clientX, e.clientY, editor.getDoc());
|
||||
}
|
||||
|
||||
function hasContentType(clipboardContent, mimeType) {
|
||||
return mimeType in clipboardContent && clipboardContent[mimeType].length > 0;
|
||||
}
|
||||
|
||||
function isKeyboardPasteEvent(e) {
|
||||
return (VK.metaKeyPressed(e) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45);
|
||||
}
|
||||
|
||||
function registerEventHandlers() {
|
||||
editor.on('keydown', function(e) {
|
||||
function removePasteBinOnKeyUp(e) {
|
||||
// Ctrl+V or Shift+Insert
|
||||
if (isKeyboardPasteEvent(e) && !e.isDefaultPrevented()) {
|
||||
removePasteBin();
|
||||
}
|
||||
}
|
||||
|
||||
// Ctrl+V or Shift+Insert
|
||||
if (isKeyboardPasteEvent(e) && !e.isDefaultPrevented()) {
|
||||
keyboardPastePlainTextState = e.shiftKey && e.keyCode == 86;
|
||||
|
||||
// Edge case on Safari on Mac where it doesn't handle Cmd+Shift+V correctly
|
||||
// it fires the keydown but no paste or keyup so we are left with a paste bin
|
||||
if (keyboardPastePlainTextState && Env.webkit && navigator.userAgent.indexOf('Version/') != -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Prevent undoManager keydown handler from making an undo level with the pastebin in it
|
||||
e.stopImmediatePropagation();
|
||||
|
||||
keyboardPasteTimeStamp = new Date().getTime();
|
||||
|
||||
// IE doesn't support Ctrl+Shift+V and it doesn't even produce a paste event
|
||||
// so lets fake a paste event and let IE use the execCommand/dataTransfer methods
|
||||
if (Env.ie && keyboardPastePlainTextState) {
|
||||
e.preventDefault();
|
||||
editor.fire('paste', {ieFake: true});
|
||||
return;
|
||||
}
|
||||
|
||||
removePasteBin();
|
||||
createPasteBin();
|
||||
|
||||
// Remove pastebin if we get a keyup and no paste event
|
||||
// For example pasting a file in IE 11 will not produce a paste event
|
||||
editor.once('keyup', removePasteBinOnKeyUp);
|
||||
editor.once('paste', function() {
|
||||
editor.off('keyup', removePasteBinOnKeyUp);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
editor.on('paste', function(e) {
|
||||
// Getting content from the Clipboard can take some time
|
||||
var clipboardTimer = new Date().getTime();
|
||||
var clipboardContent = getClipboardContent(e);
|
||||
var clipboardDelay = new Date().getTime() - clipboardTimer;
|
||||
|
||||
var isKeyBoardPaste = (new Date().getTime() - keyboardPasteTimeStamp - clipboardDelay) < 1000;
|
||||
var plainTextMode = self.pasteFormat == "text" || keyboardPastePlainTextState;
|
||||
|
||||
keyboardPastePlainTextState = false;
|
||||
|
||||
if (e.isDefaultPrevented() || isBrokenAndroidClipboardEvent(e)) {
|
||||
removePasteBin();
|
||||
return;
|
||||
}
|
||||
|
||||
if (pasteImageData(e)) {
|
||||
removePasteBin();
|
||||
return;
|
||||
}
|
||||
|
||||
// Not a keyboard paste prevent default paste and try to grab the clipboard contents using different APIs
|
||||
if (!isKeyBoardPaste) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
// Try IE only method if paste isn't a keyboard paste
|
||||
if (Env.ie && (!isKeyBoardPaste || e.ieFake)) {
|
||||
createPasteBin();
|
||||
|
||||
editor.dom.bind(pasteBinElm, 'paste', function(e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
editor.getDoc().execCommand('Paste', false, null);
|
||||
clipboardContent["text/html"] = getPasteBinHtml();
|
||||
}
|
||||
|
||||
setTimeout(function() {
|
||||
var content;
|
||||
|
||||
// Grab HTML from Clipboard API or paste bin as a fallback
|
||||
if (hasContentType(clipboardContent, 'text/html')) {
|
||||
content = clipboardContent['text/html'];
|
||||
} else {
|
||||
content = getPasteBinHtml();
|
||||
|
||||
// If paste bin is empty try using plain text mode
|
||||
// since that is better than nothing right
|
||||
if (content == pasteBinDefaultContent) {
|
||||
plainTextMode = true;
|
||||
}
|
||||
}
|
||||
|
||||
content = Utils.trimHtml(content);
|
||||
|
||||
// WebKit has a nice bug where it clones the paste bin if you paste from for example notepad
|
||||
// so we need to force plain text mode in this case
|
||||
if (pasteBinElm && pasteBinElm.firstChild && pasteBinElm.firstChild.id === 'mcepastebin') {
|
||||
plainTextMode = true;
|
||||
}
|
||||
|
||||
removePasteBin();
|
||||
|
||||
// If we got nothing from clipboard API and pastebin then we could try the last resort: plain/text
|
||||
if (!content.length) {
|
||||
plainTextMode = true;
|
||||
}
|
||||
|
||||
// Grab plain text from Clipboard API or convert existing HTML to plain text
|
||||
if (plainTextMode) {
|
||||
// Use plain text contents from Clipboard API unless the HTML contains paragraphs then
|
||||
// we should convert the HTML to plain text since works better when pasting HTML/Word contents as plain text
|
||||
if (hasContentType(clipboardContent, 'text/plain') && content.indexOf('</p>') == -1) {
|
||||
content = clipboardContent['text/plain'];
|
||||
} else {
|
||||
content = Utils.innerText(content);
|
||||
}
|
||||
}
|
||||
|
||||
// If the content is the paste bin default HTML then it was
|
||||
// impossible to get the cliboard data out.
|
||||
if (content == pasteBinDefaultContent) {
|
||||
if (!isKeyBoardPaste) {
|
||||
editor.windowManager.alert('Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.');
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (plainTextMode) {
|
||||
pasteText(content);
|
||||
} else {
|
||||
pasteHtml(content);
|
||||
}
|
||||
}, 0);
|
||||
});
|
||||
|
||||
editor.on('dragstart dragend', function(e) {
|
||||
draggingInternally = e.type == 'dragstart';
|
||||
});
|
||||
|
||||
editor.on('drop', function(e) {
|
||||
var rng = getCaretRangeFromEvent(e);
|
||||
|
||||
if (e.isDefaultPrevented() || draggingInternally) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (pasteImageData(e, rng)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (rng && editor.settings.paste_filter_drop !== false) {
|
||||
var dropContent = getDataTransferItems(e.dataTransfer);
|
||||
var content = dropContent['mce-internal'] || dropContent['text/html'] || dropContent['text/plain'];
|
||||
|
||||
if (content) {
|
||||
e.preventDefault();
|
||||
|
||||
editor.undoManager.transact(function() {
|
||||
if (dropContent['mce-internal']) {
|
||||
editor.execCommand('Delete');
|
||||
}
|
||||
|
||||
editor.selection.setRng(rng);
|
||||
|
||||
content = Utils.trimHtml(content);
|
||||
|
||||
if (!dropContent['text/html']) {
|
||||
pasteText(content);
|
||||
} else {
|
||||
pasteHtml(content);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
editor.on('dragover dragend', function(e) {
|
||||
if (editor.settings.paste_data_images) {
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
self.pasteHtml = pasteHtml;
|
||||
self.pasteText = pasteText;
|
||||
|
||||
editor.on('preInit', function() {
|
||||
registerEventHandlers();
|
||||
|
||||
// Remove all data images from paste for example from Gecko
|
||||
// except internal images like video elements
|
||||
editor.parser.addNodeFilter('img', function(nodes) {
|
||||
if (!editor.settings.paste_data_images) {
|
||||
var i = nodes.length;
|
||||
|
||||
while (i--) {
|
||||
var src = nodes[i].attributes.map.src;
|
||||
|
||||
// Some browsers automatically produce data uris on paste
|
||||
// Safari on Mac produces webkit-fake-url see: https://bugs.webkit.org/show_bug.cgi?id=49141
|
||||
if (src && /^(data:image|webkit\-fake\-url)/.test(src)) {
|
||||
if (!nodes[i].attr('data-mce-object') && src !== Env.transparentSrc) {
|
||||
nodes[i].remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
});
|
||||
@@ -1,110 +0,0 @@
|
||||
/**
|
||||
* Plugin.js
|
||||
*
|
||||
* Copyright, Moxiecode Systems AB
|
||||
* Released under LGPL License.
|
||||
*
|
||||
* License: http://www.tinymce.com/license
|
||||
* Contributing: http://www.tinymce.com/contributing
|
||||
*/
|
||||
|
||||
/**
|
||||
* This class contains the tinymce plugin logic for the paste plugin.
|
||||
*
|
||||
* @class tinymce.pasteplugin.Plugin
|
||||
* @private
|
||||
*/
|
||||
define("tinymce/pasteplugin/Plugin", [
|
||||
"tinymce/PluginManager",
|
||||
"tinymce/pasteplugin/Clipboard",
|
||||
"tinymce/pasteplugin/WordFilter",
|
||||
"tinymce/pasteplugin/Quirks"
|
||||
], function(PluginManager, Clipboard, WordFilter, Quirks) {
|
||||
var userIsInformed;
|
||||
|
||||
PluginManager.add('paste', function(editor) {
|
||||
var self = this, clipboard, settings = editor.settings;
|
||||
|
||||
function togglePlainTextPaste() {
|
||||
if (clipboard.pasteFormat == "text") {
|
||||
this.active(false);
|
||||
clipboard.pasteFormat = "html";
|
||||
} else {
|
||||
clipboard.pasteFormat = "text";
|
||||
this.active(true);
|
||||
|
||||
if (!userIsInformed) {
|
||||
editor.windowManager.alert(
|
||||
'Paste is now in plain text mode. Contents will now ' +
|
||||
'be pasted as plain text until you toggle this option off.'
|
||||
);
|
||||
|
||||
userIsInformed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.clipboard = clipboard = new Clipboard(editor);
|
||||
self.quirks = new Quirks(editor);
|
||||
self.wordFilter = new WordFilter(editor);
|
||||
|
||||
if (editor.settings.paste_as_text) {
|
||||
self.clipboard.pasteFormat = "text";
|
||||
}
|
||||
|
||||
if (settings.paste_preprocess) {
|
||||
editor.on('PastePreProcess', function(e) {
|
||||
settings.paste_preprocess.call(self, self, e);
|
||||
});
|
||||
}
|
||||
|
||||
if (settings.paste_postprocess) {
|
||||
editor.on('PastePostProcess', function(e) {
|
||||
settings.paste_postprocess.call(self, self, e);
|
||||
});
|
||||
}
|
||||
|
||||
editor.addCommand('mceInsertClipboardContent', function(ui, value) {
|
||||
if (value.content) {
|
||||
self.clipboard.pasteHtml(value.content);
|
||||
}
|
||||
|
||||
if (value.text) {
|
||||
self.clipboard.pasteText(value.text);
|
||||
}
|
||||
});
|
||||
|
||||
// Block all drag/drop events
|
||||
if (editor.paste_block_drop) {
|
||||
editor.on('dragend dragover draggesture dragdrop drop drag', function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
});
|
||||
}
|
||||
|
||||
// Prevent users from dropping data images on Gecko
|
||||
if (!editor.settings.paste_data_images) {
|
||||
editor.on('drop', function(e) {
|
||||
var dataTransfer = e.dataTransfer;
|
||||
|
||||
if (dataTransfer && dataTransfer.files && dataTransfer.files.length > 0) {
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
editor.addButton('pastetext', {
|
||||
icon: 'pastetext',
|
||||
tooltip: 'Paste as text',
|
||||
onclick: togglePlainTextPaste,
|
||||
active: self.clipboard.pasteFormat == "text"
|
||||
});
|
||||
|
||||
editor.addMenuItem('pastetext', {
|
||||
text: 'Paste as text',
|
||||
selectable: true,
|
||||
active: clipboard.pasteFormat,
|
||||
onclick: togglePlainTextPaste
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,159 +0,0 @@
|
||||
/**
|
||||
* Quirks.js
|
||||
*
|
||||
* Copyright, Moxiecode Systems AB
|
||||
* Released under LGPL License.
|
||||
*
|
||||
* License: http://www.tinymce.com/license
|
||||
* Contributing: http://www.tinymce.com/contributing
|
||||
*/
|
||||
|
||||
/**
|
||||
* This class contains various fixes for browsers. These issues can not be feature
|
||||
* detected since we have no direct control over the clipboard. However we might be able
|
||||
* to remove some of these fixes once the browsers gets updated/fixed.
|
||||
*
|
||||
* @class tinymce.pasteplugin.Quirks
|
||||
* @private
|
||||
*/
|
||||
define("tinymce/pasteplugin/Quirks", [
|
||||
"tinymce/Env",
|
||||
"tinymce/util/Tools",
|
||||
"tinymce/pasteplugin/WordFilter",
|
||||
"tinymce/pasteplugin/Utils"
|
||||
], function(Env, Tools, WordFilter, Utils) {
|
||||
"use strict";
|
||||
|
||||
return function(editor) {
|
||||
function addPreProcessFilter(filterFunc) {
|
||||
editor.on('BeforePastePreProcess', function(e) {
|
||||
e.content = filterFunc(e.content);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes BR elements after block elements. IE9 has a nasty bug where it puts a BR element after each
|
||||
* block element when pasting from word. This removes those elements.
|
||||
*
|
||||
* This:
|
||||
* <p>a</p><br><p>b</p>
|
||||
*
|
||||
* Becomes:
|
||||
* <p>a</p><p>b</p>
|
||||
*/
|
||||
function removeExplorerBrElementsAfterBlocks(html) {
|
||||
// Only filter word specific content
|
||||
if (!WordFilter.isWordContent(html)) {
|
||||
return html;
|
||||
}
|
||||
|
||||
// Produce block regexp based on the block elements in schema
|
||||
var blockElements = [];
|
||||
|
||||
Tools.each(editor.schema.getBlockElements(), function(block, blockName) {
|
||||
blockElements.push(blockName);
|
||||
});
|
||||
|
||||
var explorerBlocksRegExp = new RegExp(
|
||||
'(?:<br> [\\s\\r\\n]+|<br>)*(<\\/?(' + blockElements.join('|') + ')[^>]*>)(?:<br> [\\s\\r\\n]+|<br>)*',
|
||||
'g'
|
||||
);
|
||||
|
||||
// Remove BR:s from: <BLOCK>X</BLOCK><BR>
|
||||
html = Utils.filter(html, [
|
||||
[explorerBlocksRegExp, '$1']
|
||||
]);
|
||||
|
||||
// IE9 also adds an extra BR element for each soft-linefeed and it also adds a BR for each word wrap break
|
||||
html = Utils.filter(html, [
|
||||
[/<br><br>/g, '<BR><BR>'], // Replace multiple BR elements with uppercase BR to keep them intact
|
||||
[/<br>/g, ' '], // Replace single br elements with space since they are word wrap BR:s
|
||||
[/<BR><BR>/g, '<br>'] // Replace back the double brs but into a single BR
|
||||
]);
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
/**
|
||||
* WebKit has a nasty bug where the all computed styles gets added to style attributes when copy/pasting contents.
|
||||
* This fix solves that by simply removing the whole style attribute.
|
||||
*
|
||||
* The paste_webkit_styles option can be set to specify what to keep:
|
||||
* paste_webkit_styles: "none" // Keep no styles
|
||||
* paste_webkit_styles: "all", // Keep all of them
|
||||
* paste_webkit_styles: "font-weight color" // Keep specific ones
|
||||
*
|
||||
* @param {String} content Content that needs to be processed.
|
||||
* @return {String} Processed contents.
|
||||
*/
|
||||
function removeWebKitStyles(content) {
|
||||
// Passthrough all styles from Word and let the WordFilter handle that junk
|
||||
if (WordFilter.isWordContent(content)) {
|
||||
return content;
|
||||
}
|
||||
|
||||
// Filter away styles that isn't matching the target node
|
||||
var webKitStyles = editor.settings.paste_webkit_styles;
|
||||
|
||||
if (editor.settings.paste_remove_styles_if_webkit === false || webKitStyles == "all") {
|
||||
return content;
|
||||
}
|
||||
|
||||
if (webKitStyles) {
|
||||
webKitStyles = webKitStyles.split(/[, ]/);
|
||||
}
|
||||
|
||||
// Keep specific styles that doesn't match the current node computed style
|
||||
if (webKitStyles) {
|
||||
var dom = editor.dom, node = editor.selection.getNode();
|
||||
|
||||
content = content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, function(all, before, value, after) {
|
||||
var inputStyles = dom.parseStyle(value, 'span'), outputStyles = {};
|
||||
|
||||
if (webKitStyles === "none") {
|
||||
return before + after;
|
||||
}
|
||||
|
||||
for (var i = 0; i < webKitStyles.length; i++) {
|
||||
var inputValue = inputStyles[webKitStyles[i]], currentValue = dom.getStyle(node, webKitStyles[i], true);
|
||||
|
||||
if (/color/.test(webKitStyles[i])) {
|
||||
inputValue = dom.toHex(inputValue);
|
||||
currentValue = dom.toHex(currentValue);
|
||||
}
|
||||
|
||||
if (currentValue != inputValue) {
|
||||
outputStyles[webKitStyles[i]] = inputValue;
|
||||
}
|
||||
}
|
||||
|
||||
outputStyles = dom.serializeStyle(outputStyles, 'span');
|
||||
if (outputStyles) {
|
||||
return before + ' style="' + outputStyles + '"' + after;
|
||||
}
|
||||
|
||||
return before + after;
|
||||
});
|
||||
} else {
|
||||
// Remove all external styles
|
||||
content = content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, '$1$3');
|
||||
}
|
||||
|
||||
// Keep internal styles
|
||||
content = content.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi, function(all, before, value, after) {
|
||||
return before + ' style="' + value + '"' + after;
|
||||
});
|
||||
|
||||
return content;
|
||||
}
|
||||
|
||||
// Sniff browsers and apply fixes since we can't feature detect
|
||||
if (Env.webkit) {
|
||||
addPreProcessFilter(removeWebKitStyles);
|
||||
}
|
||||
|
||||
if (Env.ie) {
|
||||
addPreProcessFilter(removeExplorerBrElementsAfterBlocks);
|
||||
}
|
||||
};
|
||||
});
|
||||
Loaded 100 of 107 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user