option to default-disable tooltips; closes #937

This commit is contained in:
ed 2025-10-25 00:39:37 +00:00
parent 1c17b63b76
commit a325353b1b
3 changed files with 6 additions and 2 deletions

View file

@ -1796,6 +1796,7 @@ def add_ui(ap, retry: int):
ap2.add_argument("--ufavico", metavar="TXT", type=u, default="", help="URL to .ico/png/gif/svg file; \033[33m--favico\033[0m takes precedence unless disabled (volflag=ufavico)") ap2.add_argument("--ufavico", metavar="TXT", type=u, default="", help="URL to .ico/png/gif/svg file; \033[33m--favico\033[0m takes precedence unless disabled (volflag=ufavico)")
ap2.add_argument("--ext-th", metavar="E=VP", type=u, action="append", help="\033[34mREPEATABLE:\033[0m use thumbnail-image \033[33mVP\033[0m for file-extension \033[33mE\033[0m, example: [\033[32mexe=/.res/exe.png\033[0m] (volflag=ext_th)") ap2.add_argument("--ext-th", metavar="E=VP", type=u, action="append", help="\033[34mREPEATABLE:\033[0m use thumbnail-image \033[33mVP\033[0m for file-extension \033[33mE\033[0m, example: [\033[32mexe=/.res/exe.png\033[0m] (volflag=ext_th)")
ap2.add_argument("--mpmc", type=u, default="", help=argparse.SUPPRESS) ap2.add_argument("--mpmc", type=u, default="", help=argparse.SUPPRESS)
ap2.add_argument("--notooltips", action="store_true", help="tooltips disabled as default")
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("--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("--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-browser", metavar="L", type=u, default="", help="URL to additional JS to include in the filebrowser html")

View file

@ -393,7 +393,6 @@ class VFS(object):
axs: AXS, axs: AXS,
flags: dict[str, Any], flags: dict[str, Any],
) -> None: ) -> None:
nss: set[str] = set()
self.log = log self.log = log
self.realpath = realpath # absolute path on host filesystem self.realpath = realpath # absolute path on host filesystem
self.vpath = vpath # absolute path in the virtual filesystem self.vpath = vpath # absolute path in the virtual filesystem
@ -3096,6 +3095,10 @@ class AuthSrv(object):
for zs in zs.split(): for zs in zs.split():
if vf.get(zs): if vf.get(zs):
js_htm[zs] = 1 js_htm[zs] = 1
zs = "notooltips"
for zs in zs.split():
if getattr(self.args, zs, False):
js_htm[zs] = 1
vn.js_htm = json_hesc(json.dumps(js_htm)) vn.js_htm = json_hesc(json.dumps(js_htm))
vols = list(vfs.all_nodes.values()) vols = list(vfs.all_nodes.values())

View file

@ -1487,7 +1487,7 @@ var tt = (function () {
var r = { var r = {
"tt": mknod("div", 'tt'), "tt": mknod("div", 'tt'),
"th": mknod("div", 'tth'), "th": mknod("div", 'tth'),
"en": true, "en": !window.notooltips,
"el": null, "el": null,
"skip": false, "skip": false,
"lvis": 0 "lvis": 0