diff --git a/docs/config.md b/docs/config.md index d1610e3..ef8e3b5 100644 --- a/docs/config.md +++ b/docs/config.md @@ -25,6 +25,8 @@ Merge rules: objects merge key-by-key; **arrays and scalars replace** wholesale. | `branding.url` | string | Homepage (used in CTCP VERSION/SOURCE). | | `branding.tagline` / `taglineEm` / `subtitle` | string | Connect-screen copy. | | `branding.projectUrl` | string | Orbit project/source link (Settings → About). | +| `branding.links` | array | Extra `{label, url}` rows added to Settings → About. | +| `branding.accent` | string | Overrides the `--accent` CSS colour (e.g. `#ff6b00`); empty keeps the theme default. | | `turnstile.enabled` | bool | Render the anti-bot challenge inline (Cloudflare Turnstile). `false` = show the server's verification step as a link, no Cloudflare script. Whether a challenge is *required* is decided server-side. | | `turnstile.sitekey` | string | Public Turnstile site key. | | `report.service` | string | Services pseudo-client that receives reports (e.g. `ReportServ`) — not blocked by a `+n` staff channel. Empty = fall back to `report.target`. | diff --git a/docs/overview.md b/docs/overview.md index ff34b8d..f45e8ee 100644 --- a/docs/overview.md +++ b/docs/overview.md @@ -22,6 +22,8 @@ network** and **rebranded** from a single `config.json`, without recompiling. [config.json reference](https://orbit.tchatou.fr/docs/config/). - **Installable PWA.** Mobile-first layout, offline app shell, and notifications when the tab is closed. +- **Rich messages.** Image, audio and YouTube links expand inline, and `||spoiler||` text stays + hidden until you click it. - **Speaks 10 languages.** The UI, system messages, and the bundled plugins are fully translated and auto-detected (English, French, German, Spanish, Italian, Turkish, Russian, Nepali, and Brazilian + European Portuguese). Pin a default with `defaults.lang`. diff --git a/docs/plugins.md b/docs/plugins.md index e610481..a8e43fb 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -88,6 +88,10 @@ instead. See **[Compiled plugins](https://orbit.tchatou.fr/docs/compiled-plugins | `orbit.addSettingsSection({label, icon?, render})` | add a whole Settings section | | `orbit.addMessageDecorator(m => …)` | inline UI after every message's text; `m` = `{id, nick, text, raw, kind, ts, mine}` (`text` is formatting-stripped, `raw` keeps mIRC codes) | | `orbit.addMessageAction(m => …)` | a button in every message's hover action toolbar (next to reply/react); same `m` | +| `orbit.addCommand(name, {run, help?})` | register a `/slash` command — `run(args, rest)`; built-ins take priority | +| `orbit.addShortcut(combo, run)` | register a keyboard shortcut, e.g. `"mod+shift+k"` (mod = Cmd/Ctrl) | +| `orbit.addTheme(id, {name, vars, css?, icon?, color?})` | register a runtime theme; shows in Settings → Appearance | +| `orbit.notify(title, body?)` | fire a brand-styled desktop notification (asks permission once) | | `orbit.h / orbit.html` | render helpers | | `log(…)` | namespaced console logger | @@ -114,6 +118,27 @@ to reply/react. Every contributed slot, action and decorator renders inside its own error boundary, so a crashing plugin renders nothing instead of taking down the app. +Commands, shortcuts and themes hang off the same api: + +```js +orbit.addCommand('roll', { + help: 'Roll a die: /roll [sides]', + run: (args) => orbit.irc.say('rolled ' + (1 + Math.floor(Math.random() * (+args[0] || 6)))), +}); + +orbit.addShortcut('mod+shift+r', () => orbit.notify('Orbit', 'shortcut fired')); + +orbit.addTheme('midnight', { + name: 'Midnight', + color: '#0b0f1a', + vars: { '--bg': '#0b0f1a', '--accent': '#6ea8fe' }, +}); +``` + +A `/command` you register loses to a built-in of the same name. `mod` in a +shortcut is Cmd on macOS and Ctrl elsewhere. `orbit.notify` fires even when the +tab is focused and asks for permission the first time. + ### Localization (i18n) The UI ships in 10 languages — keep your plugin in step so it isn't stuck in one. Two ways: