Merge branch 'feature-disable-local-account'

This commit is contained in:
life
2016-04-14 17:06:19 +08:00
9 changed files with 67 additions and 7 deletions

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');

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": "zh-cn",
"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

@@ -233,6 +233,7 @@
"Username or Email": "用戶名或郵箱",
"Password": "密碼",
"Sign up": "註冊",
"Sign up Leanote": "註冊Leanote",
"Forget password?": "忘記密碼?",
"Find password": "找回密碼",
@@ -282,7 +283,8 @@
"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": "確認密碼",
@@ -300,6 +302,10 @@
"Sync error, retry to sync after 3 seconds": "同步失敗, 3 秒後自動重新嘗試同步",
"Network error!": "網絡異常",
"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 切換編輯與只讀"
}