diff --git a/copyparty/__main__.py b/copyparty/__main__.py index e39594df..b0cd766b 100644 --- a/copyparty/__main__.py +++ b/copyparty/__main__.py @@ -1488,6 +1488,7 @@ def add_ui(ap, retry): ap2.add_argument("--unlist", metavar="REGEX", type=u, default="", help="don't show files matching \033[33mREGEX\033[0m in file list. Purely cosmetic! Does not affect API calls, just the browser. Example: [\033[32m\\.(js|css)$\033[0m] (volflag=unlist)") ap2.add_argument("--favico", metavar="TXT", type=u, default="c 000 none" if retry else "🎉 000 none", help="\033[33mfavicon-text\033[0m [ \033[33mforeground\033[0m [ \033[33mbackground\033[0m ] ], set blank to disable") ap2.add_argument("--mpmc", metavar="URL", type=u, default="", help="change the mediaplayer-toggle mouse cursor; URL to a folder with {2..5}.png inside (or disable with [\033[32m.\033[0m])") + ap2.add_argument("--spinner", metavar="TXT", type=u, default="🌲", help="\033[33memoji\033[0m or \033[33memoji,css\033[0m Example: [\033[32m🥖,padding:0\033[0m]") ap2.add_argument("--css-browser", metavar="L", type=u, default="", help="URL to additional CSS to include in the filebrowser html") ap2.add_argument("--js-browser", metavar="L", type=u, default="", help="URL to additional JS to include in the filebrowser html") ap2.add_argument("--js-other", metavar="L", type=u, default="", help="URL to additional JS to include in all other pages") diff --git a/copyparty/authsrv.py b/copyparty/authsrv.py index 6b2c432f..ccb91c61 100644 --- a/copyparty/authsrv.py +++ b/copyparty/authsrv.py @@ -2381,6 +2381,7 @@ class AuthSrv(object): "sb_lg": "" if "no_sb_lg" in vf else (vf.get("lg_sbf") or "y"), } js_htm = { + "SPINNER": self.args.spinner, "s_name": self.args.bname, "have_up2k_idx": "e2d" in vf, "have_acode": not self.args.no_acode, diff --git a/copyparty/web/browser.css b/copyparty/web/browser.css index e66279d4..a896a2c1 100644 --- a/copyparty/web/browser.css +++ b/copyparty/web/browser.css @@ -1699,6 +1699,8 @@ html.y #tree.nowrap .ntree a+a:hover { margin: 1em .3em 1em 1em; padding: 0 1.2em 0 0; font-size: 4em; + min-width: 1em; + min-height: 1em; opacity: 0; animation: 1s linear .15s infinite forwards spin, .2s ease .15s 1 forwards fadein; position: absolute; diff --git a/copyparty/web/browser.js b/copyparty/web/browser.js index 7273f3b5..b4283733 100644 --- a/copyparty/web/browser.js +++ b/copyparty/web/browser.js @@ -8188,11 +8188,18 @@ var treectl = (function () { })(); +var m = SPINNER.split(','), + SPINNER_CSS = m.length < 2 ? '' : SPINNER.slice(m[0].length + 1); +SPINNER = m[0]; + + function enspin(sel) { despin(sel); var d = mknod('div'); d.className = 'dumb_loader_thing'; - d.innerHTML = '🌲'; + d.innerHTML = SPINNER; + if (SPINNER_CSS) + d.style.cssText = SPINNER_CSS; var tgt = QS(sel); tgt.insertBefore(d, tgt.childNodes[0]); } diff --git a/docs/rice/README.md b/docs/rice/README.md index cff400d7..76d223ac 100644 --- a/docs/rice/README.md +++ b/docs/rice/README.md @@ -48,6 +48,20 @@ and if you want to have a monospace font in the fancy markdown editor, do this: NB: `