summaryrefslogtreecommitdiff
path: root/public/js
diff options
context:
space:
mode:
authorMax Wu2017-01-10 20:23:47 +0800
committerGitHub2017-01-10 20:23:47 +0800
commita8068d38d589a1b8ed008f737d42ed35df4bfd2b (patch)
tree0f3b5fcdaa9da239170dd7a6731d0f8f0504f759 /public/js
parent258a59a77d390196a66acfbd5dd49ea66c5f18f9 (diff)
parentd6be0cf755e31002d6265b706785c06e06a0ae56 (diff)
Merge pull request #313 from elct9620/feature/disable_anonymous_view
WIP: Add options to limit anonymous view note
Diffstat (limited to 'public/js')
-rw-r--r--public/js/index.js28
1 files changed, 24 insertions, 4 deletions
diff --git a/public/js/index.js b/public/js/index.js
index 56766657..91dc8f0d 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');
@@ -2277,14 +2287,22 @@ function updatePermission(newPermission) {
label = '<i class="fa fa-shield"></i> Editable';
title = "Signed people can edit";
break;
- case "locked":
- label = '<i class="fa fa-lock"></i> Locked';
- title = "Only owner can edit";
+ case "limited":
+ label = '<i class="fa fa-id-card"></i> Limited';
+ title = "Signed people can edit & guest can't view"
break;
case "private":
label = '<i class="fa fa-hand-stop-o"></i> Private';
title = "Only owner can view & edit";
break;
+ case "protected":
+ label = '<i class="fa fa-umbrella"></i> Protected';
+ title = "Only owner can edit & guest can't view";
+ break;
+ case "locked":
+ label = '<i class="fa fa-lock"></i> Locked';
+ title = "Only owner can edit";
+ break;
}
if (personalInfo.userid && owner && personalInfo.userid == owner) {
label += ' <i class="fa fa-caret-down"></i>';
@@ -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 {