mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Add notifier to plugin helpers (#2627)
* Add notifier to client PeerTubeHelpers plugin * Add doc for notifier PeerTubeHelpers * Add getBaseClientScriptsRoute to client PeerTubeHelpers plugin * Add doc for getBaseClientScriptsRoute PeerTubeHelpers * Remove unused helper Co-authored-by: kimsible <kimsible@users.noreply.github.com>
This commit is contained in:
@@ -197,7 +197,7 @@ The `ping` route can be accessed using:
|
||||
|
||||
### Client helpers (themes & plugins)
|
||||
|
||||
### Plugin static route
|
||||
#### Plugin static route
|
||||
|
||||
To get your plugin static route:
|
||||
|
||||
@@ -206,6 +206,16 @@ const baseStaticUrl = peertubeHelpers.getBaseStaticRoute()
|
||||
const imageUrl = baseStaticUrl + '/images/chocobo.png'
|
||||
```
|
||||
|
||||
#### Notifier
|
||||
|
||||
To notify the user with the PeerTube ToastModule:
|
||||
|
||||
```js
|
||||
const { notifier } = peertubeHelpers
|
||||
notifier.success('Success message content.')
|
||||
notifier.error('Error message content.')
|
||||
```
|
||||
|
||||
#### Translate
|
||||
|
||||
You can translate some strings of your plugin (PeerTube will use your `translations` object of your `package.json` file):
|
||||
|
||||
Reference in New Issue
Block a user