ed's changes (amended)

This commit is contained in:
Til Schmitter 2026-05-11 12:54:08 +02:00
parent dff7cc38c8
commit 77cf85cdc7
7 changed files with 53 additions and 27 deletions

View file

@ -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)")

View file

@ -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)

View file

@ -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

View file

@ -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 {

View file

@ -35,6 +35,7 @@
<div id="spaceTotal_bar">
<div id="spaceUsed_bar" style="width: {{ space_used_percent }}%;"></div>
<div id="spaceMax"></div>
</div>
<span id="op_acc" class="opview popup under">

View file

@ -1033,11 +1033,10 @@ ebi('op_up2k').innerHTML = (
'</div>\n' +
' <div id="up2k_qs">' +
' <label tabindex="0" for="fsearch" class="tgl btn" tt="' + L.ut_srch +'">🔎</label>\n' +
' <label tabindex="0" for="fsearch" id="fsearch_copy" class="tgl btn" tt="' + L.ut_srch +'">🔎</label>\n' +
' <label tabindex="0" for="u2ow" id="u2ow_copy" class="tgl btn on" tt="' + L.ut_ow +'"></label>\n' +
' <label tabindex="0" for="ask_up" class="tgl btn" tt="' + L.ut_ask + '">💭</label>\n' +
' <label tabindex="0" for="upnag" class="tgl btn" tt="' + L.cut_nag + '">🔔</label>\n' +
' <label tabindex="0" for="upsfx" class="tgl btn" tt="' + L.cut_sfx + '">🔊</label>\n' +
' <label tabindex="0" for="u2rand" id="u2rand_copy" class="tgl btn" tt="' + L.ut_rand +'">🎲</label>\n' +
' <label tabindex="0" for="multitask" id="multitask_copy" class="tgl btn" tt="' + L.ut_mt +'">🏃</label>\n' +
' <a id="up_moreopts" class="btn" href="#h_up2kcfg">↗️ ' + L.more_options + '</a>\n' +
' </div>\n' +
@ -1320,7 +1319,7 @@ ebi('op_cfg').innerHTML = (
'<div class="sub">\n' +
' <h3 id="h_upload">🎈 ' + L.cl_opts + '</h3>\n' +
' <div>\n' +
' <div class="c" tt="' + L.ut_ask + '"><input type="checkbox" id="ask_up"></input><label for="ask_up" class="tgl btn">💭</label></div>\n' +
' <a id="ask_up" class="tgl btn" tt="' + L.ut_ask + '">💭</a>\n' +
' <a id="u2ts" class="tgl btn" tt="' + L.ut_u2ts + '</a>\n' +
' <a id="umod" class="tgl btn" tt="' + L.cut_umod + '</a>\n' +
' <a id="hashw" class="tgl btn" tt="' + L.cut_mt + '</a>\n' +
@ -1330,8 +1329,8 @@ ebi('op_cfg').innerHTML = (
' <input type="text" id="u2szg" value="" ' + NOAC + ' style="width:3em" tt="' + L.cut_u2sz + '" />' +
' <a id="flag_en" class="tgl btn" tt="' + L.cut_flag + '">💤</a>\n' +
' <a id="u2sort" class="tgl btn" tt="' + L.cut_az + '">az</a>\n' +
' <div class="c" tt="' + L.cut_nag + '"><input type="checkbox" id="upnag"></input><label for="upnag" class="tgl btn">🔔</label></div>\n' +
' <div class="c" tt="' + L.cut_sfx + '"><input type="checkbox" id="upsfx"></input><label for="upsfx" class="tgl btn">🔊</label></div>\n' +
' <a id="upnag" class="tgl btn" tt="' + L.cut_nag + '">🔔</a>\n' +
' <a id="upsfx" class="tgl btn" tt="' + L.cut_sfx + '">🔊</a>\n' +
' </div>\n' +
'</div>\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-</a>';
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 = ['<tr class="' + cl + '"><td>' + tn.lead + '</td><td><a href="' +
top + tn.href + '" id="' + id + '">' + hname +
'</a></td><td sortv="' + tn.sz + '">' + 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('<option value="{0}">{0} ┃ {1}</option>'.format(a, names[a] || 'custom'));

View file

@ -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"')/;