feat: refine forum settings uploads and transitions
This commit is contained in:
1 parent
e85ced7319
commit
f5d173350b
23 files changed
+985
-54
No files matched your search
@@ -0,0 +1,20 @@
|
||||
export function applyFavicon(url, version = '') {
|
||||
if (typeof document === 'undefined' || !url) return;
|
||||
|
||||
let href = url;
|
||||
try {
|
||||
const resolved = new URL(url, window.location.href);
|
||||
if (version) resolved.searchParams.set('v', version);
|
||||
href = resolved.href;
|
||||
} catch {
|
||||
href = url;
|
||||
}
|
||||
|
||||
let link = document.querySelector('link[rel="icon"]');
|
||||
if (!link) {
|
||||
link = document.createElement('link');
|
||||
link.rel = 'icon';
|
||||
document.head.appendChild(link);
|
||||
}
|
||||
link.href = href;
|
||||
}
|
||||
Reference in new issue
Block a user