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:
Kim
2020-04-15 09:08:59 +02:00
committed by GitHub
parent bb152476c8
commit 74c2dece42
3 changed files with 18 additions and 2 deletions

View File

@@ -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):