Expand description
Instance branding: administrators replace the built-in logos.
Two slots exist – the wide logo (top left of the web header and the desktop title bar) and the square logo (web footer and tab icon, desktop navigation rail). Without an upload the built-in TeamCraft logos are shown.
Uploads are small images (PNG, JPEG, WebP or SVG, at most
MAX_LOGO_BYTES) kept in the database, so a backup contains them. The
type is decided from the content, never from the file name or the
Content-Type of the upload. SVG files are shown only through <img>
and are served with a sandboxing policy; files with scripts, event
handlers or external references are refused.
Structs§
- Branding
- Which slots hold a custom logo, as the version token (first 12 hex digits
of the SHA-256) used to bust caches.
None= the built-in logo. Also the header texts an administrator may change. - Logo
- A stored logo.
Enums§
- Kind
- A logo slot.
Constants§
- DEFAULT_
SUBTITLE - The subtitle next to the name unless an administrator changes it.
- MAX_
LOGO_ BYTES - Largest accepted logo file.
- MAX_
LOGO_ PIXELS - Largest side of a bitmap logo in pixels.
- MAX_
NAME_ CHARS - Longest header name (characters).
- MAX_
SUBTITLE_ CHARS - Longest subtitle (characters).
Functions§
- current
- The custom slots (one cheap query; used for every page).
- get
- The stored logo of a slot, if any.
- reset
- Back to the built-in logo of a slot (administrators). Returns whether a custom logo existed.
- set
- Replaces the logo of a slot (administrators).
- set_
names - Sets the header name and subtitle (administrators). An empty display name
restores the default name; a subtitle equal to
DEFAULT_SUBTITLErestores the default subtitle; an empty subtitle shows none. - validate
- Checks an upload and returns its content type.
- validate_
names - Validates the display name (empty after trimming = back to the default) and the subtitle (empty = none). Pure.