local account warning!!!

This commit is contained in:
life
2016-04-14 16:45:02 +08:00
parent 5f00161cc8
commit bd4befdf95
6 changed files with 49 additions and 1 deletions

View File

@@ -579,6 +579,24 @@ function log(o) {
</div><!-- /.modal-dialog --> </div><!-- /.modal-dialog -->
</div><!-- /.modal --> </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 --> <!-- loading -->
<div class="modal fade bs-modal-sm" id="loadingDialog" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel"> <div class="modal fade bs-modal-sm" id="loadingDialog" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
<div class="modal-dialog modal-sm modal-large"> <div class="modal-dialog modal-sm modal-large">

View File

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

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后调用 // js/main.js 在load plugin后调用
// 实始化页面 // 实始化页面
// 判断是否登录 // 判断是否登录
@@ -1473,6 +1489,10 @@ function initPage(initedCallback) {
// init notebook后才调用 // init notebook后才调用
// initSlimScroll(); // initSlimScroll();
LeaAce.handleEvent(); LeaAce.handleEvent();
//
showLocalAccountWarning();
initLocalAccountDialogCheckboxEvent();
}); });
}; };

View File

@@ -184,5 +184,7 @@
"Tag": "Tag", "Tag": "Tag",
"Starred": "Starred", "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 ?" "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

@@ -304,5 +304,9 @@
"Load Database Error": "加载数据库出错, 请尝试在帐户管理中优化数据库", "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 切换编辑与只读" "ctrl/cmd+e Toggle Modify with Readonly": "ctrl/cmd+e 切换编辑与只读"
} }

View File

@@ -302,6 +302,10 @@
"Sync error, retry to sync after 3 seconds": "同步失敗, 3 秒後自動重新嘗試同步", "Sync error, retry to sync after 3 seconds": "同步失敗, 3 秒後自動重新嘗試同步",
"Network error!": "網絡異常", "Network error!": "網絡異常",
"Local account warning": "本地離線帳戶警告",
"localAccountTips": "妳好, 您使用的是本地離線帳戶, 您的數據只存在本地, 不會同步到Leanote服務器, 如果您不小心刪除了數據或硬盤損壞, 您的數據將永久丟失. <br>所以我們推薦您使用Leanote帳戶來使用該客戶端, 這樣您的數據將會存儲到雲端, 以避免失誤造成的數據丟失. <br>Leanote桌面端不再支持創建本地帳戶, 但您之前創建的本地帳戶還是可以繼續使用.",
"Don't Show Anymore": "不再提示",
"Load Database Error": "加載數據庫出錯, 請嘗試在帳戶管理中優化數據庫", "Load Database Error": "加載數據庫出錯, 請嘗試在帳戶管理中優化數據庫",
"ctrl/cmd+e Toggle Modify with Readonly": "ctrl/cmd+e 切換編輯與只讀" "ctrl/cmd+e Toggle Modify with Readonly": "ctrl/cmd+e 切換編輯與只讀"
} }