diff --git a/copyparty/__main__.py b/copyparty/__main__.py index ac85c8df..24617f4f 100644 --- a/copyparty/__main__.py +++ b/copyparty/__main__.py @@ -437,7 +437,8 @@ def run_argparse(argv, formatter): default=".vq,.aq,vc,ac,res,.fps") ap2.add_argument("-mtp", metavar="M=[f,]bin", type=u, action="append", help="read tag M using bin") - ap2 = ap.add_argument_group('appearance options') + ap2 = ap.add_argument_group('ui options') + ap2.add_argument("--js-browser", metavar="L", type=u, help="URL to additional JS to include") ap2.add_argument("--css-browser", metavar="L", type=u, help="URL to additional CSS to include") ap2 = ap.add_argument_group('debug options') diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 22f0262f..b61680b4 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -2216,6 +2216,9 @@ class HttpCli(object): if "mth" in vn.flags: j2a["def_hcols"] = vn.flags["mth"].split(",") + if self.args.js_browser: + j2a["js"] = self.args.js_browser + if self.args.css_browser: j2a["css"] = self.args.css_browser diff --git a/copyparty/web/browser.html b/copyparty/web/browser.html index d02d0c80..4570f5ef 100644 --- a/copyparty/web/browser.html +++ b/copyparty/web/browser.html @@ -141,6 +141,9 @@ + {%- if js %} + + {%- endif %} diff --git a/tests/test_httpcli.py b/tests/test_httpcli.py index d10bac66..75e2eae0 100644 --- a/tests/test_httpcli.py +++ b/tests/test_httpcli.py @@ -50,6 +50,7 @@ class Cfg(Namespace): hist=None, no_idx=None, no_hash=None, + js_browser=None, css_browser=None, **{k: False for k in "e2d e2ds e2dsa e2t e2ts e2tsr".split()} ) diff --git a/tests/test_vfs.py b/tests/test_vfs.py index 73ebe3bb..7ddd728c 100644 --- a/tests/test_vfs.py +++ b/tests/test_vfs.py @@ -25,6 +25,7 @@ class Cfg(Namespace): "hist": None, "no_idx": None, "no_hash": None, + "js_browser": None, "css_browser": None, "no_voldump": True, "no_logues": False,