apply vol-favicon on nav; closes #882

This commit is contained in:
ed 2025-10-04 11:16:16 +00:00
parent 9b7f933b78
commit 2ce32e4fb6
3 changed files with 14 additions and 3 deletions

View file

@ -2514,13 +2514,17 @@ class AuthSrv(object):
ico_url = vol.flags.get("ufavico")
if ico_url:
ico_h = ""
ico_ext = ico_url.split("?")[0].split(".")[-1].lower()
if ico_ext in FAVICON_MIMES:
zs = '<link rel="icon" type="%s" href="%s">\n'
head_s += zs % (FAVICON_MIMES[ico_ext], ico_url)
ico_h = zs % (FAVICON_MIMES[ico_ext], ico_url)
elif ico_ext == "ico":
zs = '<link rel="shortcut icon" href="%s">\n'
head_s += zs % (ico_url,)
ico_h = zs % (ico_url,)
if ico_h:
vol.flags["ufavico_h"] = ico_h
head_s += ico_h
if head_s:
vol.flags["html_head_s"] = head_s
@ -3005,6 +3009,8 @@ class AuthSrv(object):
"unlist": vf.get("unlist") or "",
"sb_lg": "" if "no_sb_lg" in vf else (vf.get("lg_sbf") or "y"),
}
if "ufavico_h" in vf:
vn.js_ls["ufavico"] = vf["ufavico_h"]
js_htm = {
"SPINNER": self.args.spinner,
"s_name": self.args.bname,

View file

@ -19113,6 +19113,11 @@ var treectl = (function () {
if (o)
o.innerHTML = ebi('srv_info').innerHTML = '<span>' + srvinf + '</span>';
if (res.ufavico && (!favico.en || !ebi('icot').value)) {
while (qsr('head>link[rel~="icon"]')) { }
document.head.insertAdjacentHTML('beforeend', res.ufavico);
}
if (this.hpush && !showfile.active())
hist_push(this.top + (dk ? '?k=' + dk : ''));

View file

@ -164,7 +164,7 @@ class Cfg(Namespace):
ex = "ctl_re db_act forget_ip idp_cookie idp_store k304 loris no304 nosubtle qr_pin qr_wait re_maxage rproxy rsp_jtr rsp_slp s_wr_slp snap_wri theme themes turbo u2ow zipmaxn zipmaxs"
ka.update(**{k: 0 for k in ex.split()})
ex = "ah_alg bname chdir chmod_f chpw_db doctitle df exit favico ipa html_head html_head_d html_head_s idp_login idp_logout lg_sba lg_sbf log_fk md_sba md_sbf name og_desc og_site og_th og_title og_title_a og_title_v og_title_i opds_exts shr tcolor textfiles txt_eol ufavico unlist vname xff_src zipmaxt R RS SR"
ex = "ah_alg bname chdir chmod_f chpw_db doctitle df exit favico ipa html_head html_head_d html_head_s idp_login idp_logout lg_sba lg_sbf log_fk md_sba md_sbf name og_desc og_site og_th og_title og_title_a og_title_v og_title_i opds_exts shr tcolor textfiles txt_eol ufavico ufavico_h unlist vname xff_src zipmaxt R RS SR"
ka.update(**{k: "" for k in ex.split()})
ex = "ban_403 ban_404 ban_422 ban_pw ban_pwc ban_url spinner"