diff --git a/src/gui/src/UI/UIDesktop.js b/src/gui/src/UI/UIDesktop.js index 6b9d619fb6..5b04880867 100644 --- a/src/gui/src/UI/UIDesktop.js +++ b/src/gui/src/UI/UIDesktop.js @@ -43,24 +43,24 @@ import launch_app from "../helpers/launch_app.js" import item_icon from "../helpers/item_icon.js" import UIWindowSearch from "./UIWindowSearch.js" -async function UIDesktop(options){ +async function UIDesktop(options) { let h = ''; // Set up the desktop channel for communication between different tabs in the same browser window.channel = new BroadcastChannel('puter-desktop-channel'); - channel.onmessage = function(e){ + channel.onmessage = function (e) { } // Give Camera and Recorder write permissions to Desktop puter.kv.get('has_set_default_app_user_permissions').then(async (user_permissions) => { - if(!user_permissions){ + if (!user_permissions) { // Camera - try{ - await fetch( window.api_origin + "/auth/grant-user-app", { + try { + await fetch(window.api_origin + "/auth/grant-user-app", { "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer " + window.auth_token, + "Content-Type": "application/json", + "Authorization": "Bearer " + window.auth_token, }, "body": JSON.stringify({ app_uid: 'app-5584fbf7-ed69-41fc-99cd-85da21b1ef51', @@ -68,16 +68,16 @@ async function UIDesktop(options){ }), "method": "POST", }); - }catch(err){ + } catch (err) { console.error(err); } // Recorder - try{ - await fetch( window.api_origin + "/auth/grant-user-app", { + try { + await fetch(window.api_origin + "/auth/grant-user-app", { "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer " + window.auth_token, + "Content-Type": "application/json", + "Authorization": "Bearer " + window.auth_token, }, "body": JSON.stringify({ app_uid: 'app-7bdca1a4-6373-4c98-ad97-03ff2d608ca1', @@ -85,7 +85,7 @@ async function UIDesktop(options){ }), "method": "POST", }); - }catch(err){ + } catch (err) { console.error(err); } @@ -103,13 +103,13 @@ async function UIDesktop(options){ window.socket.on('error', (error) => { console.error('GUI Socket Error:', error); }); - - window.socket.on('connect', function(){ + + window.socket.on('connect', function () { // console.log('GUI Socket: Connected', window.socket.id); window.socket.emit('puter_is_actually_open'); }); - window.socket.on('reconnect', function(){ + window.socket.on('reconnect', function () { console.log('GUI Socket: Reconnected', window.socket.id); }); @@ -138,17 +138,17 @@ async function UIDesktop(options){ }); window.socket.on('upload.progress', (msg) => { - if(window.progress_tracker[msg.operation_id]){ + if (window.progress_tracker[msg.operation_id]) { window.progress_tracker[msg.operation_id].cloud_uploaded += msg.loaded_diff - if(window.progress_tracker[msg.operation_id][msg.item_upload_id]){ + if (window.progress_tracker[msg.operation_id][msg.item_upload_id]) { window.progress_tracker[msg.operation_id][msg.item_upload_id].cloud_uploaded = msg.loaded; } } }); window.socket.on('download.progress', (msg) => { - if(window.progress_tracker[msg.operation_id]){ - if(window.progress_tracker[msg.operation_id][msg.item_upload_id]){ + if (window.progress_tracker[msg.operation_id]) { + if (window.progress_tracker[msg.operation_id][msg.item_upload_id]) { window.progress_tracker[msg.operation_id][msg.item_upload_id].downloaded = msg.loaded; window.progress_tracker[msg.operation_id][msg.item_upload_id].total = msg.total; } @@ -159,10 +159,10 @@ async function UIDesktop(options){ $(`.item[data-path="${html_encode(window.trash_path)}" i]`).find('.item-icon > img').attr('src', msg.is_empty ? window.icons['trash.svg'] : window.icons['trash-full.svg']); $(`.window[data-path="${html_encode(window.trash_path)}" i]`).find('.window-head-icon').attr('src', msg.is_empty ? window.icons['trash.svg'] : window.icons['trash-full.svg']); // empty trash windows if needed - if(msg.is_empty) + if (msg.is_empty) $(`.window[data-path="${html_encode(window.trash_path)}" i]`).find('.item-container').empty(); }) - + /** * This event is triggered if a user receives a notification during * an active session. @@ -171,14 +171,14 @@ async function UIDesktop(options){ let icon = window.icons[notification.icon]; let round_icon = false; - if(notification.template === "file-shared-with-you" && notification.fields?.username){ + if (notification.template === "file-shared-with-you" && notification.fields?.username) { let profile_pic = await get_profile_picture(notification.fields?.username); - if(profile_pic){ + if (profile_pic) { icon = profile_pic; round_icon = true; } } - + UINotification({ title: notification.title, text: notification.text, @@ -197,12 +197,12 @@ async function UIDesktop(options){ }); }, click: async (notif) => { - if(notification.template === "file-shared-with-you"){ + if (notification.template === "file-shared-with-you") { let item_path = '/' + notification.fields.username; UIWindow({ path: '/' + notification.fields.username, title: path.basename(item_path), - icon: await item_icon({is_dir: true, path: item_path}), + icon: await item_icon({ is_dir: true, path: item_path }), is_dir: true, app: 'explorer', }); @@ -221,22 +221,22 @@ async function UIDesktop(options){ */ window.__already_got_unreads = false; window.socket.on('notif.unreads', async ({ unreads }) => { - if ( window.__already_got_unreads ) return; + if (window.__already_got_unreads) return; window.__already_got_unreads = true; - for ( const notif_info of unreads ) { + for (const notif_info of unreads) { const notification = notif_info.notification; let icon = window.icons[notification.icon]; let round_icon = false; - if(notification.template === "file-shared-with-you" && notification.fields?.username){ + if (notification.template === "file-shared-with-you" && notification.fields?.username) { let profile_pic = await get_profile_picture(notification.fields?.username); - if(profile_pic){ + if (profile_pic) { icon = profile_pic; round_icon = true; } } - + UINotification({ icon, round_icon, @@ -256,12 +256,12 @@ async function UIDesktop(options){ }); }, click: async (notif) => { - if(notification.template === "file-shared-with-you"){ + if (notification.template === "file-shared-with-you") { let item_path = '/' + notification.fields?.username; UIWindow({ path: '/' + notification.fields?.username, title: path.basename(item_path), - icon: await item_icon({is_dir: true, path: item_path}), + icon: await item_icon({ is_dir: true, path: item_path }), is_dir: true, app: 'explorer', }); @@ -278,9 +278,9 @@ async function UIDesktop(options){ window.socket.on('app.opened', async (app) => { // don't update if this is the original client that initiated the action - if(app.original_client_socket_id === window.socket.id) + if (app.original_client_socket_id === window.socket.id) return; - + // add the app to the beginning of the array window.launch_apps.recent.unshift(app); @@ -293,15 +293,15 @@ async function UIDesktop(options){ window.socket.on('item.removed', async (item) => { // don't update if this is the original client that initiated the action - if(item.original_client_socket_id === window.socket.id) + if (item.original_client_socket_id === window.socket.id) return; // don't remove items if this was a descendants_only operation - if(item.descendants_only) + if (item.descendants_only) return; // hide all UIItems with matching uids - $(`.item[data-path='${item.path}']`).fadeOut(150, function(){ + $(`.item[data-path='${item.path}']`).fadeOut(150, function () { // close all windows with matching uids // $('.window-' + item.uid).close(); // close all windows that belong to a descendant of this item @@ -312,7 +312,7 @@ async function UIDesktop(options){ window.socket.on('item.updated', async (item) => { // Don't update if this is the original client that initiated the action - if(item.original_client_socket_id === window.socket.id) + if (item.original_client_socket_id === window.socket.id) return; // Update matching items @@ -342,31 +342,31 @@ async function UIDesktop(options){ $(`.window-${item.uid}`).attr('data-path', new_path); // Update all elements that have matching paths - $(`[data-path="${html_encode(item.old_path)}" i]`).each(function(){ + $(`[data-path="${html_encode(item.old_path)}" i]`).each(function () { $(this).attr('data-path', new_path) - if($(this).hasClass('window-navbar-path-dirname')) + if ($(this).hasClass('window-navbar-path-dirname')) $(this).text(item.name); }); // Update all elements whose paths start with old_path - $(`[data-path^="${html_encode(item.old_path) + '/'}"]`).each(function(){ - const new_el_path = _.replace($(this).attr('data-path'), item.old_path + '/', new_path+'/'); + $(`[data-path^="${html_encode(item.old_path) + '/'}"]`).each(function () { + const new_el_path = _.replace($(this).attr('data-path'), item.old_path + '/', new_path + '/'); $(this).attr('data-path', new_el_path); }); // Update all exact-matching windows - $(`.window-${item.uid}`).each(function(){ + $(`.window-${item.uid}`).each(function () { window.update_window_path(this, new_path); }) // Set new name for matching open windows $(`.window-${item.uid} .window-head-title`).text(item.name); // Re-sort all matching item containers - $(`.item[data-uid='${item.uid}']`).parent('.item-container').each(function(){ + $(`.item[data-uid='${item.uid}']`).parent('.item-container').each(function () { window.sort_items(this, $(this).closest('.item-container').attr('data-sort_by'), $(this).closest('.item-container').attr('data-sort_order')); }) }) - + window.socket.on('item.moved', async (resp) => { let fsentry = resp; // Notify all apps that are watching this item @@ -377,7 +377,7 @@ async function UIDesktop(options){ }) // don't update if this is the original client that initiated the action - if(resp.original_client_socket_id === window.socket.id) + if (resp.original_client_socket_id === window.socket.id) return; let dest_path = path.dirname(fsentry.path); @@ -385,40 +385,40 @@ async function UIDesktop(options){ // update all shortcut_to_path $(`.item[data-shortcut_to_path="${html_encode(resp.old_path)}" i]`).attr(`data-shortcut_to_path`, html_encode(fsentry.path)); - + // remove all items with matching uids - $(`.item[data-uid='${fsentry.uid}']`).fadeOut(150, function(){ + $(`.item[data-uid='${fsentry.uid}']`).fadeOut(150, function () { // find all parent windows that contain this item let parent_windows = $(`.item[data-uid='${fsentry.uid}']`).closest('.window'); // remove this item $(this).removeItems(); // update parent windows' item counts - $(parent_windows).each(function(index){ + $(parent_windows).each(function (index) { window.update_explorer_footer_item_count(this); window.update_explorer_footer_selected_items_count(this) }); }) // if trashing, close windows of trashed items and its descendants - if(dest_path === window.trash_path){ + if (dest_path === window.trash_path) { $(`.window[data-path="${html_encode(resp.old_path)}" i]`).close(); // todo this has to be case-insensitive but the `i` selector doesn't work on ^= $(`.window[data-path^="${html_encode(resp.old_path)}/"]`).close(); } // update all paths of its and its descendants' open windows - else{ + else { // todo this has to be case-insensitive but the `i` selector doesn't work on ^= - $(`.window[data-path^="${html_encode(resp.old_path)}/"], .window[data-path="${html_encode(resp.old_path)}" i]`).each(function(){ + $(`.window[data-path^="${html_encode(resp.old_path)}/"], .window[data-path="${html_encode(resp.old_path)}" i]`).each(function () { window.update_window_path(this, $(this).attr('data-path').replace(resp.old_path, fsentry.path)); }) } - if(dest_path === window.trash_path){ + if (dest_path === window.trash_path) { $(`.item[data-uid="${fsentry.uid}"]`).find('.item-is-shared').fadeOut(300); // if trashing dir... - if(fsentry.is_dir){ + if (fsentry.is_dir) { // remove website badge $(`.mywebsites-dir-path[data-uuid="${fsentry.uid}"]`).remove(); // remove the website badge from all instances of the dir @@ -429,7 +429,7 @@ async function UIDesktop(options){ } } // if replacing an existing item, remove the old item that was just replaced - if(fsentry.overwritten_uid !== undefined) + if (fsentry.overwritten_uid !== undefined) $(`.item[data-uid=${fsentry.overwritten_uid}]`).removeItems(); // if this is trash, get original name from item metadata @@ -456,14 +456,14 @@ async function UIDesktop(options){ metadata: JSON.stringify(fsentry.metadata) ?? '', }); - if(fsentry.parent_dirs_created && fsentry.parent_dirs_created.length > 0){ + if (fsentry.parent_dirs_created && fsentry.parent_dirs_created.length > 0) { // this operation may have created some missing directories, // see if any of the directories in the path of this file is new AND // if these new path have any open parents that need to be updated - + fsentry.parent_dirs_created.forEach(async dir => { let item_container = $(`.item-container[data-path='${html_encode(path.dirname(dir.path))}' i]`); - if(item_container.length > 0 && $(`.item[data-path="${html_encode(dir.path)}" i]`).length === 0){ + if (item_container.length > 0 && $(`.item[data-path="${html_encode(dir.path)}" i]`).length === 0) { UIItem({ appendTo: item_container, immutable: false, @@ -478,20 +478,20 @@ async function UIDesktop(options){ is_selected: false, is_shared: dir.is_shared, has_website: false, - }); - } + }); + } window.sort_items(item_container, $(item_container).attr('data-sort_by'), $(item_container).attr('data-sort_order')); - }); + }); } //sort each container - $(`.item-container[data-path='${html_encode(dest_path)}' i]`).each(function(){ + $(`.item-container[data-path='${html_encode(dest_path)}' i]`).each(function () { window.sort_items(this, $(this).attr('data-sort_by'), $(this).attr('data-sort_order')) }) }); - + window.socket.on('user.email_confirmed', (msg) => { // don't update if this is the original client that initiated the action - if(msg.original_client_socket_id === window.socket.id) + if (msg.original_client_socket_id === window.socket.id) return; window.refresh_user_data(window.auth_token); @@ -499,7 +499,7 @@ async function UIDesktop(options){ window.socket.on('user.email_changed', (msg) => { // don't update if this is the original client that initiated the action - if(msg.original_client_socket_id === window.socket.id) + if (msg.original_client_socket_id === window.socket.id) return; window.refresh_user_data(window.auth_token); @@ -516,7 +516,7 @@ async function UIDesktop(options){ }) // Don't update if this is the original client that initiated the action - if(item.original_client_socket_id === window.socket.id) + if (item.original_client_socket_id === window.socket.id) return; // Update matching items @@ -545,34 +545,34 @@ async function UIDesktop(options){ $(`.window-${item.uid}`).attr('data-path', new_path); // Update all elements that have matching paths - $(`[data-path="${html_encode(item.old_path)}" i]`).each(function(){ + $(`[data-path="${html_encode(item.old_path)}" i]`).each(function () { $(this).attr('data-path', new_path) - if($(this).hasClass('window-navbar-path-dirname')) + if ($(this).hasClass('window-navbar-path-dirname')) $(this).text(item.name); }); // Update all elements whose paths start with old_path - $(`[data-path^="${html_encode(item.old_path) + '/'}"]`).each(function(){ - const new_el_path = _.replace($(this).attr('data-path'), item.old_path + '/', new_path+'/'); + $(`[data-path^="${html_encode(item.old_path) + '/'}"]`).each(function () { + const new_el_path = _.replace($(this).attr('data-path'), item.old_path + '/', new_path + '/'); $(this).attr('data-path', new_el_path); }); // Update all exact-matching windows - $(`.window-${item.uid}`).each(function(){ + $(`.window-${item.uid}`).each(function () { window.update_window_path(this, new_path); }) // Set new name for matching open windows $(`.window-${item.uid} .window-head-title`).text(item.name); // Re-sort all matching item containers - $(`.item[data-uid='${item.uid}']`).parent('.item-container').each(function(){ + $(`.item[data-uid='${item.uid}']`).parent('.item-container').each(function () { window.sort_items(this, $(this).closest('.item-container').attr('data-sort_by'), $(this).closest('.item-container').attr('data-sort_order')); }) }); window.socket.on('item.added', async (item) => { // if item is empty, don't proceed - if(_.isEmpty(item)) + if (_.isEmpty(item)) return; // Notify all apps that are watching this item @@ -586,11 +586,11 @@ async function UIDesktop(options){ }); // Don't update if this is the original client that initiated the action - if(item.original_client_socket_id === window.socket.id) + if (item.original_client_socket_id === window.socket.id) return; // Update replaced items with matching uids - if(item.overwritten_uid){ + if (item.overwritten_uid) { $(`.item[data-uid='${item.overwritten_uid}']`).attr({ 'data-immutable': item.immutable, 'data-path': item.path, @@ -603,13 +603,13 @@ async function UIDesktop(options){ // set new icon const new_icon = (item.is_dir ? window.icons['folder.svg'] : (await item_icon(item)).image); $(`.item[data-uid="${item.overwritten_uid}"]`).find('.item-icon > img').attr('src', new_icon); - + //sort each window - $(`.item-container[data-path='${html_encode(item.dirpath)}' i]`).each(function(){ + $(`.item-container[data-path='${html_encode(item.dirpath)}' i]`).each(function () { window.sort_items(this, $(this).attr('data-sort_by'), $(this).attr('data-sort_order')) - }) + }) } - else{ + else { UIItem({ appendTo: $(`.item-container[data-path='${html_encode(item.dirpath)}' i]`), uid: item.uid, @@ -629,7 +629,7 @@ async function UIDesktop(options){ }); //sort each window - $(`.item-container[data-path='${html_encode(item.dirpath)}' i]`).each(function(){ + $(`.item-container[data-path='${html_encode(item.dirpath)}' i]`).each(function () { window.sort_items(this, $(this).attr('data-sort_by'), $(this).attr('data-sort_order')) }) } @@ -641,9 +641,9 @@ async function UIDesktop(options){ `; - + h += `
`; - + // Desktop // If desktop is not in fullpage/embedded mode, we hide it until files and directories are loaded and then fade in the UI // This gives a calm and smooth experience for the user @@ -661,7 +661,7 @@ async function UIDesktop(options){ puter.kv.get('window_sidebar_width').then(async (val) => { let value = parseInt(val); // if value is a valid number - if(!isNaN(value) && value > 0){ + if (!isNaN(value) && value > 0) { window.window_sidebar_width = value; } }) @@ -680,41 +680,42 @@ async function UIDesktop(options){ // Get menubar style puter.kv.get('menubar_style').then(async (val) => { let value = val; - if(value === 'system' || value === 'desktop' || value === 'window'){ + if (value === 'system' || value === 'desktop' || value === 'window') { window.menubar_style = value; - }else{ + } else { window.menubar_style = 'system'; } - if(window.menubar_style === 'system'){ - if(window.detectHostOS() === 'macos') + if (window.menubar_style === 'system') { + if (window.detectHostOS() === 'macos') window.menubar_style = 'desktop'; else window.menubar_style = 'window'; } // set menubar style class to body - if(window.menubar_style === 'desktop'){ + if (window.menubar_style === 'desktop') { $('body').addClass('menubar-style-desktop'); } }) // Remove `?ref=...` from navbar URL - if(window.url_query_params.has('ref')){ - window.history.pushState(null, document.title, '/'); + if (window.url_query_params.has('ref')) { + window.history.pushState(null, document.title, '/'); } // update local user preferences const user_preferences = { - show_hidden_files: JSON.parse(await puter.kv.get('user_preferences.show_hidden_files')), + show_hidden_files: (await puter.kv.get('user_preferences.show_hidden_files')), language: await puter.kv.get('user_preferences.language'), clock_visible: await puter.kv.get('user_preferences.clock_visible'), + hide_desktop_icons: (await puter.kv.get('user_preferences.hide_desktop_icons')), }; // update default apps puter.kv.list('user_preferences.default_apps.*').then(async (default_app_keys) => { - for(let key in default_app_keys){ + for (let key in default_app_keys) { user_preferences[default_app_keys[key].substring(17)] = await puter.kv.get(default_app_keys[key]); } @@ -749,10 +750,10 @@ async function UIDesktop(options){ drop: async function (dragsterEvent, event) { const e = event.originalEvent; // no drop on item - if($(event.target).hasClass('item') || $(event.target).parent('.item').length > 0) + if ($(event.target).hasClass('item') || $(event.target).parent('.item').length > 0) return false; // recursively create directories and upload files - if(e.dataTransfer?.items?.length>0){ + if (e.dataTransfer?.items?.length > 0) { window.upload_items(e.dataTransfer.items, window.desktop_path); } @@ -768,21 +769,21 @@ async function UIDesktop(options){ $(el_desktop).droppable({ accept: '.item', tolerance: "intersect", - drop: function( event, ui ) { + drop: function (event, ui) { // Check if item was actually dropped on desktop and not a window - if(window.mouseover_window !== undefined) + if (window.mouseover_window !== undefined) return; - + // Can't drop anything but UIItems on desktop - if(!$(ui.draggable).hasClass('item')) + if (!$(ui.draggable).hasClass('item')) return; - + // Don't move an item to its current directory - if( path.dirname($(ui.draggable).attr('data-path')) === window.desktop_path && !event.ctrlKey) + if (path.dirname($(ui.draggable).attr('data-path')) === window.desktop_path && !event.ctrlKey) return; - + // If ctrl is pressed and source is Trashed, cancel whole operation - if(event.ctrlKey && path.dirname($(ui.draggable).attr('data-path')) === window.trash_path) + if (event.ctrlKey && path.dirname($(ui.draggable).attr('data-path')) === window.trash_path) return; // Unselect previously selected items @@ -794,22 +795,22 @@ async function UIDesktop(options){ // all subsequent items const cloned_items = document.getElementsByClassName('item-selected-clone'); - for(let i =0; i 0 ? false : true, - onClick: function(){ - if(window.clipboard_op === 'copy') + onClick: function () { + if (window.clipboard_op === 'copy') window.copy_clipboard_items(window.desktop_path, el_desktop); - else if(window.clipboard_op === 'move') + else if (window.clipboard_op === 'move') window.move_clipboard_items(el_desktop) } }, @@ -974,7 +987,7 @@ async function UIDesktop(options){ { html: i18n('undo'), disabled: window.actions_history.length > 0 ? false : true, - onClick: function(){ + onClick: function () { window.undo_last_action(); } }, @@ -983,7 +996,7 @@ async function UIDesktop(options){ // ------------------------------------------- { html: i18n('upload_here'), - onClick: function(){ + onClick: function () { window.init_upload_using_dialog(el_desktop); } }, @@ -996,7 +1009,7 @@ async function UIDesktop(options){ // ------------------------------------------- { html: i18n('change_desktop_background'), - onClick: function(){ + onClick: function () { UIWindowDesktopBGSettings(); } }, @@ -1011,18 +1024,18 @@ async function UIDesktop(options){ // we don't need to get the desktop items if we're in embedded or fullpage mode // because the items aren't visible anyway and we don't need to waste bandwidth/server resources //------------------------------------------- - if(!window.is_embedded && !window.is_fullpage_mode){ - refresh_item_container(el_desktop, {fadeInItems: true}) + if (!window.is_embedded && !window.is_fullpage_mode) { + refresh_item_container(el_desktop, { fadeInItems: true }) // Show welcome window if user hasn't already seen it and hasn't directly navigated to an app - if(!window.url_paths[0]?.toLocaleLowerCase() === 'app' || !window.url_paths[1]){ - if(!isMobile.phone && !isMobile.tablet){ + if (!window.url_paths[0]?.toLocaleLowerCase() === 'app' || !window.url_paths[1]) { + if (!isMobile.phone && !isMobile.tablet) { setTimeout(() => { puter.kv.get('has_seen_welcome_window').then(async (val) => { - if(val === null){ + if (val === null) { await UIWindowWelcome(); } - }) + }) }, 1000); } } @@ -1032,7 +1045,7 @@ async function UIDesktop(options){ // Selectable // Only for desktop // ------------------------------------------- - if(!isMobile.phone && !isMobile.tablet){ + if (!isMobile.phone && !isMobile.tablet) { let selected_ctrl_items = []; const selection = new SelectionArea({ selectionContainerClass: '.selection-area-container', @@ -1047,7 +1060,7 @@ async function UIDesktop(options){ scrolling: { speedDivider: 10, manualSpeed: 750, - startScrollMargins: {x: 0, y: 0} + startScrollMargins: { x: 0, y: 0 } } }, features: { @@ -1059,87 +1072,87 @@ async function UIDesktop(options){ } } }); - - selection.on('beforestart', ({event}) => { + + selection.on('beforestart', ({ event }) => { selected_ctrl_items = []; // Returning false prevents a selection return $(event.target).hasClass('item-container'); }) - .on('beforedrag', evt => { - }) - .on('start', ({store, event}) => { - if (!event.ctrlKey && !event.metaKey) { - for (const el of store.stored) { - el.classList.remove('item-selected'); + .on('beforedrag', evt => { + }) + .on('start', ({ store, event }) => { + if (!event.ctrlKey && !event.metaKey) { + for (const el of store.stored) { + el.classList.remove('item-selected'); + } + + selection.clearSelection(); } - - selection.clearSelection(); - } - }) - .on('move', ({store: {changed: {added, removed}}, event}) => { - for (const el of added) { - // if ctrl or meta key is pressed and the item is already selected, then unselect it - if((event.ctrlKey || event.metaKey) && $(el).hasClass('item-selected')){ - el.classList.remove('item-selected'); - selected_ctrl_items.push(el); + }) + .on('move', ({ store: { changed: { added, removed } }, event }) => { + for (const el of added) { + // if ctrl or meta key is pressed and the item is already selected, then unselect it + if ((event.ctrlKey || event.metaKey) && $(el).hasClass('item-selected')) { + el.classList.remove('item-selected'); + selected_ctrl_items.push(el); + } + // otherwise select it + else { + el.classList.add('item-selected'); + } } - // otherwise select it - else{ - el.classList.add('item-selected'); + + for (const el of removed) { + el.classList.remove('item-selected'); + // in case this item was selected by ctrl+click before, then reselect it again + if (selected_ctrl_items.includes(el)) + $(el).not('.item-disabled').addClass('item-selected'); } - } - - for (const el of removed) { - el.classList.remove('item-selected'); - // in case this item was selected by ctrl+click before, then reselect it again - if(selected_ctrl_items.includes(el)) - $(el).not('.item-disabled').addClass('item-selected'); - } - }) - .on('stop', evt => { - }); + }) + .on('stop', evt => { + }); } // ---------------------------------------------------- // User options // ---------------------------------------------------- let ht = ''; ht += `
`; - // logo - ht += ``; + // logo + ht += ``; - // create account button - ht += ``; + // create account button + ht += ``; - // 'Show Desktop' - ht += ``; + // 'Show Desktop' + ht += ``; - // refer - if(window.user.referral_code){ - ht += `
`; - } + // refer + if (window.user.referral_code) { + ht += `
`; + } - // github - ht += ``; + // github + ht += ``; - // do not show the fullscreen button on mobile devices since it's broken - if(!isMobile.phone){ - // fullscreen button - ht += `
`; - } + // do not show the fullscreen button on mobile devices since it's broken + if (!isMobile.phone) { + // fullscreen button + ht += `
`; + } + + // qr code button -- only show if not embedded + if (!window.is_embedded) + ht += `
`; + + // search button + ht += `
`; - // qr code button -- only show if not embedded - if(!window.is_embedded) - ht += `
`; - - // search button - ht += `
`; - - // user options menu - ht += `
`; - ht += `
`; - ht += `
`; + // user options menu + ht += `
`; + ht += `
`; + ht += `
`; ht += `
`; // prepend toolbar to desktop @@ -1162,35 +1175,35 @@ async function UIDesktop(options){ // Determine if an app was launched from URL // i.e. https://puter.com/app/ //-------------------------------------------------------------------------------------- - if(window.url_paths[0]?.toLocaleLowerCase() === 'app' && window.url_paths[1]){ + if (window.url_paths[0]?.toLocaleLowerCase() === 'app' && window.url_paths[1]) { window.app_launched_from_url = window.url_paths[1]; // get app metadata - try{ + try { window.app_launched_from_url = await puter.apps.get(window.url_paths[1]) window.is_fullpage_mode = window.app_launched_from_url.metadata?.fullpage_on_landing ?? window.is_fullpage_mode ?? false; // show 'Show Desktop' button - if(window.is_fullpage_mode){ + if (window.is_fullpage_mode) { $('.show-desktop-btn').removeClass('hidden'); } - }catch(e){ + } catch (e) { console.error(e); } // get query params, any param that doesn't start with 'puter.' will be passed to the app window.app_query_params = {}; for (let [key, value] of window.url_query_params) { - if(!key.startsWith('puter.')) + if (!key.startsWith('puter.')) window.app_query_params[key] = value; } } //-------------------------------------------------------------------------------------- // /settings will open settings in fullpage mode //-------------------------------------------------------------------------------------- - else if(window.url_paths[0]?.toLocaleLowerCase() === 'settings'){ + else if (window.url_paths[0]?.toLocaleLowerCase() === 'settings') { // open settings UIWindowSettings({ - window_options:{ + window_options: { // is_fullpage: true, } }); @@ -1198,17 +1211,17 @@ async function UIDesktop(options){ // --------------------------------------------- // Run apps from insta-login URL // --------------------------------------------- - if(window.url_query_params.has('app')){ + if (window.url_query_params.has('app')) { let url_app_name = window.url_query_params.get('app'); - if(url_app_name === 'explorer'){ + if (url_app_name === 'explorer') { let predefined_path = window.home_path; - if(window.url_query_params.has('path')) - predefined_path =window.url_query_params.get('path') + if (window.url_query_params.has('path')) + predefined_path = window.url_query_params.get('path') // launch explorer UIWindow({ path: predefined_path, title: path.basename(predefined_path), - icon: await item_icon({is_dir: true, path: predefined_path}), + icon: await item_icon({ is_dir: true, path: predefined_path }), // todo // uid: $(el_item).attr('data-uid'), is_dir: true, @@ -1221,11 +1234,11 @@ async function UIDesktop(options){ // --------------------------------------------- // load from direct app URLs: /app/app-name // --------------------------------------------- - else if(window.app_launched_from_url){ - let qparams = new URLSearchParams(window.location.search); - if(!qparams.has('c')){ + else if (window.app_launched_from_url) { + let qparams = new URLSearchParams(window.location.search); + if (!qparams.has('c')) { let posargs = undefined; - if ( window.app_query_params && window.app_query_params.posargs ) { + if (window.app_query_params && window.app_query_params.posargs) { posargs = JSON.parse(window.app_query_params.posargs); } launch_app({ @@ -1234,9 +1247,11 @@ async function UIDesktop(options){ readURL: qparams.get('readURL'), maximized: qparams.get('maximized'), params: window.app_query_params ?? [], - ...(posargs ? { args: { - command_line: { args: posargs } - } } : {}), + ...(posargs ? { + args: { + command_line: { args: posargs } + } + } : {}), is_fullpage: window.is_fullpage_mode, window_options: { stay_on_top: false, @@ -1245,9 +1260,9 @@ async function UIDesktop(options){ } } - $(el_desktop).on('mousedown touchstart', { passive: true }, function(e){ + $(el_desktop).on('mousedown touchstart', { passive: true }, function (e) { // dimiss touchstart on regular devices - if(e.type==='taphold' && !isMobile.phone && !isMobile.tablet) + if (e.type === 'taphold' && !isMobile.phone && !isMobile.tablet) return; // disable pointer-events for all app iframes, this is to make sure selectable works @@ -1256,34 +1271,34 @@ async function UIDesktop(options){ $('.desktop').find('.item-blurred').removeClass('item-blurred'); }) - $(el_desktop).on('click', function(e){ + $(el_desktop).on('click', function (e) { // blur all windows $('.window-active').removeClass('window-active'); // hide all global menubars $('.window-menubar-global').hide(); - }) + }) function display_ct() { var x = new Date() - var ampm = x.getHours( ) >= 12 ? ' PM' : ' AM'; - let hours = x.getHours( ) % 12; + var ampm = x.getHours() >= 12 ? ' PM' : ' AM'; + let hours = x.getHours() % 12; hours = hours ? hours : 12; - hours=hours.toString().length==1? 0+hours.toString() : hours; - - var minutes=x.getMinutes().toString() - minutes=minutes.length==1 ? 0+minutes : minutes; - - var seconds=x.getSeconds().toString() - seconds=seconds.length==1 ? 0+seconds : seconds; - - var month=(x.getMonth() +1).toString(); - month=month.length==1 ? 0+month : month; - - var dt=x.getDate().toString(); - dt=dt.length==1 ? 0+dt : dt; - - var x1=month + "/" + dt + "/" + x.getFullYear(); - x1 = x1 + " - " + hours + ":" + minutes + ":" + seconds + " " + ampm; + hours = hours.toString().length == 1 ? 0 + hours.toString() : hours; + + var minutes = x.getMinutes().toString() + minutes = minutes.length == 1 ? 0 + minutes : minutes; + + var seconds = x.getSeconds().toString() + seconds = seconds.length == 1 ? 0 + seconds : seconds; + + var month = (x.getMonth() + 1).toString(); + month = month.length == 1 ? 0 + month : month; + + var dt = x.getDate().toString(); + dt = dt.length == 1 ? 0 + dt : dt; + + var x1 = month + "/" + dt + "/" + x.getFullYear(); + x1 = x1 + " - " + hours + ":" + minutes + ":" + seconds + " " + ampm; $('#clock').html(x1); $('#clock').css('line-height', window.taskbar_height + 'px'); } @@ -1291,9 +1306,9 @@ async function UIDesktop(options){ setInterval(display_ct, 1000); // show referral notice window - if(window.show_referral_notice && !window.user.email_confirmed){ + if (window.show_referral_notice && !window.user.email_confirmed) { puter.kv.get('shown_referral_notice').then(async (val) => { - if(!val || val === 'false' || val === false){ + if (!val || val === 'false' || val === false) { setTimeout(() => { UIWindowClaimReferral(); }, 1000); @@ -1310,20 +1325,20 @@ async function UIDesktop(options){ // i.e. https://puter.com/@ //-------------------------------------------------------------------------------------- const url_paths = window.location.pathname.split('/').filter(element => element); - if(url_paths[0]?.startsWith('@')){ + if (url_paths[0]?.startsWith('@')) { let username = url_paths[0].substring(1); let item_path = '/' + username + '/Public'; // check if username has valid characters - if(!username.match(/^[a-z0-9_]+$/i)){ + if (!username.match(/^[a-z0-9_]+$/i)) { UIAlert({ message: 'Invalid username.' }); - }else{ + } else { UIWindow({ path: item_path, title: path.basename(item_path), - icon: await item_icon({is_dir: true, path: item_path}), + icon: await item_icon({ is_dir: true, path: item_path }), is_dir: true, app: 'explorer', }); @@ -1331,9 +1346,9 @@ async function UIDesktop(options){ } } -$(document).on('contextmenu taphold', '.taskbar', function(event){ +$(document).on('contextmenu taphold', '.taskbar', function (event) { // dismiss taphold on regular devices - if(event.type==='taphold' && !isMobile.phone && !isMobile.tablet) + if (event.type === 'taphold' && !isMobile.phone && !isMobile.tablet) return; event.preventDefault(); @@ -1346,7 +1361,7 @@ $(document).on('contextmenu taphold', '.taskbar', function(event){ //-------------------------------------------------- { html: "Show open windows", - onClick: function(){ + onClick: function () { $(`.window`).showWindow(); } }, @@ -1355,7 +1370,7 @@ $(document).on('contextmenu taphold', '.taskbar', function(event){ //-------------------------------------------------- { html: "Show the desktop", - onClick: function(){ + onClick: function () { $(`.window`).hideWindow(); } } @@ -1371,9 +1386,9 @@ $(document).on('click', '.qr-btn', async function (e) { }); }) -$(document).on('click', '.user-options-menu-btn', async function(e){ +$(document).on('click', '.user-options-menu-btn', async function (e) { const pos = this.getBoundingClientRect(); - if($('.context-menu[data-id="user-options-menu"]').length > 0) + if ($('.context-menu[data-id="user-options-menu"]').length > 0) return; let items = []; @@ -1381,13 +1396,13 @@ $(document).on('click', '.user-options-menu-btn', async function(e){ //-------------------------------------------------- // Save Session //-------------------------------------------------- - if(window.user.is_temp){ - items.push( + if (window.user.is_temp) { + items.push( { html: i18n('save_session'), icon: ``, icon_active: ``, - onClick: async function(){ + onClick: async function () { UIWindowSaveAccount({ send_confirmation_code: false, default_username: window.user.username @@ -1404,28 +1419,28 @@ $(document).on('click', '.user-options-menu-btn', async function(e){ // ------------------------------------------- // Logged in users // ------------------------------------------- - if(window.logged_in_users.length > 0){ + if (window.logged_in_users.length > 0) { let users_arr = window.logged_in_users; // bring logged in user's item to top - users_arr.sort(function(x,y){ return x.uuid === window.user.uuid ? -1 : y.uuid == window.user.uuid ? 1 : 0; }); + users_arr.sort(function (x, y) { return x.uuid === window.user.uuid ? -1 : y.uuid == window.user.uuid ? 1 : 0; }); // create menu items users_arr.forEach(l_user => { - items.push( + items.push( { html: l_user.username, icon: l_user.username === window.user.username ? '✓' : '', - onClick: async function(val){ + onClick: async function (val) { // don't reload everything if clicked on already-logged-in user - if(l_user.username === window.user.username) + if (l_user.username === window.user.username) return; // update auth data window.update_auth_data(l_user.auth_token, l_user); // refresh location.reload(); } - + }, ) }); @@ -1434,21 +1449,21 @@ $(document).on('click', '.user-options-menu-btn', async function(e){ // ------------------------------------------- items.push('-') - items.push( + items.push( { html: i18n('add_existing_account'), // icon: l_user.username === user.username ? '✓' : '', - onClick: async function(val){ + onClick: async function (val) { await UIWindowLogin({ reload_on_success: true, send_confirmation_code: false, - window_options:{ + window_options: { has_head: true } }); } }, - ) + ) // ------------------------------------------- // - @@ -1464,7 +1479,7 @@ $(document).on('click', '.user-options-menu-btn', async function(e){ return { html: lang.name, icon: window.locale === lang.code ? '✓' : '', - onClick: async function(){ + onClick: async function () { changeLanguage(lang.code); } } @@ -1473,7 +1488,7 @@ $(document).on('click', '.user-options-menu-btn', async function(e){ UIContextMenu({ id: 'user-options-menu', parent_element: parent_element, - position: {top: pos.top + 28, left: pos.left + pos.width - 15}, + position: { top: pos.top + 28, left: pos.left + pos.width - 15 }, items: [ ...items, //-------------------------------------------------- @@ -1482,7 +1497,7 @@ $(document).on('click', '.user-options-menu-btn', async function(e){ { html: i18n('settings'), id: 'settings', - onClick: async function(){ + onClick: async function () { UIWindowSettings(); } }, @@ -1492,7 +1507,7 @@ $(document).on('click', '.user-options-menu-btn', async function(e){ { html: i18n('my_websites'), id: 'my_websites', - onClick: async function(){ + onClick: async function () { UIWindowMyWebsites(); } }, @@ -1502,7 +1517,7 @@ $(document).on('click', '.user-options-menu-btn', async function(e){ { html: i18n('task_manager'), id: 'task_manager', - onClick: async function(){ + onClick: async function () { UIWindowTaskManager(); } }, @@ -1512,7 +1527,7 @@ $(document).on('click', '.user-options-menu-btn', async function(e){ { html: i18n('contact_us'), id: 'contact_us', - onClick: async function(){ + onClick: async function () { UIWindowFeedback(); } }, @@ -1526,12 +1541,12 @@ $(document).on('click', '.user-options-menu-btn', async function(e){ //-------------------------------------------------- { html: i18n('log_out'), - onClick: async function(){ + onClick: async function () { // see if there are any open windows, if yes notify user - if($('.window-app').length > 0){ + if ($('.window-app').length > 0) { const alert_resp = await UIAlert({ message: `

${i18n('confirm_open_apps_log_out')}

`, - buttons:[ + buttons: [ { label: i18n('close_all_windows_and_log_out'), value: 'close_and_log_out', @@ -1542,7 +1557,7 @@ $(document).on('click', '.user-options-menu-btn', async function(e){ }, ] }) - if(alert_resp === 'close_and_log_out') + if (alert_resp === 'close_and_log_out') window.logout(); } // no open windows @@ -1551,11 +1566,11 @@ $(document).on('click', '.user-options-menu-btn', async function(e){ } }, ] - }); + }); }) $(document).on('click', '.fullscreen-btn', async function (e) { - if(!window.is_fullscreen()) { + if (!window.is_fullscreen()) { var elem = document.documentElement; if (elem.requestFullscreen) { elem.requestFullscreen(); @@ -1567,7 +1582,7 @@ $(document).on('click', '.fullscreen-btn', async function (e) { elem.msRequestFullscreen(); } } - else{ + else { if (document.exitFullscreen) { document.exitFullscreen(); } else if (document.webkitExitFullscreen) { @@ -1576,49 +1591,49 @@ $(document).on('click', '.fullscreen-btn', async function (e) { document.mozCancelFullScreen(); } else if (document.msExitFullscreen) { document.msExitFullscreen(); - } - } + } + } }) -$(document).on('click', '.close-launch-popover', function(){ - $(".launch-popover").closest('.popover').fadeOut(200, function(){ +$(document).on('click', '.close-launch-popover', function () { + $(".launch-popover").closest('.popover').fadeOut(200, function () { $(".launch-popover").closest('.popover').remove(); }); }); -$(document).on('click', '.search-btn', function(){ +$(document).on('click', '.search-btn', function () { UIWindowSearch(); }) -$(document).on('click', '.toolbar-puter-logo', function(){ +$(document).on('click', '.toolbar-puter-logo', function () { UIWindowSettings(); }) -$(document).on('click', '.user-options-create-account-btn', async function(e){ +$(document).on('click', '.user-options-create-account-btn', async function (e) { UIWindowSaveAccount({ send_confirmation_code: false, default_username: window.user.username, }); }) -$(document).on('click', '.refer-btn', async function(e){ +$(document).on('click', '.refer-btn', async function (e) { UIWindowRefer(); }) -$(document).on('click', '.start-app', async function(e){ +$(document).on('click', '.start-app', async function (e) { launch_app({ name: $(this).attr('data-app-name') }) // close popovers - $(".popover").fadeOut(200, function(){ + $(".popover").fadeOut(200, function () { $(".popover").remove(); }); }) -$(document).on('click', '.user-options-login-btn', async function(e){ +$(document).on('click', '.user-options-login-btn', async function (e) { const alert_resp = await UIAlert({ message: `Save session before exiting!

You are in a temporary session and logging into another account will erase all data in your current session.

`, - buttons:[ + buttons: [ { label: i18n('save_session'), value: 'save-session', @@ -1633,16 +1648,16 @@ $(document).on('click', '.user-options-login-btn', async function(e){ }, ] }) - - if(alert_resp === 'save-session'){ + + if (alert_resp === 'save-session') { let saved = await UIWindowSaveAccount({ send_confirmation_code: false, }); - if(saved) - UIWindowLogin({show_signup_button: false, reload_on_success: true}); - }else if (alert_resp === 'login'){ + if (saved) + UIWindowLogin({ show_signup_button: false, reload_on_success: true }); + } else if (alert_resp === 'login') { UIWindowLogin({ - show_signup_button: false, + show_signup_button: false, reload_on_success: true, window_options: { backdrop: true, @@ -1652,7 +1667,7 @@ $(document).on('click', '.user-options-login-btn', async function(e){ } }) -$(document).on('click mousedown', '.launch-search, .launch-popover', function(e){ +$(document).on('click mousedown', '.launch-search, .launch-popover', function (e) { $(this).focus(); e.stopPropagation(); e.preventDefault(); @@ -1660,36 +1675,36 @@ $(document).on('click mousedown', '.launch-search, .launch-popover', function(e) e.stopImmediatePropagation(); }) -$(document).on('focus', '.launch-search', function(e){ +$(document).on('focus', '.launch-search', function (e) { // remove all selected items in start menu $('.launch-app-selected').removeClass('launch-app-selected'); // scroll popover to top $('.launch-popover').scrollTop(0); }) -$(document).on('change keyup keypress keydown paste', '.launch-search', function(e){ +$(document).on('change keyup keypress keydown paste', '.launch-search', function (e) { // search window.launch_apps.recommended for query const query = $(this).val().toLowerCase(); - if(query === ''){ + if (query === '') { $('.launch-search-clear').hide(); $(`.start-app-card`).show(); $('.launch-apps-recent').show(); $('.start-section-heading').show(); - }else{ + } else { $('.launch-apps-recent').hide(); $('.start-section-heading').hide(); $('.launch-search-clear').show(); - window.launch_apps.recommended.forEach((app)=>{ - if(app.title.toLowerCase().includes(query.toLowerCase())){ + window.launch_apps.recommended.forEach((app) => { + if (app.title.toLowerCase().includes(query.toLowerCase())) { $(`.start-app-card[data-name="${app.name}"]`).show(); - }else{ + } else { $(`.start-app-card[data-name="${app.name}"]`).hide(); } }) } }) -$(document).on('click', '.launch-search-clear', function(e){ +$(document).on('click', '.launch-search-clear', function (e) { $('.launch-search').val(''); $('.launch-search').trigger('change'); $('.launch-search').focus(); @@ -1711,33 +1726,33 @@ document.addEventListener('fullscreenchange', (event) => { } }) -window.set_desktop_background = function(options){ - if(options.fit){ +window.set_desktop_background = function (options) { + if (options.fit) { let fit = options.fit; - if(fit === 'cover' || fit === 'contain'){ + if (fit === 'cover' || fit === 'contain') { $('body').css('background-size', fit); $('body').css('background-repeat', `no-repeat`); $('body').css('background-position', `center center`); } - else if(fit === 'center'){ + else if (fit === 'center') { $('body').css('background-size', 'auto'); $('body').css('background-repeat', `no-repeat`); $('body').css('background-position', `center center`); } - else if( fit === 'repeat'){ + else if (fit === 'repeat') { $('body').css('background-size', `auto`); $('body').css('background-repeat', `repeat`); } window.desktop_bg_fit = fit; } - if(options.url){ + if (options.url) { $('body').css('background-image', `url(${options.url})`); window.desktop_bg_url = options.url; window.desktop_bg_color = undefined; } - else if(options.color){ + else if (options.color) { $('body').css({ 'background-image': `none`, 'background-color': options.color, @@ -1747,11 +1762,11 @@ window.set_desktop_background = function(options){ } } -window.update_taskbar = function(){ +window.update_taskbar = function () { let items = [] - $('.taskbar-item-sortable[data-keep-in-taskbar="true"]').each(function(index){ + $('.taskbar-item-sortable[data-keep-in-taskbar="true"]').each(function (index) { items.push({ - name: $( this ).attr('data-app'), + name: $(this).attr('data-app'), type: 'app', }) }) @@ -1766,20 +1781,20 @@ window.update_taskbar = function(){ async: true, contentType: "application/json", headers: { - "Authorization": "Bearer "+window.auth_token + "Authorization": "Bearer " + window.auth_token }, }) } -window.remove_taskbar_item = function(item){ - $(item).find('*').fadeOut(100, function(){}); +window.remove_taskbar_item = function (item) { + $(item).find('*').fadeOut(100, function () { }); - $(item).animate({width: 0}, 200, function(){ + $(item).animate({ width: 0 }, 200, function () { $(item).remove(); }) } -window.enter_fullpage_mode = (el_window)=>{ +window.enter_fullpage_mode = (el_window) => { $('.taskbar').hide(); $(el_window).find('.window-head').hide(); $('body').addClass('fullpage-mode'); @@ -1792,14 +1807,14 @@ window.enter_fullpage_mode = (el_window)=>{ }); } -window.exit_fullpage_mode = (el_window)=>{ +window.exit_fullpage_mode = (el_window) => { $('body').removeClass('fullpage-mode'); window.taskbar_height = window.default_taskbar_height; $('.taskbar').css('height', window.taskbar_height); $('.taskbar').show(); - refresh_item_container($('.desktop.item-container'), {fadeInItems: true}); + refresh_item_container($('.desktop.item-container'), { fadeInItems: true }); $(el_window).removeAttr('data-is_fullpage'); - if(el_window){ + if (el_window) { window.reset_window_size_and_position(el_window) $(el_window).find('.window-head').show(); } @@ -1814,7 +1829,7 @@ window.exit_fullpage_mode = (el_window)=>{ window.refresh_desktop_background(); } -window.reset_window_size_and_position = (el_window)=>{ +window.reset_window_size_and_position = (el_window) => { $(el_window).css({ width: 680, height: 380, @@ -1823,5 +1838,5 @@ window.reset_window_size_and_position = (el_window)=>{ left: 'calc(50% - 340px)', }); } - + export default UIDesktop; \ No newline at end of file diff --git a/src/gui/src/globals.js b/src/gui/src/globals.js index a6c0ad105b..db5aa2617f 100644 --- a/src/gui/src/globals.js +++ b/src/gui/src/globals.js @@ -99,6 +99,7 @@ if (window.user_preferences === null) { show_hidden_files: false, language: navigator.language.split("-")[0] || navigator.userLanguage || 'en', clock_visible: 'auto', + hide_desktop_icons: false, } } diff --git a/src/gui/src/helpers.js b/src/gui/src/helpers.js index f855fa62e6..98cba9a255 100644 --- a/src/gui/src/helpers.js +++ b/src/gui/src/helpers.js @@ -780,6 +780,20 @@ window.show_or_hide_files = (item_containers) => { .removeClass(class_to_remove).addClass(class_to_add); } +/** + * Toggle desktop icons visibility based on user preference + * @param {NodeList|jQuery} item_containers - Container elements to search for items + */ +window.toggle_desktop_icons_visibility = (item_containers) => { + const hide_icons = window.user_preferences.hide_desktop_icons; + + // Target all desktop items (including Trash) + $(item_containers) + .filter('.desktop') + .find('.item') + .toggleClass('item-hidden', hide_icons); +} + window.create_folder = async(basedir, appendto_element)=>{ let dirname = basedir; let folder_name = 'New Folder'; diff --git a/src/gui/src/helpers/refresh_item_container.js b/src/gui/src/helpers/refresh_item_container.js index a4cdc6f8e9..5b8a859e69 100644 --- a/src/gui/src/helpers/refresh_item_container.js +++ b/src/gui/src/helpers/refresh_item_container.js @@ -228,6 +228,11 @@ const refresh_item_container = function(el_item_container, options){ $(el_item_container).attr('data-sort_order') ); + // Apply hide desktop icons preference if this is desktop + if($(el_item_container).hasClass('desktop') && window.user_preferences.hide_desktop_icons){ + window.toggle_desktop_icons_visibility(el_item_container); + } + if(options.fadeInItems) $(el_item_container).animate({'opacity': '1'}); diff --git a/src/gui/src/i18n/translations/ar.js b/src/gui/src/i18n/translations/ar.js index cc28eff757..f0d72bc9f1 100644 --- a/src/gui/src/i18n/translations/ar.js +++ b/src/gui/src/i18n/translations/ar.js @@ -151,6 +151,7 @@ const ar = { get_a_copy_of_on_puter: "احصل على نسخة من '%%' على Puter.com!", get_copy_link: "احصل على رابط النسخ", hide_all_windows: "إخفاء جميع النوافذ", + hide_desktop_icons: "إخفاء أيقونات سطح المكتب", home: "الصفحة الرئيسية", html_document: "مستند HTML", hue: "درجة اللون", @@ -288,6 +289,7 @@ const ar = { share_with: "مشاركة مع:", shortcut_to: "اختصار إلى", show_all_windows: "عرض جميع النوافذ", + show_desktop_icons: "إظهار أيقونات سطح المكتب", show_hidden: "إظهار المخفي", sign_in_with_puter: "تسجيل الدخول باستخدام Puter", sign_up: "تسجيل", diff --git a/src/gui/src/i18n/translations/bn.js b/src/gui/src/i18n/translations/bn.js index 3a8c583729..3d1d2133e9 100644 --- a/src/gui/src/i18n/translations/bn.js +++ b/src/gui/src/i18n/translations/bn.js @@ -141,6 +141,7 @@ const bn = { get_a_copy_of_on_puter: `পিউটার ডটকমে '%%' এর একটি অনুলিপি পান!`, get_copy_link: "কপি লিংক নিন", hide_all_windows: "সমস্ত উইন্ডো লুকান", + hide_desktop_icons: "ডেস্কটপ আইকন লুকান", home: "হোম", html_document: "এইচটিএমএল ডকুমেন্ট", hue: "হিউ", @@ -272,6 +273,7 @@ const bn = { share_with: "সঙ্গে ভাগাভাগি করুন:", shortcut_to: "শর্টকাট", show_all_windows: "সমস্ত উইন্ডো দেখান", + show_desktop_icons: "ডেস্কটপ আইকন দেখান", show_hidden: "লুকানো দেখান", sign_in_with_puter: "Puter দিয়ে সাইন ইন করুন", sign_up: "নিবন্ধন করুন", diff --git a/src/gui/src/i18n/translations/br.js b/src/gui/src/i18n/translations/br.js index 3524b98ef5..965e7c48b4 100644 --- a/src/gui/src/i18n/translations/br.js +++ b/src/gui/src/i18n/translations/br.js @@ -142,6 +142,7 @@ const br = { get_a_copy_of_on_puter: `Obtenha uma cópia de '%%' em Puter.com!`, get_copy_link: 'Obter Link de Cópia', hide_all_windows: "Ocultar Todas as Janelas", + hide_desktop_icons: "Ocultar Ícones da Área de Trabalho", home: 'Início', html_document: 'Documento HTML', hue: 'Matiz', diff --git a/src/gui/src/i18n/translations/da.js b/src/gui/src/i18n/translations/da.js index f49365e522..d26373ed34 100644 --- a/src/gui/src/i18n/translations/da.js +++ b/src/gui/src/i18n/translations/da.js @@ -141,6 +141,7 @@ const da = { get_a_copy_of_on_puter: `Få en kopi af '%%' på Puter.com!`, get_copy_link: 'Få kopi-link', hide_all_windows: 'Skjul alle vinduer', + hide_desktop_icons: "Skjul skrivebordikoner", home: 'Hjem', html_document: 'HTML-dokument', hue: 'Farvetone', @@ -269,6 +270,7 @@ const da = { share_with: 'Del med:', shortcut_to: 'Genvej til', show_all_windows: 'Vis alle vinduer', + show_desktop_icons: "Vis skrivebordikoner", show_hidden: 'Vis skjulte', sign_in_with_puter: 'Log ind med Puter', sign_up: 'Tilmeld dig', diff --git a/src/gui/src/i18n/translations/de.js b/src/gui/src/i18n/translations/de.js index fd4f8dc1d4..ccffdba3de 100644 --- a/src/gui/src/i18n/translations/de.js +++ b/src/gui/src/i18n/translations/de.js @@ -141,6 +141,7 @@ const de = { get_a_copy_of_on_puter: `Holen Sie sich eine Kopie von '%%' auf Puter.com!`, get_copy_link: 'Kopierlink erhalten', hide_all_windows: "Alle Fenster verstecken", + hide_desktop_icons: "Desktop-Symbole ausblenden", home: 'Startseite', html_document: 'HTML-Dokument', hue: 'Farbton', @@ -269,6 +270,7 @@ const de = { share_with: "Teilen mit:", shortcut_to: "Verknüpfung zu", show_all_windows: "Alle Fenster anzeigen", + show_desktop_icons: "Desktop-Symbole anzeigen", show_hidden: 'Zeige versteckte', sign_in_with_puter: "Mit Puter anmelden", sign_up: "Registrieren", diff --git a/src/gui/src/i18n/translations/emoji.js b/src/gui/src/i18n/translations/emoji.js index 595ba15a3a..5809bb4787 100644 --- a/src/gui/src/i18n/translations/emoji.js +++ b/src/gui/src/i18n/translations/emoji.js @@ -81,6 +81,7 @@ const emoji = { get_a_copy_of_on_puter: `📩🔄📂`, get_copy_link: '🔗🔄', hide_all_windows: "🔚🔄🖼️🖼️", + hide_desktop_icons: "🔄🖥️🖼️", html_document: '📄🌐', image: '🖼️', invite_link: "🔗📩", @@ -157,6 +158,7 @@ const emoji = { set_new_password: "🔑🆕", share_to: "🔁➡️", show_all_windows: "🔄🆓🖼️🖼️", + show_desktop_icons: "👁️🖥️🖼️", show_hidden: '👁️🔄', sign_in_with_puter: "👤🆔", sign_up: "👤🆕", diff --git a/src/gui/src/i18n/translations/en.js b/src/gui/src/i18n/translations/en.js index 613120afc0..50edc702cb 100644 --- a/src/gui/src/i18n/translations/en.js +++ b/src/gui/src/i18n/translations/en.js @@ -144,6 +144,7 @@ const en = { get_a_copy_of_on_puter: `Get a copy of '%%' on Puter.com!`, get_copy_link: 'Get Copy Link', hide_all_windows: "Hide All Windows", + hide_desktop_icons: 'Hide Desktop Icons', home: 'Home', html_document: 'HTML document', hue: 'Hue', @@ -273,6 +274,7 @@ const en = { share_with: "Share with:", shortcut_to: "Shortcut to", show_all_windows: "Show All Windows", + show_desktop_icons: 'Show Desktop Icons', show_hidden: 'Show hidden', sign_in_with_puter: "Sign in with Puter", sign_up: "Sign Up", diff --git a/src/gui/src/i18n/translations/es.js b/src/gui/src/i18n/translations/es.js index 4ff34cfe8e..11dbf17648 100644 --- a/src/gui/src/i18n/translations/es.js +++ b/src/gui/src/i18n/translations/es.js @@ -164,6 +164,7 @@ const es = { get_a_copy_of_on_puter: `¡Consigue una copia de '%%' en Puter.com!`, get_copy_link: 'Copiar el enlace', hide_all_windows: 'Ocultar todas las ventanas', + hide_desktop_icons: 'Ocultar iconos del escritorio', home: 'Inicio', html_document: 'Documento HTML', hue: 'Hue', @@ -305,6 +306,7 @@ const es = { share_with: 'Compartir con:', shortcut_to: 'Acceso directo a', show_all_windows: 'Mostrar todas las ventanas', + show_desktop_icons: 'Mostrar iconos del escritorio', show_hidden: 'Mostrar ocultos', sign_in_with_puter: 'Inicia sesión con Puter', sign_up: 'Registrarse', diff --git a/src/gui/src/i18n/translations/fa.js b/src/gui/src/i18n/translations/fa.js index eb66665443..893590cffb 100644 --- a/src/gui/src/i18n/translations/fa.js +++ b/src/gui/src/i18n/translations/fa.js @@ -82,6 +82,7 @@ const fa = { get_a_copy_of_on_puter: `یک نسخه از '%%' را در Puter.com بگیرید!`, get_copy_link: "گرفتن لینک کپی", hide_all_windows: "پنهان کردن همه پنجره ها", + hide_desktop_icons: "پنهان کردن آیکون های دسکتاپ", html_document: "سند HTML", image: "تصویر", invite_link: "لینک دعوت", @@ -155,6 +156,7 @@ const fa = { settings: "تنظیمات", share_to: "اشتراک گذاری به", show_all_windows: "نمایش همه پنجره ها", + show_desktop_icons: "نمایش آیکون های دسکتاپ", show_hidden: "نمایش مخفی", sign_in_with_puter: "ورود با Puter", sign_up: "ثبت نام", diff --git a/src/gui/src/i18n/translations/fi.js b/src/gui/src/i18n/translations/fi.js index 7c5bdd3b61..0dc06229f0 100644 --- a/src/gui/src/i18n/translations/fi.js +++ b/src/gui/src/i18n/translations/fi.js @@ -189,6 +189,7 @@ const fi = { // 'get a link to the copy' => 'Ota Linkki Kopioon' - More probable, just want to be sure hide_all_windows: "Piilota kaikki ikkunat", + hide_desktop_icons: "Piilota työpöydän kuvakkeet", home: "Koti", html_document: "HTML-dokumentti", hue: "Sävy", @@ -348,6 +349,7 @@ const fi = { share_with: "Jaa:", shortcut_to: "Pikakuvake", show_all_windows: "Näytä kaikki ikkunat", + show_desktop_icons: "Näytä työpöydän kuvakkeet", show_hidden: "Näytä piilotetut", sign_in_with_puter: "Kirjaudu sisään Puterilla", sign_up: "Rekisteröidy", diff --git a/src/gui/src/i18n/translations/fr.js b/src/gui/src/i18n/translations/fr.js index cd5066163a..6940d99213 100644 --- a/src/gui/src/i18n/translations/fr.js +++ b/src/gui/src/i18n/translations/fr.js @@ -141,6 +141,7 @@ const fr = { get_a_copy_of_on_puter: `Obtenez une copie de '%%' sur Puter.com !`, get_copy_link: 'Obtenir le lien de copie', hide_all_windows: "Masquer toutes les fenêtres", + hide_desktop_icons: "Masquer les icônes du bureau", home: 'Accueil', html_document: 'Document HTML', hue: 'Teinte', @@ -269,6 +270,7 @@ const fr = { share_with: "Partager avec", shortcut_to: "Raccourci vers", show_all_windows: "Afficher toutes les fenêtres", + show_desktop_icons: "Afficher les icônes du bureau", show_hidden: 'Afficher les fichiers cachés', sign_in_with_puter: "Se connecter avec Puter", sign_up: "S'inscrire", diff --git a/src/gui/src/i18n/translations/he.js b/src/gui/src/i18n/translations/he.js index 61312e4085..db3350e524 100644 --- a/src/gui/src/i18n/translations/he.js +++ b/src/gui/src/i18n/translations/he.js @@ -152,6 +152,7 @@ const en = { get_a_copy_of_on_puter: `קבל עותק של '%%' ב Puter.com!`, get_copy_link: "קבל העתק קישור", hide_all_windows: "הסתר את כל החלונות", + hide_desktop_icons: "הסתר סמלי שולחן עבודה", home: "בית", html_document: "מסמך HTML", hue: "דרגת צבע", @@ -286,6 +287,7 @@ const en = { share_with: "שתף עם:", shortcut_to: "קיצור דרך אל", show_all_windows: "הצג את כל החלונות", + show_desktop_icons: "הצג סמלי שולחן עבודה", show_hidden: "הצג מוסתר", sign_in_with_puter: "להתחבר עם Puter", sign_up: "הרשמה", diff --git a/src/gui/src/i18n/translations/hi.js b/src/gui/src/i18n/translations/hi.js index 49fd1a5d1b..be4972c0d1 100644 --- a/src/gui/src/i18n/translations/hi.js +++ b/src/gui/src/i18n/translations/hi.js @@ -141,6 +141,7 @@ const hi = { get_a_copy_of_on_puter: "Purer.com पर '%%' की एक कॉपी प्राप्त करें!", get_copy_link: 'कॉपी लिंक प्राप्त करें', hide_all_windows: "सभी विंडोज़ छिपाएँ", + hide_desktop_icons: "डेस्कटॉप आइकन छिपाएं", home: 'घर', html_document: 'एचटीएमएल दस्तावेज़', hue: 'रंग', @@ -269,6 +270,7 @@ const hi = { share_with: "के साथ साझा करें", shortcut_to: "के लिए शॉर्टकट", show_all_windows: "सभी विंडोज़ दिखाएँ", + show_desktop_icons: "डेस्कटॉप आइकन दिखाएं", show_hidden: 'छिपा हुआ दिखाएं', sign_in_with_puter: "पुटर के साथ साइन इन करें", sign_up: "साइन अप करें", diff --git a/src/gui/src/i18n/translations/hu.js b/src/gui/src/i18n/translations/hu.js index 01fe9412ae..1dc52e8105 100644 --- a/src/gui/src/i18n/translations/hu.js +++ b/src/gui/src/i18n/translations/hu.js @@ -137,6 +137,7 @@ const hu = { get_a_copy_of_on_puter: "Szerezz egy példányt a(z) '%%' Puter.com-on!", get_copy_link: "Másolási link megszerzése", hide_all_windows: "Minden ablak elrejtése", + hide_desktop_icons: "Asztal ikonok elrejtése", home: "Otthon", html_document: "HTML dokumentum", hue: "Színárnyalat", @@ -265,6 +266,7 @@ const hu = { share_with: "Megosztás valakivel:", shortcut_to: "Parancsikon ide:", show_all_windows: "Összes ablak megjelenítése", + show_desktop_icons: "Asztal ikonok megjelenítése", show_hidden: "Rejtett megjelenítése", sign_in_with_puter: "Bejelentkezés Puterrel", sign_up: "Regisztráció", diff --git a/src/gui/src/i18n/translations/hy.js b/src/gui/src/i18n/translations/hy.js index 98894d73a0..d51e0496d7 100644 --- a/src/gui/src/i18n/translations/hy.js +++ b/src/gui/src/i18n/translations/hy.js @@ -141,6 +141,7 @@ const hy = { get_a_copy_of_on_puter: "Ստանալ '%%'-ի պատճենը Puter.com-ում!", get_copy_link: "Ստանալ պատճենված հղումը", hide_all_windows: "Թաքցնել բոլոր պատուհանները", + hide_desktop_icons: "Թաքցնել դեսքթոփի պատկերակները", home: "Գլխավոր", html_document: "HTML փաստաթուղթ", hue: "Երանգ", @@ -269,6 +270,7 @@ const hy = { share_with: "Տարածել հետ՝", shortcut_to: "Դյուրանցում դեպի", show_all_windows: "Ցույց տալ բոլոր պատուհանները", + show_desktop_icons: "Ցուցադրել դեսքթոփի պատկերակները", show_hidden: "Ցույց տալ թաքնված տարրերը", sign_in_with_puter: "Մուտք գործել Փութերի միջոցով", sign_up: "Գրանցվել", diff --git a/src/gui/src/i18n/translations/id.js b/src/gui/src/i18n/translations/id.js index b838923193..f8e7b75c55 100644 --- a/src/gui/src/i18n/translations/id.js +++ b/src/gui/src/i18n/translations/id.js @@ -152,6 +152,7 @@ const id = { get_a_copy_of_on_puter: `Dapatkan salinan '%%' di Puter.com!`, get_copy_link: "Dapatkan Tautan Salinan", hide_all_windows: "Sembunyikan Semua Jendela", + hide_desktop_icons: "Sembunyikan ikon desktop", home: "Beranda", html_document: "Dokumen HTML", hue: "Hue", @@ -287,6 +288,7 @@ const id = { share_with: "Bagikan dengan:", shortcut_to: "Jalan Pintas ke", show_all_windows: "Tampilkan Semua Jendela", + show_desktop_icons: "Tampilkan ikon desktop", show_hidden: "Tampilkan yang tersembunyi", sign_in_with_puter: "Masuk dengan Puter", sign_up: "Daftar", diff --git a/src/gui/src/i18n/translations/ig.js b/src/gui/src/i18n/translations/ig.js index 75d6b8ffa2..b6599609ea 100644 --- a/src/gui/src/i18n/translations/ig.js +++ b/src/gui/src/i18n/translations/ig.js @@ -155,6 +155,7 @@ const ig = { get_a_copy_of_on_puter: `Nweta otu '%%' na Puter.com!`, get_copy_link: "Nweta njikọ nke", hide_all_windows: "Ezo Windows niile", + hide_desktop_icons: "Zoo Desktop Icons", home: "ụlọ", html_document: "akwụkwọ HTML", hue: "Hue", @@ -292,6 +293,7 @@ const ig = { share_with: "ji ike nye:", shortcut_to: "Ụzọ mkpirisi ka", show_all_windows: "Gosi Windows niile", + show_desktop_icons: "Gosi Desktop Icons", show_hidden: "Gosi ihe ezozo", sign_in_with_puter: "Jiri Puter banye", sign_up: "Debanye aha", diff --git a/src/gui/src/i18n/translations/it.js b/src/gui/src/i18n/translations/it.js index 34766bb046..40fb76df97 100644 --- a/src/gui/src/i18n/translations/it.js +++ b/src/gui/src/i18n/translations/it.js @@ -157,6 +157,7 @@ const it = { get_a_copy_of_on_puter: `Ottieni una copia di '%%' su Puter.com!`, get_copy_link: "Ottieni link di copia", hide_all_windows: "Nascondi tutte le finestre", + hide_desktop_icons: "Nascondi icone desktop", home: "Home", html_document: "Documento HTML", hue: "Tonalità", @@ -298,6 +299,7 @@ const it = { share_with: "Condividi con", shortcut_to: "Scorciatoia per", show_all_windows: "Mostra tutte le finestre", + show_desktop_icons: "Mostra icone desktop", show_hidden: "Mostra nascosti", sign_in_with_puter: "Accedi con Puter", sign_up: "Registrati", diff --git a/src/gui/src/i18n/translations/ja.js b/src/gui/src/i18n/translations/ja.js index c199b892b3..691f31ea81 100644 --- a/src/gui/src/i18n/translations/ja.js +++ b/src/gui/src/i18n/translations/ja.js @@ -142,6 +142,7 @@ const ja = { get_a_copy_of_on_puter: `Puter.comで '%%' のコピーを取得!`, get_copy_link: 'コピーリンクを取得', hide_all_windows: "すべてのウィンドウを隠す", + hide_desktop_icons: "デスクトップアイコンを隠す", home: 'ホーム', html_document: 'HTML文書', hue: '色合い', @@ -270,6 +271,7 @@ const ja = { share_with: "共有相手:", shortcut_to: "ショートカット先", show_all_windows: "すべてのウィンドウを表示", + show_desktop_icons: "デスクトップアイコンを表示", show_hidden: '隠しファイルを表示', sign_in_with_puter: "Puterでサインイン", sign_up: "サインアップ", diff --git a/src/gui/src/i18n/translations/ko.js b/src/gui/src/i18n/translations/ko.js index 800005d7c4..316c68f18c 100644 --- a/src/gui/src/i18n/translations/ko.js +++ b/src/gui/src/i18n/translations/ko.js @@ -154,6 +154,7 @@ const ko = { get_a_copy_of_on_puter: `Puter.com에서 '%%'의 사본을 받으세요!`, get_copy_link: "링크 복사", hide_all_windows: "모든 창 숨기기", + hide_desktop_icons: "데스크톱 아이콘 숨기기", home: "홈", html_document: "HTML 문서", hue: "색조", @@ -290,6 +291,7 @@ const ko = { share_with: "공유 대상", shortcut_to: "바로 가기", show_all_windows: "모든 창 표시", + show_desktop_icons: "데스크톱 아이콘 표시", show_hidden: "숨김 항목 표시", sign_in_with_puter: "Puter로 로그인", sign_up: "가입", diff --git a/src/gui/src/i18n/translations/ku.js b/src/gui/src/i18n/translations/ku.js index 962ad7cced..82115986eb 100644 --- a/src/gui/src/i18n/translations/ku.js +++ b/src/gui/src/i18n/translations/ku.js @@ -158,6 +158,7 @@ const ku = { get_a_copy_of_on_puter: `کۆپیێک وەرگرتنەوەی '%%' لە پوتەر.com!`, get_copy_link: "کۆپی بەستەر وەرگرتن", hide_all_windows: "شاردنەوەی هەموو پەنجەکان", + hide_desktop_icons: "شاردنەوەی ئایکۆنەکانی دێسکتۆپ", home: "ماڵەوە", html_document: "بەڵگەی HTML", hue: "هیو", @@ -296,6 +297,7 @@ const ku = { share_with: "هاوبەشکردن بە:", shortcut_to: "شارتی بۆ", show_all_windows: "پیشاندانی هەموو پەنجەکان", + show_desktop_icons: "پیشاندانی ئایکۆنەکانی دێسکتۆپ", show_hidden: "پیشاندانی شاردراوەکان", sign_in_with_puter: "چوونەژوورەوە بە پوتەر", sign_up: "خۆتۆمارکردن", diff --git a/src/gui/src/i18n/translations/nb.js b/src/gui/src/i18n/translations/nb.js index 3cb4508697..c1ddc2c9d4 100644 --- a/src/gui/src/i18n/translations/nb.js +++ b/src/gui/src/i18n/translations/nb.js @@ -81,6 +81,7 @@ const nb = { get_a_copy_of_on_puter: "Få en kopi av '%%' på Puter.com!", get_copy_link: "Få kopilenke", hide_all_windows: "Skjul alle vinduer", + hide_desktop_icons: "Skjul skrivebordikoner", html_document: "HTML-dokument", image: "Bilde", invite_link: "Invitasjonslenke", @@ -157,6 +158,7 @@ const nb = { set_new_password: "Angi nytt passord", share_to: "Del", show_all_windows: "Vis alle vinduer", + show_desktop_icons: "Vis skrivebordikoner", show_hidden: "Vis skjulte", sign_in_with_puter: "Logg inn med Puter", sign_up: "Registrer deg", diff --git a/src/gui/src/i18n/translations/nl.js b/src/gui/src/i18n/translations/nl.js index 950eaaf612..25b4bfbcd7 100644 --- a/src/gui/src/i18n/translations/nl.js +++ b/src/gui/src/i18n/translations/nl.js @@ -141,6 +141,7 @@ const nl = { get_a_copy_of_on_puter: `Krijg een kopie van '%%' op Puter.com!`, get_copy_link: 'Krijg Kopieerlink', hide_all_windows: 'Alle Vensters Verbergen', + hide_desktop_icons: "Bureaublad iconen verbergen", home: 'Home', html_document: 'HTML-document', hue: 'Tint', @@ -270,6 +271,7 @@ const nl = { share_with: 'Delen met:', shortcut_to: 'Snelkoppeling naar', show_all_windows: 'Toon alle vensters', + show_desktop_icons: "Bureaublad iconen tonen", show_hidden: 'Toon verborgen', sign_in_with_puter: 'Inloggen met Puter', sign_up: 'Aanmelden', diff --git a/src/gui/src/i18n/translations/nn.js b/src/gui/src/i18n/translations/nn.js index ab8e1e7f8c..8fd08daf3b 100644 --- a/src/gui/src/i18n/translations/nn.js +++ b/src/gui/src/i18n/translations/nn.js @@ -75,6 +75,7 @@ const nn = { get_a_copy_of_on_puter: "Få ein kopi av '%%' på Puter.com!", get_copy_link: "Få kopilenkje", hide_all_windows: "Skjul alle vindauge", + hide_desktop_icons: "Skjul skrivebordsikon", html_document: "HTML-dokument", image: "Bilete", invite_link: "Invitasjonslenkje", @@ -140,6 +141,7 @@ const nn = { set_new_password: "Set nytt passord", share_to: "Del", show_all_windows: "Vis alle vindauge", + show_desktop_icons: "Vis skrivebordsikon", show_hidden: "Vis skjulte", sign_in_with_puter: "Logg inn med Puter", sign_up: "Registrer deg", diff --git a/src/gui/src/i18n/translations/pl.js b/src/gui/src/i18n/translations/pl.js index 6e89438f00..c0e55ba7c6 100644 --- a/src/gui/src/i18n/translations/pl.js +++ b/src/gui/src/i18n/translations/pl.js @@ -141,6 +141,7 @@ const pl = { get_a_copy_of_on_puter: `Pobierz kopię '%%' na Puter.com!`, get_copy_link: 'Pobierz skopiowany link', hide_all_windows: "Zamknij wszystkie okna", + hide_desktop_icons: "Ukryj ikony pulpitu", home: 'Folder domowy', html_document: 'dokument HTML', hue: 'Odcień', @@ -269,6 +270,7 @@ const pl = { share_with: "Udostępnij dla:", shortcut_to: "Skrót do", show_all_windows: "Pokaż wszystkie okna", + show_desktop_icons: "Pokaż ikony pulpitu", show_hidden: 'Pokaż ukryte', sign_in_with_puter: "Zaloguj się z Puter", sign_up: "Zarejestruj się", diff --git a/src/gui/src/i18n/translations/pt.js b/src/gui/src/i18n/translations/pt.js index eed6d0a886..8af59bd439 100644 --- a/src/gui/src/i18n/translations/pt.js +++ b/src/gui/src/i18n/translations/pt.js @@ -143,6 +143,7 @@ const pt = { get_a_copy_of_on_puter: `Obter uma cópia de '%%' em Puter.com!`, get_copy_link: 'Copiar Link', hide_all_windows: "Ocultar Todas as Janelas", + hide_desktop_icons: "Ocultar ícones da área de trabalho", home: 'Home', html_document: 'Documento HTML', hue: 'Hue', @@ -273,6 +274,7 @@ const pt = { share_with: " Partilhar com:", shortcut_to: "Atalho para", show_all_windows: "Mostrar Todas as Janelas", + show_desktop_icons: "Mostrar ícones da área de trabalho", show_hidden: 'Exibir janelas ocultas', sign_in_with_puter: "Entrar em Puter", sign_up: "Registar", diff --git a/src/gui/src/i18n/translations/ro.js b/src/gui/src/i18n/translations/ro.js index ab93c061a7..d61bab76c4 100644 --- a/src/gui/src/i18n/translations/ro.js +++ b/src/gui/src/i18n/translations/ro.js @@ -142,6 +142,7 @@ const ro = { get_a_copy_of_on_puter: `Obțineți o copie a '%%' pe Puter.com!`, get_copy_link: 'Obțineți link-ul copiei', hide_all_windows: "Ascunde toate ferestrele", + hide_desktop_icons: "Ascunde pictogramele desktop", home: "Acasă", html_document: 'Document HTML', hue: "Hue", @@ -270,6 +271,7 @@ const ro = { share_with: "Distribuie cu", shortcut_to: "Comandă rapidă ©ătre", show_all_windows: "Afișați toate ferestrele", + show_desktop_icons: "Afișează pictogramele desktop", show_hidden: 'Arată ascuns', sign_in_with_puter: "Conectați-vă cu Puter", sign_up: "Inscrie-te", diff --git a/src/gui/src/i18n/translations/ru.js b/src/gui/src/i18n/translations/ru.js index 38900f7c47..436e933575 100644 --- a/src/gui/src/i18n/translations/ru.js +++ b/src/gui/src/i18n/translations/ru.js @@ -158,6 +158,7 @@ const ru = { get_a_copy_of_on_puter: `Получите копию '%%' на Puter.com!`, get_copy_link: 'Получить ссылку для копирования', hide_all_windows: 'Скрыть все окна', + hide_desktop_icons: "Скрыть значки рабочего стола", home: 'Домой', html_document: 'HTML документ', hue: 'Оттенок', @@ -300,6 +301,7 @@ const ru = { share_with: 'Поделиться с: ', shortcut_to: 'Ярлык для', show_all_windows: 'Показать Все Окна', + show_desktop_icons: "Показать значки рабочего стола", show_hidden: 'Показать скрытые', sign_in_with_puter: 'Войти с Puter', sign_up: 'Зарегистрироваться', diff --git a/src/gui/src/i18n/translations/sv.js b/src/gui/src/i18n/translations/sv.js index 6c3e1e9489..8f6d255134 100644 --- a/src/gui/src/i18n/translations/sv.js +++ b/src/gui/src/i18n/translations/sv.js @@ -142,6 +142,7 @@ const sv = { get_a_copy_of_on_puter: "Få en kopia av '%%' på Puter.com!", get_copy_link: "Få kopieringslänk", hide_all_windows: "Dölj alla fönster", + hide_desktop_icons: "Dölj skrivbordsikoner", home: "Hem", html_document: "HTML-dokument", hue: "Färgton", @@ -270,6 +271,7 @@ const sv = { share_with: "Dela med:", shortcut_to: "Genväg till", show_all_windows: "Visa alla fönster", + show_desktop_icons: "Visa skrivbordsikoner", show_hidden: "Visa dolda", sign_in_with_puter: "Logga in med Puter", sign_up: "Skapa konto", diff --git a/src/gui/src/i18n/translations/ta.js b/src/gui/src/i18n/translations/ta.js index ebd7d244ba..db3f39962c 100644 --- a/src/gui/src/i18n/translations/ta.js +++ b/src/gui/src/i18n/translations/ta.js @@ -140,6 +140,7 @@ const ta = { get_a_copy_of_on_puter: `Puter.com இல் '%%' நகலைப் பெறுங்கள்!`, get_copy_link: 'நகல் இணைப்பைப் பெறவும்', hide_all_windows: "அனைத்து விண்டோஸையும் மறைக்கவும்", + hide_desktop_icons: "டெஸ்க்டாப் ஐகான்களை மறை", home: 'வீடு', html_document: 'HTML ஆவணம்', hue: 'சாயல்', @@ -268,6 +269,7 @@ const ta = { share_with: "இவர்களுடன் பகிரவும்:", shortcut_to: "குறுக்குவழி", show_all_windows: "அனைத்து விண்டோஸையும் காட்டு", + show_desktop_icons: "டெஸ்க்டாப் ஐகான்களைக் காட்டு", show_hidden: 'மறைக்கப்பட்டதைக் காட்டு', sign_in_with_puter: "புட்டர் மூலம் உள்நுழையவும்", sign_up: "பதிவு செய்யவும்", diff --git a/src/gui/src/i18n/translations/th.js b/src/gui/src/i18n/translations/th.js index ab63765c65..913591e6da 100644 --- a/src/gui/src/i18n/translations/th.js +++ b/src/gui/src/i18n/translations/th.js @@ -140,6 +140,7 @@ const th = { get_a_copy_of_on_puter: `รับสำเนาของ "%%" ได้ที่ Puter.com!`, get_copy_link: "คัดลอกลิงก์", hide_all_windows: "ซ่อนหน้าต่างทั้งหมด", + hide_desktop_icons: "ซ่อนไอคอนเดสก์ท็อป", home: 'บ้าน', html_document: "เอกสาร HTML", hue: 'สี', @@ -266,6 +267,7 @@ const th = { share_with: "แชร์ไปให้:", shortcut_to: "ทางลัดไป", show_all_windows: "แสดงหน้าต่างทั้งหมด", + show_desktop_icons: "แสดงไอคอนเดสก์ท็อป", show_hidden: "แสดงที่ซ่อนไว้", sign_in_with_puter: "ลงชื่อเข้าใช้ด้วย Puter", sign_up: "สมัครสมาชิก", diff --git a/src/gui/src/i18n/translations/tr.js b/src/gui/src/i18n/translations/tr.js index 7cd913a2c6..e256871205 100644 --- a/src/gui/src/i18n/translations/tr.js +++ b/src/gui/src/i18n/translations/tr.js @@ -141,6 +141,7 @@ const tr = { get_a_copy_of_on_puter: "'%' kopyasını Puter.com'da edinin!", get_copy_link: "Kopyalama Bağlantısını Al", hide_all_windows: "Tüm Pencereleri Gizle", + hide_desktop_icons: "Masaüstü simgelerini gizle", home: "Anasayfa", html_document: "HTML belgesi", hue: "Renk Tonu", @@ -269,6 +270,7 @@ const tr = { share_with: "Şununla paylaş", shortcut_to: "Şuna kısayol oluştur", show_all_windows: "Tüm Pencereleri Göster", + show_desktop_icons: "Masaüstü simgelerini göster", show_hidden: "Gizli dosyaları göster", sign_in_with_puter: "Puter ile giriş yap", sign_up: "Kaydol", diff --git a/src/gui/src/i18n/translations/ua.js b/src/gui/src/i18n/translations/ua.js index eee1183b87..acbc103799 100644 --- a/src/gui/src/i18n/translations/ua.js +++ b/src/gui/src/i18n/translations/ua.js @@ -143,6 +143,7 @@ const ua = { get_a_copy_of_on_puter: `Отримайте копію '%%' на Puter.com!`, get_copy_link: "Отримати Посилання для Копіювання", hide_all_windows: "Приховати всі вікна", + hide_desktop_icons: "Приховати іконки робочого столу", home: "Додому", html_document: "HTML документ", hue: "Колірна Гама", @@ -273,6 +274,7 @@ const ua = { share_with: "Поділитися з", shortcut_to: "Ярлик для", show_all_windows: "Показати Всі Вікна", + show_desktop_icons: "Показати іконки робочого столу", show_hidden: 'Показати приховані', sign_in_with_puter: "Увійти з Puter", sign_up: "Зареєструватися", diff --git a/src/gui/src/i18n/translations/ur.js b/src/gui/src/i18n/translations/ur.js index 82b13b28c9..049e06a8b5 100644 --- a/src/gui/src/i18n/translations/ur.js +++ b/src/gui/src/i18n/translations/ur.js @@ -146,6 +146,7 @@ const ur = { get_a_copy_of_on_puter: "Puter.com پر '%%' کی ایک کاپی حاصل کریں!", get_copy_link: "کاپی لنک حاصل کریں", hide_all_windows: "تمام ونڈوز چھپائیں ", + hide_desktop_icons: "ڈیسک ٹاپ آئیکنز چھپائیں", home: "گھر", html_document: "ایچ ٹی ایم ایل دستاویز", hue: "رنگت", @@ -275,6 +276,7 @@ const ur = { set_new_password: "نیا پاس ورڈ مقرر کریں ", share_to: " کے ساتھ شیئر کریں", show_all_windows: "تمام ونڈوز دکھائیں ", + show_desktop_icons: "ڈیسک ٹاپ آئیکنز دکھائیں", show_hidden: "پوشیدہ دکھائیں ", sign_in_with_puter: "پیوٹر کے ساتھ سائن ان کریں", sign_up: "سائن اپ کریں", diff --git a/src/gui/src/i18n/translations/vi.js b/src/gui/src/i18n/translations/vi.js index 0963d2509a..0a8098b36c 100644 --- a/src/gui/src/i18n/translations/vi.js +++ b/src/gui/src/i18n/translations/vi.js @@ -142,6 +142,7 @@ const vi = { get_a_copy_of_on_puter: `Nhận một bản sao của '%%' trên Puter.com!`, get_copy_link: 'Lấy liên kết sao chép', hide_all_windows: "Ẩn tất cả cửa sổ", + hide_desktop_icons: "Ẩn biểu tượng trên màn hình", home: 'Trang chủ', html_document: 'Tài liệu HTML', hue: 'Màu sắc', @@ -270,6 +271,7 @@ const vi = { share_with: "Chia sẻ với:", shortcut_to: "Lối tắt đến", show_all_windows: "Hiển thị tất cả cửa sổ", + show_desktop_icons: "Hiển thị biểu tượng trên màn hình", show_hidden: 'Hiển thị mục ẩn', sign_in_with_puter: "Đăng nhập bằng Puter", sign_up: "Đăng ký", diff --git a/src/gui/src/i18n/translations/zh.js b/src/gui/src/i18n/translations/zh.js index 3d8ddc1d82..3bc5ece93a 100644 --- a/src/gui/src/i18n/translations/zh.js +++ b/src/gui/src/i18n/translations/zh.js @@ -142,6 +142,7 @@ const zh = { get_a_copy_of_on_puter: `在 Puter.com 上获取 '%%' 的副本!`, get_copy_link: '获取复制链接', hide_all_windows: "隐藏所有窗口", + hide_desktop_icons: "隐藏桌面图标", home: '主页', html_document: 'HTML 文档', hue: '色调', @@ -270,6 +271,7 @@ const zh = { share_with: "分享:", shortcut_to: "快捷方式", show_all_windows: "显示所有窗口", + show_desktop_icons: "显示桌面图标", show_hidden: '显示隐藏', sign_in_with_puter: "使用 Puter 登录", sign_up: "注册", diff --git a/src/gui/src/i18n/translations/zhtw.js b/src/gui/src/i18n/translations/zhtw.js index 00b31d178d..8bdf2ff405 100644 --- a/src/gui/src/i18n/translations/zhtw.js +++ b/src/gui/src/i18n/translations/zhtw.js @@ -141,6 +141,7 @@ const zhtw = { get_a_copy_of_on_puter: `在 Puter.com 上獲取 '%%' 的副本!`, get_copy_link: '獲取副本連結', hide_all_windows: "隱藏所有視窗", + hide_desktop_icons: "隱藏桌面圖示", home: '首頁', html_document: 'HTML 文件', hue: '色相', @@ -269,6 +270,7 @@ const zhtw = { share_with: "分享給:", shortcut_to: "捷徑到", show_all_windows: "顯示所有視窗", + show_desktop_icons: "顯示桌面圖示", show_hidden: '顯示隱藏項目', sign_in_with_puter: "使用 Puter 登入", sign_up: "註冊",