summaryrefslogtreecommitdiff
path: root/public/js/index.js
diff options
context:
space:
mode:
authorCheng-Han, Wu2016-04-20 18:03:55 +0800
committerCheng-Han, Wu2016-04-20 18:03:55 +0800
commit49b51e478fa75b8d5254662de3265edcf8906004 (patch)
tree3b09213baae129156339b5ad496924f591790e88 /public/js/index.js
parente613aeba75aec5ceb4f10ae62881a3635183857d (diff)
Refactor server with Sequelize ORM, refactor server configs, now will show note status (created or updated) and support docs (note alias)
Diffstat (limited to '')
-rw-r--r--public/js/index.js17
1 files changed, 12 insertions, 5 deletions
diff --git a/public/js/index.js b/public/js/index.js
index 6cbaf066..0e4fd21a 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -1423,7 +1423,7 @@ function updatePermission(newPermission) {
title = "Only owner can view & edit";
break;
}
- if (personalInfo.userid == owner) {
+ if (personalInfo.userid && personalInfo.userid == owner) {
label += ' <i class="fa fa-caret-down"></i>';
ui.infobar.permission.label.removeClass('disabled');
} else {
@@ -1476,11 +1476,14 @@ socket.emit = function () {
socket.on('info', function (data) {
console.error(data);
switch (data.code) {
+ case 403:
+ location.href = "./403";
+ break;
case 404:
location.href = "./404";
break;
- case 403:
- location.href = "./403";
+ case 500:
+ location.href = "./500";
break;
}
});
@@ -1517,11 +1520,15 @@ socket.on('version', function (data) {
});
function updateLastInfo(data) {
//console.log(data);
- if (lastchangetime !== data.updatetime) {
+ if (data.hasOwnProperty('createtime') && createtime !== data.createtime) {
+ createtime = data.createtime;
+ updateLastChange();
+ }
+ if (data.hasOwnProperty('updatetime') && lastchangetime !== data.updatetime) {
lastchangetime = data.updatetime;
updateLastChange();
}
- if (lastchangeuser !== data.lastchangeuser) {
+ if (data.hasOwnProperty('lastchangeuser') && lastchangeuser !== data.lastchangeuser) {
lastchangeuser = data.lastchangeuser;
lastchangeuserprofile = data.lastchangeuserprofile;
updateLastChangeUser();