diff --git a/src/UI/UIWindowItemProperties.js b/src/UI/UIWindowItemProperties.js index 821483b1..0bbccae3 100644 --- a/src/UI/UIWindowItemProperties.js +++ b/src/UI/UIWindowItemProperties.js @@ -169,24 +169,6 @@ async function UIWindowItemProperties(item_name, item_path, item_uid, left, top, $(el_window).find('.item-props-version-list').append('-'); } - // owner - $(el_window).find('.item-prop-val-permissions').append(`

${(fsentry.owner.email === undefined || fsentry.owner.email === null) ? fsentry.owner.username : fsentry.owner.email} (owner)

`); - - // other users with access - if(fsentry.permissions && fsentry.permissions.length > 0 ){ - fsentry.permissions.forEach(perm => { - let h = ``; - // username/email - h += `

${perm.email ?? perm.username} `; - // remove - h += `(remove)`; - $(el_window).find('.item-prop-val-permissions').append(h); - }); - } - else{ - $(el_window).find('.item-prop-val-permissions').append('-'); - } - $(el_window).find(`.disassociate-website-link`).on('click', function(e){ puter.hosting.update( $(e.target).attr('data-subdomain'), @@ -199,43 +181,7 @@ async function UIWindowItemProperties(item_name, item_path, item_uid, left, top, } } ) - }) - - $(el_window).find('.remove-permission-link').on('click', function(e){ - const el_remove_perm_link= this; - const perm_uid = $(el_remove_perm_link).attr('data-perm-uid'); - $.ajax({ - url: api_origin + "/remove-perm", - type: 'POST', - async: true, - contentType: "application/json", - data: JSON.stringify({ - uid: perm_uid, - }), - headers: { - "Authorization": "Bearer "+auth_token - }, - statusCode: { - 401: function () { - logout(); - }, - }, - success: async function (res){ - $(el_window).find(`.item-prop-perm-entry[data-perm-uid="${perm_uid}"]`).remove(); - - if($(el_window).find(`.item-prop-perm-entry`).length === 0){ - $(el_window).find(`.item-prop-val-permissions`).html('-'); - // todo is it better to combine the following two queriesinto one css selector? - $(`.item[data-uid="${item_uid}"]`).find(`.item-is-shared`).fadeOut(200); - // todo optim do this only if item is a directory - // todo this has to be case-insensitive but the `i` selector doesn't work on ^= - $(`.item[data-path^="${item_path}/"]`).find(`.item-is-shared`).fadeOut(200); - } - }, - complete: function(){ - } - }) - }) + }) } }) } diff --git a/src/helpers.js b/src/helpers.js index 21e11f5e..c4c8bbbd 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -2476,29 +2476,6 @@ window.move_items = async function(el_items, dest_path, is_undo = false){ success: function (){ } }) - // remove all associated permissions - // todo, some client-side check to see if this dir has an FR associated with it before sending a whole ajax req - $.ajax({ - url: api_origin + "/remove-item-perms", - type: 'POST', - data: JSON.stringify({ - uid: $(el_item).attr('data-uid'), - }), - async: true, - contentType: "application/json", - headers: { - "Authorization": "Bearer "+auth_token - }, - statusCode: { - 401: function () { - logout(); - }, - }, - success: function (){ - } - }) - $(`.item[data-uid="${$(el_item).attr('data-uid')}"]`).find('.item-is-shared').fadeOut(300); - // if trashing dir... if($(el_item).attr('data-is_dir') === '1'){ // disassociate all its websites diff --git a/src/initgui.js b/src/initgui.js index 25a5c12f..e285f06d 100644 --- a/src/initgui.js +++ b/src/initgui.js @@ -1697,35 +1697,6 @@ window.initgui = async function(){ } }); - $(document).on('click', '.remove-permission-link', async function(e){ - const el_remove_perm_link= this; - const perm_uid = $(el_remove_perm_link).attr('data-perm-uid'); - $.ajax({ - url: api_origin + "/remove-perm", - type: 'POST', - async: true, - contentType: "application/json", - data: JSON.stringify({ - uid: perm_uid, - }), - headers: { - "Authorization": "Bearer "+auth_token - }, - statusCode: { - 401: function () { - logout(); - }, - }, - success: async function (res){ - $(`[data-perm-uid="${perm_uid}"]`).hide("slide", { direction: "right" }, 300, function(e){ - $(this).remove(); - }); - }, - complete: function(){ - } - }) - }) - // update mouse position coordinates $(document).mousemove(function(event){ mouseX = event.clientX;