From 352366ba76b31c00e153101fc4c06a9e97af5022 Mon Sep 17 00:00:00 2001 From: juodumas Date: Tue, 2 Jun 2026 22:26:45 +0300 Subject: [PATCH 1/2] add upload hotkeys: n & shift+n --- README.md | 2 ++ copyparty/web/browser.js | 8 ++++++++ copyparty/web/up2k.js | 11 +++++++---- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 133d962f..cecad1a8 100644 --- a/README.md +++ b/README.md @@ -687,6 +687,8 @@ the browser has the following hotkeys (always qwerty) * `ctrl-C` copy selected files/folders to clipboard * `ctrl-V` paste (move/copy) * `Y` download selected files +* `N` upload file(s) +* `shift-N` upload folder * `F2` [rename](#batch-rename) selected file/folder * when a file/folder is selected (in not-grid-view): * `Up/Down` move cursor diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 6622c5c1..82cc2321 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -45,6 +45,8 @@ if (1) ["ctrl-C", "copy selection to clipboard"], ["ctrl-V", "paste (move/copy) here"], ["Y", "download selected"], + ["N", "upload file(s)"], + ["ctrl-N", "upload folder"], ["F2", "rename selected"], "file-list-sel", @@ -6365,6 +6367,12 @@ var ahotkeys = function (e) { return showfile.ppj(e) || true; } + if (kl == 'n' && sh) + return up2k.up('dir') + + if (kl == 'n') + return up2k.up('file') + if (sh && kl != 'a' && kl != 'd') return; diff --git a/copyparty/web/up2k.js b/copyparty/web/up2k.js index 4750765b..21220883 100644 --- a/copyparty/web/up2k.js +++ b/copyparty/web/up2k.js @@ -796,7 +796,8 @@ function up2k_init(subtle) { "tact": Date.now(), "init_deps": init_deps, "set_fsearch": set_fsearch, - "gotallfiles": [gotallfiles] // hooks + "gotallfiles": [gotallfiles], // hooks + "up": up, }; setTimeout(function () { @@ -998,7 +999,7 @@ function up2k_init(subtle) { apply_flag_cfg(); set_fsearch(); - function nav() { + function up(t) { start_actx(); var uf = function () { ebi('file' + fdom_ctr).click(); }, @@ -1013,9 +1014,11 @@ function up2k_init(subtle) { if (MOBILE) return uf(); - modal.confirm(L.u_nav_m, uf, ud, null, L.u_nav_b); + if (t == 'file') return uf(); + else if (t == 'dir') return ud(); + else modal.confirm(L.u_nav_m, uf, ud, null, L.u_nav_b); } - ebi('u2btn').onclick = nav; + ebi('u2btn').onclick = up; var nenters = 0; function ondrag(e) { From b91b55017fc66854520e52945eabee2a468e5031 Mon Sep 17 00:00:00 2001 From: juodumas Date: Wed, 3 Jun 2026 11:40:29 +0300 Subject: [PATCH 2/2] =?UTF-8?q?fix=20indent:=20tabs=20in=20browser.js,=20b?= =?UTF-8?q?ut=20spaces=20in=20up2k.js=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- copyparty/web/browser.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 82cc2321..5d59ce81 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -6367,11 +6367,11 @@ var ahotkeys = function (e) { return showfile.ppj(e) || true; } - if (kl == 'n' && sh) - return up2k.up('dir') + if (kl == 'n' && sh) + return up2k.up('dir') if (kl == 'n') - return up2k.up('file') + return up2k.up('file') if (sh && kl != 'a' && kl != 'd') return;