From 9777fe9eebe53debdf45091cab98f72a5987e05a Mon Sep 17 00:00:00 2001 From: John Livingston <38844060+JohnXLivingston@users.noreply.github.com> Date: Thu, 3 Jun 2021 12:28:26 +0200 Subject: Adding frontend peertubeHelpers.getBaseRouterRoute. (#4153) * Adding frontend peertubeHelpers.getBaseRouterRoute. * Fix doctoc. --- client/src/app/core/plugins/plugin.service.ts | 5 +++++ client/src/standalone/videos/embed.ts | 2 ++ client/src/types/register-client-option.model.ts | 2 ++ 3 files changed, 9 insertions(+) (limited to 'client') diff --git a/client/src/app/core/plugins/plugin.service.ts b/client/src/app/core/plugins/plugin.service.ts index 6a1a46e73..a3de98390 100644 --- a/client/src/app/core/plugins/plugin.service.ts +++ b/client/src/app/core/plugins/plugin.service.ts @@ -250,6 +250,11 @@ export class PluginService implements ClientHook { return environment.apiUrl + `${pathPrefix}/${plugin.name}/${plugin.version}/static` }, + getBaseRouterRoute: () => { + const pathPrefix = this.getPluginPathPrefix(pluginInfo.isTheme) + return environment.apiUrl + `${pathPrefix}/${plugin.name}/${plugin.version}/router` + }, + getSettings: () => { const path = PluginService.BASE_PLUGIN_API_URL + '/' + npmName + '/public-settings' diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.ts index 4ce5c78e8..a367feb8e 100644 --- a/client/src/standalone/videos/embed.ts +++ b/client/src/standalone/videos/embed.ts @@ -781,6 +781,8 @@ export class PeerTubeEmbed { return { getBaseStaticRoute: unimplemented, + getBaseRouterRoute: unimplemented, + getSettings: unimplemented, isLoggedIn: unimplemented, diff --git a/client/src/types/register-client-option.model.ts b/client/src/types/register-client-option.model.ts index 8802edc32..59bcbc5ff 100644 --- a/client/src/types/register-client-option.model.ts +++ b/client/src/types/register-client-option.model.ts @@ -19,6 +19,8 @@ export type RegisterClientOptions = { export type RegisterClientHelpers = { getBaseStaticRoute: () => string + getBaseRouterRoute: () => string + isLoggedIn: () => boolean getAuthHeader: () => { 'Authorization': string } | undefined -- cgit v1.2.3