summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
Diffstat (limited to 'public')
-rw-r--r--public/js/index.js22
-rw-r--r--public/views/body.ejs1
2 files changed, 21 insertions, 2 deletions
diff --git a/public/js/index.js b/public/js/index.js
index 1dfadc9a..86771fde 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -327,7 +327,8 @@ var ui = {
label: $(".ui-permission-label"),
freely: $(".ui-permission-freely"),
editable: $(".ui-permission-editable"),
- locked: $(".ui-permission-locked")
+ locked: $(".ui-permission-locked"),
+ private: $(".ui-permission-private")
}
},
toc: {
@@ -1067,6 +1068,10 @@ ui.infobar.permission.editable.click(function () {
ui.infobar.permission.locked.click(function () {
emitPermission("locked");
});
+//private
+ui.infobar.permission.private.click(function () {
+ emitPermission("private");
+});
function emitPermission(_permission) {
if (_permission != permission) {
@@ -1094,6 +1099,10 @@ function updatePermission(newPermission) {
label = '<i class="fa fa-lock"></i> Locked';
title = "Only owner can edit";
break;
+ case "private":
+ label = '<i class="fa fa-hand-stop-o"></i> Private';
+ title = "Only owner can view & edit";
+ break;
}
if (personalInfo.userid == owner) {
label += ' <i class="fa fa-caret-down"></i>';
@@ -1118,6 +1127,7 @@ function havePermission() {
}
break;
case "locked":
+ case "private":
if (personalInfo.userid != owner) {
bool = false;
} else {
@@ -1145,7 +1155,14 @@ socket.emit = function () {
};
socket.on('info', function (data) {
console.error(data);
- location.href = "./404";
+ switch (data.code) {
+ case 404:
+ location.href = "./404";
+ break;
+ case 403:
+ location.href = "./403";
+ break;
+ }
});
socket.on('error', function (data) {
console.error(data);
@@ -1755,6 +1772,7 @@ editor.on('beforeChange', function (cm, change) {
$('.signin-modal').modal('show');
break;
case "locked":
+ case "private":
$('.locked-modal').modal('show');
break;
}
diff --git a/public/views/body.ejs b/public/views/body.ejs
index b3a49db8..fa7436e7 100644
--- a/public/views/body.ejs
+++ b/public/views/body.ejs
@@ -18,6 +18,7 @@
<li class="ui-permission-freely"><a><i class="fa fa-leaf fa-fw"></i> Freely - Anyone can edit</a></li>
<li class="ui-permission-editable"><a><i class="fa fa-shield fa-fw"></i> Editable - Signed people can edit</a></li>
<li class="ui-permission-locked"><a><i class="fa fa-lock fa-fw"></i> Locked - Only owner can edit</a></li>
+ <li class="ui-permission-private"><a><i class="fa fa-hand-stop-o fa-fw"></i> Private - Only owner can view &amp; edit</a></li>
</ul>
</span>
</small>