From 30db54f06294c393758ae69d5d00941399625bf7 Mon Sep 17 00:00:00 2001 From: jelveh Date: Sun, 3 Aug 2025 14:50:02 -0700 Subject: [PATCH] Remove context menu from entries --- src/dev-center/css/style.css | 21 ++++++++++++++------- src/dev-center/js/apps.js | 11 ----------- src/dev-center/js/websites.js | 17 ----------------- src/dev-center/js/workers.js | 26 ++++++++------------------ 4 files changed, 22 insertions(+), 53 deletions(-) diff --git a/src/dev-center/css/style.css b/src/dev-center/css/style.css index 7febab428..7c0679093 100644 --- a/src/dev-center/css/style.css +++ b/src/dev-center/css/style.css @@ -237,8 +237,8 @@ section { padding: 10px; overflow: hidden; width: 100%; - padding-right: 20px; - padding-left: 20px; + padding-right: 40px; + padding-left: 40px; box-sizing: border-box; } #app-list, #website-list, #worker-list { @@ -756,12 +756,13 @@ th.sorted{ } .my-apps-title, .my-workers-title, .my-websites-title { - font-size: 27px; + font-size: 22px; margin-top: 0px; float: left; font-weight: 500; - margin-bottom: 15px; + margin-bottom: 0; color: #394254; + flex-grow: 1; } .app-row-toolbar { @@ -956,7 +957,7 @@ ol li:before { .create-an-app-btn, .create-a-website-btn{ float:right; - margin-bottom: 10px; + margin-bottom: 0px; } .create-an-app-btn img, .create-a-website-btn img, .create-a-worker-btn img{ width: 25px; @@ -967,7 +968,8 @@ ol li:before { margin-right: 4px; } .create-a-worker-btn, .create-a-website-btn{ - float:right; margin-bottom: 10px; + float:right; + margin-bottom: 0px; } .jip-submit-btn{ @@ -979,7 +981,12 @@ ol li:before { font-size: 12px; margin-top: 20px; margin-bottom: 0; } .app-list-nav, .worker-list-nav, .website-list-nav{ - overflow: hidden; margin-bottom: 40px; margin-top: 10px; + overflow: hidden; + margin-bottom: 40px; + margin-top: 10px; + display: flex; + flex-direction: row; + align-items: center; } .back-to-main-btn{ float:right; margin-bottom: 10px; diff --git a/src/dev-center/js/apps.js b/src/dev-center/js/apps.js index eb0aa81be..504123753 100644 --- a/src/dev-center/js/apps.js +++ b/src/dev-center/js/apps.js @@ -2660,17 +2660,6 @@ $(document).on('click', '.options-icon-app', function(e) { app_context_menu(app_name, app_title, app_uid); }) -$(document).on('contextmenu', '.app-card', function(e) { - let app_name = $(this).attr('data-name'); - let app_title = $(this).attr('data-title'); - let app_uid = $(this).attr('data-uid'); - - e.preventDefault(); - e.stopPropagation(); - e.stopImmediatePropagation(); - app_context_menu(app_name, app_title, app_uid); -}) - async function attempt_delete_app(app_name, app_title, app_uid) { // get app const app_data = await puter.apps.get(app_name, { icon_size: 16 }); diff --git a/src/dev-center/js/websites.js b/src/dev-center/js/websites.js index 328573318..ba66153e6 100644 --- a/src/dev-center/js/websites.js +++ b/src/dev-center/js/websites.js @@ -286,23 +286,6 @@ $(document).on('click', '.delete-websites-btn', async function (e) { } }) -$(document).on('contextmenu', '.website-card', function (e) { - e.preventDefault(); - e.stopPropagation(); - e.stopImmediatePropagation(); - puter.ui.contextMenu({ - items: [ - { - label: 'Delete', - type: 'danger', - action: () => { - attempt_delete_website($(this).attr('data-name')); - }, - }, - ], - }); -}) - $(document).on('click', '.options-icon-website', function (e) { e.preventDefault(); e.stopPropagation(); diff --git a/src/dev-center/js/workers.js b/src/dev-center/js/workers.js index d6ad910e4..e94cb6eee 100644 --- a/src/dev-center/js/workers.js +++ b/src/dev-center/js/workers.js @@ -4,7 +4,14 @@ window.workers = []; let search_query; window.create_worker = async (name) => { - let worker = await puter.workers.create(name, window.default_worker_file); + let worker; + + try { + worker = await puter.workers.create(name, window.default_worker_file); + } catch (err) { + console.log(err); + console.error('Error creating worker:', err.error); + } return worker; } @@ -309,23 +316,6 @@ $(document).on('click', '.delete-workers-btn', async function (e) { } }) -$(document).on('contextmenu', '.worker-card', function (e) { - e.preventDefault(); - e.stopPropagation(); - e.stopImmediatePropagation(); - puter.ui.contextMenu({ - items: [ - { - label: 'Delete', - type: 'danger', - action: () => { - attempt_delete_worker($(this).attr('data-name')); - }, - }, - ], - }); -}) - $(document).on('click', '.options-icon-worker', function (e) { e.preventDefault(); e.stopPropagation();