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 +++++++++++++++++++++- public/views/body.ejs | 2 ++ 2 files changed, 23 insertions(+), 1 deletion(-) (limited to 'public') 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 { diff --git a/public/views/body.ejs b/public/views/body.ejs index 83a82fa3..79e36141 100644 --- a/public/views/body.ejs +++ b/public/views/body.ejs @@ -19,6 +19,8 @@
  • Editable - Signed people can edit
  • Locked - Only owner can edit
  • Private - Only owner can view & edit
  • +
  • Limited - Signed people can edit & view
  • +
  • Protected - Only owner can edit
  • Delete this note
  • -- 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 +++++++------- public/views/body.ejs | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'public') 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 += ' '; diff --git a/public/views/body.ejs b/public/views/body.ejs index 79e36141..988d4f5b 100644 --- a/public/views/body.ejs +++ b/public/views/body.ejs @@ -17,10 +17,10 @@ -- 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') 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 ++-------- public/views/body.ejs | 4 ++-- 2 files changed, 4 insertions(+), 10 deletions(-) (limited to 'public') 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": diff --git a/public/views/body.ejs b/public/views/body.ejs index 988d4f5b..6500e607 100644 --- a/public/views/body.ejs +++ b/public/views/body.ejs @@ -17,9 +17,9 @@