diff options
author | Yukai Huang | 2017-01-15 11:33:22 +0800 |
---|---|---|
committer | Yukai Huang | 2017-01-15 11:33:22 +0800 |
commit | c0e8306961a47e7a2ba52d0445c12aaa5fe07949 (patch) | |
tree | cec2451fd8afa80210d966d51dcba875bf3a6ffd /public/js | |
parent | 0f833f099f61b93e76a5f32175580fc2c0b9dc1a (diff) | |
parent | 3d6b31921651e71ef68fdc88af4ddef50cc9bcb3 (diff) |
Merge branch 'frontend-next' into t216-refactor-common
Diffstat (limited to '')
-rw-r--r-- | public/js/cover.js | 2 | ||||
-rw-r--r-- | public/js/index.js | 30 |
2 files changed, 27 insertions, 5 deletions
diff --git a/public/js/cover.js b/public/js/cover.js index bc04923b..a3ed7784 100644 --- a/public/js/cover.js +++ b/public/js/cover.js @@ -118,9 +118,11 @@ $(".ui-history").click(() => { function checkHistoryList() { if ($("#history-list").children().length > 0) { + $('.pagination').show(); $(".ui-nohistory").hide(); $(".ui-import-from-browser").hide(); } else if ($("#history-list").children().length == 0) { + $('.pagination').hide(); $(".ui-nohistory").slideDown(); getStorageHistory(data => { if (data && data.length > 0 && getLoginState() && historyList.items.length == 0) { diff --git a/public/js/index.js b/public/js/index.js index 3bf42ad4..a7e69e81 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -864,7 +864,9 @@ window.ui = { freely: $(".ui-permission-freely"), editable: $(".ui-permission-editable"), locked: $(".ui-permission-locked"), - private: $(".ui-permission-private") + private: $(".ui-permission-private"), + limited: $(".ui-permission-limited"), + protected: $(".ui-permission-protected") }, delete: $(".ui-delete-note") }, @@ -2254,6 +2256,14 @@ ui.infobar.permission.locked.click(function () { ui.infobar.permission.private.click(function () { emitPermission("private"); }); +//limited +ui.infobar.permission.limited.click(function() { + emitPermission("limited"); +}); +//protected +ui.infobar.permission.protected.click(function() { + emitPermission("protected"); +}); // delete note ui.infobar.delete.click(function () { $('.delete-modal').modal('show'); @@ -2284,10 +2294,18 @@ function updatePermission(newPermission) { label = '<i class="fa fa-shield"></i> Editable'; title = "Signed people can edit"; break; + case "limited": + label = '<i class="fa fa-id-card"></i> Limited'; + title = "Signed people can edit (forbid guest)" + break; case "locked": label = '<i class="fa fa-lock"></i> Locked'; title = "Only owner can edit"; break; + case "protected": + label = '<i class="fa fa-umbrella"></i> Protected'; + title = "Only owner can edit (forbid guest)"; + break; case "private": label = '<i class="fa fa-hand-stop-o"></i> Private'; title = "Only owner can view & edit"; @@ -2309,6 +2327,7 @@ function havePermission() { bool = true; break; case "editable": + case "limited": if (!personalInfo.login) { bool = false; } else { @@ -2317,6 +2336,7 @@ function havePermission() { break; case "locked": case "private": + case "protected": if (!owner || personalInfo.userid != owner) { bool = false; } else { @@ -2933,14 +2953,14 @@ function sortOnlineUserList(list) { else if (usera.idle && !userb.idle) return 1; else { - if (usera.name && usera.name.toLowerCase() < userb.name.toLowerCase()) { + if (usera.name && userb.name && usera.name.toLowerCase() < userb.name.toLowerCase()) { return -1; - } else if (usera.name && usera.name.toLowerCase() > userb.name.toLowerCase()) { + } else if (usera.name && userb.name && usera.name.toLowerCase() > userb.name.toLowerCase()) { return 1; } else { - if (usera.color && usera.color.toLowerCase() < userb.color.toLowerCase()) + if (usera.color && userb.color && usera.color.toLowerCase() < userb.color.toLowerCase()) return -1; - else if (usera.color && usera.color.toLowerCase() > userb.color.toLowerCase()) + else if (usera.color && userb.color && usera.color.toLowerCase() > userb.color.toLowerCase()) return 1; else return 0; |