From 89b8ddeabae81fd3a8891ce9d8191fbc9e27c83c Mon Sep 17 00:00:00 2001 From: 蒼時弦也 Date: Tue, 10 Jan 2017 10:02:37 +0800 Subject: Add limited and protected permission --- public/js/index.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'public/js') diff --git a/public/js/index.js b/public/js/index.js index 56766657..5b606242 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -857,7 +857,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") }, @@ -2247,6 +2249,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'); @@ -2285,6 +2295,14 @@ function updatePermission(newPermission) { label = ' Private'; title = "Only owner can view & edit"; break; + case "limited": + label = ' Limited'; + title = "Signed people can view and edit" + break; + case "protected": + label = ' Protected'; + title = "Signed people can view"; + break; } if (personalInfo.userid && owner && personalInfo.userid == owner) { label += ' '; @@ -2302,6 +2320,7 @@ function havePermission() { bool = true; break; case "editable": + case "limited": if (!personalInfo.login) { bool = false; } else { @@ -2310,6 +2329,7 @@ function havePermission() { break; case "locked": case "private": + case "protected": if (!owner || personalInfo.userid != owner) { bool = false; } else { -- cgit v1.2.3 From 7b02c48d93d05e3ced0a030a13d620559710c9cd Mon Sep 17 00:00:00 2001 From: 蒼時弦也 Date: Tue, 10 Jan 2017 14:13:30 +0800 Subject: Adjust permission order to more clarly --- public/js/index.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'public/js') diff --git a/public/js/index.js b/public/js/index.js index 5b606242..4cbc6b93 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -2287,22 +2287,22 @@ function updatePermission(newPermission) { label = ' Editable'; title = "Signed people can edit"; break; - case "locked": - label = ' Locked'; - title = "Only owner can edit"; + case "limited": + label = ' Limited'; + title = "Signed people can view & edit" break; case "private": label = ' Private'; title = "Only owner can view & edit"; break; - case "limited": - label = ' Limited'; - title = "Signed people can view and edit" - break; case "protected": label = ' Protected'; title = "Signed people can view"; break; + case "locked": + label = ' Locked'; + title = "Only owner can edit"; + break; } if (personalInfo.userid && owner && personalInfo.userid == owner) { label += ' '; -- cgit v1.2.3 From 758607d37808b7fee2957bdb33eeda44e02233d4 Mon Sep 17 00:00:00 2001 From: 蒼時弦也 Date: Tue, 10 Jan 2017 15:15:12 +0800 Subject: Add fa-stack style to public/js/index.js --- public/js/index.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'public/js') diff --git a/public/js/index.js b/public/js/index.js index 4cbc6b93..7ddc696a 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -2288,16 +2288,22 @@ function updatePermission(newPermission) { title = "Signed people can edit"; break; case "limited": - label = ' Limited'; - title = "Signed people can view & edit" + label = ' Limited'; + title = "Signed people can edit & guest can't view" break; case "private": label = ' Private'; title = "Only owner can view & edit"; break; case "protected": - label = ' Protected'; - title = "Signed people can view"; + label = '' + + '' + + '' + + ' Protected'; + title = "Only owner can edit & guest can't view"; break; case "locked": label = ' Locked'; -- cgit v1.2.3 From a9fe43ac3a38f036d4f9baa27c50fc9b5fea8c1f Mon Sep 17 00:00:00 2001 From: 蒼時弦也 Date: Tue, 10 Jan 2017 17:22:57 +0800 Subject: Update limited/protected permission icon --- public/js/index.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'public/js') diff --git a/public/js/index.js b/public/js/index.js index 7ddc696a..057ddd9d 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -2288,10 +2288,7 @@ function updatePermission(newPermission) { title = "Signed people can edit"; break; case "limited": - label = ' Limited'; + label = ' Limited'; title = "Signed people can edit & guest can't view" break; case "private": @@ -2299,10 +2296,7 @@ function updatePermission(newPermission) { title = "Only owner can view & edit"; break; case "protected": - label = '' + - '' + - '' + - ' Protected'; + label = ' Protected'; title = "Only owner can edit & guest can't view"; break; case "locked": -- cgit v1.2.3 From d6be0cf755e31002d6265b706785c06e06a0ae56 Mon Sep 17 00:00:00 2001 From: 蒼時弦也 Date: Tue, 10 Jan 2017 20:22:06 +0800 Subject: Update limite icon to fa-id-card --- public/js/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'public/js') diff --git a/public/js/index.js b/public/js/index.js index 057ddd9d..91dc8f0d 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -2288,7 +2288,7 @@ function updatePermission(newPermission) { title = "Signed people can edit"; break; case "limited": - label = ' Limited'; + label = ' Limited'; title = "Signed people can edit & guest can't view" break; case "private": -- cgit v1.2.3 From 0432fef26762cfa62338a11b864488a4d525b233 Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Thu, 12 Jan 2017 17:14:32 +0800 Subject: Fix history list might check pagination on clear and open --- public/js/cover.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'public/js') diff --git a/public/js/cover.js b/public/js/cover.js index 2f35bd28..a8d8ecfe 100644 --- a/public/js/cover.js +++ b/public/js/cover.js @@ -107,9 +107,11 @@ $(".ui-history").click(function () { 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(function (data) { if (data && data.length > 0 && getLoginState() && historyList.items.length == 0) { -- cgit v1.2.3 From ffa14cfeefb9afcc6f177a9ecfe710ffb3227242 Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Thu, 12 Jan 2017 17:17:36 +0800 Subject: Fix sortOnlineUserList might not check property existence before comparsion --- public/js/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'public/js') diff --git a/public/js/index.js b/public/js/index.js index 91dc8f0d..7effcbd7 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -2946,14 +2946,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; -- cgit v1.2.3 From 5f65795e79561f7b787767b7c184f66b65f74c5f Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Thu, 12 Jan 2017 19:04:17 +0800 Subject: Fix permission order and keep wording consistency --- public/js/index.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'public/js') diff --git a/public/js/index.js b/public/js/index.js index 7effcbd7..1dfb02e1 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -2291,17 +2291,17 @@ function updatePermission(newPermission) { label = ' Limited'; title = "Signed people can edit & guest can't view" break; - case "private": - label = ' Private'; - title = "Only owner can view & edit"; + case "locked": + label = ' Locked'; + title = "Only owner can edit"; break; case "protected": label = ' Protected'; title = "Only owner can edit & guest can't view"; break; - case "locked": - label = ' Locked'; - title = "Only owner can edit"; + case "private": + label = ' Private'; + title = "Only owner can view & edit"; break; } if (personalInfo.userid && owner && personalInfo.userid == owner) { -- cgit v1.2.3 From 8b378d7847b82f34ceedfdfbf27d5fe324ab1944 Mon Sep 17 00:00:00 2001 From: Wu Cheng-Han Date: Thu, 12 Jan 2017 23:36:23 +0800 Subject: Update to use shorter wording in limited and protected permissions --- public/js/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'public/js') diff --git a/public/js/index.js b/public/js/index.js index 1dfb02e1..14235bc3 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -2289,7 +2289,7 @@ function updatePermission(newPermission) { break; case "limited": label = ' Limited'; - title = "Signed people can edit & guest can't view" + title = "Signed people can edit (forbid guest)" break; case "locked": label = ' Locked'; @@ -2297,7 +2297,7 @@ function updatePermission(newPermission) { break; case "protected": label = ' Protected'; - title = "Only owner can edit & guest can't view"; + title = "Only owner can edit (forbid guest)"; break; case "private": label = ' Private'; -- cgit v1.2.3