From 74c2dece42d387506421623fbfadc83da811ebcd Mon Sep 17 00:00:00 2001 From: Kim <1877318+kimsible@users.noreply.github.com> Date: Wed, 15 Apr 2020 09:08:59 +0200 Subject: 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 --- support/doc/plugins/guide.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'support') diff --git a/support/doc/plugins/guide.md b/support/doc/plugins/guide.md index bdc9d2ad8..5251ce48a 100644 --- a/support/doc/plugins/guide.md +++ b/support/doc/plugins/guide.md @@ -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): -- cgit v1.2.3