This commit is contained in:
lealife
2015-11-28 15:56:25 +08:00
parent f834f469fc
commit 926882dce6
7 changed files with 132 additions and 18 deletions

View File

@ -144,7 +144,7 @@ function log(o) {
<li role="presentation" id="setTheme">
<a>
<i class="fa fa-sun-o"></i>
{{msg . "themeSetting"}}
{{leaMsg . "Theme"}}
</a>
</li>
@ -187,7 +187,7 @@ function log(o) {
</div>
<div class="pull-right top-nav writting-hide lea-blog">
<a target="_blank" href="http://lea.leanote.com">
lea++
Lea++
</a>
</div>
@ -573,9 +573,7 @@ function log(o) {
</form>
<!-- 由此可以算高度 -->
<div id="editorContent" name="editorContent" tabindex="2" />
{{.noteContent}}
</div>
<div id="editorContent" name="editorContent" tabindex="2" /></div>
</div>
<div id="mdEditor" class="read-only">
@ -589,7 +587,7 @@ function log(o) {
<span class="lang">{{msg . "updated"}}</span>: <span class="updated-time"></span>
</div>
<div class="wmd-button-bar-inner">
<div class="wmd-button-bar-inner clearfix">
<ul class="nav left-buttons">
<li class="wmd-button-group1 btn-group"></li>
</ul>
@ -634,6 +632,8 @@ function log(o) {
<div class="layout-wrapper-l3">
<div id="left-column">
<pre id="wmd-input" class="form-control"><div class="editor-content mousetrap" contenteditable=true></div><div class="editor-margin"></div></pre>
<!-- v2 markdown lightmode需要 -->
<div class="textarea-helper"></div>
</div>
<div id="right-column">
<div class="preview-panel panel-open" id="preview-panel">

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
var MSG={"app":"Leanote","share":"分享","noTag":"无标签","inputUsername":"请输入用户名","inputEmail":"请输入Email","inputPassword":"请输入密码","inputPassword2":"请输入确认密码","confirmPassword":"两次密码输入不正确","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":"无标题","defaultShare":"默认分享","writingMode":"写作模式","normalMode":"普通模式","saving":"正在保存","saveSuccess":"保存成功","Are you sure to delete it ?":"确认删除?","Insert link into content":"将附件链接插入到内容中","Download":"下载","Delete":"删除","update":"更新","Update Time":"更新时间","Create Time":"创建时间","Post Url":"博文链接","close":"关闭","cancel":"取消","send":"发送","shareToFriends":"分享给好友","publicAsBlog":"公开为博客","cancelPublic":"取消公开为博客","move":"移动","copy":"复制","rename":"重命名","exportPdf":"导出PDF","addChildNotebook":"添加子笔记本","deleteAllShared":"删除所有共享","deleteSharedNotebook":"删除共享笔记本","copyToMyNotebook":"复制到我的笔记本","checkEmail":"查看邮件","sendVerifiedEmail":"发送验证邮箱","sendSuccess":"发送成功","sendFailed":"发送失败","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会备份当前版本到历史记录中.","createAccountSuccess":"帐号创建成功","createAccountFailed":"帐号创建失败","updateUsernameSuccess":"用户名修改成功","usernameIsExisted":"用户名已存在","noSpecialChars":"不能包含特殊字符","minLength":"长度至少为%s","errorEmail":"请输入正确的email","verifiedEmaiHasSent":"验证邮件已发送, 请及时查阅邮件并验证.","emailSendFailed":"邮件发送失败","inputNewPassword":"请输入新密码","errorPassword":"请输入长度不少于6位的密码, 尽量复杂","updatePasswordSuccess":"修改密码成功","Hyperlink":"超链接","Please provide the link URL and an optional title":"请填写链接和一个可选的标题","optional title":"可选标题","Cancel":"取消","Strong":"粗体","strong text":"粗体","Emphasis":"斜体","emphasized text":"斜体","Blockquote":"引用","Code Sample":"代码","enter code here":"代码","Image":"图片","Heading":"标题","Numbered List":"有序列表","Bulleted List":"无序列表","List item":"项目","Horizontal Rule":"水平线","Undo":"撤销","Redo":"重做","enter image description here":"图片标题","enter link description here":"链接标题","Edit mode":"编辑模式","Vim mode":"Vim模式","Emacs mode":"Emacs模式","Normal mode":"普通模式","Add Album":"添加相册","Cannot delete default album":"不能删除默认相册","Cannot rename default album":"不能重命名默认相册","Rename Album":"重命名","Add Success!":"添加成功!","Rename Success!":"重命名成功!","Delete Success!":"删除成功","Are you sure to delete this image ?":"确定删除该图片?","click to remove this image":"删除图片","error":"错误","Error":"错误","Prev":"上一页","Next":"下一页"};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":"无标签","inputUsername":"请输入用户名","inputEmail":"请输入Email","inputPassword":"请输入密码","inputPassword2":"请输入确认密码","confirmPassword":"两次密码输入不正确","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":"无标题","defaultShare":"默认分享","writingMode":"写作模式","normalMode":"普通模式","saving":"正在保存","saveSuccess":"保存成功","Are you sure to delete it ?":"确认删除?","Insert link into content":"将附件链接插入到内容中","Download":"下载","Delete":"删除","update":"更新","Update Time":"更新时间","Create Time":"创建时间","Post Url":"博文链接","close":"关闭","cancel":"取消","send":"发送","shareToFriends":"分享给好友","publicAsBlog":"公开为博客","cancelPublic":"取消公开为博客","move":"移动","copy":"复制","rename":"重命名","exportPdf":"导出PDF","addChildNotebook":"添加子笔记本","deleteAllShared":"删除所有共享","deleteSharedNotebook":"删除共享笔记本","copyToMyNotebook":"复制到我的笔记本","checkEmail":"查看邮件","sendVerifiedEmail":"发送验证邮箱","sendSuccess":"发送成功","sendFailed":"发送失败","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会备份当前版本到历史记录中.","createAccountSuccess":"帐号创建成功","createAccountFailed":"帐号创建失败","updateUsernameSuccess":"用户名修改成功","usernameIsExisted":"用户名已存在","noSpecialChars":"不能包含特殊字符","minLength":"长度至少为%s","errorEmail":"请输入正确的email","verifiedEmaiHasSent":"验证邮件已发送, 请及时查阅邮件并验证.","emailSendFailed":"邮件发送失败","inputNewPassword":"请输入新密码","errorPassword":"请输入长度不少于6位的密码, 尽量复杂","updatePasswordSuccess":"修改密码成功","Hyperlink":"超链接","Please provide the link URL and an optional title":"请填写链接和一个可选的标题","optional title":"可选标题","Cancel":"取消","Strong":"粗体","strong text":"粗体","Emphasis":"斜体","emphasized text":"斜体","Blockquote":"引用","Code Sample":"代码","enter code here":"代码","Image":"图片","Heading":"标题","Numbered List":"有序列表","Bulleted List":"无序列表","List item":"项目","Horizontal Rule":"水平线","Markdown syntax":"Markdown 语法","Undo":"撤销","Redo":"重做","enter image description here":"图片标题","enter link description here":"链接标题","Edit mode":"编辑模式","Vim mode":"Vim模式","Emacs mode":"Emacs模式","Normal mode":"普通模式","Normal":"普通","Light":"轻量","Light editor":"轻量编辑器","Add Album":"添加相册","Cannot delete default album":"不能删除默认相册","Cannot rename default album":"不能重命名默认相册","Rename Album":"重命名","Add Success!":"添加成功!","Rename Success!":"重命名成功!","Delete Success!":"删除成功","Are you sure to delete this image ?":"确定删除该图片?","click to remove this image":"删除图片","error":"错误","Error":"错误","Prev":"上一页","Next":"下一页","Are you sure ?":"你确定执行该操作?","Are you sure to install it ?":"你确定安装该主题?","Are you sure to delete":"你确定删除","Success":"成功","File exists":"文件已存在","Delete file":"删除文件","No images":"无图片","Filename":"文件名","Group Title":"分组名"};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;}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -54,7 +54,7 @@ define('avatar', ['fileupload'], function(){
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>');
var tpl = $('<div class="alert alert-info"><img class="loader" src="/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>');

View File

@ -0,0 +1,114 @@
define('import_theme', ['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("#dropAvatar", "#uploadAvatar");
var initUploader = function() {
$('.dropzone .btn-choose-file').click(function() {
$(this).parent().find('input').click();
});
var $msg2 = $('#avatarUploadMsg');
$('#uploadAvatar').fileupload({
dataType: 'json',
dropZone: $('#dropAvatar'),
add: function(e, data) {
var tpl = $('<div class="alert alert-info"><img class="loader" src="/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;
if(typeof size == 'number' && size > 10 * 1024 * 1024) {
tpl.find("img").remove();
tpl.removeClass("alert-info").addClass("alert-danger");
tpl.append("Warning: File size is bigger than 10M");
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;
art.tips("Success");
setTimeout(function() {
location.reload();
}, 1000);
} 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);
}
},
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();
});