Place the credits line where Cesium's is, and draw a logo in place of its text

- Every placement of Cesium's credit display (above the command dock, the
  Minimal HUD's corner, clean view and recording, the phone tab bar and an
  open sheet) has the same rule for the application's line; a test keeps
  each stylesheet's pairs together.
- A credit's logo is drawn in place of its text, which names it (the
  image's alt), as Cesium shows logo credits; the contract's Credit says
  so. Links open with noopener and noreferrer; a list that empties while
  focus is in it hands focus back to the line.
- A stack that stays after any failed switch (a tileset or imagery that
  fails to load, or a photoreal base that fails to come back) still falls
  back on its tile failures: the controller binds its listener again for
  that switch where it handles the failure.
This commit is contained in:
Sameh Khamis committed 2026-11-10 18:48:26 -08:00
1 parent 241c8dde64
commit 6a6967d1ad
8 files changed
+137 -24

No files matched your search

+10 -3
View File
@@ -25,7 +25,7 @@ function distinct(list) {
});
}
/** One credit as DOM: its logo, then its text, linked when it has a link. */
/** One credit as DOM: its logo or its text, linked when it has a link. */
function creditElement(doc, credit) {
const href = credit.href ? safeUrl(credit.href, LINK_SCHEMES) : null;
const element = doc.createElement(href ? 'a' : 'span');
@@ -33,8 +33,9 @@ function creditElement(doc, credit) {
if (href) {
element.href = href;
element.target = '_blank';
element.rel = 'noopener';
element.rel = 'noopener noreferrer';
}
// A logo is drawn in place of the text, which names it (its alt text).
const logo = credit.logoUrl ? safeUrl(credit.logoUrl, LOGO_SCHEMES) : null;
if (logo) {
const image = doc.createElement('img');
@@ -121,11 +122,17 @@ export function mountCreditsView(viewer, { root = document.body } = {}) {
}),
);
expand.hidden = listed.length === 0;
if (expand.hidden && !panel.hidden) setOpen(false);
if (expand.hidden && !panel.hidden) {
// Focus in the list goes back to the line, not to the page.
const focused = panel.contains(doc.activeElement);
setOpen(false);
if (focused) line.querySelector('a')?.focus();
}
};
const onExpand = () => setOpen(panel.hidden);
const onClose = () => setOpen(false, { focus: true });
// Escape in the open list closes it (it takes focus as it opens).
const onKey = (event) => {
if (event.key !== 'Escape' || panel.hidden) return;
event.preventDefault();