docs: cover addCommand/addShortcut/addTheme/notify, branding.links + accent, spoilers
This commit is contained in:
parent
572a9d9c5f
commit
f06cc502f0
3 changed files with 29 additions and 0 deletions
|
|
@ -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.url` | string | Homepage (used in CTCP VERSION/SOURCE). |
|
||||||
| `branding.tagline` / `taglineEm` / `subtitle` | string | Connect-screen copy. |
|
| `branding.tagline` / `taglineEm` / `subtitle` | string | Connect-screen copy. |
|
||||||
| `branding.projectUrl` | string | Orbit project/source link (Settings → About). |
|
| `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.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. |
|
| `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`. |
|
| `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`. |
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,8 @@ network** and **rebranded** from a single `config.json`, without recompiling.
|
||||||
[config.json reference](https://orbit.tchatou.fr/docs/config/).
|
[config.json reference](https://orbit.tchatou.fr/docs/config/).
|
||||||
- **Installable PWA.** Mobile-first layout, offline app shell, and notifications when the tab is
|
- **Installable PWA.** Mobile-first layout, offline app shell, and notifications when the tab is
|
||||||
closed.
|
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
|
- **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
|
and auto-detected (English, French, German, Spanish, Italian, Turkish, Russian, Nepali, and
|
||||||
Brazilian + European Portuguese). Pin a default with `defaults.lang`.
|
Brazilian + European Portuguese). Pin a default with `defaults.lang`.
|
||||||
|
|
|
||||||
|
|
@ -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.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.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.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 |
|
| `orbit.h / orbit.html` | render helpers |
|
||||||
| `log(…)` | namespaced console logger |
|
| `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
|
own error boundary, so a crashing plugin renders nothing instead of taking down
|
||||||
the app.
|
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)
|
### Localization (i18n)
|
||||||
|
|
||||||
The UI ships in 10 languages — keep your plugin in step so it isn't stuck in one. Two ways:
|
The UI ships in 10 languages — keep your plugin in step so it isn't stuck in one. Two ways:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue