aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/app.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-08 15:54:08 +0200
committerChocobozzz <chocobozzz@cpy.re>2019-07-24 10:58:16 +0200
commit18a6f04c071f7a0735eb39b8c67fd51a082d1a31 (patch)
treeb9fb0637878390d32b5c73d02b8eee2ef48cbfa5 /client/src/app/app.component.ts
parent2c0539420d77339e6afe8d7920b44af4c0dcb1e6 (diff)
downloadPeerTube-18a6f04c071f7a0735eb39b8c67fd51a082d1a31.tar.gz
PeerTube-18a6f04c071f7a0735eb39b8c67fd51a082d1a31.tar.zst
PeerTube-18a6f04c071f7a0735eb39b8c67fd51a082d1a31.zip
WIP plugins: hook on client side
Diffstat (limited to 'client/src/app/app.component.ts')
-rw-r--r--client/src/app/app.component.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts
index 915466af7..548173f61 100644
--- a/client/src/app/app.component.ts
+++ b/client/src/app/app.component.ts
@@ -9,6 +9,7 @@ import { Hotkey, HotkeysService } from 'angular2-hotkeys'
9import { I18n } from '@ngx-translate/i18n-polyfill' 9import { I18n } from '@ngx-translate/i18n-polyfill'
10import { fromEvent } from 'rxjs' 10import { fromEvent } from 'rxjs'
11import { ViewportScroller } from '@angular/common' 11import { ViewportScroller } from '@angular/common'
12import { PluginService } from '@app/core/plugins/plugin.service'
12 13
13@Component({ 14@Component({
14 selector: 'my-app', 15 selector: 'my-app',
@@ -27,6 +28,7 @@ export class AppComponent implements OnInit {
27 private router: Router, 28 private router: Router,
28 private authService: AuthService, 29 private authService: AuthService,
29 private serverService: ServerService, 30 private serverService: ServerService,
31 private pluginService: PluginService,
30 private domSanitizer: DomSanitizer, 32 private domSanitizer: DomSanitizer,
31 private redirectService: RedirectService, 33 private redirectService: RedirectService,
32 private screenService: ScreenService, 34 private screenService: ScreenService,
@@ -69,6 +71,8 @@ export class AppComponent implements OnInit {
69 this.serverService.loadVideoPrivacies() 71 this.serverService.loadVideoPrivacies()
70 this.serverService.loadVideoPlaylistPrivacies() 72 this.serverService.loadVideoPlaylistPrivacies()
71 73
74 this.loadPlugins()
75
72 // Do not display menu on small screens 76 // Do not display menu on small screens
73 if (this.screenService.isInSmallView()) { 77 if (this.screenService.isInSmallView()) {
74 this.isMenuDisplayed = false 78 this.isMenuDisplayed = false
@@ -196,6 +200,14 @@ export class AppComponent implements OnInit {
196 }) 200 })
197 } 201 }
198 202
203 private async loadPlugins () {
204 this.pluginService.initializePlugins()
205
206 await this.pluginService.loadPluginsByScope('common')
207
208 this.pluginService.runHook('action:application.loaded')
209 }
210
199 private initHotkeys () { 211 private initHotkeys () {
200 this.hotkeysService.add([ 212 this.hotkeysService.add([
201 new Hotkey(['/', 's'], (event: KeyboardEvent): boolean => { 213 new Hotkey(['/', 's'], (event: KeyboardEvent): boolean => {