feat(branding): logo and system name on share and report pages, drop logo border-radius
This commit is contained in:
+14
-1
@@ -4,7 +4,20 @@ function loadBrand(){
|
||||
return fetch('/api/public-settings').then(function(res){
|
||||
return res.ok?res.json():null;
|
||||
}).then(function(s){
|
||||
if(s&&(s.system_name||'').trim())state.systemName=s.system_name;
|
||||
if(!s)return;
|
||||
if((s.system_name||'').trim())state.systemName=s.system_name;
|
||||
var logo=document.getElementById('brandLogo');
|
||||
if(logo&&s.system_logo){
|
||||
logo.src=s.system_logo;
|
||||
logo.hidden=false;
|
||||
var mark=document.getElementById('brandMark');
|
||||
if(mark)mark.style.display='none';
|
||||
}
|
||||
var name=document.getElementById('brandName');
|
||||
if(name&&(s.system_name||'').trim()){
|
||||
name.textContent=s.system_name;
|
||||
name.hidden=false;
|
||||
}
|
||||
}).catch(function(){});
|
||||
}
|
||||
|
||||
|
||||
@@ -309,3 +309,27 @@ document.addEventListener('click', e => {
|
||||
notice.classList.add('hidden');
|
||||
});
|
||||
})();
|
||||
|
||||
(async function(){
|
||||
try {
|
||||
const res = await fetch('/api/public-settings');
|
||||
if (!res.ok) return;
|
||||
const s = await res.json();
|
||||
const head = document.getElementById('brandHead');
|
||||
if (!head) return;
|
||||
const logo = document.getElementById('brandLogo');
|
||||
const name = document.getElementById('brandName');
|
||||
let any = false;
|
||||
if (name && (s.system_name || '').trim()) {
|
||||
name.textContent = s.system_name;
|
||||
name.hidden = false;
|
||||
any = true;
|
||||
}
|
||||
if (logo && s.system_logo) {
|
||||
logo.src = s.system_logo;
|
||||
logo.hidden = false;
|
||||
any = true;
|
||||
}
|
||||
if (any) head.hidden = false;
|
||||
} catch (e) {}
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user