Skip to content

Commit

Permalink
deprecate UIWindowGetCopyLink as it's not supported by the backend
Browse files Browse the repository at this point in the history
  • Loading branch information
jelveh committed Apr 23, 2024
1 parent 65a73b5 commit ab5fee1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 163 deletions.
32 changes: 0 additions & 32 deletions src/UI/UIItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import UIWindowPublishWebsite from './UIWindowPublishWebsite.js';
import UIWindowItemProperties from './UIWindowItemProperties.js';
import UIWindowGetCopyLink from './UIWindowGetCopyLink.js';
import UIWindowSaveAccount from './UIWindowSaveAccount.js';
import UIPopover from './UIPopover.js';
import UIWindowEmailConfirmationRequired from './UIWindowEmailConfirmationRequired.js';
Expand Down Expand Up @@ -1131,37 +1130,6 @@ function UIItem(options){
}
});
}


// -------------------------------------------
// Get Copy Link
// -------------------------------------------
if(!is_trashed && !is_trash && (options.associated_app_name === null || options.associated_app_name === undefined)){
menu_items.push({
html: i18n('get_copy_link'),
onClick: async function(){
if(window.user.is_temp &&
!await UIWindowSaveAccount({
message: i18n('save_account_to_get_copy_link'),
send_confirmation_code: true,
window_options: {
backdrop: true,
close_on_backdrop_click: false,
}
}))
return;
else if(!window.user.email_confirmed && !await UIWindowEmailConfirmationRequired())
return;

UIWindowGetCopyLink({
name: $(el_item).attr('data-name'),
uid: $(el_item).attr('data-uid'),
path: $(el_item).attr('data-path'),
is_dir: options.is_dir,
});
}
});
}
// -------------------------------------------
// Zip
// -------------------------------------------
Expand Down
121 changes: 0 additions & 121 deletions src/UI/UIWindowGetCopyLink.js

This file was deleted.

12 changes: 6 additions & 6 deletions src/UI/UIWindowItemProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,27 +117,27 @@ async function UIWindowItemProperties(item_name, item_path, item_uid, left, top,
$(el_window).find('[data-tab="versions"]').hide();
}
// name
$(el_window).find('.item-prop-val-name').html(fsentry.name);
$(el_window).find('.item-prop-val-name').text(fsentry.name);
// path
$(el_window).find('.item-prop-val-path').html(item_path);
$(el_window).find('.item-prop-val-path').text(item_path);
// original name & path
if(fsentry.metadata){
try{
let metadata = JSON.parse(fsentry.metadata);
if(metadata.original_name){
$(el_window).find('.item-prop-val-original-name').html(metadata.original_name);
$(el_window).find('.item-prop-val-original-name').text(metadata.original_name);
$(el_window).find('.item-prop-original-name').show();
}
if(metadata.original_path){
$(el_window).find('.item-prop-val-original-path').html(metadata.original_path);
$(el_window).find('.item-prop-val-original-path').text(metadata.original_path);
$(el_window).find('.item-prop-original-path').show();
}
}catch(e){}
}

// shortcut to
if(fsentry.shortcut_to && fsentry.shortcut_to_path){
$(el_window).find('.item-prop-val-shortcut-to').html(fsentry.shortcut_to_path);
$(el_window).find('.item-prop-val-shortcut-to').text(fsentry.shortcut_to_path);
}
// uid
$(el_window).find('.item-prop-val-uid').html(fsentry.id);
Expand All @@ -152,7 +152,7 @@ async function UIWindowItemProperties(item_name, item_path, item_uid, left, top,
// subdomains
if(fsentry.subdomains && fsentry.subdomains.length > 0 ){
fsentry.subdomains.forEach(subdomain => {
$(el_window).find('.item-prop-val-websites').append(`<p class="item-prop-website-entry" data-uuid="${subdomain.uuid}" style="margin-bottom:5px; margin-top:5px;"><a target="_blank" href="${subdomain.address}">${subdomain.address}</a> (<span class="disassociate-website-link" data-uuid="${subdomain.uuid}" data-subdomain="${extractSubdomain(subdomain.address)}">disassociate</span>)</p>`);
$(el_window).find('.item-prop-val-websites').append(`<p class="item-prop-website-entry" data-uuid="${html_encode(subdomain.uuid)}" style="margin-bottom:5px; margin-top:5px;"><a target="_blank" href="${html_encode(subdomain.address)}">${html_encode(subdomain.address)}</a> (<span class="disassociate-website-link" data-uuid="${html_encode(subdomain.uuid)}" data-subdomain="${extractSubdomain(subdomain.address)}">disassociate</span>)</p>`);
});
}
else{
Expand Down
8 changes: 4 additions & 4 deletions src/UI/UIWindowMyWebsites.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,16 @@ async function UIWindowMyWebsites(options){
h += `<img class="mywebsites-site-setting" data-site-uuid="${sites[i].uid}" src="${html_encode(window.icons['cog.svg'])}">`;
// there is a directory associated with this site
if(sites[i].root_dir){
h += `<p class="mywebsites-dir-path" data-path="${html_encode(sites[i].root_dir.path)}" data-name="${sites[i].root_dir.name}" data-uuid="${sites[i].root_dir.id}">`;
h += `<p class="mywebsites-dir-path" data-path="${html_encode(sites[i].root_dir.path)}" data-name="${html_encode(sites[i].root_dir.name)}" data-uuid="${sites[i].root_dir.id}">`;
h+= `<img src="${html_encode(window.icons['folder.svg'])}">`;
h+= `${sites[i].root_dir.path}`;
h+= `${html_encode(sites[i].root_dir.path)}`;
h += `</p>`;
h += `<p style="margin-bottom:0; margin-top: 20px; font-size: 13px;">`;
h += `<span class="mywebsites-dis-dir" data-dir-uuid="${sites[i].root_dir.id}" data-site-uuid="${sites[i].uid}">`;
h += `<span class="mywebsites-dis-dir" data-dir-uuid="${html_encode(sites[i].root_dir.id)}" data-site-uuid="${html_encode(sites[i].uid)}">`;
h += `<img style="width: 16px; margin-bottom: -2px; margin-right: 4px;" src="${html_encode(window.icons['plug.svg'])}">${i18n('disassociate_dir')}</span>`;
h += `</p>`;
}
h += `<p class="mywebsites-no-dir-notice" data-site-uuid="${sites[i].uid}" style="${sites[i].root_dir ? `display:none;` : `display:block;`}">${i18n('no_dir_associated_with_site')}</p>`;
h += `<p class="mywebsites-no-dir-notice" data-site-uuid="${html_encode(sites[i].uid)}" style="${sites[i].root_dir ? `display:none;` : `display:block;`}">${i18n('no_dir_associated_with_site')}</p>`;
h += `</div>`;
}
$(el_window).find('.window-body').html(h);
Expand Down

0 comments on commit ab5fee1

Please sign in to comment.