Merge pull request #1 from leanote/master

同步原项目
This commit is contained in:
Jifa Jiang
2016-04-28 16:30:12 +09:00
23 changed files with 333 additions and 232 deletions

View File

@@ -1 +1 @@
{"version":"1.0.6","updatedTime":"2016-02-27T07:21:51.505Z"}
{"version":"1.0.7","updatedTime":"2016-04-14T07:21:51.505Z"}

View File

@@ -27,8 +27,11 @@ if(process.platform != 'darwin') {
</div>
<div class="bottom">
<a id="customServer" class="lang customServer">Self-hosted Service</a>
<a id="localAccount" class="lang localAccount">Create Local Account</a>
<a id="localAccount" onclick="openExternal('https://leanote.com/register')" class="lang localAccount">Sign up Leanote</a>
<a id="customServer" class="lang customServer">Sign in to Self-hosted Service</a>
<!-- <a id="localAccount" class="lang localAccount">Create Local Account</a> -->
<a id="loginWithLeanote" class="lang loginWithLeanote">Sign in to Leanote</a>
</div>
@@ -40,8 +43,8 @@ if(process.platform != 'darwin') {
<a onclick="openExternal('https://leanote.com')" id="loadingLogo" title="leanote">
<img src="public/images/logo/leanote_icon_blue.png">
</a>
<span class="lang customServer">Self-hosted Service</span>
<span class="lang localAccount">Create Local Account</span>
</h1>
<div class="alert-wrap">
@@ -92,7 +95,9 @@ if(process.platform != 'darwin') {
<div class="clearfix btns">
<a onclick="openExternal('https://leanote.com/findPassword')" class="pull-right m-t-xs"><small class="lang">Forget password?</small></a>
<!--
<a onclick="openExternal('https://leanote.com/register')" class="pull-right m-t-xs" style="margin-right: 10px"><small class="lang">Sign up</small></a>
-->
</div>
</form>
</div>
@@ -271,11 +276,13 @@ $(function() {
hideMsg();
});
/*
$('#localAccount').click(function() {
$body.addClass('local-account');
$('#username').focus();
hideMsg();
});
*/
$('#loginWithLeanote').click(function () {
$body.removeClass('local-account custom-server');

26
node_modules/api.js generated vendored
View File

@@ -228,13 +228,21 @@ var Api = {
getImage: function(fileId, callback) {
var me = this;
var url = me.getUrl('file/getImage', {fileId: fileId});
log(url);
// console.log('getImage');
// console.log(url);
needle.get(url, function(err, resp) {
me.checkError(err, resp);
if(err) {
return callback && callback(false);
}
// log(resp.body);
else if (resp.statusCode != 200) {
console.log(fileId + ' 图片返回状态错误: ' + resp.statusCode);
return callback && callback(false);
}
// log(resp);
/*
{ 'accept-ranges': 'bytes',
'content-disposition': 'inline; filename="logo.png"',
@@ -243,10 +251,14 @@ var Api = {
date: 'Mon, 19 Jan 2015 15:01:47 GMT',
*/
// log(resp.headers);
if(err) {
callback(false);
} else {
var typeStr = resp.headers['content-type'];
else {
var typeStr = ('' + resp.headers['content-type']).toLowerCase();
if (typeStr.indexOf('image') < 0) {
console.log(fileId + ' 不是图片');
return callback && callback(false);
}
var type = 'png';
if(typeStr) {
var typeArr = typeStr.split('/');
@@ -258,13 +270,13 @@ var Api = {
var filename = Common.uuid() + '.' + type;
var imagePath = User.getCurUserImagesPath();
var imagePathAll = imagePath + '/' + filename;
log(imagePathAll);
fs.writeFile(imagePathAll, resp.body, function(err) {
if(err) {
log(err);
log('local save image failed 本地保存失败');
callback(false);
} else {
console.log('main save image success');
callback(imagePathAll, filename);
}
});

18
node_modules/api_main.js generated vendored
View File

@@ -41,12 +41,20 @@ var Api = {
getImage: function(fileId, callback) {
var me = this;
var url = me.getUrl('file/getImage', {fileId: fileId});
// console.log('getImage');
// console.log(url);
needle.get(url, function(err, resp) {
me.checkError(err, resp);
if(err) {
return callback && callback(false);
}
// log(resp.body);
else if (resp.statusCode != 200) {
console.log(fileId + ' 图片返回状态错误: ' + resp.statusCode + ' ' + url);
return callback && callback(false);
}
// log(resp);
/*
{ 'accept-ranges': 'bytes',
'content-disposition': 'inline; filename="logo.png"',
@@ -56,7 +64,13 @@ var Api = {
*/
// log(resp.headers);
else {
var typeStr = resp.headers['content-type'];
var typeStr = ('' + resp.headers['content-type']).toLowerCase();
if (typeStr.indexOf('image') < 0) {
console.log(fileId + ' 不是图片 ' + typeStr + ' ' + url);
return callback && callback(false);
}
var type = 'png';
if(typeStr) {
var typeArr = typeStr.split('/');

46
node_modules/file.js generated vendored
View File

@@ -532,7 +532,7 @@ var File = {
} else {
// 远程取不到图片, 是没有网络? 还是远程真的没有了
// TODO
// console.log("cann't get server's image" + fileId);
console.log("cann't get server's image" + fileId);
callback(false);
// return me.e404(res);
}
@@ -547,8 +547,8 @@ var File = {
// console.log(fs.exists(fileLocalPath));
if(has && fileLocalPath) {
fs.exists(fileLocalPath, function(exists) {
if(exists) {
// console.log('本地存在');
if(exists) {
// console.log('本地存在 ' + fileId);
callback(fileLocalPath);
// me.retImage(fileLocalPath, res);
} else {
@@ -673,7 +673,45 @@ var File = {
callback();
}
} else {
// 形如 file:///Users/life/Desktop/test/1.jpeg 本地文件
// file:///C:/Users/CLi/App
// file://C:/Users/CLi/App
} else if(src.indexOf('file:') === 0) {
src = src.substr('file://'.length); // /user 或 /C:
if (!src) {
callback();
return;
}
// windows下的 把最前一个'/'去掉
if (src.indexOf(':') >= 0 && src[0] == '/') {
src = src.substr(1);
}
// 图片类型
var type = 'png';
var strArr = src.split('.');
if (strArr.length > 1) {
type = strArr.pop();
}
// 新图片地址
var filename = Common.uuid() + '.' + type;
var imagePath = User.getCurUserImagesPath();
var imagePathAll = imagePath + '/' + filename;
// 复制图片
var readStream = fs.createReadStream(src);
var writeStream = fs.createWriteStream(imagePathAll);
readStream.pipe(writeStream);
readStream.on('end', function () {
callback(imagePathAll);
});
readStream.on('error', function () {
callback();
});
}
else {
// 远程的图片
needle.get(src, function(err, resp) {
// console.log(resp);

12
node_modules/file_main.js generated vendored
View File

@@ -109,9 +109,15 @@ var File = {
if(has && fileLocalPath) {
fs.exists(fileLocalPath, function(exists) {
if(exists) {
// console.log('本地存在');
callback(fileLocalPath);
// me.retImage(fileLocalPath, res);
if (fileLocalPath.indexOf('; charset=utf-8') < 0) {
// console.log('本地存在 ' + fileId);
callback(fileLocalPath);
}
else {
// 存在, 但之前存错了
console.log('存在, 但之前存错了 ' + fileId);
getImageFromApi();
}
} else {
getImageFromApi();
}

4
node_modules/leanote_protocol.js generated vendored
View File

@@ -17,12 +17,14 @@ var leanoteProtocol = {
var ret = /fileId=([a-zA-Z0-9]{24})/.exec(url);
if (ret && ret[1]) {
var fileId = ret[1];
// console.log(fileId);
// console.log('imageId: ' + fileId);
File.getImage(ret[1], function(fileLocalPath) {
if(fileLocalPath) {
// console.log(fileId + ' : ' + fileLocalPath);
callback({path: fileLocalPath});
} else {
console.log('取不到图片: ' + fileId);
callback();
}
});

View File

@@ -579,6 +579,24 @@ function log(o) {
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- 本地帐户警告 -->
<div class="modal fade bs-modal-sm" id="localAccountDialog" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
<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">&times;</button>
<h4 class="modal-title modalTitle lang">Local account warning</h4>
</div>
<div class="modal-body lang">localAccountTips</div>
<div class="modal-footer ">
<label><input type="checkbox" id="localAccountDialogCheckbox"/> <span class="lang">Don't Show Anymore</span></label>
<button type="button" class="btn btn-default upgrade-cancel-btn lang" data-dismiss="modal">Close</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- loading -->
<div class="modal fade bs-modal-sm" id="loadingDialog" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
<div class="modal-dialog modal-sm modal-large">

View File

@@ -24,6 +24,6 @@ var Config = {
"name": "繁体中文"
}
],
"lang": "",
"lang": "en-us",
"theme": ""
};

View File

@@ -734,7 +734,7 @@ form {
.local-account #loadingLogo {
display: none;
}
.local-account #box h1 span.localAccount {
.local-account #box h1 .localAccount {
display: block;
}
.win-tool {

View File

@@ -785,6 +785,7 @@ form {
display: block;
}
}
}
.custom-server {
@@ -817,7 +818,7 @@ form {
#loadingLogo {
display: none;
}
#box h1 span.localAccount {
#box h1 .localAccount {
display: block;
}
}

View File

@@ -1380,6 +1380,22 @@ var State = {
}
};
function initLocalAccountDialogCheckboxEvent() {
$('#localAccountDialogCheckbox').click(function () {
localStorage.setItem(UserInfo.UserId + '-local', $(this).prop('checked') ? 'no': '');
});
}
function showLocalAccountWarning() {
if (!UserInfo || !UserInfo.IsLocal) {
return;
}
if (localStorage.getItem(UserInfo.UserId + '-local')) {
return;
}
$('#localAccountDialog').modal('show');
}
// js/main.js 在load plugin后调用
// 实始化页面
// 判断是否登录
@@ -1473,6 +1489,10 @@ function initPage(initedCallback) {
// init notebook后才调用
// initSlimScroll();
LeaAce.handleEvent();
//
showLocalAccountWarning();
initLocalAccountDialogCheckboxEvent();
});
};

View File

@@ -184,5 +184,7 @@
"Tag": "Tag",
"Starred": "Starred",
"localAccountTips": "Please note that your account is local account which <b>is not the Leanote's account</b>, and your data just save onto your local disk. Once your disk is broken, the data cannot be recovered. So we recommend you to use Leanote Desktop App with Leanote account, and your data will sync to Leanote server.<p>Leanote Desktop App has disabled the feature that create a local account. You can login Leanote Desktop App with local account whitch created before. But we recommend you to use Leanote Desktop App with Leanote account.</p>",
"ForceFullSyncMsg": "Full sync will remove the current account's all local data (includes database, images and attachments) and load all data from server, are you sure ?"
}

View File

@@ -233,6 +233,7 @@
"Username or Email": "用户名或邮箱",
"Password": "密码",
"Sign up": "注册",
"Sign up Leanote": "注册Leanote",
"Forget password?": "忘记密码?",
"Find password": "找回密码",
@@ -282,6 +283,7 @@
"Password is required": "请输入密码",
"The minimum password length is 6": "密码长度最少6位",
"Sign in to Self-hosted Service": "登录自建服务",
"Self-hosted Service": "自建服务",
"Create Local Account": "创建本地帐户",
"Sign in to Leanote": "登录到Leanote",
@@ -302,5 +304,9 @@
"Load Database Error": "加载数据库出错, 请尝试在帐户管理中优化数据库",
"Local account warning": "本地离线帐户警告",
"localAccountTips": "你好, 您使用的是本地离线帐户, 您的数据只存在本地, 不会同步到Leanote服务器, 如果您不小心删除了数据或硬盘损坏, 您的数据将永久丢失. <br>所以我们推荐您使用Leanote帐户来使用该客户端, 这样您的数据将会存储到云端, 以避免失误造成的数据丢失. <br>Leanote桌面端不再支持创建本地帐户, 但您之前创建的本地帐户还是可以继续使用.",
"Don't Show Anymore": "不再提示",
"ctrl/cmd+e Toggle Modify with Readonly": "ctrl/cmd+e 切换编辑与只读"
}

View File

@@ -2,69 +2,69 @@
"3th": "第三方登錄",
"aboutLeanote": "關於leanote",
"aboutMe": "關於我",
"accountSetting": "帳戶設",
"addChildNotebook": "添加子筆記本",
"addNotebook": "添加筆記本",
"addShare": "添加分享",
"accountSetting": "帳戶設",
"addChildNotebook": "新增子記事本",
"addNotebook": "新增記事本",
"addShare": "新增分享",
"all": "最新",
"app": "leanote",
"attachments ": " 附件",
"basicInfo": "基本信息",
"blog": "博客",
"basicInfo": "基本資訊",
"blog": "部落格",
"blogInfo": "將筆記公開, 讓知識傳播的更遠!",
"blogSet": "博客設置",
"blogSet": "部落格設定",
"blue": "藍色",
"Cancel": "取消",
"Cancel public": "取消公開為博客",
"canntNewNoteTips": "Sorry, 這裏不能添加筆記的. 需要先選擇壹個筆記本.",
"checkEmai": "查郵箱",
"Cancel public": "取消公開為部落格",
"canntNewNoteTips": "Sorry, 這裏不能新增筆記的. 需要先選擇一個記事本.",
"checkEmai": "查郵箱",
"checkEmail": "查看郵件",
"clearSearch": "清除搜",
"clickAddTag": "點擊添加標簽",
"clickToChangePermission": "點擊改變權限",
"clickToCopy": "點擊復制",
"clearSearch": "清除搜",
"clickAddTag": "按一下新增標籤",
"clickToChangePermission": "按一下改變權限",
"clickToCopy": "按一下複製",
"Close": "關閉",
"confirmBackup": "確定要從該版還原? 還原前leanote會備份前版本到歷史記錄中.",
"confirmBackup": "確定要從該版還原? 還原前leanote會備份前版本到歷史記錄中.",
"confirmPassword": "兩次密碼輸入不正確",
"cooperation": "協作",
"cooperationInfo": "分享給好友的同時也可以讓的好友和妳壹起來完善它.",
"Copy": "復制",
"copyFailed": "對不起, 復制失敗, 請自行復制",
"copySuccess": "復制成功",
"copyToMyNotebook": "復制到我的記本",
"create": "建",
"createAccount": "建帳號",
"createAccountFailed": "帳號建失敗",
"createAccountSuccess": "帳號建成功",
"cooperationInfo": "分享給好友的同時也可以讓的好友和你一起來完善它.",
"Copy": "複製",
"copyFailed": "對不起, 複製失敗, 請自行複製",
"copySuccess": "複製成功",
"copyToMyNotebook": "複製到我的記本",
"create": "建",
"createAccount": "建帳號",
"createAccountFailed": "帳號建失敗",
"createAccountSuccess": "帳號建成功",
"curUser": "當前登錄帳戶",
"currentEmail": "當前郵箱為: \u003ccode\u003e%s\u003c/code\u003e ",
"datetime": "日期",
"default": "默認",
"defaultShare": "默認共享",
"defaulthhare": "默認共享",
"default": "預設",
"defaultShare": "預設共享",
"defaulthhare": "預設共享",
"delete": "刪除",
"deleteAllShared": "刪除所有共享",
"deleteSharedNotebook": "刪除共享記本",
"deleteSharedNotebook": "刪除共享記本",
"demoRegister": "\u003ca href=\"/register\"\u003e立即註冊\u003c/a\u003e",
"discussion": "社區討論",
"donate ": " 捐贈",
"donate ": " 贊助",
"download": "下載",
"editorTips": "幫助",
"editorTips": "說明",
"email": "Email",
"emailBodyRequired": "郵件內容不能為空",
"emailBodyRequired": "郵件內容不能為空",
"emailInSending": "正在發送郵件到",
"emailOrOthers": "Email或其它聯系方式",
"emailSendFailed": "郵件發送失敗",
"errorEmail": "請輸入正確的email",
"errorPassword": "請輸入長度不少於6位的密碼, 盡量復雜",
"errorPassword": "請輸入長度不少於6位的密碼, 盡量複雜一點",
"findPassword": "找回密碼",
"findPasswordSendEmailOver": "已經將修改密碼的鏈接發送到您的郵箱, 請查郵件.",
"findPasswordTimeout": "鏈接已過期",
"findPasswordSendEmailOver": "已經將修改密碼的連結發送到您的郵箱, 請查郵件.",
"findPasswordTimeout": "連結已過期",
"fold": "折疊",
"forgetPassword ": " 忘記密碼?",
"fork github": "Github 碼",
"fork github": "Github 原始碼",
"friendEmail": "好友郵箱",
"friendNotExits": "該用戶還沒有註冊%s, 復制邀請鏈接發送給Ta, 邀請鏈接: %s",
"friendNotExits": "該用戶還沒有註冊%s, 複製邀請連結發送給Ta, 邀請連結: %s",
"green": "綠色",
"hadAcount ": " 已有帳戶?",
"hasAcount ": " 還無帳戶?",
@@ -80,34 +80,34 @@
"inputPassword2": "請輸入確認密碼",
"inputUsername": "請輸入用戶名",
"knowledge": "知識",
"knowledgeInfo": "leanote是個筆記, 可以用它來管理自己的知識.",
"leanoteBlog": "官方博客",
"knowledgeInfo": "leanote是個筆記, 可以用它來管理自己的知識.",
"leanoteBlog": "官方部落格",
"leftHidden": "隱藏左側",
"leftShow": "展開左側",
"login": "登錄",
"loginSuccess": "登錄成功, 正在跳轉",
"logining": "正在登錄",
"logout": "退出",
"Logout": "註銷",
"logout": "出",
"Logout": "登出",
"minLength": "長度至少為%s",
"Move": "移動",
"myBlog": "我的博客",
"myBlog": "我的部落格",
"myNote": "我的筆記",
"myNotebook": "我的記本",
"myTag": "我的標",
"myNotebook": "我的記本",
"myTag": "我的標",
"nav": "文檔導航",
"new": "新",
"newMarkdown": "新Markdown筆記",
"newMarkdownNote": "新Markdown筆記",
"newNote": "新筆記",
"new": "新",
"newMarkdown": "新Markdown筆記",
"newMarkdownNote": "新Markdown筆記",
"newNote": "新筆記",
"newPassword": "新密碼",
"noHistories": "無歷史記錄",
"noNoteNewNoteTips": "該記本下空空如也...何不",
"noNoteNewNoteTips": "該記本下空空如也...何不",
"noSpecialChars": "不能包含特殊字符",
"normalMode": "普通模式",
"notFound": "該頁面不存在",
"notGoodPassword": "密碼至少6位",
"notebook": "記本",
"notebook": "記本",
"oldPassword": "舊密碼",
"or": "或",
"password": "密碼",
@@ -122,30 +122,30 @@
"rename": "重命名",
"resendVerifiedEmail": "重新發送驗證郵件",
"restoreFromThisVersion": "從該版本還原",
"save": "存",
"saveSuccess": "存成功",
"saving": "正在存",
"search": "搜",
"save": "存",
"saveSuccess": "存成功",
"saving": "正在存",
"search": "搜",
"send": "發送",
"sendFailed": "發送失敗",
"sendInviteEmailToYourFriend": "發送邀請email給Ta",
"sendSuccess": "發送成功",
"sendVerifiedEmail": "發送驗證郵箱",
"setAvatar": "頭像設",
"setUsername": "用戶名設",
"setUsernameTips": "的郵箱是 \u003ccode\u003e%s\u003c/code\u003e, 可以再設置壹個唯的用戶名.\u003cbr /\u003e用戶名至少4位, 不可含特殊字符.",
"setAvatar": "頭像設",
"setUsername": "用戶名設",
"setUsernameTips": "的郵箱是 \u003ccode\u003e%s\u003c/code\u003e, 可以再設定一個唯的用戶名.\u003cbr /\u003e用戶名至少4位, 不可含特殊字符.",
"share": "分享",
"shareInfo": "也可以將知識分享給的好友.",
"shareInfo": "也可以將知識分享給的好友.",
"shareToFriends": "分享給好友",
"simple": "簡約",
"submit": "提交",
"suggestions": "建議",
"suggestionsInfo": "幫助我們完善leanote",
"tag": "標",
"themeSetting": "主題設",
"thirdCreateAcountTips": "您現在使用的是第三方帳號登錄%(app)s, 您也可以註冊%(app)s帳號登錄, 趕緊註冊個吧. \u003cbr /\u003e註冊成功後仍可以使用第三方帳號登錄leanote並管理您現有的筆記.",
"trash": "廢紙簍",
"try": "體驗下",
"suggestionsInfo": "說明我們完善leanote",
"tag": "標",
"themeSetting": "主題設",
"thirdCreateAcountTips": "您現在使用的是第三方帳號登錄%(app)s, 您也可以註冊%(app)s帳號登錄, 趕緊註冊個吧. \u003cbr /\u003e註冊成功後仍可以使用第三方帳號登錄leanote並管理您現有的筆記.",
"trash": "垃圾桶",
"try": "體驗下",
"unTitled": "無標題",
"unVerified": "未驗證",
"unfold": "展開",
@@ -160,7 +160,7 @@
"use ": " 使用",
"usernameIsExisted": "用戶名已存在",
"usernameOrEmail": "用戶名或Email",
"usernameSetting": "用戶名設",
"usernameSetting": "用戶名設",
"verified": "已驗證",
"verifiedEmaiHasSent": "驗證郵件已發送, 請及時查閱郵件並驗證.",
"verifiedNow": "現在去驗證",
@@ -172,26 +172,26 @@
"wrongUsernameOrPassword": "用戶名或密碼有誤",
"yellow": "黃色",
"yourContact": "您的聯系方式",
"yourSuggestions": "幫助完善leanote",
"yourSuggestions": "說明完善leanote",
"Close": "關閉",
"Notebook": "記本",
"Notebook": "記本",
"Note": "筆記",
"Tag": "標",
"Tag": "標",
"Starred": "加星筆記",
"Newest": "最新筆記",
"New": "新",
"New note": "新筆記",
"Search note": "搜筆記",
"Search notebook": "搜索筆記本",
"New": "新",
"New note": "新筆記",
"Search note": "搜筆記",
"Search notebook": "搜尋記事本",
"Add account": "添加帳戶",
"Add account": "新增帳戶",
"Switch account": "切換帳戶",
"Sync": "同步",
"Loading": "正在載",
"Loading...": "正在載",
"loading...": "正在載",
"loading": "正在載",
"Loading": "正在載",
"Loading...": "正在載",
"loading...": "正在載",
"loading": "正在載",
"Choose Files": "選擇文件",
"Check for updates": "檢查更新",
"Checking for udpates...": "正在檢查是否有可用更新...",
@@ -200,14 +200,14 @@
"This note is conflicted with:": "該筆記與以下筆記沖突:",
"Maker as resolved": "標記已解決沖突",
"Leanote, Not Just A Notepad": "Leanote, 不只是筆記",
"Public as blog": "公開為博客",
"Cancel public": "取消公開為博客",
"Public as blog": "公開為部落格",
"Cancel public": "取消公開為部落格",
"Delete": "刪除",
"Remove": "移除",
"Export": "出",
"Export notes": "出筆記",
"Export": "出",
"Export notes": "出筆記",
"Histories": "歷史記錄",
"Created": "建",
"Created": "建",
"Updated": "更新",
"Modify": "修改",
"Toggle writting mode": "切換寫作模式",
@@ -221,18 +221,19 @@
"Light": "輕量",
"Normal": "普通",
"Add sub notebook": "添加子筆記本",
"Add sub notebook": "新增子記事本",
"Rename": "重命名",
"Import notes": "入筆記",
"Import notes": "入筆記",
"My blog": "我的博客",
"My blog": "我的部落格",
"Sync now": "立即同步",
"Custom server": "配置服務",
"Custom server": "設定服務",
"Host, https://leanote.com": "服務地址, 如 https://leanote.com",
"Username or Email": "用戶名或郵箱",
"Password": "密碼",
"Sign up": "註冊",
"Sign up Leanote": "註冊Leanote",
"Forget password?": "忘記密碼?",
"Find password": "找回密碼",
@@ -240,49 +241,50 @@
"No Starred Note": "無加星筆記",
"Conflict": "沖突",
"Star": "加星",
"Blog": "博客",
"Setting": "設",
"Blog": "部落格",
"Setting": "設",
"Insert link into content": "插件附件鏈接到筆記中",
"Insert link into content": "插件附件連結到筆記中",
"Save as": "另存為",
"Search results": "搜結果",
"Search results": "搜結果",
"Image saved successful!": "圖片存成功!",
"Image saved failed!": "圖片存失敗!",
"File saved failed!": "文件存失敗!",
"File saved successful!": "文件存成功!",
"Image saved successful!": "圖片存成功!",
"Image saved failed!": "圖片存失敗!",
"File saved failed!": "文件存失敗!",
"File saved successful!": "文件存成功!",
"File not exists!": "文件不存在!",
"Error": "錯誤",
"Cut": "剪",
"Copy": "復制",
"Paste": "貼",
"Cut": "剪",
"Copy": "複製",
"Paste": "貼",
"Open link in browser": "在瀏覽器打開",
"Info": "提示",
"Warning": "警告",
"Mode": "模式",
"Toggle Fullscreen": "全切換",
"Toggle Presentation": "示切換",
"Toggle Fullscreen": "全螢幕切換",
"Toggle Presentation": "示切換",
"Toggle View": "預覽切換",
"More...": "更多",
"Force full sync": "強制全同步",
"ForceFullSyncMsg": "強制全同步會先將該帳戶的本地數據全部刪除(包括數據庫, 圖片和附件), 然後從服器上同步所有數據, 確定?",
"Force full sync": "強制全同步",
"ForceFullSyncMsg": "強制全同步會先將該帳戶的本地資料全部刪除(包括資料庫, 圖片和附件), 然後從服器上同步, 確定?",
"Are you sure to delete it ?": "確定刪除?",
"Are you sure ?": "確定執行該操作?",
"Are you sure ?": "確定執行該操作?",
"Email or Password Error": "用戶名或密碼錯誤",
"Invalid host": "服務地址錯誤",
"Invalid host": "主機位址錯誤",
"Leanote login": "登錄",
"Email is required": "請輸入用戶名或郵箱",
"Password is required": "請輸入密碼",
"The minimum password length is 6": "密碼長度最少6位",
"Self-hosted Service": "自建服務",
"Sign in to Self-hosted Service": "登錄自建伺服器",
"Self-hosted Service": "登錄自建服務",
"Create Local Account": "創建本地帳戶",
"Sign in to Leanote": "登錄到Leanote",
"Confirm password": "確認密碼",
@@ -292,14 +294,18 @@
"Synchronizing": "正在同步",
"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":"鏈接標題",
"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":"連結標題",
"Please select a note firstly.": "請先選擇個筆記",
"Please select a note firstly.": "請先選擇個筆記",
"<span></span> notes selected": "當前選中了 <span></span> 篇筆記",
"Sync error, retry to sync after 3 seconds": "同步失敗, 3 秒後自動重新嘗試同步",
"Network error!": "網絡異常",
"Load Database Error": "加載數據庫出錯, 請嘗試在帳戶管理中優化數據庫",
"ctrl/cmd+e Toggle Modify with Readonly": "ctrl/cmd+e 切換編輯與只讀"
}
"Local account warning": "本地離線帳戶警告",
"localAccountTips": "妳好, 您使用的是本地離線帳戶, 您的數據只存在本地, 不會同步到Leanote服務器, 如果您不小心刪除了數據或硬盤損壞, 您的數據將永久丟失. <br>所以我們推薦您使用Leanote帳戶來使用該客戶端, 這樣您的數據將會存儲到雲端, 以避免失誤造成的數據丟失. <br>Leanote桌面端不再支持創建本地帳戶, 但您之前創建的本地帳戶還是可以繼續使用.",
"Don't Show Anymore": "不再提示",
"Load Database Error": "載入資料庫出錯, 請嘗試在帳戶管理中優化資料庫",
"ctrl/cmd+e Toggle Modify with Readonly": "ctrl/cmd+e 切換編輯與唯讀"
}

File diff suppressed because one or more lines are too long

View File

@@ -12054,8 +12054,16 @@ define('extensions/markdownExtra',[
};
function onToggleMode(editor) {
// 不能加linenums, 加了后, uml不能显示
// 但是, 有人说没有行号了, 很不好
// 怎么办
editor.hooks.chain("onPreviewRefresh", function () {
$('#preview-contents pre').addClass('prettyprint'); // 不能加linenums, 加了后, uml不能显示
$('#preview-contents pre code').each(function () {
var classes = $(this).attr('class');
if (classes != 'language-flow' && classes != 'language-sequence') {
$(this).parent().addClass('prettyprint linenums');
}
});
prettify.prettyPrint();
});
}

File diff suppressed because one or more lines are too long

View File

@@ -70,6 +70,10 @@ pre.prettyprint {
-khtml-border-radius: 3px;
border-radius: 3px;
display: block;
box-shadow: 0 1px 2px rgba(255, 255, 255, 0.1) inset, 40px 0 0 rgba(102, 128, 153, 0.05) inset, 0 1px 0 rgba(102, 128, 153, 0.05);
}
#preview-contents pre ol li {
padding-left: 10px;
}
/*行号*/
code.prettyprint .linenums,
@@ -152,65 +156,7 @@ code.prettyprint .pln,
pre.prettyprint .pln {
color: #48484c;
}
/*
@font-face {
font-family: 'fontello';
src: url('../font/fontello.svg#fontello') format('svg'),
url('../font/fontello.woff') format('woff');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 300;
src: local('Source Sans Pro Light'), local('SourceSansPro-Light'), url("../font/SourceSansPro-Light-webfont.woff") format('woff');
}
@font-face {
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 400;
src: local('Source Sans Pro'), local('SourceSansPro'), url("../font/SourceSansPro-Regular-webfont.woff") format('woff');
}
@font-face {
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 700;
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), url("../font/SourceSansPro-Bold-webfont.woff") format('woff');
}
@font-face {
font-family: 'Source Sans Pro';
font-style: italic;
font-weight: 300;
src: local('Source Sans Pro Light Italic'), local('SourceSansProLight-Italic'), url("../font/SourceSansPro-LightItalic-webfont.woff") format('woff');
}
@font-face {
font-family: 'Source Sans Pro';
font-style: italic;
font-weight: 400;
src: local('Source Sans Pro Italic'), local('SourceSansPro-Italic'), url("../font/SourceSansPro-Italic-webfont.woff") format('woff');
}
@font-face {
font-family: 'Source Sans Pro';
font-style: italic;
font-weight: 700;
src: local('Source Sans Pro Bold Italic'), local('SourceSansPro-BoldItalic'), url("../font/SourceSansPro-BoldItalic-webfont.woff") format('woff');
}
@font-face {
font-family: 'Source Code Pro';
font-style: normal;
font-weight: 400;
src: local('Source Code Pro'), local('SourceCodePro-Regular'), url("../font/SourceCodePro-Regular-webfont.woff") format('woff');
}
@font-face {
font-family: 'Source Code Pro';
font-style: normal;
font-weight: 700;
src: local('Source Code Pro Bold'), local('SourceCodePro-Bold'), url("../font/SourceCodePro-Bold-webfont.woff") format('woff');
}
*/
.container {
margin-bottom: 180px;
text-align: justify;
@@ -218,19 +164,6 @@ pre.prettyprint .pln {
a code {
color: inherit;
}
/*
h1 { font-size: @title-base-size * 2.60; }
h2 { font-size: @title-base-size * 2.15; }
h3 { font-size: @title-base-size * 1.70; }
h4 { font-size: @title-base-size * 1.25; }
h5 { font-size: @title-base-size; }
h6 { font-size: @title-base-size * 0.85; }
h1, h2, h3, h4, h5, h6 {
margin: 1.5em 0;
text-align: start;
}
*/
pre {
word-break: break-word;
}
@@ -289,6 +222,7 @@ pre.prettyprint {
text-align: start;
border: 0;
padding: 10px 20px;
font-size: 12px;
}
pre.prettyprint code {
background-color: transparent !important;
@@ -302,40 +236,36 @@ dd {
dd {
margin-left: 40px;
}
/* Table style */
table {
#preview-contents table {
margin-bottom: 20px;
width: 100%;
}
table th,
table td {
#preview-contents table th,
#preview-contents table td {
padding: 8px;
line-height: 20px;
vertical-align: top;
border-top: 1px solid #dddddd;
border: 1px solid #dddddd;
}
table th {
#preview-contents table th {
font-weight: bold;
}
table thead th {
vertical-align: bottom;
}
table caption + thead tr:first-child th,
table caption + thead tr:first-child td,
table colgroup + thead tr:first-child th,
table colgroup + thead tr:first-child td,
table thead:first-child tr:first-child th,
table thead:first-child tr:first-child td {
border-top: 0;
}
table tbody + tbody {
border-top: 2px solid #dddddd;
#preview-contents table tbody>tr:nth-child(2n+1)>td,
#preview-contents table tbody>tr:nth-child(2n+1)>th {
background-color: rgba(102,128,153,.05);
}
blockquote {
border-left-width: 10px;
background-color: rgba(128, 128, 128, 0.05);
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
padding: 15px 20px;
border-left: 10px solid #D6DBDF;
background: none repeat scroll 0 0 rgba(102,128,153,.05);
}
blockquote p {
margin-bottom: 0.3em;
@@ -1393,6 +1323,7 @@ a.input-group-addon {
box-shadow: inset 1px 0 rgba(128, 128, 128, 0.06);
background-color: #f8f8f8;
z-index: 10;
font-size: 16px;
}
.layout-animate .preview-panel {
-webkit-transition: 350ms ease-in-out all;

View File

@@ -141,7 +141,7 @@ define(function() {
// 得到存放images, js, css的路径
getAssetsPath: function(basePath, nameNotExt, n, cb) {
var me = this;
var absPath = basePath + '/' + nameNotExt + '_files';
var absPath = basePath + Api.commonService.getPathSep() + nameNotExt + '_files';
if (n > 1) {
absPath += '-' + n;
}

View File

@@ -2923,6 +2923,23 @@ body,
padding-left: 10px;
overflow-y: auto;
}
.mce-item-table,
.mce-item-table td,
.mce-item-table th,
.mce-item-table caption {
border: 1px solid #ddd;
border-collapse: collapse;
}
.mce-item-table td {
padding: 3px;
}
.mce-item-table tr {
background-color: none;
border-top: 1px solid #ccc;
}
.mce-item-table tr:nth-child(2n) {
background-color: #f7f7f9;
}
#mdEditor .navbar-default,
#wmd-button-bar {
overflow: visible;

View File

@@ -912,4 +912,19 @@ html, body, #page, #pageInner, #noteList, #notebook, #leftNotebook {
}
}
.mce-item-table, .mce-item-table td, .mce-item-table th, .mce-item-table caption {
border: 1px solid #ddd;
border-collapse: collapse;
}
.mce-item-table td {
padding: 3px;
}
.mce-item-table tr {
background-color: none;
border-top: 1px solid #ccc;
}
.mce-item-table tr:nth-child(2n) {
background-color: #f7f7f9;
}
@import 'includes/markdown.less';

View File

@@ -1,8 +1,7 @@
var needle = require('needle');
var url = 'http://i7.baidu.com/it/u=401605395,2928249378&fm=96&s=5DAEA85217785B88557C00640300B062';
url = 'http://i7.baidu.com/it/u=401605395,2928249378&fm=96&s=5DAEA85217785B88557C00640300B062';
var url = 'http://leanote.com/api/file/getImage?fileId=56fe6b53ab64415150001dee';
// url = 'http://leanote.com/images/logo.png';
needle.get(url, function(err, resp) {
console.log(resp.statusCode);
console.log(typeof resp.body);
console.log(resp.body);
});