aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core/plugins/plugin.service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/core/plugins/plugin.service.ts')
-rw-r--r--client/src/app/core/plugins/plugin.service.ts44
1 files changed, 24 insertions, 20 deletions
diff --git a/client/src/app/core/plugins/plugin.service.ts b/client/src/app/core/plugins/plugin.service.ts
index c6efcac6d..3cab64142 100644
--- a/client/src/app/core/plugins/plugin.service.ts
+++ b/client/src/app/core/plugins/plugin.service.ts
@@ -1,28 +1,33 @@
1import { Inject, Injectable, LOCALE_ID, NgZone } from '@angular/core'
2import { Router } from '@angular/router'
3import { getCompleteLocale, isDefaultLocale, peertubeTranslate, ServerConfigPlugin } from '@shared/models'
4import { ServerService } from '@app/core/server/server.service'
5import { ClientScript } from '@shared/models/plugins/plugin-package-json.model'
6import { ClientScript as ClientScriptModule } from '../../../types/client-script.model'
7import { environment } from '../../../environments/environment'
8import { Observable, of, ReplaySubject } from 'rxjs' 1import { Observable, of, ReplaySubject } from 'rxjs'
9import { catchError, first, map, shareReplay } from 'rxjs/operators' 2import { catchError, first, map, shareReplay } from 'rxjs/operators'
10import { getHookType, internalRunHook } from '@shared/core-utils/plugins/hooks'
11import { ClientHook, ClientHookName, clientHookObject } from '@shared/models/plugins/client-hook.model'
12import { PluginClientScope } from '@shared/models/plugins/plugin-client-scope.type'
13import { RegisterClientHookOptions } from '@shared/models/plugins/register-client-hook.model'
14import { HttpClient } from '@angular/common/http' 3import { HttpClient } from '@angular/common/http'
4import { Inject, Injectable, LOCALE_ID, NgZone } from '@angular/core'
15import { AuthService } from '@app/core/auth' 5import { AuthService } from '@app/core/auth'
16import { Notifier } from '@app/core/notification' 6import { Notifier } from '@app/core/notification'
17import { RestExtractor } from '@app/shared/rest' 7import { MarkdownService } from '@app/core/renderer'
18import { MarkdownService } from '@app/shared/renderer' 8import { RestExtractor } from '@app/core/rest'
19import { PluginType } from '@shared/models/plugins/plugin.type' 9import { ServerService } from '@app/core/server/server.service'
20import { PublicServerSetting } from '@shared/models/plugins/public-server.setting' 10import { getDevLocale, importModule, isOnDevLocale } from '@app/helpers'
21import { getDevLocale, isOnDevLocale } from '@app/shared/i18n/i18n-utils'
22import { RegisterClientHelpers } from '../../../types/register-client-option.model'
23import { PluginTranslation } from '@shared/models/plugins/plugin-translation.model'
24import { importModule } from '@app/shared/misc/utils'
25import { CustomModalComponent } from '@app/modal/custom-modal.component' 11import { CustomModalComponent } from '@app/modal/custom-modal.component'
12import { getHookType, internalRunHook } from '@shared/core-utils/plugins/hooks'
13import {
14 ClientHook,
15 ClientHookName,
16 clientHookObject,
17 ClientScript,
18 getCompleteLocale,
19 isDefaultLocale,
20 peertubeTranslate,
21 PluginClientScope,
22 PluginTranslation,
23 PluginType,
24 PublicServerSetting,
25 RegisterClientHookOptions,
26 ServerConfigPlugin
27} from '@shared/models'
28import { environment } from '../../../environments/environment'
29import { ClientScript as ClientScriptModule } from '../../../types/client-script.model'
30import { RegisterClientHelpers } from '../../../types/register-client-option.model'
26 31
27interface HookStructValue extends RegisterClientHookOptions { 32interface HookStructValue extends RegisterClientHookOptions {
28 plugin: ServerConfigPlugin 33 plugin: ServerConfigPlugin
@@ -64,7 +69,6 @@ export class PluginService implements ClientHook {
64 private hooks: { [ name: string ]: HookStructValue[] } = {} 69 private hooks: { [ name: string ]: HookStructValue[] } = {}
65 70
66 constructor ( 71 constructor (
67 private router: Router,
68 private authService: AuthService, 72 private authService: AuthService,
69 private notifier: Notifier, 73 private notifier: Notifier,
70 private markdownRenderer: MarkdownService, 74 private markdownRenderer: MarkdownService,