From 77cf85cdc7d5d58fc90e5c0c3a9f4af2432369b3 Mon Sep 17 00:00:00 2001 From: Til Schmitter Date: Mon, 11 May 2026 12:54:08 +0200 Subject: [PATCH] ed's changes (amended) --- copyparty/__main__.py | 6 +++--- copyparty/httpcli.py | 8 +++----- copyparty/ico.py | 6 ++++++ copyparty/web/browser.css | 22 ++++++++++++++++------ copyparty/web/browser.html | 1 + copyparty/web/browser.js | 26 ++++++++++++++------------ scripts/make-sfx.sh | 11 ++++++++++- 7 files changed, 53 insertions(+), 27 deletions(-) diff --git a/copyparty/__main__.py b/copyparty/__main__.py index 496956d7..54462aae 100644 --- a/copyparty/__main__.py +++ b/copyparty/__main__.py @@ -1902,8 +1902,8 @@ def add_og(ap): def add_ui(ap, retry: int): THEMES = 10 ap2 = ap.add_argument_group("ui options") - ap2.add_argument("--grid", action="store_true", default="true", help="show grid/thumbnails by default (volflag=grid)") - ap2.add_argument("--gsel", action="store_true", default="true", help="select files in grid by ctrl-click (volflag=gsel)") + ap2.add_argument("--grid", action="store_true", help="show grid/thumbnails by default (volflag=grid)") + ap2.add_argument("--gsel", action="store_true", help="select files in grid by ctrl-click (volflag=gsel)") ap2.add_argument("--localtime", action="store_true", help="default to local timezone instead of UTC") ap2.add_argument("--ui-filesz", metavar="FMT", type=u, default="6", help="default filesize format; one of these: 0, 1, 2, 2c, 3, 3c, 4, 4c, 5, 5c, 6, 6c, 7, 7c, fuzzy (see UI)") ap2.add_argument("--gauto", metavar="PERCENT", type=int, default=0, help="switch to gridview if more than \033[33mPERCENT\033[0m of files are pics/vids; 0=disabled") @@ -1917,7 +1917,7 @@ def add_ui(ap, retry: int): ap2.add_argument("--nsort", action="store_true", help="default-enable natural sort of filenames with leading numbers (volflag=nsort)") ap2.add_argument("--hsortn", metavar="N", type=int, default=2, help="number of sorting rules to include in media URLs by default (volflag=hsortn)") ap2.add_argument("--see-dots", action="store_true", help="default-enable seeing dotfiles; only takes effect if user has the necessary permissions") - ap2.add_argument("--qdel", metavar="LVL", type=int, default=1, help="number of confirmations to show when deleting files (2/1/0)") + ap2.add_argument("--qdel", metavar="LVL", type=int, default=2, help="number of confirmations to show when deleting files (2/1/0)") ap2.add_argument("--dlni", action="store_true", help="force download (don't show inline) when files are clicked (volflag:dlni)") ap2.add_argument("--unlist", metavar="REGEX", type=u, default="", help="don't show files/folders matching \033[33mREGEX\033[0m in file list. WARNING: Purely cosmetic! Does not affect API calls, just the browser. Example: [\033[32m\\.(js|css)$\033[0m] (volflag=unlist)") ap2.add_argument("--dothidden", action="store_true", help="hide specific files in a folder by listing them in a file named .hidden -- WARNING: Mostly cosmetic! Download-as-zip/tar will still download them. Do not rely on this for security (volflag=dothidden)") diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 692fbc69..05e7265a 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -6851,7 +6851,7 @@ class HttpCli(object): pass if is_dir: - return '' # self.tx_svg("folder") + return self.reply(b"(no thumbnail)") thp = None if self.thumbcli and not nothumb: @@ -6871,7 +6871,7 @@ class HttpCli(object): elif th_fmt in ACODE2_FMT: raise Pebkac(415) - return '' # self.tx_ico(rem) + return self.reply(b"(no thumbnail)") elif self.can_write and th_fmt is not None: return self.tx_svg("upload\nonly") @@ -7208,7 +7208,7 @@ class HttpCli(object): and vpath ) for fn in ls_names: - cls = base = "" + base = "" href = fn if use_abs_url: base = "/" + vpath + "/" @@ -7228,7 +7228,6 @@ class HttpCli(object): is_dir = stat.S_ISDIR(inf.st_mode) if is_dir: - cls = "dir" href += "/" if no_zip: margin = "DIR" @@ -7298,7 +7297,6 @@ class HttpCli(object): "ext": ext, "dt": dt, "ts": int(linf.st_mtime), - "cls": cls, } if is_dir: dirs.append(item) diff --git a/copyparty/ico.py b/copyparty/ico.py index cce4839f..5b27027a 100644 --- a/copyparty/ico.py +++ b/copyparty/ico.py @@ -11,6 +11,9 @@ from .th_srv import HAVE_PIL, HAVE_PILF from .util import BytesIO, html_escape # type: ignore +RE_CSS_COLOR = re.compile(r"[^a-zA-Z0-9#()%.,/-]") + + class Ico(object): def __init__(self, args: argparse.Namespace) -> None: self.args = args @@ -27,6 +30,9 @@ class Ico(object): sw, sh = self.args.th_size.split("x") h = int(100.0 / (float(sw) / float(sh))) + if accent: + accent = RE_CSS_COLOR.sub("", accent) + # obsolete. 2000+ svgs slows chrome down massively, but no crash. # further, unique svgs are only used for non-standard thumbnails, # so it's unrealistic to see that many in use diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css index 3e3d2b96..2b5b4220 100644 --- a/copyparty/web/browser.css +++ b/copyparty/web/browser.css @@ -1940,7 +1940,7 @@ input.ssconf_v { overscroll-behavior-y: none; box-shadow: 0 0 1em var(--mp-sh), 0 -1px 0 rgba(128,128,128,0.3); border: 1px solid var(--bg-u3); - transition: width 0.15s; + transition: width .05s; z-index: 5; padding-bottom: 3em; } @@ -2615,11 +2615,11 @@ html.noscroll .sbar::-webkit-scrollbar { -ms-interpolation-mode: nearest-neighbor; image-rendering: pixelated; } -html.ab_fsc .full-image img, -html.ab_fsc .full-image video { +html.bb_fsc .full-image img, +html.bb_fsc .full-image video { max-height: 100%; } -html.ab_fsc figcaption { +html.bb_fsc figcaption { display: none; } .full-image img.nt, @@ -4950,9 +4950,19 @@ html.e #wtc { background: linear-gradient(to right, transparent, var(--a-dark), var(--a)); } #spaceTotal_bar { + position: relative; margin-bottom: .5em; background: #ccc; - background: var(--bg-u5); + background: var(--bg-u1); +} +#spaceMax { + position: absolute; + background: var(--a); + right: 0; + top: 0; + width: .3em; + height: .3em; + border-radius: var(--radius); } #tree_footer { width: 0; @@ -4962,7 +4972,7 @@ html.e #wtc { left: 0; padding: 1em; pointer-events: none; - transition: width .15s; + transition: width .05s; background: linear-gradient(to top, var(--bg-u2), transparent); } .popup_button { diff --git a/copyparty/web/browser.html b/copyparty/web/browser.html index d0203cf8..ca6a0886 100644 --- a/copyparty/web/browser.html +++ b/copyparty/web/browser.html @@ -35,6 +35,7 @@
+
diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 2af83bf0..0b1f4337 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -1033,11 +1033,10 @@ ebi('op_up2k').innerHTML = ( '\n' + '
' + - ' \n' + + ' \n' + ' \n' + - ' \n' + - ' \n' + - ' \n' + + ' \n' + + ' \n' + ' ↗️ ' + L.more_options + '\n' + '
\n' + @@ -1320,7 +1319,7 @@ ebi('op_cfg').innerHTML = ( '
\n' + '

🎈 ' + L.cl_opts + '

\n' + '
\n' + - '
\n' + + ' 💭\n' + ' ' + ' 💤\n' + ' az\n' + - '
\n' + - '
\n' + + ' 🔔\n' + + ' 🔊\n' + '
\n' + '
\n' + @@ -7244,11 +7243,11 @@ var search_ui = (function () { var ms = ebi('moresearch'); if(e){ - window.scrollTo(0, 0) - ms.innerHTML = '▴' + window.scrollTo(0, 0); + ms.innerHTML = '▴'; } else{ - ms.innerHTML = '▾' + ms.innerHTML = '▾'; } } ebi('moresearch').onclick = function () { @@ -8476,6 +8475,9 @@ var treectl = (function () { r.gentab = function (top, res) { showfile.untail(); + for (var a = 0; a < res.dirs.length; a++) + res.dirs[a].cls = 'dir'; + var nodes = res.dirs.concat(res.files), html = mk_files_header(res.taglist), sel = msel.hist[top], @@ -8543,7 +8545,7 @@ var treectl = (function () { '" rel="nofollow" class="doc' + (lang ? ' bri' : '') + '" hl="' + id + '" name="' + hname + '">-txt-'; - var cl = (/\.PARTIAL$/.exec(fname) ? 'fade ' : '') + (img_re.exec(fname) ? 'img ' : '') + tn.cls, + var cl = (/\.PARTIAL$/.exec(fname) ? 'fade ' : '') + (img_re.exec(fname) ? 'img ' : '') + (tn.cls || ''), ln = ['' + tn.lead + '' + hname + '' + filesizefun(tn.sz)]; @@ -9404,7 +9406,7 @@ var settheme = (function () { var html = [], cb = ebi('themes'), itheme = ax.indexOf(theme[0]) * 2 + (light ? 1 : 0), - names = ['flat dark', 'flat light', 'gradient dark', 'gradient light', 'vice', 'hotdog stand', 'hacker', 'hi-con', 'phi95 dark', 'phi95']; + names = ['flat dark', 'flat light', 'fancy dark', 'fancy light', 'vice', 'hotdog stand', 'hacker', 'hi-con', 'phi95 dark', 'phi95']; for (var a = 0; a < themes; a++) html.push(''.format(a, names[a] || 'custom')); diff --git a/scripts/make-sfx.sh b/scripts/make-sfx.sh index af4060b7..838fbff9 100755 --- a/scripts/make-sfx.sh +++ b/scripts/make-sfx.sh @@ -404,8 +404,17 @@ git describe --tags >/dev/null 2>/dev/null && { printf 'unexpected git version format: [%s]\n' "$git_ver" exit 1 } - dt="$(git log -1 --format=%cd --date=short | sed -E 's/-0?/, /g')" +} + +[ "$PRTY_SFX_VER" ] && { + # PRTY_SFX_VER='1.20.14-5-g139ef185' PRTY_SFX_DT='2026, 5, 8' + # PRTY_SFX_VER='2026-0510-2303' PRTY_SFX_DT='2026, 5, 10' + ver="$PRTY_SFX_VER" + dt="$PRTY_SFX_DT" +} + +[ "$ver" ] && { printf 'git %3s: \033[36m%s\033[0m\n' ver "$ver" dt "$dt" sed -ri ' s/^(VERSION =)(.*)/#\1\2\n\1 ('"$t_ver"')/;