From 5b3a5fe76b94f8e7be57898d9baef2d0f167181b Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 20 Apr 2025 13:33:01 +0000 Subject: [PATCH] show warning on ctrl-a in lazyloaded folders --- copyparty/web/browser.js | 9 ++++++++- scripts/tl.js | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 16e4f538..98883e23 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -332,6 +332,7 @@ var Ls = { "f_bigtxt": "this file is {0} MiB large -- really view as text?", "fbd_more": '
showing {0} of {1} files; show {2} or show all
', "fbd_all": '
showing {0} of {1} files; show all
', + "f_anota": "only {0} of the {1} items were selected;\nto select the full folder, first scroll to the bottom", "f_dls": 'the file links in the current folder have\nbeen changed into download links', @@ -937,6 +938,7 @@ var Ls = { "f_bigtxt": "denne filen er hele {0} MiB -- vis som tekst?", "fbd_more": '
viser {0} av {1} filer; vis {2} eller vis alle
', "fbd_all": '
viser {0} av {1} filer; vis alle
', + "f_anota": "kun {0} av totalt {1} elementer ble markert;\nfor å velge alt må du bla til bunnen av mappen først", "f_dls": 'linkene i denne mappen er nå\nomgjort til nedlastningsknapper', @@ -6759,11 +6761,16 @@ var ahotkeys = function (e) { } if (in_ftab || !aet || (ae && ae.closest('#ggrid'))) { if ((k == 'KeyA' || k == 'a') && ctrl(e)) { - var sel = msel.getsel(), + var ntot = treectl.lsc.files.length + treectl.lsc.dirs.length, + sel = msel.getsel(), all = msel.getall(); msel.evsel(e, sel.length < all.length); msel.origin_id(null); + if (ntot > all.length) + toast.warn(10, L.f_anota.format(all.length, ntot), L.f_anota); + else if (toast.tag == L.f_anota) + toast.hide(); return ev(e); } } diff --git a/scripts/tl.js b/scripts/tl.js index b3c98a4d..5e2f4226 100644 --- a/scripts/tl.js +++ b/scripts/tl.js @@ -418,6 +418,7 @@ var tl_browser = { "f_bigtxt": "this file is {0} MiB large -- really view as text?", "fbd_more": '
showing {0} of {1} files; show {2} or show all
', "fbd_all": '
showing {0} of {1} files; show all
', + "f_anota": "only {0} of the {1} items were selected;\nto select the full folder, first scroll to the bottom", "f_dls": 'the file links in the current folder have\nbeen changed into download links',