Fix: restliche CSP-blockierte Inline-Handler — Bild-Fallbacks (globaler data-fb Error-Handler) + Hover-Effekte (CSS-Utilities + data-hover-play)
App ist jetzt vollständig frei von Inline-Event-Handlern (onerror/onmouseenter/etc.). data-fb Modi: hide/hide-parent/dim-grandparent/sibling/show-el/emoji/initials + data-fb-src. Hover: .by-hover-lift/-surface2/-surface3 in utilities.css. SW v1165
This commit is contained in:
parent
2ddd8ac350
commit
c07b1cc01b
23 changed files with 125 additions and 68 deletions
|
|
@ -298,11 +298,11 @@ window.Page_friends = (() => {
|
|||
|
||||
const avatar = item.dog_foto
|
||||
? `<img src="${UI.escape(item.dog_foto)}" alt="${UI.escape(item.dog_name || '')}"
|
||||
loading="lazy" decoding="async" onerror="this.style.display='none'"
|
||||
loading="lazy" decoding="async" data-fb="hide"
|
||||
class="fr-activity-avatar">`
|
||||
: item.avatar_url
|
||||
? `<img src="${UI.escape(item.avatar_url)}" alt="${UI.escape(item.user_name)}"
|
||||
loading="lazy" decoding="async" onerror="this.style.display='none'"
|
||||
loading="lazy" decoding="async" data-fb="hide"
|
||||
class="fr-activity-avatar">`
|
||||
: `<div class="fr-activity-avatar fr-activity-avatar--initial">
|
||||
${UI.escape((item.user_name || '?')[0].toUpperCase())}
|
||||
|
|
@ -556,7 +556,7 @@ window.Page_friends = (() => {
|
|||
${withPhotos.slice(0, 4).map(d => `
|
||||
<div class="text-center">
|
||||
<img src="${UI.escape(d.foto_url)}" alt="${UI.escape(d.name)}"
|
||||
loading="lazy" decoding="async" onerror="this.style.display='none'"
|
||||
loading="lazy" decoding="async" data-fb="hide"
|
||||
style="width:44px;height:44px;border-radius:50%;object-fit:cover;
|
||||
border:2px solid var(--c-surface)">
|
||||
<div style="font-size:10px;color:var(--c-text-muted);margin-top:2px;
|
||||
|
|
@ -580,7 +580,7 @@ window.Page_friends = (() => {
|
|||
<div class="text-center">
|
||||
${d.foto_url
|
||||
? `<img src="${UI.escape(d.foto_url)}" alt="${UI.escape(d.name)}"
|
||||
loading="lazy" decoding="async" onerror="this.style.display='none'"
|
||||
loading="lazy" decoding="async" data-fb="hide"
|
||||
style="width:72px;height:72px;border-radius:50%;object-fit:cover;
|
||||
border:2px solid var(--c-primary);margin-bottom:var(--space-2)">`
|
||||
: `<div style="width:72px;height:72px;border-radius:50%;
|
||||
|
|
@ -803,13 +803,13 @@ window.Page_friends = (() => {
|
|||
function _userAvatar(name, firstDog, avatarUrl) {
|
||||
if (avatarUrl) {
|
||||
return `<img src="${UI.escape(avatarUrl)}" alt="${UI.escape(name)}"
|
||||
loading="lazy" decoding="async" onerror="this.style.display='none'"
|
||||
loading="lazy" decoding="async" data-fb="hide"
|
||||
style="width:44px;height:44px;border-radius:50%;object-fit:cover;
|
||||
border:2px solid var(--c-primary);flex-shrink:0">`;
|
||||
}
|
||||
if (firstDog?.foto_url) {
|
||||
return `<img src="${UI.escape(firstDog.foto_url)}" alt="${UI.escape(firstDog.name)}"
|
||||
loading="lazy" decoding="async" onerror="this.style.display='none'"
|
||||
loading="lazy" decoding="async" data-fb="hide"
|
||||
style="width:44px;height:44px;border-radius:50%;object-fit:cover;
|
||||
border:2px solid var(--c-primary);flex-shrink:0">`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue