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