mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-18 17:25:16 -04:00
Merge branch 'frontend-next' into t216-refactor-common
This commit is contained in:
commit
c0e8306961
18 changed files with 306 additions and 69 deletions
|
@ -118,9 +118,11 @@ $(".ui-history").click(() => {
|
|||
|
||||
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(data => {
|
||||
if (data && data.length > 0 && getLoginState() && historyList.items.length == 0) {
|
||||
|
|
|
@ -864,7 +864,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")
|
||||
},
|
||||
|
@ -2254,6 +2256,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');
|
||||
|
@ -2284,10 +2294,18 @@ function updatePermission(newPermission) {
|
|||
label = '<i class="fa fa-shield"></i> Editable';
|
||||
title = "Signed people can edit";
|
||||
break;
|
||||
case "limited":
|
||||
label = '<i class="fa fa-id-card"></i> Limited';
|
||||
title = "Signed people can edit (forbid guest)"
|
||||
break;
|
||||
case "locked":
|
||||
label = '<i class="fa fa-lock"></i> Locked';
|
||||
title = "Only owner can edit";
|
||||
break;
|
||||
case "protected":
|
||||
label = '<i class="fa fa-umbrella"></i> Protected';
|
||||
title = "Only owner can edit (forbid guest)";
|
||||
break;
|
||||
case "private":
|
||||
label = '<i class="fa fa-hand-stop-o"></i> Private';
|
||||
title = "Only owner can view & edit";
|
||||
|
@ -2309,6 +2327,7 @@ function havePermission() {
|
|||
bool = true;
|
||||
break;
|
||||
case "editable":
|
||||
case "limited":
|
||||
if (!personalInfo.login) {
|
||||
bool = false;
|
||||
} else {
|
||||
|
@ -2317,6 +2336,7 @@ function havePermission() {
|
|||
break;
|
||||
case "locked":
|
||||
case "private":
|
||||
case "protected":
|
||||
if (!owner || personalInfo.userid != owner) {
|
||||
bool = false;
|
||||
} else {
|
||||
|
@ -2933,14 +2953,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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue